mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-10-28 18:07:12 +08:00
Clang MemorySanitizer builds define LIBYUV_ENABLE_ROWWIN and compile row_win.cc and scale_win.cc instead of inline assembly. Two AVX-512 intrinsic patterns in those files are not modeled by LLVM MSan: 1. _mm512_mask_cvtepi32_storeu_epi8 and _mm512_mask_cvtepi64_storeu_epi8 lower to @llvm.x86.avx512.mask.pmov.db.mem.512 and @llvm.x86.avx512.mask.pmov.qb.mem.512, which LLVM MSan handles as unknown intrinsics without unpoisoning destination shadow memory. Replace them in ARGBExtractAlphaRow_AVX512BW, ScaleAddCols1_AVX512BW, and ScaleAddCols2_AVX512BW with _mm512_cvtepi32_epi8 / _mm512_cvtepi64_epi8 followed by _mm_mask_storeu_epi8, which lowers to @llvm.masked.store and still compiles to a single vpmovdb/vpmovqb instruction. 2. ARGBCopyYToAlphaRow_AVX512BW loaded dst and blended the alpha channel using _mm512_ternarylogic_epi32, which LLVM MSan does not model bitwise and flags when any destination byte (such as the old alpha channel) is uninitialized. Replace the load + vpternlogd + store in both row_win.cc and row_gcc.cc with byte-masked stores (_mm512_mask_storeu_epi8 / vmovdqu8 with mask 0x8888888888888888) that write only the alpha bytes without reading dst. Expand ARGBCopyAlpha, ARGBExtractAlpha, and ARGBCopyYToAlpha unit tests into _Any, _Unaligned, _Invert, and _Opt variants and poison destination buffers under MSan to catch unmodeled masked stores. Document MSan AVX-512 intrinsic guidelines in GEMINI.md. Test: out/msan/libyuv_unittest --gtest_filter=*Alpha*:*ScalePlaneBox_Any* Bug: 578615529 Change-Id: I54ac4a5844aca6cfe3aa3445fa04b8221c610b35 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8672001 Commit-Queue: Frank Barchard <fbarchard@google.com> Reviewed-by: Dale Curtis <dalecurtis@chromium.org> |
||
|---|---|---|
| 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.