Frank Barchard 64ddbbcdde [libyuv] Optimize SsimWindowRow with SIMD and use compare_win on x86
- Route 32-bit x86 (__i386__ / _M_IX86) to compare_win.cc intrinsics
  and restrict compare_gcc.cc to 64-bit x86 (__x86_64__), avoiding
  x87 float rounding and enabling SSE2, AVX2, and AVX-512 on 32-bit
  and 64-bit MinGW, GCC, Clang, and MSan (LIBYUV_ENABLE_ROWWIN).
- Enable AVX-512BW on GCC >= 6 (GCC_HAS_AVX512) and add
  LIBYUV_TARGET_AVX512BW attributes to compare_gcc.cc and
  compare_win.cc.
- Refactor SsimWindowRow_C and Ssim8x8_C to use int32_t and float,
  and add SsimWindowRow_SSE2, SsimWindowRow_AVX2, and
  SsimWindowRow_AVX512BW in both compare_win.cc and compare_gcc.cc.
- Update TestSsimAnyWidth, Ssim, and BenchmarkSsim_Opt in
  compare_test.cc to use EXPECT_NEAR and deterministic test patterns
  (identical, different, similar).
- Update util/compare.cc and linux.mk to compute I420Ssim.

Performance (BenchmarkSsim_Opt, 1280x720):
uArch                        Before      After  Improvement
Intel Lion Cove (x64 AVX2) 120.2 us    68.1 us        1.76x
Intel Skymont (x64 SSE2)   249.6 us   146.8 us        1.70x
AMD Zen 3 (x64 AVX2)       314.9 us   150.2 us        2.10x
Intel Lion Cove (MinGW686) 203.7 us    77.9 us        2.61x
Intel Skymont (MinGW686)   338.8 us   167.5 us        2.02x
AMD Zen 3 (i686 AVX2)      738.4 us   206.5 us        3.58x

Quality (util/compare on 640x360 I420 test images):
Image Comparison                MSE       PSNR         SSIM
Identical (orig vs orig)       0.00  128.00 dB     1.000000
Similar (light +/-3 noise)     4.57   41.53 dB     0.956556
Degraded (16x16 blocky)       98.18   28.21 dB     0.858893
Very different (inverted)  11160.29    7.65 dB     0.000181

Co-authored-by: Martin Storsjö <martin@martin.st>
Bug: b/493910265
Test: out/Release/libyuv_unittest --gtest_filter=*Ssim*
Change-Id: I8603dab3f752af32d07ae9039502ca5da5a05425
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8618641
Reviewed-by: richard winterton <rrwinterton@gmail.com>
Commit-Queue: Frank Barchard <fbarchard@google.com>
2026-10-20 15:00:52 -07:00
..
compare_common.cc [libyuv] Optimize SsimWindowRow with SIMD and use compare_win on x86 2026-10-20 15:00:52 -07:00
compare_gcc.cc [libyuv] Optimize SsimWindowRow with SIMD and use compare_win on x86 2026-10-20 15:00:52 -07:00
compare_hvx.cc [libyuv] Add Qualcomm Hexagon HVX SIMD support 2026-10-19 14:16:18 -07:00
compare_neon64.cc [libyuv] Optimize CalcFrameSsim with 2-row 4x4 tile buffer and SIMD 2026-10-15 23:22:58 -07:00
compare_neon.cc [libyuv] Optimize CalcFrameSsim with 2-row 4x4 tile buffer and SIMD 2026-10-15 23:22:58 -07:00
compare_wasm.cc [libyuv] Optimize CalcFrameSsim with 2-row 4x4 tile buffer and SIMD 2026-10-15 23:22:58 -07:00
compare_win.cc [libyuv] Optimize SsimWindowRow with SIMD and use compare_win on x86 2026-10-20 15:00:52 -07:00
compare.cc [libyuv] Optimize SsimWindowRow with SIMD and use compare_win on x86 2026-10-20 15:00:52 -07:00
convert_argb.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
convert_from_argb.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
convert_from.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -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 [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
convert_to_i420.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
convert.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
cpu_id.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
mjpeg_decoder.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -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] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
rotate_any.cc [libyuv] Rewrite LoongArch LSX/LASX kernels in compact inline asm 2026-10-16 17:25:23 -07:00
rotate_argb.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
rotate_common.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate_gcc.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate_hvx.cc [libyuv] Add Qualcomm Hexagon HVX SIMD support 2026-10-19 14:16:18 -07:00
rotate_lasx.cc [libyuv] Rewrite LoongArch LSX/LASX kernels in compact inline asm 2026-10-16 17:25:23 -07:00
rotate_lsx.cc [libyuv] Rewrite LoongArch LSX/LASX kernels in compact inline asm 2026-10-16 17:25:23 -07:00
rotate_neon64.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate_neon.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate_rvv.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate_sme.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate_sve.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
rotate_wasm.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate_win.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
row_any.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
row_common.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
row_gcc.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
row_hvx.cc [libyuv] Add Qualcomm Hexagon HVX SIMD support 2026-10-19 14:16:18 -07:00
row_lasx.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
row_lsx.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
row_neon64.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
row_neon.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
row_rvv.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
row_sme.cc [libyuv] Optimize CalcFrameSsim with 2-row 4x4 tile buffer and SIMD 2026-10-15 23:22:58 -07:00
row_sve.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
row_wasm.cc [libyuv] AVX512, NEON, WASM and RVV alpha copy and mirror rows 2026-10-07 12:44:53 -07:00
row_win.cc Add 25 native k-masked AVX-512 row kernels 2026-10-12 18:14:41 -07:00
scale_any.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
scale_argb.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
scale_common.cc [libyuv] Multi-platform ScaleUVAddCols3 for ScaleUVBox at 3x 2026-10-19 15:56:38 -07:00
scale_gcc.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
scale_hvx.cc [libyuv] Multi-platform ScaleUVAddCols3 for ScaleUVBox at 3x 2026-10-19 15:56:38 -07:00
scale_lsx.cc [libyuv] Multi-platform ScaleUVAddCols3 for ScaleUVBox at 3x 2026-10-19 15:56:38 -07:00
scale_neon64.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
scale_neon.cc [libyuv] Multi-platform ScaleUVAddCols3 for ScaleUVBox at 3x 2026-10-19 15:56:38 -07:00
scale_rgb.cc Fix Coverity Control flow issues (DEADCODE) 2026-07-01 10:39:22 -07:00
scale_rvv.cc [libyuv] Multi-platform ScaleUVAddCols3 for ScaleUVBox at 3x 2026-10-19 15:56:38 -07:00
scale_sme.cc [libyuv] Multi-platform ScaleUVAddCols3 for ScaleUVBox at 3x 2026-10-19 15:56:38 -07:00
scale_uv.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
scale_wasm.cc [libyuv] Multi-platform ScaleUVAddCols3 for ScaleUVBox at 3x 2026-10-19 15:56:38 -07:00
scale_win.cc [libyuv] Multi-platform ScaleUVAddCols3 for ScaleUVBox at 3x 2026-10-19 15:56:38 -07:00
scale.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -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