forge
Explore
Log in

Don't you dare go Hollow

Keep the leaf8 RD-cost guard until crate::decode reads leaf8

Browse files at this commit

1d41e742b65d178fad00880fea0647662c8134baAhmet Kaan GümüşParent: e05f550
  • fix
    • keep the leaf8 RD-cost guard until crate::decode reads leaf8
Show full message
fix(av1): keep the leaf8 RD-cost guard until crate::decode reads leaf8

r15 proved the 8x8-leaf path against ffmpeg, but the in-crate software
decoder has no leaf8 read path yet; letting leaf8 win on cost at sizes
decode_stream round-trips broke 3 decoder tests. Guard re-instated with
the new reason; lifts when decode.rs learns the path.
crates/ec-av1/src/encode.rsmodified+6 -4
@@ -1835,10 +1835,12 @@ pub(crate) fn encode_key_frame_inner(
1835 // carrying an 8x8-leaf sub was, through r14, only ever1835 // carrying an 8x8-leaf sub was, through r14, only ever
1836 // forced (`!whole_legal`), never chosen on cost, because the1836 // forced (`!whole_legal`), never chosen on cost, because the
1837 // leaf path was not yet proven against a real decoder. r151837 // leaf path was not yet proven against a real decoder. r15
1838- // closed that gap (`a_single_axis_straddle_round_trips_1838+ // proved it against ffmpeg, but crate::decode has not learned
1839- // through_ffmpeg` decodes clean), so the guard is lifted:1839+ // the 8x8-leaf read path yet, so choosing leaf8 on cost at a
1840- // leaf8 splits now compete on cost like any other split.1840+ // size our own decoder round-trips would break decode_stream;
1841- if !whole_legal || (split_blocks && cost_split < cost_whole) {1841+ // the guard stays until decode.rs reads leaf8, then lifts.
1842+ let has_leaf8 = split.iter().any(|b| b.eight.is_some());
1843+ if !whole_legal || (split_blocks && !has_leaf8 && cost_split < cost_whole) {
1842 modes.extend_from_slice(&split_modes);1844 modes.extend_from_slice(&split_modes);
1843 blocks.push(Quadrant::Split(split));1845 blocks.push(Quadrant::Split(split));
1844 } else {1846 } else {