libyuv/unit_test
Frank Barchard dd4ac91d3f Fix center coordinate when dst == 1 and src == 32768 in scale functions
In ScalePlane and ScalePlane_16, when dst_width == src_width and
dst_height == 1 with src_height >= 32768, set y to
(src_height << 15) - 32768 for bilinear filtering and src_height << 15
for point sampling so the center row is sampled instead of row 0.

In ScaleSlope, when dst_width == 1 and Abs(src_width) >= 32768 (or
dst_height == 1 and src_height >= 32768), compute the centered *x and *y
coordinates directly instead of overwriting dst_width or dst_height,
which previously sampled pixel/row 0 (or 0.5) and added
(Abs(src_width) - 1) * *dx when horizontally mirroring src_width < 0.
Use Abs(src_width) << 15 and src_height << 15 as the non-box step values
so ScaleARGB and ScaleUV treat the 32768x downscale as an even scale
factor rather than 1x. Save Abs(src_width) in a local variable.

In ScaleAddCols1_16_C, shift x >>= 16 before indexing src_ptr[x],
matching ScaleAddCols1_C.

Bug: b:573815252
Test: libyuv_unittest --gtest_filter=*ScalePlaneOversizeHeight*:*ARGBScaleOversizeWidthTo1*
Change-Id: Ic82319dae6291d17b98b056b5d64a4bbf02f7787
2026-10-15 22:36:38 -07:00
..
testdata Deprecate MIPS and MSA support. 2025-10-16 12:20:40 -07:00
basictypes_test.cc [libyuv] Keep LIBYUV_API in basic_types.h and remove legacy types and bool macros 2026-08-28 08:32:19 -07:00
color_test.cc [libyuv] Enable LIBYUV_ENABLE_ROWWIN and MSAN_MEMSET for MSan builds 2026-09-28 10:49:58 -07:00
compare_test.cc Compare AVX512BW and AVX2, intrinsics for Visual C and ROWWIN 2026-10-02 15:30:05 -07:00
convert_argb_test.cc clang format and bump version 2026-09-28 10:42:45 -07:00
convert_test.cc Add 25 native k-masked AVX-512 row kernels 2026-10-12 18:14:41 -07:00
cpu_test.cc [libyuv] Add WASM SIMD128 and Relaxed SIMD for RAWToRGB24Row 2026-10-05 17:45:41 -07:00
cpu_thread_test.cc Unittests use ASSERT instead of EXPECT 2026-05-11 19:10:47 -07:00
math_test.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_test.cc Add 25 native k-masked AVX-512 row kernels 2026-10-12 18:14:41 -07:00
rotate_argb_test.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate_test.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
scale_argb_test.cc Fix center coordinate when dst == 1 and src == 32768 in scale functions 2026-10-15 22:36:38 -07:00
scale_plane_test.cc Fix center coordinate when dst == 1 and src == 32768 in scale functions 2026-10-15 22:36:38 -07:00
scale_rgb_test.cc Unittests use ASSERT instead of EXPECT 2026-05-11 19:10:47 -07:00
scale_test.cc convert, scale: Add P010/P210/P410 convert paths and NV16/NV24/Px10 scale 2026-09-23 20:43:22 -07:00
scale_uv_test.cc Add a box filter to ScaleUV 2026-10-02 15:37:21 -07:00
unit_test.cc [libyuv] Add WASM SIMD128 and Relaxed SIMD for RAWToRGB24Row 2026-10-05 17:45:41 -07:00
unit_test.h [libyuv] Enable LIBYUV_ENABLE_ROWWIN and MSAN_MEMSET for MSan builds 2026-09-28 10:49:58 -07:00
video_common_test.cc convert, scale: Add P010/P210/P410 convert paths and NV16/NV24/Px10 scale 2026-09-23 20:43:22 -07:00