mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-11-09 14:49:57 +08:00
Clang MemorySanitizer builds define LIBYUV_ENABLE_ROWWIN and compile
row_win.cc and scale_win.cc instead of inline assembly. Replace three
families of AVX-512 intrinsics that LLVM MSan does not model bitwise or
lane-by-lane:
- _mm512_ternarylogic_epi32 (@llvm.x86.avx512.pternlog.d.512) in
ARGBGrayRow_AVX512VNNI, ARGBToUV444MatrixRow_AVX512VNNIVBMI, and
I422ToAR30Row_AVX512BW, which raises false use-of-uninitialized-value
errors whenever any bit of any operand is uninitialized (such as the
unused alpha channel of an RGBX buffer). Use _mm512_and_si512,
_mm512_andnot_si512, _mm512_or_si512, _mm512_xor_si512, and
_mm512_shuffle_i64x2, which LLVM MSan models bit-by-bit.
- _mm512_permutexvar_epi{8,16,32,64} and
_mm512_mask_permutexvar_epi{8,32} (@llvm.x86.avx512.permvar.*) across
row_win.cc and ScaleUVAddCols3_AVX512VBMI in scale_win.cc, which OR
input shadows without permuting them and poison initialized output
lanes whenever any lane of the input vector is uninitialized. Route
through PermutexvarEpi* and MaskPermutexvarEpi* helpers that use
portable lane-by-lane C loops under LIBYUV_MSAN and the native
AVX-512 intrinsics otherwise.
- _mm512_cvttps_epi32 (@llvm.x86.avx512.mask.cvttps2dq.512) in
ARGBAlphaBlendRow_AVX512BW. Route through CvttpsEpi32, which uses a
portable lane-by-lane C loop under LIBYUV_MSAN and _mm512_cvttps_epi32
otherwise.
In standalone MSan builds (!build_with_chromium &&
prebuilt_instrumented_libraries_available && is_msan), override the
relative ELF PT_INTERP from //third_party/instrumented_libs with the
absolute path to the instrumented ld-linux-x86-64.so.2 so test and
utility binaries launch cleanly from any working directory (fixing the
LUCI Linux MSan test runner FileNotFoundError).
Add MSan regression tests with poisoned RGBX alpha channels, poisoned
tail padding, and poisoned destination buffers in planar_test.cc, and
document the AVX-512 MSan intrinsic guidelines in GEMINI.md.
Test: out/msan/libyuv_unittest
Bug: libyuv:388428508
Change-Id: I6a002393db2d2e629cd7a3cf2bf4d98ee9daf79d
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8686036
Reviewed-by: richard winterton <rrwinterton@gmail.com>
|
||
|---|---|---|
| build_overrides | ||
| docs | ||
| include | ||
| infra/config | ||
| riscv_script | ||
| source | ||
| tools_libyuv | ||
| unit_test | ||
| util | ||
| .clang-format | ||
| .gitignore | ||
| .gn | ||
| 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 | ||
| vpython.toml | ||
| vpython.toml.uv.lock | ||
| 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.