The second half of a 128-root HORZ/VERT inter block never read its own cdef_idx literal
Browse files at this commitd5c0a13384281712d9f8dab7f427587dc4d3bbefParent: 9385d73- fix
- the second half of a 128-root HORZ/VERT inter block never read its own cdef_idx literal
1 changed file +9 -0
crates/ec-av1/src/decode.rsmodified+9 -0
| @@ -27266,6 +27266,15 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( | |||
| 27266 | if i > 0 && (at_mi.0 >= mi_rows as usize || at_mi.1 >= mi_cols as usize) { | 27266 | if i > 0 && (at_mi.0 >= mi_rows as usize || at_mi.1 >= mi_cols as usize) { |
| 27267 | break; | 27267 | break; |
| 27268 | } | 27268 | } |
| 27269 | + // Each half reads its OWN `cdef_idx` literal: libaom keeps | ||
| 27270 | + // `cdef_transmitted[4]`, one flag per 64x64 CDEF unit of a | ||
| 27271 | + // 128x128 superblock (`read_cdef`, decodemv.c:50-81), and | ||
| 27272 | + // the two halves of a 128-root HORZ/VERT sit in different | ||
| 27273 | + // units (index `col_in_sb != 0` + 2 * `row_in_sb != 0`). | ||
| 27274 | + // The key-frame 128 loop already resets here; without it | ||
| 27275 | + // the second half skipped a `cdef_bits`-wide literal that | ||
| 27276 | + // libaom reads, desyncing the tile at that block. | ||
| 27277 | + CDEF_TRANSMITTED.with(|c| c.set(false)); | ||
| 27269 | inter_piece!( | 27278 | inter_piece!( |
| 27270 | at_mi, SB * 2, | 27279 | at_mi, SB * 2, |
| 27271 | TxbSet::Luma64, TxbSet::Luma64, TxbSet::Chroma32, TX32, TX32, | 27280 | TxbSet::Luma64, TxbSet::Luma64, TxbSet::Chroma32, TX32, TX32, |