Frank Barchard 42eb3a552f [libyuv] Add ScaleRowDown2Box_AVX512BW with tail masking
Add AVX-512BW implementations of ScaleRowDown2_AVX512BW,
ScaleRowDown2Linear_AVX512BW, ScaleRowDown2Box_AVX512BW, and
ScaleRowDown2Box_Odd_AVX512BW in scale_gcc.cc.

Use 512-bit zmm vectors (64 source bytes -> 32 destination pixels per
iteration) with vpmovwb narrowing stores, and handle remaining 1..31
destination pixels in-place using hardware mask register k1 (vmovdqu16
zero-masked loads for 2-byte source pixel pairs and vpmovwb masked
narrowing store), eliminating the ScaleRowDown2*_Any_AVX2 fallback on
AVX-512BW CPUs.

Hook up the new row functions in ScalePlaneDown2 (source/scale.cc) and
I420Blend (source/planar_functions.cc).

I420ScaleDownBy2_Box
(LIBYUV_WIDTH=638 LIBYUV_HEIGHT=360 LIBYUV_REPEAT=2000):
CPU                      SSSE3    AVX2  AVX512  512/AVX2
AMD Turin (Zen 5)           57      62      36     1.72x
Intel Granite Rapids        76      76      45     1.69x
AMD Genoa (Zen 4)           85      84      50     1.68x
Intel Sapphire Rapids       68      73      44     1.66x
Intel Emerald Rapids        69      66      48     1.38x
Intel Ice Lake             128     128      96     1.33x
Intel Skylake-X            153     150     121     1.24x
AMD Milan (Zen 3)           95      95      96         -
Intel Haswell              193     172     162         -

R=rrwinterton@gmail.com

Bug: libyuv:960
Test: libyuv_unittest --gtest_filter=*ScalePlaneDown2*:*I420Blend*
Change-Id: Ifbfcc4042c50d28022b12cb807dad56e66e7f301
TAG=agy
CONV=5f01827f-2aa8-4718-b8c1-7f282730918e
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8504320
Reviewed-by: richard winterton <rrwinterton@gmail.com>
2026-10-05 10:56:34 -07:00
..
compare_common.cc [libyuv] Keep LIBYUV_API in basic_types.h and remove legacy types and bool macros 2026-08-28 08:32:19 -07:00
compare_gcc.cc Compare AVX512BW and AVX2, intrinsics for Visual C and ROWWIN 2026-10-02 15:30:05 -07:00
compare_neon64.cc [libyuv] Keep LIBYUV_API in basic_types.h and remove legacy types and bool macros 2026-08-28 08:32:19 -07:00
compare_neon.cc [libyuv] Keep LIBYUV_API in basic_types.h and remove legacy types and bool macros 2026-08-28 08:32:19 -07:00
compare_win.cc Compare AVX512BW and AVX2, intrinsics for Visual C and ROWWIN 2026-10-02 15:30:05 -07:00
compare.cc Compare AVX512BW and AVX2, intrinsics for Visual C and ROWWIN 2026-10-02 15:30:05 -07:00
convert_argb.cc I422ToRGB24 avx512bw tail and row coalesce 2026-09-24 12:07:29 -07:00
convert_from_argb.cc ARGBToRGB24 AVX512 with tail masking 2026-09-29 16:15:44 -07:00
convert_from.cc clang format and bump version 2026-09-28 10:42:45 -07:00
convert_jpeg.cc [libyuv] Keep LIBYUV_API in basic_types.h and remove legacy types and bool macros 2026-08-28 08:32:19 -07:00
convert_to_argb.cc clang format and bump version 2026-09-28 10:42:45 -07:00
convert_to_i420.cc clang format and bump version 2026-09-28 10:42:45 -07:00
convert.cc InterpolateRow_AVX512BW with tail masking 2026-09-29 11:22:47 -07:00
cpu_id.cc RVV port to inline from intrinsics 2026-09-21 14:26:26 -07:00
mjpeg_decoder.cc [libyuv] Fix RISC-V CMake/GN/Bazel builds and C compiler driver linking 2026-09-28 10:59:30 -07:00
mjpeg_validate.cc [libyuv] Keep LIBYUV_API in basic_types.h and remove legacy types and bool macros 2026-08-28 08:32:19 -07:00
planar_functions.cc [libyuv] Add ScaleRowDown2Box_AVX512BW with tail masking 2026-10-05 10:56:34 -07:00
rotate_any.cc Rotate intrinsics for Visual C, ROWWIN and 32 bit x86 2026-10-01 20:39:30 -07:00
rotate_argb.cc SVE2 row functions needed for multipass image functions 2026-08-06 12:40:26 -07:00
rotate_common.cc Transpose 16x16 for AVX2 2026-10-01 17:31:33 -07:00
rotate_gcc.cc Rotate intrinsics for Visual C, ROWWIN and 32 bit x86 2026-10-01 20:39:30 -07:00
rotate_lsx.cc Transpose 16x16 for AVX2 2026-10-01 17:31:33 -07:00
rotate_neon64.cc [libyuv] Keep LIBYUV_API in basic_types.h and remove legacy types and bool macros 2026-08-28 08:32:19 -07:00
rotate_neon.cc [libyuv] Keep LIBYUV_API in basic_types.h and remove legacy types and bool macros 2026-08-28 08:32:19 -07:00
rotate_sme.cc [libyuv] Keep LIBYUV_API in basic_types.h and remove legacy types and bool macros 2026-08-28 08:32:19 -07:00
rotate_win.cc Rotate intrinsics for Visual C, ROWWIN and 32 bit x86 2026-10-01 20:39:30 -07:00
rotate.cc Rotate intrinsics for Visual C, ROWWIN and 32 bit x86 2026-10-01 20:39:30 -07:00
row_any.cc ARGBToRGB24 AVX512 with tail masking 2026-09-29 16:15:44 -07:00
row_common.cc clang format and bump version 2026-09-28 10:42:45 -07:00
row_gcc.cc ARGBToRGB24 AVX512 with tail masking 2026-09-29 16:15:44 -07:00
row_lasx.cc ARGBMultiplyRow with rounding for AVX2 and RVV 2026-09-21 10:20:14 -07:00
row_lsx.cc clang format and bump version 2026-09-28 10:42:45 -07:00
row_neon64.cc clang format and bump version 2026-09-28 10:42:45 -07:00
row_neon.cc clang format and bump version 2026-09-28 10:42:45 -07:00
row_rvv.cc clang format and bump version 2026-09-28 10:42:45 -07:00
row_sme.cc Convert8To16 takes bits instead of scale. 2026-09-01 16:07:23 -07:00
row_sve.cc clang format and bump version 2026-09-28 10:42:45 -07:00
row_win.cc Fix _M_X86 to _M_IX86 2026-10-01 02:50:39 -07:00
scale_any.cc [libyuv] Enable LIBYUV_ENABLE_ROWWIN and MSAN_MEMSET for MSan builds 2026-09-28 10:49:58 -07:00
scale_argb.cc InterpolateRow_AVX512BW with tail masking 2026-09-29 11:22:47 -07:00
scale_common.cc InterpolateRow_AVX512BW with tail masking 2026-09-29 11:22:47 -07:00
scale_gcc.cc [libyuv] Add ScaleRowDown2Box_AVX512BW with tail masking 2026-10-05 10:56:34 -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 Fix Coverity Control flow issues (DEADCODE) 2026-07-01 10:39:22 -07:00
scale_rvv.cc RVV replace vnclipu.wi with vwaddu.vx and vnsrl.wi 2026-09-25 12:43:28 -07:00
scale_sme.cc Apply clang format 2025-01-02 13:31:20 -08:00
scale_uv.cc Add a box filter to ScaleUV 2026-10-02 15:37:21 -07:00
scale_win.cc BGRAToI420 use BgraConstants for a direct conversion using AVX512BW 2026-06-08 12:21:47 -07:00
scale.cc [libyuv] Add ScaleRowDown2Box_AVX512BW with tail masking 2026-10-05 10:56:34 -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