forge
Explore
Log in

Don't you dare go Hollow

ec-av1: lane-av1-422l -- key the inter-strip chroma pairing on the strip's own subsampled axis

Browse files at this commit

9278c9ae0d36384a60911f457f878d556775bb2bAhmet Kaan GümüşParent: a880723
strip_has_chroma: horz keeps i%2==1 || ss_y==0 (no chroma row parity once
ss_y==0, every 16x4 strip its own reference, mirroring the intra strip
arm); vert becomes i%2==1 || ss_x==0 so 4:4:4 keeps self-paired strips and
4:2:2 keeps the 4:2:0 column pairing with an existing left neighbour.
pair_mi self-pairs whenever the pair axis is unsubsampled, and prev
carries pair motion only when the strip actually pairs. 4:2:0 and 4:4:4
are branch-identical to the previous code; 4:2:2 no longer underflows
at_mi.0/at_mi.1 on strip 0.
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 codes41519 // so there is no pair: each strip codes
41520 // and predicts its own chroma from its41520 // 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_mi41525+ // 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 None41567 None
41540 },41568 },