Keep the leaf8 RD-cost guard until crate::decode reads leaf8
Browse files at this commit1d41e742b65d178fad00880fea0647662c8134baParent: e05f550- fix
- keep the leaf8 RD-cost guard until crate::decode reads leaf8
1 changed file +6 -4
crates/ec-av1/src/encode.rsmodified+6 -4
| @@ -1835,10 +1835,12 @@ pub(crate) fn encode_key_frame_inner( | ||
| 1835 | 1835 | // carrying an 8x8-leaf sub was, through r14, only ever |
| 1836 | 1836 | // forced (`!whole_legal`), never chosen on cost, because the |
| 1837 | 1837 | // leaf path was not yet proven against a real decoder. r15 |
| 1838 | - // closed that gap (`a_single_axis_straddle_round_trips_ | |
| 1839 | - // through_ffmpeg` decodes clean), so the guard is lifted: | |
| 1840 | - // leaf8 splits now compete on cost like any other split. | |
| 1841 | - if !whole_legal || (split_blocks && cost_split < cost_whole) { | |
| 1838 | + // proved it against ffmpeg, but crate::decode has not learned | |
| 1839 | + // the 8x8-leaf read path yet, so choosing leaf8 on cost at a | |
| 1840 | + // size our own decoder round-trips would break decode_stream; | |
| 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 | 1844 | modes.extend_from_slice(&split_modes); |
| 1843 | 1845 | blocks.push(Quadrant::Split(split)); |
| 1844 | 1846 | } else { |