ec-vp8: restore shared avx2 probe after idct revert
Browse files at this commit7ffca32472ad84c5553cf1d0007234bb113361a3Parent: bb830d81 changed file +8 -0
- crates/ec-vp8/src/lib.rs +8 -0
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 as | 59 | /// 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 { |