mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-10-28 18:07:12 +08:00
- MergeUVRow_SVE2: Interleaves U and V - SplitUVRow_SVE2: De-interleaves UV - InterpolateRow_SVE2: Bilinear row interpolation - YUY2ToYRow_SVE2, YUY2ToUVRow_SVE2, UYVYToYRow_SVE2, UYVYToUVRow_SVE2 - HalfMergeUVRow_SVE2: 2:1 vertical averaging of U and V OnePlus 15 with Qualcomm Snapdragon 8 Elite Gen 5 Oryon V3 Benchmark (1280x720 1000x) | SVE2 | NEON | Result -------------------------------+--------+--------+------------------ TestInterpolatePlane | 119 ms | 164 ms | SVE2 is 1.38x win TestInterpolatePlane_16 | 138 ms | 172 ms | SVE2 is 1.25x win SplitUVPlane_Opt | 68 ms | 69 ms | SVE2 is 1.01x win MergeUVPlane_Opt | 40 ms | 40 ms | Tied SwapUVPlane_Opt | 72 ms | 72 ms | Tied HalfMergeUVPlane_Opt | 50 ms | 50 ms | Tied I420ToNV12_Opt | 25 ms | 26 ms | SVE2 is faster I420ToNV21_Opt | 26 ms | 26 ms | Tied YUY2ToNV12_Opt | 79 ms | 81 ms | SVE2 is faster NV21ToNV12_Opt | 36 ms | 35 ms | Tied Android420ToI420ToNV12_Opt | 53 ms | 53 ms | Tied Android420ToI420ToNV21_Opt | 35 ms | 33 ms | NEON is faster YUY2ToI420_Opt | 87 ms | 84 ms | NEON is faster UYVYToI420_Opt | 87 ms | 83 ms | NEON is faster YUY2ToI422_Opt | 101 ms | 97 ms | NEON is faster UYVYToI422_Opt | 101 ms | 97 ms | NEON is faster UYVYToNV12_Opt | 111 ms | 108 ms | NEON is faster ARGBToNV21_Opt | 279 ms | 279 ms | Tied ABGRToNV21_Opt | 279 ms | 280 ms | SVE2 is faster ARGBToNV12_Opt | 285 ms | 280 ms | NEON is faster ABGRToNV12_Opt | 284 ms | 281 ms | NEON is faster Bug: 42280902 Change-Id: I53f633fe453f2853f7bc9fe17280e938912c4e8f Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8196068 Reviewed-by: Justin Green <greenjustin@google.com> Commit-Queue: Frank Barchard <fbarchard@google.com>
2.7 KiB
2.7 KiB
Gemini Project Context: libyuv Row Functions
This file provides context for the core row-processing architecture of
libyuv. Use these guidelines when refactoring, reviewing, or generating
code within the row_*.cc files.
Architectural Overview
Libyuv uses a dispatch system where high-level conversion functions call optimized "Row" functions. These functions are categorized by SIMD architecture and compiler compatibility.
Source File Map
x86 Architectures (32-bit and 64-bit)
- row_gcc.cc: Master copy. Contains inline assembly in GCC syntax for GCC and Clang. Supports AVX, and AVX512. AVX512 implementations are strictly for 64-bit targets.
- row_win.cc: Derivative of
row_gcc.cc. Contains C++ intrinsics specifically for Visual C++ (MSVC). Can be tested with Clang using-DLIBYUV_ENABLE_ROWWIN. - Note: Use either
row_gccorrow_win, never both.
ARM Architectures
- row_neon.cc: 32-bit ARM. Written entirely in inline assembly for GCC/Clang.
- row_neon64.cc: 64-bit ARM (AArch64). Written entirely in inline assembly for GCC/Clang.
- row_sve.cc: ARMv9 Scalable Vector Extensions (SVE).
- row_sme.cc: ARMv9 Scalable Matrix Extension (SME) and Streaming SVE (SSVE).
Other Architectures
- row_rvv.cc: RISC-V Vector (RVV). Implemented using intrinsics. Optimized for SiFive X280.
- row_lsx.cc / row_lasx.cc: Loongarch MIPS-like extensions.
Utility and Fallbacks
- row_common.cc: Portable C/C++ versions. This is the reference implementation.
- row_any.cc: Handles "remainder" pixels for widths not multiples of SIMD register size. Used for x86, NEON, and MIPS. Not required for SVE, SME, or RVV due to hardware-level masking.
Coding Guidelines
- AVX512 Logic: AVX512 row functions are strictly enabled for 64-bit x86 only.
- Feature Macros: Use the
HAS_macros ininclude/libyuv/row.hto enable or disable specific AVX512 versions. - MSVC Intrinsics (
row_win.cc): When convertingrow_gcc.cctorow_win.cc, use_mm512_permutex2var_epi8, not_mm512_permi2var_epi8intrinsic.
Changelist (CL) Format Guidelines
When adding new code, remove trailing spaces. When generating descriptions, follow the Chromium standard format. Wrap commit message text at 72 characters
Changelist (CL) Description Example
libyuv] Optimized ARGBToRGB24 for AVX2
Detailed technical explanation of the change. Describe the SIMD
optimization logic and any platform-specific constraints. Mention
if this impacts specific row files like row_gcc.cc.
Test: libyuv_unittest --gunit_filter=*ARGBToRGB24*
Bug: libyuv:12345, b/67890