ec-av1: drop the vacuous aq-mode=2 lag16 census arm (lane-av1seglvl); scope census SEG_LVL imports to cfg(test)
Browse files at this commitd884467623ea202a8ba6cd051449b4067886509aParent: abdbfa31 changed file +14 -10
- crates/ec-av1/src/stream.rs +14 -10
crates/ec-av1/src/stream.rsmodified+14 -10
| @@ -17,8 +17,13 @@ | |||
| 17 | 17 | ||
| 18 | use ec_av1_syntax::{ | 18 | use ec_av1_syntax::{ |
| 19 | Av1Parser, FrameHeader, FrameType, MAX_SEGMENTS, NUM_REF_FRAMES, ObuKind, PRIMARY_REF_NONE, | 19 | Av1Parser, FrameHeader, FrameType, MAX_SEGMENTS, NUM_REF_FRAMES, ObuKind, PRIMARY_REF_NONE, |
| 20 | - SEG_LVL_ALT_Q, SEG_LVL_GLOBALMV, SEG_LVL_MAX, SEG_LVL_REF_FRAME, SEG_LVL_SKIP, Tile, TxMode, | 20 | + SEG_LVL_GLOBALMV, SEG_LVL_REF_FRAME, SEG_LVL_SKIP, Tile, TxMode, |
| 21 | }; | 21 | }; |
| 22 | +// Census-only: read outside `mod tests` only in comments; the non-test lib | ||
| 23 | +// target never touches them, so they ride in behind cfg(test) (via the test | ||
| 24 | +// module's `use super::*`). | ||
| 25 | +#[cfg(test)] | ||
| 26 | +use ec_av1_syntax::{SEG_LVL_ALT_Q, SEG_LVL_MAX}; | ||
| 22 | use ec_core::{Error, Result}; | 27 | use ec_core::{Error, Result}; |
| 23 | 28 | ||
| 24 | use crate::cdf_state::Cdfs; | 29 | use crate::cdf_state::Cdfs; |
| @@ -2889,7 +2894,7 @@ pub(crate) mod tests { | |||
| 2889 | // REF_FRAME/SKIP/GLOBALMV, so an ALT_LF-only stream would decode | 2894 | // REF_FRAME/SKIP/GLOBALMV, so an ALT_LF-only stream would decode |
| 2890 | // silently past it -- but a direct parse of every frame header's | 2895 | // silently past it -- but a direct parse of every frame header's |
| 2891 | // `feature_enabled` table. | 2896 | // `feature_enabled` table. |
| 2892 | - let lag_recipes: [(&str, &str, usize, usize, Vec<&str>); 4] = [ | 2897 | + let lag_recipes: [(&str, &str, usize, usize, Vec<&str>); 3] = [ |
| 2893 | ( | 2898 | ( |
| 2894 | "aq-mode=1 lag16 mandelbrot", | 2899 | "aq-mode=1 lag16 mandelbrot", |
| 2895 | "mandelbrot", | 2900 | "mandelbrot", |
| @@ -2911,13 +2916,12 @@ pub(crate) mod tests { | |||
| 2911 | 128, | 2916 | 128, |
| 2912 | vec!["--cpu-used=4", "--aq-mode=1", "--cq-level=63", "--lag-in-frames=16", "--auto-alt-ref=1"], | 2917 | vec!["--cpu-used=4", "--aq-mode=1", "--cq-level=63", "--lag-in-frames=16", "--auto-alt-ref=1"], |
| 2913 | ), | 2918 | ), |
| 2914 | - ( | 2919 | + // `--aq-mode=2 lag16` (complexity AQ over an alt-ref group) was |
| 2915 | - "aq-mode=2 lag16", | 2920 | + // measured 2026-09-24: it encodes and decodes cleanly but codes |
| 2916 | - "mandelbrot", | 2921 | + // ZERO segmentation-enabled frames -- complexity AQ never reaches |
| 2917 | - 192, | 2922 | + // the seg table at this recipe -- so as a census arm it measures |
| 2918 | - 128, | 2923 | + // nothing (class gate-blind-to-feature) and was dropped; the |
| 2919 | - vec!["--cpu-used=4", "--aq-mode=2", "--cq-level=45", "--lag-in-frames=16", "--auto-alt-ref=1"], | 2924 | + // 1-pass `aq-mode=2` r27 arm above stays. |
| 2920 | - ), | ||
| 2921 | ]; | 2925 | ]; |
| 2922 | let mut total_enabled = 0usize; | 2926 | let mut total_enabled = 0usize; |
| 2923 | let mut total_inherited = 0usize; | 2927 | let mut total_inherited = 0usize; |
| @@ -2995,7 +2999,7 @@ pub(crate) mod tests { | |||
| 2995 | ); | 2999 | ); |
| 2996 | } | 3000 | } |
| 2997 | eprintln!( | 3001 | eprintln!( |
| 2998 | - "SEGCENSUS lag/twopass: {total_enabled} seg-enabled frames over 5 arms, {total_inherited} inherited-map frames, {total_alt_q} with ALT_Q, all other SEG_LVL features: 0 frames" | 3002 | + "SEGCENSUS lag/twopass: {total_enabled} seg-enabled frames over 4 arms, {total_inherited} inherited-map frames, {total_alt_q} with ALT_Q, all other SEG_LVL features: 0 frames" |
| 2999 | ); | 3003 | ); |
| 3000 | } | 3004 | } |
| 3001 | 3005 | ||