mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-07-30 08:16:22 +08:00
[libyuv] Fix NV21 chroma plane ordering in ARGBToNV21Matrix
Fix the chroma plane order passed to MergeUVRow in ARGBToNV21Matrix. MergeUVRow(a, b, dst, ...) writes a into byte 0 and b into byte 1. Passing (row_u, row_v) produced NV12 format (UV interleaved) instead of NV21 format (VU interleaved). Swapping to (row_v, row_u) ensures the chroma channels are correctly ordered for NV21 output. Test: libyuv_unittest --gtest_filter=*NV21* Bug: None Change-Id: I3b78246c635ce515923739298013a61203cabb72 TAG=agy CONV=5daf08a8-11bd-4d47-8c71-c5b7a882a788 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8133203 Reviewed-by: richard winterton <rrwinterton@gmail.com>
This commit is contained in:
parent
1e06475900
commit
805babf995
@ -777,7 +777,7 @@ int ARGBToNV21Matrix(const uint8_t* src_argb,
|
||||
for (y = 0; y < height - 1; y += 2) {
|
||||
ARGBToUVMatrixRow(src_argb, src_stride_argb, row_u, row_v, width,
|
||||
argbconstants);
|
||||
MergeUVRow(row_u, row_v, dst_vu, halfwidth);
|
||||
MergeUVRow(row_v, row_u, dst_vu, halfwidth);
|
||||
ARGBToYMatrixRow(src_argb, dst_y, width, argbconstants);
|
||||
ARGBToYMatrixRow(src_argb + src_stride_argb, dst_y + dst_stride_y, width,
|
||||
argbconstants);
|
||||
@ -787,7 +787,7 @@ int ARGBToNV21Matrix(const uint8_t* src_argb,
|
||||
}
|
||||
if (height & 1) {
|
||||
ARGBToUVMatrixRow(src_argb, 0, row_u, row_v, width, argbconstants);
|
||||
MergeUVRow(row_u, row_v, dst_vu, halfwidth);
|
||||
MergeUVRow(row_v, row_u, dst_vu, halfwidth);
|
||||
ARGBToYMatrixRow(src_argb, dst_y, width, argbconstants);
|
||||
}
|
||||
free_aligned_buffer_64(row_u);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user