|
if (in_planes == 1) |
|
memcpy(dest_buffer, in[0], plane_hsize); |
|
else { |
|
for (int j = 0; j < plane_hsize; j++) { |
|
for (int p = 0; p < in_planes; p++) |
|
dest_buffer[j * in_planes + p] = |
|
(dest_buffer[j * in_planes + p] * |
|
(0xff - alpha) + |
|
in[p][j] * alpha) / |
|
0xff; |
|
} |
|
} |
Simply put the planar-to-semi-packed do not match the behavior of the planar code just above which uses memcpy. If you call the function without alpha plane, alpha=128 and threshold=0 you can encounter the difference in behavior. In fact for an nv12 (two planes: "y8" "u8v8") frame you will get different behavior between the luma and the chroma.
Please tell me what the correct behavior is so I can get it correct in a test program I am writing.
@quarium You added the semi-planar code in commit 21ec357
upipe/include/upipe/ubuf_pic.h
Lines 443 to 454 in 092ad01
Simply put the planar-to-semi-packed do not match the behavior of the planar code just above which uses memcpy. If you call the function without alpha plane, alpha=128 and threshold=0 you can encounter the difference in behavior. In fact for an nv12 (two planes: "y8" "u8v8") frame you will get different behavior between the luma and the chroma.
Please tell me what the correct behavior is so I can get it correct in a test program I am writing.
@quarium You added the semi-planar code in commit 21ec357