debug(av1): EC_TRACE_MODE_STEP ladder lines for the 8x8 intra-in-inter leaf (use_filter_intra + modes)
Browse files at this commit6670752233513889ba8735b63ec6b9b93d745430Parent: a9c4f351 changed file +38 -4
- crates/ec-av1/src/decode.rs +38 -4
crates/ec-av1/src/decode.rsmodified+38 -4
| @@ -21848,6 +21848,15 @@ fn decode_inter_block8( | |||
| 21848 | // but `DC_PRED` was refused here, which is what blocked the low-cq | 21848 | // but `DC_PRED` was refused here, which is what blocked the low-cq |
| 21849 | // CDEF arms and the 10-bit gates. | 21849 | // CDEF arms and the 10-bit gates. |
| 21850 | let uv_mode = dec.symbol(&mut cdfs.uv_mode_cfl[mode]); | 21850 | let uv_mode = dec.symbol(&mut cdfs.uv_mode_cfl[mode]); |
| 21851 | + if std::env::var_os("EC_TRACE_MODE_STEP").is_some() { | ||
| 21852 | + eprintln!( | ||
| 21853 | + "EC_ISTEP8 mi_row={} mi_col={} name=modes y={mode} uv={uv_mode} fi_enabled={} rng={}", | ||
| 21854 | + leaf_mi.0, | ||
| 21855 | + leaf_mi.1, | ||
| 21856 | + ENABLE_FILTER_INTRA_INTER.with(std::cell::Cell::get), | ||
| 21857 | + dec.debug_state().0 | ||
| 21858 | + ); | ||
| 21859 | + } | ||
| 21851 | if (9..=12).contains(&uv_mode) { | 21860 | if (9..=12).contains(&uv_mode) { |
| 21852 | SMOOTH_UV_HITS.with(|c| c.set(c.get() + 1)); | 21861 | SMOOTH_UV_HITS.with(|c| c.set(c.get() + 1)); |
| 21853 | INTRA_IN_INTER8_UV_SMOOTH_HITS.with(|c| c.set(c.get() + 1)); | 21862 | INTRA_IN_INTER8_UV_SMOOTH_HITS.with(|c| c.set(c.get() + 1)); |
| @@ -21908,14 +21917,39 @@ fn decode_inter_block8( | |||
| 21908 | // `av1_filter_intra_allowed`'s `palette_size[0] == 0` term is implied: | 21917 | // `av1_filter_intra_allowed`'s `palette_size[0] == 0` term is implied: |
| 21909 | // a real palette-Y block already returned above. | 21918 | // a real palette-Y block already returned above. |
| 21910 | let mut filter_intra = None; | 21919 | let mut filter_intra = None; |
| 21920 | + // lane-uv8 r2: the oracle's `EC_ISTEP` ladder (`EC_TRACE_MODE_STEP`) | ||
| 21921 | + // prints `use_filter_intra` for an intra block inside an INTER frame | ||
| 21922 | + // and nothing else, so this leaf needs the same two lines for a | ||
| 21923 | + // range-ladder diff against it. | ||
| 21924 | + let ec_istep8 = std::env::var_os("EC_TRACE_MODE_STEP").is_some(); | ||
| 21911 | if mode == DC_PRED | 21925 | if mode == DC_PRED |
| 21912 | && ENABLE_FILTER_INTRA_INTER.with(std::cell::Cell::get) | 21926 | && ENABLE_FILTER_INTRA_INTER.with(std::cell::Cell::get) |
| 21913 | && let Some(class) = filter_intra_size_class(SIDE) | 21927 | && let Some(class) = filter_intra_size_class(SIDE) |
| 21914 | - && dec.symbol(&mut cdfs.filter_intra[class]) != 0 | ||
| 21915 | { | 21928 | { |
| 21916 | - FILTER_INTRA_HITS.with(|c| c.set(c.get() + 1)); | 21929 | + let use_fi = dec.symbol(&mut cdfs.filter_intra[class]) != 0; |
| 21917 | - INTRA_IN_INTER_FILTER_INTRA_HITS.with(|c| c.set(c.get() + 1)); | 21930 | + if ec_istep8 { |
| 21918 | - filter_intra = Some(dec.symbol(&mut cdfs.filter_intra_mode)); | 21931 | + eprintln!( |
| 21932 | + "EC_ISTEP mi_row={} mi_col={} name=use_filter_intra val={} rng={}", | ||
| 21933 | + leaf_mi.0, | ||
| 21934 | + leaf_mi.1, | ||
| 21935 | + u8::from(use_fi), | ||
| 21936 | + dec.debug_state().0 | ||
| 21937 | + ); | ||
| 21938 | + } | ||
| 21939 | + if use_fi { | ||
| 21940 | + FILTER_INTRA_HITS.with(|c| c.set(c.get() + 1)); | ||
| 21941 | + INTRA_IN_INTER_FILTER_INTRA_HITS.with(|c| c.set(c.get() + 1)); | ||
| 21942 | + let fi = dec.symbol(&mut cdfs.filter_intra_mode); | ||
| 21943 | + if ec_istep8 { | ||
| 21944 | + eprintln!( | ||
| 21945 | + "EC_ISTEP mi_row={} mi_col={} name=filter_intra_mode val={fi} rng={}", | ||
| 21946 | + leaf_mi.0, | ||
| 21947 | + leaf_mi.1, | ||
| 21948 | + dec.debug_state().0 | ||
| 21949 | + ); | ||
| 21950 | + } | ||
| 21951 | + filter_intra = Some(fi); | ||
| 21952 | + } | ||
| 21919 | } | 21953 | } |
| 21920 | mode_for_tx = mode; | 21954 | mode_for_tx = mode; |
| 21921 | let (mi_row, mi_col) = leaf_mi; | 21955 | let (mi_row, mi_col) = leaf_mi; |