Frank Barchard 3c5fa6ef27 libyuv] Replace hardcoded RGB to YUV functions with Matrix variants
Removes non-matrix implementations for RGB24, RAW, RGB565, ARGB1555,
and ARGB4444 conversions. Introduces RGBToYMatrixRow, RGBToUVMatrixRow,
and equivalent functions for 16-bit and 24-bit formats. These functions
utilize a 2-step conversion internally (to ARGB, then to YUV) inside
row_common.cc for C, AVX2, and NEON, allowing the high-level
convert.cc logic to execute in a single pass using ArgbConstants.

Benchmark on Zen4
Test: libyuv_unittest --gtest_filter=*RGB*ToI420*

Was BT.601-only
ARGBToI420_Opt (115 ms)
ARGB4444ToI420_Opt (190 ms)
RGB565ToI420_Opt (194 ms)
ARGB1555ToI420_Opt (207 ms)
RGB24ToI420_Opt (143 ms)
RGBAToI420_Opt (167 ms)
28.07% ARGBToUVMatrixRow_AVX512BW
19.65% ARGBToYMatrixRow_AVX512BW
11.32% RGBAToUVRow_SSSE3
10.24% ARGB1555ToARGBRow_SSE2
 8.56% ARGB4444ToARGBRow_SSE2
 8.47% RGB565ToARGBRow_SSE2
 4.17% RGBAToYRow_AVX512BW
 4.04% RGB24ToARGBRow_AVX512BW

Now Matrix
ARGBToI420_Opt (124 ms)
ARGB4444ToI420_Opt (287 ms)
RGB565ToI420_Opt (292 ms)
ARGB1555ToI420_Opt (324 ms)
RGB24ToI420_Opt (236 ms)
RGBAToI420_Opt (126 ms)
29.74% ARGBToUVMatrixRow_AVX2
14.58% ARGB1555ToARGBRow_SSE2
12.59% RGB565ToARGBRow_SSE2
11.32% ARGB4444ToARGBRow_SSE2
 9.35% ARGBToYMatrixRow_AVX2
 8.45% RGB24ToARGBRow_SSSE3
 5.56% ARGBToYMatrixRow_AVX512BW
 1.37% ARGBToUVMatrixRow_Any_AVX2
 0.74% ARGBToYMatrixRow_Any_AVX2
 0.49% ARGB4444ToARGBRow_Any_SSE2
 0.46% RGB565ToARGBRow_Any_SSE2
 0.39% ARGB1555ToARGBRow_Any_SSE2
 0.28% RGB24ToARGBRow_Any_SSSE3
 0.11% ARGB4444ToYMatrixRow_AVX2
 0.09% RGB565ToUVMatrixRow_AVX2
 0.09% RGB565ToYMatrixRow_AVX2
 0.07% RGBToYMatrixRow_AVX2
 0.05% ARGB1555ToUVMatrixRow_AVX2
 0.04% ARGB1555ToYMatrixRow_AVX2
 0.03% RGBToUVMatrixRow_AVX2
 0.02% ARGB4444ToUVMatrixRow_AVX2

Bug: libyuv:508639302
Change-Id: I362c0cfe4c86ee1f3ffb569fa4f784b84148f11a
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/7891045
Commit-Queue: Frank Barchard <fbarchard@google.com>
Reviewed-by: richard winterton <rrwinterton@gmail.com>
2026-06-01 14:04:07 -07:00
..
compare_common.cc clang-tidy applied 2021-04-01 21:42:47 +00:00
compare_gcc.cc ARGBToJ444 use 256 for fixed point scale UV 2025-02-27 13:04:15 -08:00
compare_neon64.cc Add hybrid detect for Intel laptop cpus 2025-06-13 13:22:54 -07:00
compare_neon.cc Apply format with no code changes 2025-02-24 23:57:01 -08:00
compare_win.cc ARGBToJ444 use 256 for fixed point scale UV 2025-02-27 13:04:15 -08:00
compare.cc Don't coalesce rows if width*height would overflow 2026-05-29 11:57:47 -07:00
convert_argb.cc Fix integer overflow in two convert functions 2026-05-29 19:26:14 -07:00
convert_from_argb.cc Don't coalesce rows if width*height would overflow 2026-05-29 11:57:47 -07:00
convert_from.cc Don't coalesce rows if width*height would overflow 2026-05-29 11:57:47 -07:00
convert_jpeg.cc PlaneScale, UVScale and ARGBScale test 3x and 4x down sample. 2020-10-28 20:41:59 +00:00
convert_to_argb.cc Apply clang format 2025-01-02 13:31:20 -08:00
convert_to_i420.cc Fix integer overflows in ConvertToI420() 2026-05-29 19:22:01 -07:00
convert.cc libyuv] Replace hardcoded RGB to YUV functions with Matrix variants 2026-06-01 14:04:07 -07:00
cpu_id.cc Replace strtok_r with strchr in RISC-V CPU capability detection 2026-04-10 12:33:43 -07:00
mjpeg_decoder.cc Add AMXINT8 cpu detect 2024-02-15 21:44:47 +00:00
mjpeg_validate.cc Update to r1732 for more robust jpeg 2019-07-01 22:32:36 +00:00
planar_functions.cc Don't coalesce rows if width*height would overflow 2026-05-29 11:57:47 -07:00
rotate_any.cc Deprecate MIPS and MSA support. 2025-10-16 12:20:40 -07:00
rotate_argb.cc Deprecate MIPS and MSA support. 2025-10-16 12:20:40 -07:00
rotate_common.cc Remove redundant #include <stddef.h> 2026-05-28 17:10:22 -07:00
rotate_gcc.cc Use ptrdiff_t for buffer offsets 2026-04-28 18:21:42 -07:00
rotate_lsx.cc [AArch64] Use full vectors in TransposeWx{8 => 16}_NEON 2024-05-21 07:46:42 +00:00
rotate_neon64.cc Fix integer overflow in multiplications of stride 2026-05-28 14:12:37 -07:00
rotate_neon.cc Fix integer overflow in multiplications of stride 2026-05-28 14:12:37 -07:00
rotate_sme.cc [AArch64] Re-enable SME only for Linux and new versions of Clang 2024-09-23 09:29:53 +00:00
rotate_win.cc ARGBToJ444 use 256 for fixed point scale UV 2025-02-27 13:04:15 -08:00
rotate.cc Fix integer overflow in multiplications of stride 2026-05-28 14:12:37 -07:00
row_any.cc J400ToARGB switch from SSE2 to AVX2 2026-05-28 21:24:32 -07:00
row_common.cc libyuv] Replace hardcoded RGB to YUV functions with Matrix variants 2026-06-01 14:04:07 -07:00
row_gcc.cc J400ToARGB switch from SSE2 to AVX2 2026-05-28 21:24:32 -07:00
row_lasx.cc Replace RAWToY/RGB24ToY with RGBToYMatrix 2026-04-21 17:11:14 -07:00
row_lsx.cc Replace RAWToY/RGB24ToY with RGBToYMatrix 2026-04-21 17:11:14 -07:00
row_neon64.cc Fix integer overflow in multiplications of stride 2026-05-28 14:12:37 -07:00
row_neon.cc ABGRToJ420 call ARGBToI420Matrix 2026-05-08 15:23:30 -07:00
row_rvv.cc Replace RAWToY/RGB24ToY with RGBToYMatrix 2026-04-21 17:11:14 -07:00
row_sme.cc RAWToNV21 using SME, SVE, I8MM or Neon 2026-04-29 13:11:04 -07:00
row_sve.cc RAWToNV21 using SME, SVE, I8MM or Neon 2026-04-29 13:11:04 -07:00
row_win.cc J400ToARGB switch from SSE2 to AVX2 2026-05-28 21:24:32 -07:00
scale_any.cc Deprecate MIPS and MSA support. 2025-10-16 12:20:40 -07:00
scale_argb.cc Fix integer overflow in multiplications of stride 2026-05-28 14:12:37 -07:00
scale_common.cc InterpolateRow for Visual C 2026-05-18 17:28:46 -07:00
scale_gcc.cc Unittests use ASSERT instead of EXPECT 2026-05-11 19:10:47 -07:00
scale_lsx.cc DetilePlane and unittest for NEON 2022-01-31 20:05:55 +00:00
scale_neon64.cc Apply format with no code changes 2025-02-24 23:57:01 -08:00
scale_neon.cc Apply format with no code changes 2025-02-24 23:57:01 -08:00
scale_rgb.cc Apply clang format 2025-01-02 13:31:20 -08:00
scale_rvv.cc Replace RAWToY/RGB24ToY with RGBToYMatrix 2026-04-21 17:11:14 -07:00
scale_sme.cc Apply clang format 2025-01-02 13:31:20 -08:00
scale_uv.cc Fix integer overflow in multiplications of stride 2026-05-28 14:12:37 -07:00
scale_win.cc Fix linear interpolation 2026-05-13 05:33:33 -07:00
scale.cc [libyuv] Fix security vulnerabilities in ScalePlane and ARGBAffineRow_C 2026-05-29 18:30:38 -07:00
test.sh Optimze ABGRToI420 for AVX2 2020-06-04 18:24:45 +00:00
video_common.cc Lint cleanup after C99 change CL 2018-01-24 19:16:03 +00:00