forge
Explore
Log in

Don't you dare go Hollow

ec-vp8: restore shared avx2 probe after idct revert

Browse files at this commit

7ffca32472ad84c5553cf1d0007234bb113361a3Ahmet Kaan GümüşParent: bb830d8
The revert of 4d6a9f27 also dropped lib.rs's avx2_supported(), which
mc.rs's six-tap/bilinear kernels import since 79e13d22.
crates/ec-vp8/src/lib.rsmodified+8 -0
@@ -48,6 +48,14 @@ pub(crate) fn trace_enabled() -> bool {
48 }48 }
49 }49 }
50 50
51+/// Cached AVX2 availability for the explicit-SIMD kernels (`mc`).
52+#[cfg(target_arch = "x86_64")]
53+pub(crate) fn avx2_supported() -> bool {
54+ static AVX2: std::sync::LazyLock<bool> =
55+ std::sync::LazyLock::new(|| std::arch::is_x86_feature_detected!("avx2"));
56+ *AVX2
57+}
58+
51 /// Whether `EC_VP8_DEBUG` per-macroblock dumps are enabled (same shape as59 /// Whether `EC_VP8_DEBUG` per-macroblock dumps are enabled (same shape as
52 /// [`trace_enabled`]; the check sits in the per-MB reconstruct path).60 /// [`trace_enabled`]; the check sits in the per-MB reconstruct path).
53 pub(crate) fn debug_enabled() -> bool {61 pub(crate) fn debug_enabled() -> bool {