ec-av1: lane-av1-422l -- key the inter-strip chroma pairing on the strip's own subsampled axis
Browse files at this commit9278c9ae0d36384a60911f457f878d556775bb2bParent: a8807231 changed file +37 -9
- crates/ec-av1/src/decode.rs +37 -9
crates/ec-av1/src/decode.rsmodified+37 -9
| @@ -41519,22 +41519,50 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( | |||
| 41519 | // so there is no pair: each strip codes | 41519 | // so there is no pair: each strip codes |
| 41520 | // and predicts its own chroma from its | 41520 | // and predicts its own chroma from its |
| 41521 | // own motion (`prev` = None). | 41521 | // own motion (`prev` = None). |
| 41522 | - let strip_has_chroma = | 41522 | + // lane-av1-422l: a strip pairs along its |
| 41523 | - i % 2 == 1 || ss_y(fctx) == 0; | 41523 | + // OWN subsampled axis -- horz strips pair |
| 41524 | - let pair_mi = if !strip_has_chroma || ss_x(fctx) == 0 { | 41524 | + // on rows (no pair once ss_y == 0: chroma |
| 41525 | - at_mi | 41525 | + // has no row parity, every 16x4 strip is |
| 41526 | - } else if horz { | 41526 | + // its own reference, exactly the intra |
| 41527 | - (at_mi.0 - 1, at_mi.1) | 41527 | + // strip arm's `else if ss_y(fctx) == 0`); |
| 41528 | + // vert strips pair on columns (ss_x == 0 | ||
| 41529 | + // => every strip self-pairs, 4:2:2 keeps | ||
| 41530 | + // the 4:2:0 column pairing -- a VERT_4 | ||
| 41531 | + // 4x16 strip's `ss_size_lookup` chroma | ||
| 41532 | + // at ss (1,0) is BLOCK_INVALID, so only | ||
| 41533 | + // the pair shape can ever be coded). | ||
| 41534 | + let strip_has_chroma = if horz { | ||
| 41535 | + i % 2 == 1 || ss_y(fctx) == 0 | ||
| 41528 | } else { | 41536 | } else { |
| 41529 | - (at_mi.0, at_mi.1 - 1) | 41537 | + i % 2 == 1 || ss_x(fctx) == 0 |
| 41530 | }; | 41538 | }; |
| 41539 | + let pair_mi = | ||
| 41540 | + if !strip_has_chroma | ||
| 41541 | + || (if horz { | ||
| 41542 | + ss_y(fctx) == 0 | ||
| 41543 | + } else { | ||
| 41544 | + ss_x(fctx) == 0 | ||
| 41545 | + }) | ||
| 41546 | + { | ||
| 41547 | + at_mi | ||
| 41548 | + } else if horz { | ||
| 41549 | + (at_mi.0 - 1, at_mi.1) | ||
| 41550 | + } else { | ||
| 41551 | + (at_mi.0, at_mi.1 - 1) | ||
| 41552 | + }; | ||
| 41531 | fctx.inter_strip_chroma.with(|c| { | 41553 | fctx.inter_strip_chroma.with(|c| { |
| 41532 | c.set(Some(InterStripChroma { | 41554 | c.set(Some(InterStripChroma { |
| 41533 | has_chroma: strip_has_chroma, | 41555 | has_chroma: strip_has_chroma, |
| 41534 | horz, | 41556 | horz, |
| 41535 | pair_mi, | 41557 | pair_mi, |
| 41536 | - prev: if strip_has_chroma && ss_x(fctx) == 1 { | 41558 | + prev: if strip_has_chroma |
| 41537 | - fctx.inter_last_mc.with(std::cell::Cell::get) | 41559 | + && (if horz { |
| 41560 | + ss_y(fctx) == 1 | ||
| 41561 | + } else { | ||
| 41562 | + ss_x(fctx) == 1 | ||
| 41563 | + }) { | ||
| 41564 | + fctx.inter_last_mc | ||
| 41565 | + .with(std::cell::Cell::get) | ||
| 41538 | } else { | 41566 | } else { |
| 41539 | None | 41567 | None |
| 41540 | }, | 41568 | }, |