Commit 5a54974
Erik Språng
Fix asymmetric chroma plane stride handling in encoder preprocessing
When preprocessing incoming I420 source frames, WelsMoveMemoryWrapper
previously read only the U chroma plane stride (iStride[1]) and used it as a
shared stride for copying both the U and V chroma planes. If an incoming
frame has distinct, asymmetric strides for the U and V chroma planes (for
example, when the U plane stride is larger than the V plane stride), copying
the V plane using the U plane's stride advances the source pointer incorrectly.
This change ensures correct memory advancement for each chroma plane by:
- Modifying WelsMoveMemory_c to accept separate destination and source
strides for the U and V chroma planes (iDstStrideU, iDstStrideV,
iSrcStrideU, iSrcStrideV).
- Updating WelsMoveMemoryWrapper to read and pass iStride[1] and iStride[2]
separately from the input SSourcePicture.
- Updating internal callers (DownsamplePadding and Padding) to pass their
respective U and V line sizes cleanly.
- Adding a unit test (CustomChromaPlaneStrides) to verify that distinct,
asymmetric chroma plane strides are handled correctly.1 parent a8e04ad commit 5a54974
3 files changed
Lines changed: 87 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
656 | 658 | | |
657 | 659 | | |
658 | 660 | | |
659 | | - | |
660 | | - | |
661 | | - | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
662 | 666 | | |
663 | 667 | | |
664 | 668 | | |
| |||
1361 | 1365 | | |
1362 | 1366 | | |
1363 | 1367 | | |
1364 | | - | |
1365 | | - | |
1366 | | - | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
1367 | 1373 | | |
1368 | 1374 | | |
1369 | 1375 | | |
| |||
1377 | 1383 | | |
1378 | 1384 | | |
1379 | 1385 | | |
1380 | | - | |
1381 | | - | |
1382 | | - | |
1383 | | - | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
1384 | 1390 | | |
1385 | 1391 | | |
1386 | 1392 | | |
| |||
1413 | 1419 | | |
1414 | 1420 | | |
1415 | 1421 | | |
1416 | | - | |
| 1422 | + | |
| 1423 | + | |
1417 | 1424 | | |
1418 | 1425 | | |
1419 | 1426 | | |
1420 | 1427 | | |
1421 | 1428 | | |
1422 | | - | |
| 1429 | + | |
| 1430 | + | |
1423 | 1431 | | |
1424 | 1432 | | |
1425 | 1433 | | |
| |||
1438 | 1446 | | |
1439 | 1447 | | |
1440 | 1448 | | |
1441 | | - | |
1442 | | - | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
1443 | 1452 | | |
1444 | 1453 | | |
1445 | 1454 | | |
1446 | | - | |
| 1455 | + | |
| 1456 | + | |
1447 | 1457 | | |
1448 | 1458 | | |
1449 | 1459 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
49 | 55 | | |
50 | 56 | | |
51 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
0 commit comments