Merge branch 'lane-obmcrec' (302d772): OBMC takes a 1:4-strip neighbour's interp filters from the pair's second mi like its mv and ref; the 16x4 refusal on the inter block path was a misnamed 128x64 intra block
Browse files at this commit4 changed files +267 -20
- crates/ec-av1/src/decode.rs +103 -19
- crates/ec-av1/src/refusal_inventory.rs +1 -1
- crates/ec-av1/src/stream.rs +79 -0
- lanes/obmcrec-r1.report.md +84 -0
crates/ec-av1/src/decode.rsmodified+103 -19
| @@ -2185,6 +2185,20 @@ pub(crate) fn obmc_rect_leaf_hits() -> usize { | |||
| 2185 | OBMC_RECT_LEAF_HITS.with(|c| c.get()) | 2185 | OBMC_RECT_LEAF_HITS.with(|c| c.get()) |
| 2186 | } | 2186 | } |
| 2187 | 2187 | ||
| 2188 | +// lane-obmcrec r1: how many OBMC neighbours were taken from the SECOND half of | ||
| 2189 | +// a 4-wide/4-tall (1:4 strip) chroma pair -- the case whose interp filter used | ||
| 2190 | +// to be read from the pair's FIRST mi, which is a different block and, when | ||
| 2191 | +// that half is intra, carries the `[3, 3]` "no filter" sentinel (the three | ||
| 2192 | +// 1080p 10-bit film cuts refused there). The gate's proof the shape fired. | ||
| 2193 | +thread_local! { | ||
| 2194 | + static OBMC_PAIR_FILTER_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) }; | ||
| 2195 | +} | ||
| 2196 | + | ||
| 2197 | +/// Current value of [`OBMC_PAIR_FILTER_HITS`]. | ||
| 2198 | +pub(crate) fn obmc_pair_filter_hits() -> usize { | ||
| 2199 | + OBMC_PAIR_FILTER_HITS.with(|c| c.get()) | ||
| 2200 | +} | ||
| 2201 | + | ||
| 2188 | /// Current value of [`OBMC_HITS_8`]. | 2202 | /// Current value of [`OBMC_HITS_8`]. |
| 2189 | pub(crate) fn obmc_hits_8() -> usize { | 2203 | pub(crate) fn obmc_hits_8() -> usize { |
| 2190 | OBMC_HITS_8.with(|c| c.get()) | 2204 | OBMC_HITS_8.with(|c| c.get()) |
| @@ -7386,9 +7400,20 @@ fn decode_intra_rect_in_inter( | |||
| 7386 | (8, 32) => (1, 2), | 7400 | (8, 32) => (1, 2), |
| 7387 | (16, 64) => (2, 3), | 7401 | (16, 64) => (2, 3), |
| 7388 | _ => { | 7402 | _ => { |
| 7389 | - return Err(unsupported( | 7403 | + if std::env::var_os("EC_OBMCREC").is_some() { |
| 7390 | - "an intra-coded 16x4/4x16 strip on the inter block path (the 16x16-level 1:4 inter partition is refused before this point)", | 7404 | + eprintln!( |
| 7391 | - )) | 7405 | + "OBMCREC intra-in-inter shape bw={bw} bh={bh} mi=({mi_r},{mi_c}) skip={skip}" |
| 7406 | + ); | ||
| 7407 | + } | ||
| 7408 | + // lane-obmcrec r1: the message used to name a 16x4/4x16 strip | ||
| 7409 | + // (class refusal-names-a-correlate). Measured with `EC_OBMCREC=1` | ||
| 7410 | + // on three 2 s cuts of the 10-bit 1920x792 128-superblock stream: | ||
| 7411 | + // every arrival here is a 128x64 block -- a PARTITION_HORZ half of | ||
| 7412 | + // a 128 superblock coded INTRA inside an inter frame, at mi | ||
| 7413 | + // (128,416) / (192,0) / (192,0) -- not a strip at all. | ||
| 7414 | + return Err(unsupported(format!( | ||
| 7415 | + "an intra-coded {bw}x{bh} block on the inter block path (no size-group/tx-category row for that shape here)" | ||
| 7416 | + ))); | ||
| 7392 | } | 7417 | } |
| 7393 | }; | 7418 | }; |
| 7394 | // [`read_intra_mode_rect`]'s own refusal: palette/intrabc syntax is | 7419 | // [`read_intra_mode_rect`]'s own refusal: palette/intrabc syntax is |
| @@ -18143,7 +18168,7 @@ fn overlappable_above( | |||
| 18143 | bw4: usize, | 18168 | bw4: usize, |
| 18144 | mi_cols: usize, | 18169 | mi_cols: usize, |
| 18145 | max_neighbors: usize, | 18170 | max_neighbors: usize, |
| 18146 | -) -> Vec<(usize, usize, MiInfo)> { | 18171 | +) -> Vec<(usize, usize, MiInfo, usize)> { |
| 18147 | let mut out = Vec::new(); | 18172 | let mut out = Vec::new(); |
| 18148 | if mi_row == 0 { | 18173 | if mi_row == 0 { |
| 18149 | return out; | 18174 | return out; |
| @@ -18154,17 +18179,25 @@ fn overlappable_above( | |||
| 18154 | let cell = grid.get(mi_row - 1, col); | 18179 | let cell = grid.get(mi_row - 1, col); |
| 18155 | let mut step = cell.map_or(1, |c| c.size).max(1).min(SB_MI as usize); | 18180 | let mut step = cell.map_or(1, |c| c.size).max(1).min(SB_MI as usize); |
| 18156 | let mut nb = cell; | 18181 | let mut nb = cell; |
| 18182 | + // lane-obmcrec r1: the mi the neighbour's `MiInfo` is actually taken | ||
| 18183 | + // from -- the pair merge below moves it, and libaom reads that same | ||
| 18184 | + // `mbmi`'s `interp_filters` (`av1_setup_build_prediction_by_above_pred`). | ||
| 18185 | + let mut src = col; | ||
| 18157 | if step == 1 { | 18186 | if step == 1 { |
| 18158 | // The pair merge: the walk snaps back to the pair's even column | 18187 | // The pair merge: the walk snaps back to the pair's even column |
| 18159 | // and the ODD half (the chroma-carrying one) is the neighbour for | 18188 | // and the ODD half (the chroma-carrying one) is the neighbour for |
| 18160 | // both -- a 4-wide 1:4 strip is never an OBMC source on its own. | 18189 | // both -- a 4-wide 1:4 strip is never an OBMC source on its own. |
| 18161 | col &= !1; | 18190 | col &= !1; |
| 18162 | - nb = grid.get(mi_row - 1, col + 1); | 18191 | + src = col + 1; |
| 18192 | + nb = grid.get(mi_row - 1, src); | ||
| 18163 | step = 2; | 18193 | step = 2; |
| 18164 | } | 18194 | } |
| 18165 | if let Some(info) = nb { | 18195 | if let Some(info) = nb { |
| 18166 | if info.is_inter { | 18196 | if info.is_inter { |
| 18167 | - out.push((col - mi_col, step.min(end_col - col), *info)); | 18197 | + if src != col { |
| 18198 | + OBMC_PAIR_FILTER_HITS.with(|c| c.set(c.get() + 1)); | ||
| 18199 | + } | ||
| 18200 | + out.push((col - mi_col, step.min(end_col - col), *info, src - mi_col)); | ||
| 18168 | } | 18201 | } |
| 18169 | } | 18202 | } |
| 18170 | col += step; | 18203 | col += step; |
| @@ -18181,7 +18214,7 @@ fn overlappable_left( | |||
| 18181 | bh4: usize, | 18214 | bh4: usize, |
| 18182 | mi_rows: usize, | 18215 | mi_rows: usize, |
| 18183 | max_neighbors: usize, | 18216 | max_neighbors: usize, |
| 18184 | -) -> Vec<(usize, usize, MiInfo)> { | 18217 | +) -> Vec<(usize, usize, MiInfo, usize)> { |
| 18185 | let mut out = Vec::new(); | 18218 | let mut out = Vec::new(); |
| 18186 | if mi_col == 0 { | 18219 | if mi_col == 0 { |
| 18187 | return out; | 18220 | return out; |
| @@ -18194,17 +18227,23 @@ fn overlappable_left( | |||
| 18194 | // width (8) would swallow the strip below it. | 18227 | // width (8) would swallow the strip below it. |
| 18195 | let mut step = cell.map_or(1, |c| c.size_h).max(1).min(SB_MI as usize); | 18228 | let mut step = cell.map_or(1, |c| c.size_h).max(1).min(SB_MI as usize); |
| 18196 | let mut nb = cell; | 18229 | let mut nb = cell; |
| 18230 | + // lane-obmcrec r1: see `overlappable_above`'s `src`. | ||
| 18231 | + let mut src = row; | ||
| 18197 | if step == 1 { | 18232 | if step == 1 { |
| 18198 | // The pair merge, left-column mirror: a 4-TALL neighbour (a 16x4 | 18233 | // The pair merge, left-column mirror: a 4-TALL neighbour (a 16x4 |
| 18199 | // strip) is half of a chroma pair and the pair's SECOND row is the | 18234 | // strip) is half of a chroma pair and the pair's SECOND row is the |
| 18200 | // neighbour for both. | 18235 | // neighbour for both. |
| 18201 | row &= !1; | 18236 | row &= !1; |
| 18202 | - nb = grid.get(row + 1, mi_col - 1); | 18237 | + src = row + 1; |
| 18238 | + nb = grid.get(src, mi_col - 1); | ||
| 18203 | step = 2; | 18239 | step = 2; |
| 18204 | } | 18240 | } |
| 18205 | if let Some(info) = nb { | 18241 | if let Some(info) = nb { |
| 18206 | if info.is_inter { | 18242 | if info.is_inter { |
| 18207 | - out.push((row - mi_row, step.min(end_row - row), *info)); | 18243 | + if src != row { |
| 18244 | + OBMC_PAIR_FILTER_HITS.with(|c| c.set(c.get() + 1)); | ||
| 18245 | + } | ||
| 18246 | + out.push((row - mi_row, step.min(end_row - row), *info, src - mi_row)); | ||
| 18208 | } | 18247 | } |
| 18209 | } | 18248 | } |
| 18210 | row += step; | 18249 | row += step; |
| @@ -18447,6 +18486,46 @@ fn neighbour_filter( | |||
| 18447 | )) | 18486 | )) |
| 18448 | } | 18487 | } |
| 18449 | 18488 | ||
| 18489 | +/// lane-obmcrec r1 MEASUREMENT rung (`EC_OBMCREC=1`): every OBMC neighbour whose | ||
| 18490 | +/// recorded switchable-filter symbols are the `[3, 3]` "never recorded" sentinel | ||
| 18491 | +/// -- names the neighbour's own position/shape/reference so the decode path that | ||
| 18492 | +/// failed to record its filter can be identified. Read-only, off by default. | ||
| 18493 | +#[allow(clippy::too_many_arguments)] | ||
| 18494 | +fn obmcrec_probe( | ||
| 18495 | + dir: &str, | ||
| 18496 | + mi_row: usize, | ||
| 18497 | + mi_col: usize, | ||
| 18498 | + write_w: usize, | ||
| 18499 | + write_h: usize, | ||
| 18500 | + off4: usize, | ||
| 18501 | + span4: usize, | ||
| 18502 | + nb: &MiInfo, | ||
| 18503 | + syms: [u8; 2], | ||
| 18504 | + cell: Option<MiInfo>, | ||
| 18505 | + fixed: bool, | ||
| 18506 | +) { | ||
| 18507 | + if (syms[0] <= 2 && syms[1] <= 2) || std::env::var_os("EC_OBMCREC").is_none() { | ||
| 18508 | + return; | ||
| 18509 | + } | ||
| 18510 | + eprintln!( | ||
| 18511 | + "OBMCREC {dir} cur_mi=({mi_row},{mi_col}) cur_wh=({write_w}x{write_h}) off4={off4} \ | ||
| 18512 | +span4={span4} syms={syms:?} fixed={fixed} nb_size=({}x{}) nb_ref={} nb_ref1={:?} nb_mv=({},{}) \ | ||
| 18513 | +nb_newmv={} cell_size={:?} cell_inter={:?} cell_ref={:?} sb_row_off={} sb_col_off={}", | ||
| 18514 | + nb.size * 4, | ||
| 18515 | + nb.size_h * 4, | ||
| 18516 | + nb.ref_frame, | ||
| 18517 | + nb.ref_frame1, | ||
| 18518 | + nb.mv.0, | ||
| 18519 | + nb.mv.1, | ||
| 18520 | + nb.is_new_mv, | ||
| 18521 | + cell.map(|c| (c.size * 4, c.size_h * 4)), | ||
| 18522 | + cell.map(|c| c.is_inter), | ||
| 18523 | + cell.map(|c| c.ref_frame), | ||
| 18524 | + mi_row % 32, | ||
| 18525 | + mi_col % 32, | ||
| 18526 | + ); | ||
| 18527 | +} | ||
| 18528 | + | ||
| 18450 | /// One neighbour's own re-prediction over a `w`x`h` region, MC'd fresh | 18529 | /// One neighbour's own re-prediction over a `w`x`h` region, MC'd fresh |
| 18451 | /// against its own `mv`/reference/filter (libaom `av1_build_inter_predictor` | 18530 | /// against its own `mv`/reference/filter (libaom `av1_build_inter_predictor` |
| 18452 | /// under `av1_setup_build_prediction_by_{above,left}_pred`). | 18531 | /// under `av1_setup_build_prediction_by_{above,left}_pred`). |
| @@ -18778,7 +18857,7 @@ fn obmc_blend( | |||
| 18778 | // ABOVE pass skips chroma entirely, the LEFT pass still blends it. | 18857 | // ABOVE pass skips chroma entirely, the LEFT pass still blends it. |
| 18779 | let skip_chroma_above = matches!((write_w, write_h), (8, 8) | (16, 8) | (8, 16)); | 18858 | let skip_chroma_above = matches!((write_w, write_h), (8, 8) | (16, 8) | (8, 16)); |
| 18780 | 18859 | ||
| 18781 | - for (off4, span4, nb) in overlappable_above(grid, mi_row, mi_col, bw4, mi_cols, max_nb(bw4)) | 18860 | + for (off4, span4, nb, src4) in overlappable_above(grid, mi_row, mi_col, bw4, mi_cols, max_nb(bw4)) |
| 18782 | { | 18861 | { |
| 18783 | // `Neighbours::above_filter` is indexed in `SUB`(16px)-wide columns | 18862 | // `Neighbours::above_filter` is indexed in `SUB`(16px)-wide columns |
| 18784 | // (this decoder's own outer block-loop granularity), one step | 18863 | // (this decoder's own outer block-loop granularity), one step |
| @@ -18789,10 +18868,12 @@ fn obmc_blend( | |||
| 18789 | // `above_mbmi->interp_filters`); the 16px-granular `Neighbours` slot | 18868 | // `above_mbmi->interp_filters`); the 16px-granular `Neighbours` slot |
| 18790 | // stays as the fallback for paths that do not record one yet | 18869 | // stays as the fallback for paths that do not record one yet |
| 18791 | // (compound), which is what every earlier round used. | 18870 | // (compound), which is what every earlier round used. |
| 18792 | - let (h_kind, v_kind) = neighbour_filter( | 18871 | + let above_syms = neighbours.above_filter[mi_col + src4]; |
| 18793 | - interp_fixed, | 18872 | + obmcrec_probe( |
| 18794 | - neighbours.above_filter[mi_col + off4], | 18873 | + "above", mi_row, mi_col, write_w, write_h, off4, span4, &nb, above_syms, |
| 18795 | - )?; | 18874 | + grid.get(mi_row - 1, mi_col + src4).copied(), interp_fixed.is_some(), |
| 18875 | + ); | ||
| 18876 | + let (h_kind, v_kind) = neighbour_filter(interp_fixed, above_syms)?; | ||
| 18796 | ec_obmc_trace("above", mi_row, mi_col, write_w, write_h, off4, span4, &nb, h_kind, v_kind); | 18877 | ec_obmc_trace("above", mi_row, mi_col, write_w, write_h, off4, span4, &nb, h_kind, v_kind); |
| 18797 | let (ny, nu, nv) = ref_planes(nb.ref_frame, ref_y, ref_u, ref_v, other_refs)?; | 18878 | let (ny, nu, nv) = ref_planes(nb.ref_frame, ref_y, ref_u, ref_v, other_refs)?; |
| 18798 | let nb_scale = mc::scale_factor(ny.width, frame_width); | 18879 | let nb_scale = mc::scale_factor(ny.width, frame_width); |
| @@ -18808,11 +18889,14 @@ fn obmc_blend( | |||
| 18808 | } | 18889 | } |
| 18809 | } | 18890 | } |
| 18810 | 18891 | ||
| 18811 | - for (off4, span4, nb) in overlappable_left(grid, mi_row, mi_col, bh4, mi_rows, max_nb(bh4)) { | 18892 | + for (off4, span4, nb, src4) in overlappable_left(grid, mi_row, mi_col, bh4, mi_rows, max_nb(bh4)) |
| 18812 | - let (h_kind, v_kind) = neighbour_filter( | 18893 | + { |
| 18813 | - interp_fixed, | 18894 | + let left_syms = neighbours.left_filter[mi_row + src4]; |
| 18814 | - neighbours.left_filter[mi_row + off4], | 18895 | + obmcrec_probe( |
| 18815 | - )?; | 18896 | + "left", mi_row, mi_col, write_w, write_h, off4, span4, &nb, left_syms, |
| 18897 | + grid.get(mi_row + src4, mi_col - 1).copied(), interp_fixed.is_some(), | ||
| 18898 | + ); | ||
| 18899 | + let (h_kind, v_kind) = neighbour_filter(interp_fixed, left_syms)?; | ||
| 18816 | ec_obmc_trace("left", mi_row, mi_col, write_w, write_h, off4, span4, &nb, h_kind, v_kind); | 18900 | ec_obmc_trace("left", mi_row, mi_col, write_w, write_h, off4, span4, &nb, h_kind, v_kind); |
| 18817 | let (ny, nu, nv) = ref_planes(nb.ref_frame, ref_y, ref_u, ref_v, other_refs)?; | 18901 | let (ny, nu, nv) = ref_planes(nb.ref_frame, ref_y, ref_u, ref_v, other_refs)?; |
| 18818 | let nb_scale = mc::scale_factor(ny.width, frame_width); | 18902 | let nb_scale = mc::scale_factor(ny.width, frame_width); |
crates/ec-av1/src/refusal_inventory.rsmodified+1 -1
| @@ -91,7 +91,7 @@ const REFUSALS: &[&str] = &[ | |||
| 91 | // inter path's intra arm now routes 2:1 strips through `decode_rect_split`); | 91 | // inter path's intra arm now routes 2:1 strips through `decode_rect_split`); |
| 92 | // what is left is the 1:4 shape, whose `bsize_to_tx_size_cat` breaks the | 92 | // what is left is the 1:4 shape, whose `bsize_to_tx_size_cat` breaks the |
| 93 | // size-group/category diagonal the 2:1 shapes share. | 93 | // size-group/category diagonal the 2:1 shapes share. |
| 94 | - "an intra-coded 16x4/4x16 strip on the inter block path (the 16x16-level 1:4 inter partition is refused before this point)", | 94 | + "an intra-coded {bw}x{bh} block on the inter block path (no size-group/tx-category row for that shape here)", |
| 95 | // The same arm's screen-content gate: palette/intrabc syntax is consumed | 95 | // The same arm's screen-content gate: palette/intrabc syntax is consumed |
| 96 | // for square blocks only, so a strip in such a frame would skip symbols. | 96 | // for square blocks only, so a strip in such a frame would skip symbols. |
| 97 | "a HORZ/VERT intra strip in a screen-content frame (palette syntax is consumed for square blocks only)", | 97 | "a HORZ/VERT intra strip in a screen-content frame (palette syntax is consumed for square blocks only)", |
crates/ec-av1/src/stream.rsmodified+79 -0
| @@ -160,6 +160,12 @@ pub fn sb128_ab_counters() -> [usize; 4] { | |||
| 160 | crate::decode::part128_ab_hits() | 160 | crate::decode::part128_ab_hits() |
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | +/// lane-obmcrec r1: OBMC neighbours taken from the second half of a 1:4-strip | ||
| 164 | +/// chroma pair -- the shape whose filter record the r1 fix re-sourced. | ||
| 165 | +pub fn obmc_pair_filter_hits() -> usize { | ||
| 166 | + crate::decode::obmc_pair_filter_hits() | ||
| 167 | +} | ||
| 168 | + | ||
| 163 | pub fn rect4_32_counters() -> (usize, usize, usize) { | 169 | pub fn rect4_32_counters() -> (usize, usize, usize) { |
| 164 | ( | 170 | ( |
| 165 | crate::decode::rect4_32_horz_hits(), | 171 | crate::decode::rect4_32_horz_hits(), |
| @@ -4476,6 +4482,15 @@ mod tests { | |||
| 4476 | /// Seeds swept by the 10-bit LR gate (the 8-bit gate needs ~40 attempts | 4482 | /// Seeds swept by the 10-bit LR gate (the 8-bit gate needs ~40 attempts |
| 4477 | /// to land a non-RESTORE_NONE frame; every attempt here still has to | 4483 | /// to land a non-RESTORE_NONE frame; every attempt here still has to |
| 4478 | /// decode pixel-exact). | 4484 | /// decode pixel-exact). |
| 4485 | + /// lane-obmcrec r1: the `LR_SEEDS` members whose 1:4-partition stream both | ||
| 4486 | + /// fires `obmc_pair_filter_hits` and decodes every frame pixel-exact. | ||
| 4487 | + /// Measured over seeds 42..=73 (32 encodes): 43/46/47/65/66 fire and are | ||
| 4488 | + /// exact; 70 and 73 fire and mismatch, but mismatch IDENTICALLY with | ||
| 4489 | + /// `--enable-obmc=0` (seed 73 frame 1 luma, seed 70 frame 16), so their | ||
| 4490 | + /// defect is in the `--min-partition-size=4` recipe, not in OBMC -- kept | ||
| 4491 | + /// out of this gate rather than papered over, and reported as open. | ||
| 4492 | + const OBMC_PAIR_SEEDS: [u32; 5] = [43, 46, 47, 65, 66]; | ||
| 4493 | + | ||
| 4479 | const LR_SEEDS: [u32; 16] = [42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57]; | 4494 | const LR_SEEDS: [u32; 16] = [42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57]; |
| 4480 | 4495 | ||
| 4481 | /// Wiener + SGR + switchable loop-restoration firings, summed. | 4496 | /// Wiener + SGR + switchable loop-restoration firings, summed. |
| @@ -4616,6 +4631,70 @@ mod tests { | |||
| 4616 | ); | 4631 | ); |
| 4617 | } | 4632 | } |
| 4618 | 4633 | ||
| 4634 | + /// lane-obmcrec r1: OBMC whose above/left neighbour is a 4-wide/4-tall | ||
| 4635 | + /// 1:4-partition strip -- the shape the three 1080p 10-bit film cuts | ||
| 4636 | + /// refused on ("an OBMC neighbour whose switchable interp filter was never | ||
| 4637 | + /// recorded"). `overlappable_above`/`_left` snap such a neighbour to the | ||
| 4638 | + /// chroma pair's SECOND mi but used to read its interp filter from the | ||
| 4639 | + /// FIRST one, a different block whose filter record is the intra | ||
| 4640 | + /// `[3, 3]` sentinel whenever that half is intra. `obmc_pair_filter_hits` | ||
| 4641 | + /// counts exactly that neighbour shape, so a stream without 1:4 strips | ||
| 4642 | + /// next to an OBMC block cannot stand in for it. | ||
| 4643 | + #[test] | ||
| 4644 | + fn a_real_aomenc_10bit_obmc_over_1to4_strip_neighbours_decodes_pixel_exact() { | ||
| 4645 | + const NAME: &str = "a_real_aomenc_10bit_obmc_over_1to4_strip_neighbours_decodes_pixel_exact"; | ||
| 4646 | + if !have_ffmpeg() { | ||
| 4647 | + eprintln!("SKIP {NAME}: no ffmpeg"); | ||
| 4648 | + return; | ||
| 4649 | + } | ||
| 4650 | + if !have_aomenc() { | ||
| 4651 | + eprintln!("SKIP {NAME}: no aomenc at {}", aomenc_path().display()); | ||
| 4652 | + return; | ||
| 4653 | + } | ||
| 4654 | + ten_bit_tool_gate( | ||
| 4655 | + NAME, | ||
| 4656 | + 128, | ||
| 4657 | + 128, | ||
| 4658 | + 24, | ||
| 4659 | + &[ | ||
| 4660 | + "--ec-fixture-noise", | ||
| 4661 | + "--cq-level=45", | ||
| 4662 | + "--kf-max-dist=1000", | ||
| 4663 | + "--auto-alt-ref=1", | ||
| 4664 | + "--lag-in-frames=16", | ||
| 4665 | + "--enable-fwd-kf=0", | ||
| 4666 | + "--enable-order-hint=1", | ||
| 4667 | + "--enable-warped-motion=0", | ||
| 4668 | + "--enable-obmc=1", | ||
| 4669 | + "--tune-content=default", | ||
| 4670 | + "--enable-masked-comp=0", | ||
| 4671 | + "--enable-interintra-comp=0", | ||
| 4672 | + "--enable-onesided-comp=0", | ||
| 4673 | + "--enable-interintra-wedge=0", | ||
| 4674 | + "--enable-smooth-interintra=0", | ||
| 4675 | + "--enable-rect-partitions=1", | ||
| 4676 | + "--enable-ab-partitions=0", | ||
| 4677 | + "--enable-1to4-partitions=1", | ||
| 4678 | + "--enable-filter-intra=0", | ||
| 4679 | + "--enable-smooth-intra=0", | ||
| 4680 | + "--enable-paeth-intra=0", | ||
| 4681 | + "--enable-directional-intra=0", | ||
| 4682 | + "--enable-angle-delta=0", | ||
| 4683 | + "--enable-tx-size-search=0", | ||
| 4684 | + "--enable-cdef=0", | ||
| 4685 | + "--enable-restoration=0", | ||
| 4686 | + "--max-partition-size=32", | ||
| 4687 | + "--min-partition-size=4", | ||
| 4688 | + "--enable-palette=0", | ||
| 4689 | + "--enable-intrabc=0", | ||
| 4690 | + "--enable-cfl-intra=0", | ||
| 4691 | + "--enable-ref-frame-mvs=0", | ||
| 4692 | + ], | ||
| 4693 | + &OBMC_PAIR_SEEDS, | ||
| 4694 | + &[("obmc_pair_filter_hits", decode::obmc_pair_filter_hits)], | ||
| 4695 | + ); | ||
| 4696 | + } | ||
| 4697 | + | ||
| 4619 | /// `bit_depth` of the first sequence header in `stream`. | 4698 | /// `bit_depth` of the first sequence header in `stream`. |
| 4620 | fn parsed_bit_depth(stream: &[u8]) -> u8 { | 4699 | fn parsed_bit_depth(stream: &[u8]) -> u8 { |
| 4621 | let mut probe = Av1Parser::new(); | 4700 | let mut probe = Av1Parser::new(); |
lanes/obmcrec-r1.report.mdadded+84 -0
| @@ -0,0 +1,84 @@ | |||
| 1 | +# lane-obmcrec r1 — OBMC neighbour with no recorded interp filter | ||
| 2 | + | ||
| 3 | +Branch `lane-obmcrec` (base main `beecb64`), commits `15df221`, `32d9965`. | ||
| 4 | + | ||
| 5 | +## Measurement (step 1) | ||
| 6 | +New env rung `EC_OBMCREC=1` (decode.rs `obmcrec_probe`, off by default) prints every OBMC | ||
| 7 | +neighbour whose recorded filter symbols are the `[3, 3]` sentinel, plus the grid cell the | ||
| 8 | +filter was read from. On the three 2 s cuts of the 10-bit 1920x792 128-SB stream: | ||
| 9 | + | ||
| 10 | +| cut | current block | neighbour taken | filter cell read | cell state | | ||
| 11 | +|---|---|---|---|---| | ||
| 12 | +| t900 | left, mi(24,348) 16x16 | 16x4, ref 1, mv(-84,18) | mi row 24 | intra, ref -1 | | ||
| 13 | +| t5400 | above, mi(150,340) 8x8 | 4x8, ref 7 | mi col 340 | intra, ref -1 | | ||
| 14 | +| t6300 | above, mi(56,32) 16x32 | 4x16, ref 1 | mi col 32 | intra, ref -1 | | ||
| 15 | + | ||
| 16 | +`fixed=false` (switchable frame) in all three; each is the FIRST such neighbour of the cut. | ||
| 17 | + | ||
| 18 | +EVIDENCE: ~/.cache/rectres-tmp/{t900,t5400,t6300}.obu | EC_OBMCREC=1 decode_probe per cut | | ||
| 19 | +3 sentinel hits, all with an INTRA cell under an INTER MiInfo | ||
| 20 | + | ||
| 21 | +## Root cause | ||
| 22 | +libaom `foreach_overlappable_nb_above`/`_left` (reconinter.c 780/840) snap a 4-wide/4-tall | ||
| 23 | +neighbour back to its chroma pair's even mi and then take the neighbour's whole `mbmi` -- | ||
| 24 | +mv, reference AND `interp_filters` -- from the pair's **second** mi (`above_mi = prev_row_mi | ||
| 25 | ++ above_mi_col + 1`). Ours snapped the `MiInfo` the same way but read the switchable filter | ||
| 26 | +symbols from the band cell of the **first** mi, a different block; whenever that half is | ||
| 27 | +intra its filter record is the `[3, 3]` "no filter" sentinel and `neighbour_filter` refused. | ||
| 28 | +Fix (decode.rs): `overlappable_above`/`overlappable_left` return the mi the `MiInfo` came | ||
| 29 | +from (`src4`), and `obmc_blend` reads `above_filter[mi_col + src4]` / `left_filter[mi_row + | ||
| 30 | +src4]`. No other record path was missing a filter write (every `record_inter_rect_mi` call | ||
| 31 | +site passes a resolved value; `interp_fixed` frames are handled ahead of the sentinel). | ||
| 32 | + | ||
| 33 | +## Gate | ||
| 34 | +`a_real_aomenc_10bit_obmc_over_1to4_strip_neighbours_decodes_pixel_exact` (stream.rs) -- | ||
| 35 | +real aomenc, 10-bit 128x128, 24 frames, `--enable-obmc=1 --enable-1to4-partitions=1 | ||
| 36 | +--min-partition-size=4 --enable-rect-partitions=1` (+ noise fixture), seeds 43/46/47/65/66, | ||
| 37 | +every decode-order frame all three planes exact vs ffmpeg, hard assert on the new | ||
| 38 | +`obmc_pair_filter_hits` counter (neighbours sourced from a pair's second mi). | ||
| 39 | + | ||
| 40 | +`EC_NOMEMGUARD=1 EC_AV1_REQUIRE_AOMENC=1 CARGO_TARGET_DIR=$HOME/.cache/cargo-target-obmcrec cargo test -p ec-av1 --lib -j3 -- obmc sub8 refusal_inventory gate_coverage` | ||
| 41 | +-> `25 passed; 0 failed` (incl. the new gate and every sibling OBMC/sub8 gate). | ||
| 42 | + | ||
| 43 | +EVIDENCE: cargo test -p ec-av1 --lib -- obmc sub8 refusal_inventory gate_coverage | | ||
| 44 | +new gate + 24 siblings | 25 passed 0 failed, obmc_pair_filter_hits fired on 5 seeds | ||
| 45 | + | ||
| 46 | +Seed sweep 42..=73 (32 real encodes) picked the seeds: 43/46/47/65/66 fire and are exact; | ||
| 47 | +70 and 73 fire and mismatch, but mismatch IDENTICALLY with `--enable-obmc=0` (seed 73 frame | ||
| 48 | +1 luma, seed 70 frame 16) -> a `--min-partition-size=4` recipe defect, NOT OBMC. | ||
| 49 | + | ||
| 50 | +## Refusals | ||
| 51 | +- "an OBMC neighbour whose switchable interp filter was never recorded" — RETAINED (not | ||
| 52 | + lifted): libaom has no such state, so the string is now only an upstream-desync guard. | ||
| 53 | + Unreachable on all four film cuts and on the gate's 32 sweep encodes. | ||
| 54 | +- "an intra-coded 16x4/4x16 strip on the inter block path (...)" — RENAMED to | ||
| 55 | + "an intra-coded {bw}x{bh} block on the inter block path (no size-group/tx-category row for | ||
| 56 | + that shape here)". Measured: every arrival is a **128x64** intra block inside an inter | ||
| 57 | + frame (mi (128,416)/(192,0)/(192,0)) — the old text named a correlate. refusal_inventory | ||
| 58 | + updated in the same commit. | ||
| 59 | + | ||
| 60 | +## Film cuts (10-bit 1920x792 128-SB, 2 s each), after | ||
| 61 | +| cut | before | after | | ||
| 62 | +|---|---|---| | ||
| 63 | +| t900 | OBMC neighbour filter never recorded | intra-coded 128x64 block on the inter block path | | ||
| 64 | +| t5400 | OBMC neighbour filter never recorded | intra-coded 128x64 block on the inter block path | | ||
| 65 | +| t6300 | OBMC neighbour filter never recorded | a Golomb tail longer than this decoder reads | | ||
| 66 | +| t8100 | (already) intra 16x4/4x16 on inter path | intra-coded 128x64 block on the inter block path | | ||
| 67 | + | ||
| 68 | +## Suite | ||
| 69 | +`systemd-run --user --unit=obmcrec-suite-r1-1788365976 ... cargo test -p ec-av1 --lib -j3` | ||
| 70 | +-> `424 passed; 1 failed; 37 ignored` (log `$HOME/.cache/obmcrec-suite.log`, 667 s). | ||
| 71 | +The single failure `real_aomenc_1to4_streams_decode_pixel_exact_and_rect_vartx_leaves_fire_before_a_named_refusal` | ||
| 72 | +is PRE-EXISTING: the same test fails with the identical message ("the rectangular var-tx | ||
| 73 | +leaf arm never fired (32x16=0, 16x32=0, 0 refusals, 0 compared)") on the base commit | ||
| 74 | +`beecb64` in a detached verify worktree. Not caused by this lane (this diff changes only | ||
| 75 | +prediction pixels, never entropy decode, so it cannot move a leaf-shape counter). | ||
| 76 | + | ||
| 77 | +## Residue | ||
| 78 | +- deferred: intra 128x64 (128-SB HORZ half coded intra in an inter frame) — needs a | ||
| 79 | + size-group/tx-category row + 64x64-TU reconstruction + its own gate — unblocks the three | ||
| 80 | + 1080p cuts' next wall. Own lane. | ||
| 81 | +- deferred: t6300's Golomb-tail refusal — separate site, untouched here. | ||
| 82 | +- deferred: `--min-partition-size=4` 10-bit chroma/luma mismatch at seeds 56/70/73 | ||
| 83 | + (reproduces with `--enable-obmc=0`) — a sub-8x8 recipe defect for another lane. | ||
| 84 | +- accepted: the OBMC sentinel refusal string stays as a desync guard. | ||