libyuv/unit_test
Frank Barchard 1e06475900 [libyuv] Fix color matrix constants in RAWToI420
RAW format in libyuv is Red-first ([R, G, B] in memory), whereas RGB24
is Blue-first ([B, G, R] in memory).

RGBToYMatrixRow and RGBToUVMatrixRow internally expand 3-byte input
into 4-byte [byte0, byte1, byte2, 255]. For RAW, this buffer becomes
[R, G, B, 255] (matching ABGR byte order). RAWToI420 previously passed
&kArgbI601Constants (which expects [B, G, R, 255]) instead of
&kAbgrI601Constants, causing Red and Blue channels to be swapped.

Pass &kAbgrI601Constants in RAWToI420, fix parameter names in
source/convert.cc, and add a unit test.

Test: libyuv_unittest --gtest_filter=*RAWToI420*
Bug: libyuv:537503370

TAG=agy
CONV=2c54c4b5-f515-421b-80b3-079caa9f948b

Change-Id: Ic72470813eaf15e80046c2c01cf804cb827039ab
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8133048
Reviewed-by: richard winterton <rrwinterton@gmail.com>
2026-07-21 18:31:48 -07:00
..
testdata Deprecate MIPS and MSA support. 2025-10-16 12:20:40 -07:00
basictypes_test.cc Unittests use ASSERT instead of EXPECT 2026-05-11 19:10:47 -07:00
color_test.cc BGRAToI420 use BgraConstants for a direct conversion using AVX512BW 2026-06-08 12:21:47 -07:00
compare_test.cc Unittests use ASSERT instead of EXPECT 2026-05-11 19:10:47 -07:00
convert_argb_test.cc BGRAToI420 use BgraConstants for a direct conversion using AVX512BW 2026-06-08 12:21:47 -07:00
convert_test.cc [libyuv] Fix color matrix constants in RAWToI420 2026-07-21 18:31:48 -07:00
cpu_test.cc add bmm detect and vdpphps in util/cpuid 2026-06-09 14:52:48 -07:00
cpu_thread_test.cc Unittests use ASSERT instead of EXPECT 2026-05-11 19:10:47 -07:00
math_test.cc Unittests use ASSERT instead of EXPECT 2026-05-11 19:10:47 -07:00
planar_test.cc BGRAToI420 use BgraConstants for a direct conversion using AVX512BW 2026-06-08 12:21:47 -07:00
rotate_argb_test.cc Unittests use ASSERT instead of EXPECT 2026-05-11 19:10:47 -07:00
rotate_test.cc BGRAToI420 use BgraConstants for a direct conversion using AVX512BW 2026-06-08 12:21:47 -07:00
scale_argb_test.cc BGRAToI420 use BgraConstants for a direct conversion using AVX512BW 2026-06-08 12:21:47 -07:00
scale_plane_test.cc [libyuv] Fix security vulnerabilities in ScalePlane and ARGBAffineRow_C 2026-05-29 18:30:38 -07:00
scale_rgb_test.cc Unittests use ASSERT instead of EXPECT 2026-05-11 19:10:47 -07:00
scale_test.cc BGRAToI420 use BgraConstants for a direct conversion using AVX512BW 2026-06-08 12:21:47 -07:00
scale_uv_test.cc Unittests use ASSERT instead of EXPECT 2026-05-11 19:10:47 -07:00
unit_test.cc Deprecate MIPS and MSA support. 2025-10-16 12:20:40 -07:00
unit_test.h BGRAToI420 use BgraConstants for a direct conversion using AVX512BW 2026-06-08 12:21:47 -07:00
video_common_test.cc Unittests use ASSERT instead of EXPECT 2026-05-11 19:10:47 -07:00