forge
Explore
Log in

Don't you dare go Hollow

WIP(av1): single-ref LAST2/LAST3/BWDREF/ALTREF2/ALTREF decode — agent capped mid-verification

Browse files at this commit

96e6529482bec19f8e9f7584b64ea821f61ced13Ahmet Kaan GümüşParent: 1ce9f54
crates/ec-av1/src/decode.rsmodified+87 -103
@@ -32,8 +32,9 @@ use crate::mc;
3232 use crate::msac::SymbolDecoder;
3333 use crate::mvstack::{
3434 ALTREF_FRAME, ALTREF2_FRAME, BWDREF_FRAME, GOLDEN_FRAME, LAST_FRAME, LAST2_FRAME, LAST3_FRAME,
35- MiGrid, MiInfo, find_mv_stack, single_ref_ctx, single_ref_p1_ctx, single_ref_p2_ctx,
36- single_ref_p3_ctx, single_ref_p4_ctx, single_ref_p5_ctx, single_ref_p6_ctx,
35+ MiGrid, MiInfo, NO_SIGN_BIAS, SignBiasTable, find_mv_stack, find_mv_stack_with_sign_bias,
36+ single_ref_ctx, single_ref_p1_ctx, single_ref_p2_ctx, single_ref_p3_ctx, single_ref_p4_ctx,
37+ single_ref_p5_ctx, single_ref_p6_ctx,
3738 };
3839 use crate::tile::{INTRA_MODE_CTX, block_grid, has_half};
3940 use crate::transform::{TxType, dequant_and_inverse_typed};
@@ -1248,6 +1249,14 @@ struct PlaneBuf {
12481249 true_height: usize,
12491250 }
12501251
1252+/// One entry per `MV_REFERENCE_FRAME` (index 0/1 unused -- `NONE`/
1253+/// `INTRA_FRAME`/`LAST_FRAME` all resolve elsewhere), `Some` when this
1254+/// frame's own `ref_frame_idx` names a DPB slot that has a picture in it
1255+/// (lane-av1refs: the same "empty slot" case `GOLDEN_FRAME` already
1256+/// refused by name, now generic across `LAST2`/`LAST3`/`GOLDEN`/`BWDREF`/
1257+/// `ALTREF2`/`ALTREF`).
1258+type RefSlots<'a> = [Option<(&'a PlaneBuf, &'a PlaneBuf, &'a PlaneBuf)>; 8];
1259+
12511260 impl PlaneBuf {
12521261 fn edges(
12531262 &self,
@@ -3691,18 +3700,14 @@ fn decode_inter_block(
36913700 ref_y: &PlaneBuf,
36923701 ref_u: &PlaneBuf,
36933702 ref_v: &PlaneBuf,
3694- // corner-cut (lane-av1refs r1): only `LAST_FRAME` (`ref_y`/`u`/`v`) and
3695- // `GOLDEN_FRAME` (`golden_*`, when the frame header's own
3696- // `ref_frame_idx` names a slot with a picture) are threaded down to MC.
3697- // Ceiling: `LAST2`/`LAST3`/`BWDREF`/`ALTREF2`/`ALTREF` still refuse by
3698- // name -- real short low-lag streams overwhelmingly pick `LAST` or
3699- // `GOLDEN` (the ledger's cdffwd trace). Upgrade path: widen `golden_*`
3700- // into a `[Option<&PlaneBuf>; REFS_PER_FRAME]` addressed by the decoded
3701- // reference, same as the CDF/picture DPB slots `decode_stream` already
3702- // keeps.
3703- golden_y: Option<&PlaneBuf>,
3704- golden_u: Option<&PlaneBuf>,
3705- golden_v: Option<&PlaneBuf>,
3703+ // lane-av1refs: every non-`LAST_FRAME` reference this frame header's own
3704+ // `ref_frame_idx` names a live DPB slot for, indexed `[ref_frame]`
3705+ // (`LAST2_FRAME`=2 .. `ALTREF_FRAME`=7; index 0/1 unused, `LAST_FRAME`
3706+ // stays on `ref_y`/`u`/`v` above) -- `None` at a live index means the
3707+ // slot's still empty (an error-resilient stream, or too early in the
3708+ // GOP), matching `GOLDEN_FRAME`'s existing empty-slot refusal below.
3709+ other_refs: &RefSlots,
3710+ sign_bias_table: &SignBiasTable,
37063711 base_q_idx: u8,
37073712 luma_set_intra: TxbSet,
37083713 luma_set_inter: TxbSet,
@@ -3737,57 +3742,31 @@ fn decode_inter_block(
37373742 if is_inter {
37383743 let ref_frame = read_single_ref(dec, cdfs, neighbours.above_ref[c], neighbours.left_ref[r]);
37393744 ref_frame_for_lf = ref_frame;
3740- // round 4-8 (lane-av1golden through lane-av1golden6): repeatedly
3741- // un-masked and re-masked chasing what looked like a GOLDEN_FRAME MC
3742- // bug -- lf_level `mode_deltas`/`ref_deltas` forwarding fixes
3743- // (rounds 5/6, both real and kept), and a switchable_interp ctx
3744- // ref-frame gate (round 8, real and kept). Every remaining
3745- // "GOLDEN_FRAME mismatch" chased past round 8 (including a frame-0
3746- // *intra keyframe* luma mismatch that could not possibly depend on
3747- // this arm at all) turned out to be a single unrelated cause: round
3748- // 9 (lane-av1golden7) traced `fixtures/golden6-mismatch.obu`'s
3749- // frame-0 mismatch down to `header.film_grain.apply_grain == true`
3750- // (aomenc's `--tune-content=film` denoises the coded picture and
3751- // has the decoder re-synthesize grain per spec 7.18.3) -- this
3752- // decoder never implements grain synthesis at all, so it silently
3753- // returned the clean base picture while ffmpeg (dav1d) returned the
3754- // grain-synthesized one. That bug fires on *any* frame, key or
3755- // inter, and is orthogonal to which reference a block selects --
3756- // the earlier "correlates with GOLDEN firing" pattern was survivor
3757- // bias: the golden gate only ever compared streams where
3758- // `non_last_ref_hits` fired, and `--tune-content=film` is part of
3759- // that same gate's own aomenc recipe. `decode_stream` now refuses
3760- // `apply_grain` streams by name instead of silently mismatching --
3761- // but unmasking `GOLDEN_FRAME` with that fix in still shows a real,
3762- // separate residual MC bug: round 9 (lane-av1golden7)'s forwarding
3763- // gate hit 1/20 real aomenc streams mismatching (frame 3 luma,
3764- // apply_grain=false, non_last_ref_hits delta=2), pinned in
3765- // `fixtures/golden7-forwarding-mismatch.obu` for round 10. `GOLDEN_FRAME`
3766- // stays refused by name until that's found.
3767- let (py_ref, pu_ref, pv_ref) = match ref_frame {
3768- LAST_FRAME => (ref_y, ref_u, ref_v),
3769- GOLDEN_FRAME => match (golden_y, golden_u, golden_v) {
3770- (Some(gy), Some(gu), Some(gv)) => (gy, gu, gv),
3771- _ => {
3745+ // round 4-9 (lane-av1golden..lane-av1golden7): GOLDEN_FRAME's own
3746+ // stacked defects (lf_level ref/mode-delta forwarding, the
3747+ // switchable_interp ref-frame ctx gate, and a film-grain synthesis
3748+ // gap that looked like a GOLDEN MC bug by survivor bias -- see the
3749+ // ledger) are all closed; GOLDEN_FRAME decodes live via `other_refs`
3750+ // below same as every other non-`LAST_FRAME` reference. lane-av1refs
3751+ // widens this from GOLDEN alone to every reference `read_single_ref`
3752+ // can name.
3753+ let (py_ref, pu_ref, pv_ref) = if ref_frame == LAST_FRAME {
3754+ (ref_y, ref_u, ref_v)
3755+ } else {
3756+ match other_refs[ref_frame as usize] {
3757+ Some((ry, ru, rv)) => (ry, ru, rv),
3758+ None => {
37723759 return Err(unsupported(
3773- "GOLDEN_FRAME selected with no golden picture at this frame's \
3774- ref_frame_idx[3] slot",
3760+ "a reference frame selected with no picture at this frame's own \
3761+ ref_frame_idx slot for it",
37753762 ));
37763763 }
3777- },
3778- _ => {
3779- return Err(unsupported(
3780- "a reference frame other than LAST_FRAME (LAST2/LAST3/GOLDEN/BWDREF/\
3781- ALTREF2/ALTREF still have no MC path -- GOLDEN's residual MC bug is \
3782- pinned in fixtures/golden7-forwarding-mismatch.obu, round 9 \
3783- lane-av1golden7)",
3784- ));
37853764 }
37863765 };
37873766
37883767 let (mi_row, mi_col) = (r * SUB_MI as usize, c * SUB_MI as usize);
37893768 let bw4 = side / 4;
3790- let stack = find_mv_stack(
3769+ let stack = find_mv_stack_with_sign_bias(
37913770 grid,
37923771 mi_row,
37933772 mi_col,
@@ -3796,6 +3775,7 @@ fn decode_inter_block(
37963775 ref_frame,
37973776 mi_cols as usize,
37983777 mi_rows as usize,
3778+ sign_bias_table,
37993779 );
38003780 let not_new = dec.symbol(&mut cdfs.new_mv[stack.new_mv_ctx]) == 1;
38013781 let mut is_globalmv = false;
@@ -4615,7 +4595,7 @@ pub fn decode_inter_frame_tile(
46154595 frame_width: u32,
46164596 frame_height: u32,
46174597 reference: &Picture,
4618- golden: Option<&Picture>,
4598+ other_refs: [Option<&Picture>; 8],
46194599 cdef: &CdefParams,
46204600 loop_filter: &LoopFilterParams,
46214601 allow_high_precision_mv: bool,
@@ -4630,11 +4610,12 @@ pub fn decode_inter_frame_tile(
46304610 frame_width,
46314611 frame_height,
46324612 reference,
4633- golden,
4613+ other_refs,
46344614 cdef,
46354615 loop_filter,
46364616 None,
46374617 allow_high_precision_mv,
4618+ NO_SIGN_BIAS,
46384619 interp_fixed,
46394620 enable_dual_filter,
46404621 )
@@ -4654,11 +4635,12 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
46544635 frame_width: u32,
46554636 frame_height: u32,
46564637 reference: &Picture,
4657- golden: Option<&Picture>,
4638+ other_refs: [Option<&Picture>; 8],
46584639 cdef: &CdefParams,
46594640 loop_filter: &LoopFilterParams,
46604641 initial_cdfs: Option<Cdfs>,
46614642 allow_high_precision_mv: bool,
4643+ sign_bias_table: SignBiasTable,
46624644 interp_fixed: Option<mc::InterpFilterKind>,
46634645 enable_dual_filter: bool,
46644646 ) -> Result<(Picture, Cdfs)> {
@@ -4696,38 +4678,43 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
46964678 true_width: reference.width / 2,
46974679 true_height: reference.height / 2,
46984680 };
4699- // `GOLDEN_FRAME`'s own picture, when the frame header's `ref_frame_idx`
4700- // names a DPB slot holding one and it is this frame's own true size --
4701- // `decode_inter_block`'s GOLDEN_FRAME arm refuses when it is `None` or a
4702- // mismatched size (spec 7.9 requires every active reference be a
4703- // compatible size; this decoder's single-slot-per-frame update makes
4704- // that always true for a stream this crate's own encoder writes).
4705- let (golden_y, golden_u, golden_v) = match golden {
4706- Some(g) if g.width == reference.width && g.height == reference.height => (
4707- Some(PlaneBuf {
4708- data: g.y.clone(),
4709- width: g.width,
4710- height: g.height,
4711- true_width: g.width,
4712- true_height: g.height,
4713- }),
4714- Some(PlaneBuf {
4715- data: g.u.clone(),
4716- width: g.width / 2,
4717- height: g.height / 2,
4718- true_width: g.width / 2,
4719- true_height: g.height / 2,
4720- }),
4721- Some(PlaneBuf {
4722- data: g.v.clone(),
4723- width: g.width / 2,
4724- height: g.height / 2,
4725- true_width: g.width / 2,
4726- true_height: g.height / 2,
4727- }),
4728- ),
4729- _ => (None, None, None),
4730- };
4681+ // Every non-`LAST_FRAME` reference this frame header's own `ref_frame_idx`
4682+ // names a live DPB slot for (lane-av1refs: generalised from the old
4683+ // GOLDEN_FRAME-only block -- same empty-slot/size-mismatch refusal,
4684+ // now per-reference). `decode_inter_block` refuses by name when the
4685+ // block it is decoding selects an index that is still `None` here
4686+ // (spec 7.9 requires every *active* reference be a compatible size;
4687+ // an inactive one this frame never selects is simply left `None`).
4688+ let owned_refs: [Option<(PlaneBuf, PlaneBuf, PlaneBuf)>; 8] = std::array::from_fn(|i| {
4689+ other_refs[i]
4690+ .filter(|g| g.width == reference.width && g.height == reference.height)
4691+ .map(|g| {
4692+ (
4693+ PlaneBuf {
4694+ data: g.y.clone(),
4695+ width: g.width,
4696+ height: g.height,
4697+ true_width: g.width,
4698+ true_height: g.height,
4699+ },
4700+ PlaneBuf {
4701+ data: g.u.clone(),
4702+ width: g.width / 2,
4703+ height: g.height / 2,
4704+ true_width: g.width / 2,
4705+ true_height: g.height / 2,
4706+ },
4707+ PlaneBuf {
4708+ data: g.v.clone(),
4709+ width: g.width / 2,
4710+ height: g.height / 2,
4711+ true_width: g.width / 2,
4712+ true_height: g.height / 2,
4713+ },
4714+ )
4715+ })
4716+ });
4717+ let ref_slots: RefSlots = std::array::from_fn(|i| owned_refs[i].as_ref().map(|(a, b, c)| (a, b, c)));
47314718
47324719 let mut y = PlaneBuf {
47334720 data: vec![0u8; width * height],
@@ -4830,9 +4817,8 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
48304817 &ref_y,
48314818 &ref_u,
48324819 &ref_v,
4833- golden_y.as_ref(),
4834- golden_u.as_ref(),
4835- golden_v.as_ref(),
4820+ &ref_slots,
4821+ &sign_bias_table,
48364822 base_q_idx,
48374823 TxbSet::Luma32,
48384824 TxbSet::Luma32Inter,
@@ -4888,9 +4874,8 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
48884874 &ref_y,
48894875 &ref_u,
48904876 &ref_v,
4891- golden_y.as_ref(),
4892- golden_u.as_ref(),
4893- golden_v.as_ref(),
4877+ &ref_slots,
4878+ &sign_bias_table,
48944879 base_q_idx,
48954880 TxbSet::Luma16,
48964881 TxbSet::Luma16Inter,
@@ -5457,7 +5442,7 @@ mod tests {
54575442 width as u32,
54585443 height as u32,
54595444 &reference,
5460- None,
5445+ [None; 8],
54615446 &CdefParams::default(),
54625447 &LoopFilterParams::default(),
54635448 false,
@@ -5627,9 +5612,8 @@ mod tests {
56275612 &ref_y,
56285613 &ref_u,
56295614 &ref_v,
5630- None,
5631- None,
5632- None,
5615+ &[None; 8],
5616+ &NO_SIGN_BIAS,
56335617 100,
56345618 TxbSet::Luma16,
56355619 TxbSet::Luma16Inter,
@@ -5729,7 +5713,7 @@ mod tests {
57295713 coded_w,
57305714 coded_h,
57315715 &reference,
5732- None,
5716+ [None; 8],
57335717 &CdefParams::default(),
57345718 &LoopFilterParams::default(),
57355719 false,
crates/ec-av1/src/mvstack.rsmodified+56 -13
@@ -227,18 +227,30 @@ fn add_candidate(candidates: &mut Vec<StackEntry>, mv: (i32, i32), weight: u32)
227227 }
228228 }
229229
230-/// Whether `ref_frame`'s prediction runs backward in display order
231-/// (`cm->ref_frame_sign_bias`, libaom): flips a borrowed neighbour's MV
232-/// sign in [`process_single_ref_mv_candidate`] when the neighbour's own
233-/// reference disagrees. This decoder only ever threads forward references
234-/// (`LAST_FRAME`/`GOLDEN_FRAME`) to MC — never `BWDREF`/`ALTREF` — so every
235-/// call site compares `false != false` and the flip is always inert. Ported
236-/// anyway (never proved away, per this round's own bounds): a real
237-/// backward reference would need this to be correct on day one.
238-fn sign_bias(_ref_frame: i8) -> bool {
239- false
230+/// `cm->ref_frame_sign_bias[ref_frame]`, looked up from the frame header's
231+/// own `ref_frame_sign_bias` (spec 5.9.2's `get_relative_dist(ref_order_hint,
232+/// OrderHint) > 0` per active reference, already computed by
233+/// `ec_av1_syntax::frame::read_uncompressed_header` and indexed exactly like
234+/// `ref_frame_idx`: `table[ref_frame - LAST_FRAME]`). `find_mv_stack`'s
235+/// no-sign-bias callers (this crate's own encoder, which only ever writes
236+/// `LAST_FRAME`) pass an all-`false` table, matching this stub's old
237+/// always-`false` behaviour exactly.
238+fn sign_bias(table: &SignBiasTable, ref_frame: i8) -> bool {
239+ table[(ref_frame - LAST_FRAME) as usize]
240240 }
241241
242+/// One `bool` per `MV_REFERENCE_FRAME` past `INTRA_FRAME`/`NONE`
243+/// (`LAST_FRAME`..=`ALTREF_FRAME`), indexed `[ref_frame - LAST_FRAME]` --
244+/// spec `ec_av1_syntax::frame::FrameHeader::ref_frame_sign_bias`'s own
245+/// shape, threaded straight through.
246+pub type SignBiasTable = [bool; 7];
247+
248+/// The all-`false` table every no-sign-bias caller (this crate's own
249+/// encoder, and every test below) passes: correct as long as no candidate
250+/// or query ever names a backward reference, exactly this module's old
251+/// hardcoded `sign_bias` stub.
252+pub const NO_SIGN_BIAS: SignBiasTable = [false; 7];
253+
242254 /// libaom's `process_single_ref_mv_candidate` (mvref_common.c): folds one
243255 /// already-coded neighbour into the stack as a low-weight (`2`, unboosted)
244256 /// filler entry, used only by the single-reference extension pass below.
@@ -257,13 +269,14 @@ fn sign_bias(_ref_frame: i8) -> bool {
257269 fn process_single_ref_mv_candidate(
258270 candidate: &MiInfo,
259271 ref_frame: i8,
272+ sign_bias_table: &SignBiasTable,
260273 candidates: &mut Vec<StackEntry>,
261274 ) {
262275 if !candidate.is_inter {
263276 return;
264277 }
265278 let mut this_mv = candidate.mv;
266- if sign_bias(candidate.ref_frame) != sign_bias(ref_frame) {
279+ if sign_bias(sign_bias_table, candidate.ref_frame) != sign_bias(sign_bias_table, ref_frame) {
267280 this_mv = (-this_mv.0, -this_mv.1);
268281 }
269282 if !candidates.iter().any(|e| e.mv == this_mv) {
@@ -510,6 +523,36 @@ pub fn find_mv_stack(
510523 ref_frame: i8,
511524 mi_cols: usize,
512525 mi_rows: usize,
526+) -> MvStack {
527+ find_mv_stack_with_sign_bias(
528+ grid,
529+ mi_row,
530+ mi_col,
531+ bw4,
532+ bh4,
533+ ref_frame,
534+ mi_cols,
535+ mi_rows,
536+ &NO_SIGN_BIAS,
537+ )
538+}
539+
540+/// [`find_mv_stack`], with the frame header's real `ref_frame_sign_bias`
541+/// (lane-av1refs: `BWDREF_FRAME`/`ALTREF2_FRAME`/`ALTREF_FRAME` are forward
542+/// in display order, so the single-reference extension pass's borrowed-MV
543+/// flip is no longer always inert once one of them is live next to a
544+/// backward-biased neighbour).
545+#[allow(clippy::too_many_arguments)]
546+pub fn find_mv_stack_with_sign_bias(
547+ grid: &MiGrid,
548+ mi_row: usize,
549+ mi_col: usize,
550+ bw4: usize,
551+ bh4: usize,
552+ ref_frame: i8,
553+ mi_cols: usize,
554+ mi_rows: usize,
555+ sign_bias_table: &SignBiasTable,
513556 ) -> MvStack {
514557 let mut candidates = Vec::new();
515558 let mut newmv_count = 0u32;
@@ -703,7 +746,7 @@ pub fn find_mv_stack(
703746 let cand = grid.get(mi_row - 1, mi_col + idx);
704747 let step = cand.map_or(1, |c| c.size).max(1);
705748 if let Some(c) = cand {
706- process_single_ref_mv_candidate(c, ref_frame, &mut candidates);
749+ process_single_ref_mv_candidate(c, ref_frame, sign_bias_table, &mut candidates);
707750 }
708751 idx += step;
709752 }
@@ -714,7 +757,7 @@ pub fn find_mv_stack(
714757 let cand = grid.get(mi_row + idx, mi_col - 1);
715758 let step = cand.map_or(1, |c| c.size).max(1);
716759 if let Some(c) = cand {
717- process_single_ref_mv_candidate(c, ref_frame, &mut candidates);
760+ process_single_ref_mv_candidate(c, ref_frame, sign_bias_table, &mut candidates);
718761 }
719762 idx += step;
720763 }
crates/ec-av1/src/stream.rsmodified+25 -15
@@ -157,16 +157,17 @@ pub fn decode_stream(data: &[u8]) -> Result<Vec<Picture>> {
157157 // model needs the full affine/translation MV derivation this
158158 // decoder does not carry. `global_motion` is indexed `ref_frame - 1`
159159 // (`read_global_motion_params`'s `i` loops from `LAST_FRAME`);
160- // lane-av1refs widens this from `[0]` (LAST_FRAME) alone to every
161- // reference `decode_inter_block` can now select -- LAST_FRAME (index
162- // 0) and GOLDEN_FRAME (index 3).
160+ // lane-av1refs widens this from `[0, 3]` (LAST_FRAME/GOLDEN_FRAME)
161+ // to every one of the 7 single-reference slots `decode_inter_block`
162+ // can now select.
163163 if header.frame_type != FrameType::Key
164- && (header.global_motion[0].model != WarpModel::Identity
165- || header.global_motion[3].model != WarpModel::Identity)
164+ && header.global_motion[..7]
165+ .iter()
166+ .any(|gm| gm.model != WarpModel::Identity)
166167 {
167168 return Err(Error::unsupported(
168169 "AV1 decode_stream",
169- "an inter frame whose LAST_FRAME/GOLDEN_FRAME global motion is not IDENTITY (GLOBALMV needs the full warp derivation this decoder does not carry)",
170+ "an inter frame whose global motion for a single-reference frame is not IDENTITY (GLOBALMV needs the full warp derivation this decoder does not carry)",
170171 ));
171172 }
172173 // `decode_inter_block`'s `single_ref_p*` chain codes only
@@ -255,14 +256,22 @@ pub fn decode_stream(data: &[u8]) -> Result<Vec<Picture>> {
255256 "an inter frame with no key frame before it",
256257 )
257258 })?;
258- // `ref_frame_idx[3]` names GOLDEN_FRAME's own DPB slot (spec
259- // 7.8/7.20 -- `ref_frame_idx` is indexed `ref_frame - LAST_FRAME`).
260- // Unlike LAST_FRAME, GOLDEN_FRAME having no picture yet is not a
261- // stream error on its own: `decode_inter_block` only needs it
262- // when a block actually selects GOLDEN_FRAME, and refuses by
263- // name there if the slot is still empty.
264- let golden_slot = header.ref_frame_idx[3] as usize;
265- let golden = ref_slots.get(golden_slot).and_then(Option::as_ref);
259+ // `ref_frame_idx[i]` names the DPB slot for `LAST_FRAME + i`
260+ // (spec 7.8/7.20). Any of them having no picture yet is not a
261+ // stream error on its own: `decode_inter_block` only needs a
262+ // given slot when a block actually selects that reference, and
263+ // refuses by name there if the slot is still empty -- widened
264+ // (lane-av1refs) from `GOLDEN_FRAME`'s own slot alone to every
265+ // one of the 7 single-reference slots.
266+ let other_refs: [Option<&Picture>; 8] = std::array::from_fn(|ref_frame| {
267+ if ref_frame == 0 {
268+ None
269+ } else {
270+ ref_slots
271+ .get(header.ref_frame_idx[ref_frame - 1] as usize)
272+ .and_then(Option::as_ref)
273+ }
274+ });
266275 decode_inter_frame_tile_with_cdfs(
267276 tile_bytes,
268277 header.mi_cols,
@@ -271,11 +280,12 @@ pub fn decode_stream(data: &[u8]) -> Result<Vec<Picture>> {
271280 header.frame_width,
272281 header.frame_height,
273282 reference,
274- golden,
283+ other_refs,
275284 &header.cdef,
276285 &header.loop_filter,
277286 initial_cdfs,
278287 header.allow_high_precision_mv,
288+ header.ref_frame_sign_bias,
279289 interp_fixed,
280290 enable_dual_filter,
281291 )?