mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-06-15 08:26:06 +08:00
Replaced the 2-pass conversion (I420 -> ARGB -> RGB24/RAW) with a
highly optimized 1-pass AVX2 implementation. This avoids intermediate
stack buffering and significantly reduces memory bandwidth.
Implemented `I422ToRGB24Row_AVX2` in:
- `row_gcc.cc`: Inline assembly for GCC/Clang.
- `row_win.cc`: C++ intrinsics for MSVC (also verified with Clang).
Optimized the width alignment requirement: changed from 32-pixel to
16-pixel alignment in `convert_argb.cc` and `row_any.cc`. This allows
the optimized AVX2 path to be used for more common video resolutions.
Performance results (1080p, 100 iterations):
- C Reference: ~18.5 ms
- AVX2 2-Pass (Baseline): ~412 us (~45x speedup)
- AVX2 1-Pass (GCC Assembly): ~411 us (~s45x speedup)
- AVX2 1-Pass (Intrinsics): ~365 us (~50x speedup, 11% faster than asm)
Test: libyuv_unittest --gunit_filter=*I420ToRGB24*
Test: libyuv_unittest --gunit_filter=*I420ToRAW*
Bug: 42280902
Change-Id: I07c0505c95410ea16a6218c858844791a11ef073
|
||
|---|---|---|
| build_overrides | ||
| docs | ||
| include | ||
| infra/config | ||
| riscv_script | ||
| source | ||
| tools_libyuv | ||
| unit_test | ||
| util | ||
| .clang-format | ||
| .gitignore | ||
| .gn | ||
| .vpython3 | ||
| Android.bp | ||
| Android.mk | ||
| AUTHORS | ||
| BUILD.bazel | ||
| BUILD.gn | ||
| CM_linux_packages.cmake | ||
| CMakeLists.txt | ||
| codereview.settings | ||
| DEPS | ||
| DIR_METADATA | ||
| download_vs_toolchain.py | ||
| GEMINI.md | ||
| libyuv.bzl | ||
| libyuv.gni | ||
| libyuv.gyp | ||
| libyuv.gypi | ||
| LICENSE | ||
| linux.mk | ||
| OWNERS | ||
| PATENTS | ||
| PRESUBMIT.py | ||
| public.mk | ||
| pylintrc | ||
| README.chromium | ||
| README.md | ||
| winarm.mk | ||
| WORKSPACE.bazel | ||
libyuv is an open source project that includes YUV scaling and conversion functionality.
- Scale YUV to prepare content for compression, with point, bilinear or box filter.
- Convert to YUV from webcam formats for compression.
- Convert to RGB formats for rendering/effects.
- Rotate by 90/180/270 degrees to adjust for mobile devices in portrait mode.
- Optimized for SSSE3/AVX2 on x86/x64.
- Optimized for Neon/SVE2/SME on Arm.
- Optimized for MSA on Mips.
- Optimized for RVV on RISC-V.
Development
See Getting started for instructions on how to get started developing.
You can also browse the docs directory for more documentation.