forge
Explore
Log in

Don't you dare go Hollow

A real GOLDEN reference beside LAST

Browse files at this commit

2f069ae4a17da33d971d179a30db52925bf7e750Ahmet Kaan GümüşParent: f5cb29a
  • feat
    • a real GOLDEN reference beside LAST
Show full message
feat(av1): a real GOLDEN reference beside LAST

The key frame refreshes all eight DPB slots and every inter frame only
slot 0, so slot 1 still holds the key frame however long the GOP runs:
inter_frame_headers now points ref_frame_idx[3] (GOLDEN_FRAME) at it, the
encoder carries that picture through encode_sequence and Av1Encoder, and
the 32x32 inter RD prices GOLDEN's two search-free modes (NEARESTMV off
its own mv stack, GLOBALMV) beside LAST's whole mode set. No second
motion search -- that stage owns the wall -- and one trial set per
distinct (reference, vector) pair, so the added modes mostly reuse work.

The trial decode of the filter search and the two GOP tests take the
golden plane at RefPix index 4 (the array is keyed by reference NAME, not
by DPB slot).

GOLDEN is picked for 50%/56%/37% of inter blocks. BD-rate vs libaom
133.7/162.3/83.8 -> 127.3/153.4/83.0, vs rav1e 84.7/113.1/18.0 ->
78.6/105.7/18.3; wall 10.1/9.5/9.4 -> 7.8/7.1/7.8 s. ffmpeg decodes every
stream sample-exact (ffmpeg_and_this_decoder_agree_on_a_gop).
crates/ec-av1/src/decode.rsmodified+13 -2
@@ -35637,6 +35637,17 @@ mod tests {
3563735637 RefPix::ready(refs)
3563835638 }
3563935639
35640+ /// [`last_only`] plus `GOLDEN_FRAME` (index 4 of the name-keyed array):
35641+ /// what a frame this encoder writes needs, since every inter frame's
35642+ /// `ref_frame_idx[3]` names the slot the key frame left behind and its
35643+ /// blocks may code `single_ref` out to it.
35644+ fn last_and_golden<'a>(last: &'a Picture, golden: &'a Picture) -> RefPix<'a> {
35645+ let mut refs: [Option<&Picture>; 8] = [None; 8];
35646+ refs[1] = Some(last);
35647+ refs[4] = Some(golden);
35648+ RefPix::ready(refs)
35649+ }
35650+
3564035651
3564135652 /// lane-perf6 step 2: the CDEF kernel now reads a pre-gathered window and
3564235653 /// a pre-resolved damping shift instead of a bounds-testing closure and a
@@ -37164,7 +37175,7 @@ mod tests {
3716437175 frame.base_q_idx,
3716537176 width as u32,
3716637177 height as u32,
37167- &last_only(&reference),
37178+ &last_and_golden(&reference, &encoded.frames[0].reconstruction),
3716837179 &frame.cdef,
3716937180 &frame.loop_filter,
3717037181 false,
@@ -37476,7 +37487,7 @@ mod tests {
3747637487 frame.base_q_idx,
3747737488 coded_w,
3747837489 coded_h,
37479- &last_only(&reference),
37490+ &last_and_golden(&reference, &encoded.frames[0].reconstruction),
3748037491 &frame.cdef,
3748137492 &frame.loop_filter,
3748237493 false,
crates/ec-av1/src/encode.rsmodified+136 -22
@@ -713,6 +713,11 @@ pub(crate) fn key_frame_headers_colour(
713713 Ok((seq, header))
714714 }
715715
716+/// The DPB slot `GOLDEN_FRAME` names in every frame this encoder writes: the
717+/// key frame refreshes all eight slots, each inter frame only slot 0, so slot
718+/// 1 still holds the key frame however long the GOP runs.
719+pub const GOLDEN_SLOT: u8 = 1;
720+
716721 /// The frame header for a shown inter frame that predicts from the single
717722 /// slot `last_slot` (every `ref_frame_idx` entry names it) and refreshes that
718723 /// same slot with itself once coded. The sequence header is [`key_frame_headers`]'s,
@@ -742,7 +747,16 @@ pub fn inter_frame_headers(
742747 order_hint,
743748 primary_ref_frame: 0,
744749 refresh_frame_flags: 1 << last_slot,
745- ref_frame_idx: [last_slot; ec_av1_syntax::REFS_PER_FRAME],
750+ // Every reference but `GOLDEN_FRAME` (index 3 of `ref_frame_idx`)
751+ // names the slot this frame both predicts from and refreshes;
752+ // GOLDEN names slot 1, which the key frame wrote when it refreshed
753+ // all eight and which no inter frame ever overwrites, so it holds
754+ // the key frame's own picture for the whole GOP.
755+ ref_frame_idx: {
756+ let mut idx = [last_slot; ec_av1_syntax::REFS_PER_FRAME];
757+ idx[3] = GOLDEN_SLOT;
758+ idx
759+ },
746760 allow_high_precision_mv: false,
747761 interpolation_filter: ec_av1_syntax::InterpolationFilter::Eighttap,
748762 is_motion_mode_switchable: false,
@@ -2411,7 +2425,7 @@ fn record_mi(grid: &mut MiGrid, mi_row: usize, mi_col: usize, size: u8, inter: O
24112425 let info = match inter {
24122426 Some(info) => MiInfo {
24132427 is_inter: true,
2414- ref_frame: LAST_FRAME,
2428+ ref_frame: info.ref_frame,
24152429 ref_frame1: NO_REF1,
24162430 mv1: (0, 0),
24172431 mv: mv16(info.mv),
@@ -3388,7 +3402,13 @@ fn search_inter_block(
33883402 search: &Search,
33893403 mode_bits: &[f64; 13],
33903404 reference: &Picture,
3391- stack: &MvStack, fctx: &crate::decode::FrameCtx,
3405+ stack: &MvStack,
3406+ // `GOLDEN_FRAME`: the key frame's own reconstruction, held in DPB slot 1
3407+ // for the whole GOP, with the stack this block derives against it. Only
3408+ // its two search-free modes are priced (`NEARESTMV`, `GLOBALMV`) -- a
3409+ // second motion search would double the wall of the stage that already
3410+ // owns most of it.
3411+ golden: Option<(&Picture, &MvStack)>, fctx: &crate::decode::FrameCtx,
33923412 ) -> (BlockCoeffs, f64) {
33933413 // `luma_set` is the INTRA candidates' table; the two inter candidates
33943414 // below price their coefficients through `TxbSet::Luma32Inter`, which is
@@ -3401,9 +3421,17 @@ fn search_inter_block(
34013421 // function's doc comment.
34023422 let skip_bits = |skip: bool| symbol_bits(&cdf::SKIP[0], usize::from(skip));
34033423 let intra_inter_bits = |inter: bool| symbol_bits(&cdf::INTRA_INTER[0], usize::from(inter));
3404- let single_ref_bits = symbol_bits(&cdf::SINGLE_REF[0][0], 0)
3405- + symbol_bits(&cdf::SINGLE_REF[0][2], 0)
3406- + symbol_bits(&cdf::SINGLE_REF[0][3], 0);
3424+ // `write_single_ref`'s own tree, at the fixed context this pricer uses
3425+ // for every neighbour-derived symbol: LAST is p1=0,p3=0,p4=0 and GOLDEN
3426+ // p1=0,p3=1,p5=1.
3427+ let single_ref_bits = |ref_frame: i8| {
3428+ symbol_bits(&cdf::SINGLE_REF[0][0], 0)
3429+ + if ref_frame == crate::mvstack::GOLDEN_FRAME {
3430+ symbol_bits(&cdf::SINGLE_REF[0][2], 1) + symbol_bits(&cdf::SINGLE_REF[0][4], 1)
3431+ } else {
3432+ symbol_bits(&cdf::SINGLE_REF[0][2], 0) + symbol_bits(&cdf::SINGLE_REF[0][3], 0)
3433+ }
3434+ };
34073435
34083436 struct Candidate {
34093437 cost: f64,
@@ -3561,10 +3589,11 @@ fn search_inter_block(
35613589 }
35623590 bits
35633591 };
3592+ let last_ref_bits = single_ref_bits(crate::mvstack::LAST_FRAME);
35643593 let mut cands: Vec<((i32, i32), f64, InterInfo)> = vec![
35653594 (
35663595 stack.nearest_mv,
3567- not_new + not_zero + symbol_bits(&cdf::REF_MV[stack.ref_mv_ctx], 0),
3596+ last_ref_bits + not_new + not_zero + symbol_bits(&cdf::REF_MV[stack.ref_mv_ctx], 0),
35683597 InterInfo {
35693598 ref_frame: crate::mvstack::LAST_FRAME,
35703599 mode: InterMode::NearestMv,
@@ -3577,7 +3606,7 @@ fn search_inter_block(
35773606 // content where that vector is also the right one.
35783607 (
35793608 (0, 0),
3580- not_new + symbol_bits(&cdf::ZERO_MV[stack.zero_mv_ctx], 0),
3609+ last_ref_bits + not_new + symbol_bits(&cdf::ZERO_MV[stack.zero_mv_ctx], 0),
35813610 InterInfo {
35823611 ref_frame: crate::mvstack::LAST_FRAME,
35833612 mode: InterMode::GlobalMv,
@@ -3586,7 +3615,8 @@ fn search_inter_block(
35863615 },
35873616 ),
35883617 ];
3589- let near_bits = not_new + not_zero + symbol_bits(&cdf::REF_MV[stack.ref_mv_ctx], 1);
3618+ let near_bits =
3619+ last_ref_bits + not_new + not_zero + symbol_bits(&cdf::REF_MV[stack.ref_mv_ctx], 1);
35903620 for idx in 1..=2usize {
35913621 if let Some(e) = stack.entries.get(idx) {
35923622 cands.push((
@@ -3640,7 +3670,7 @@ fn search_inter_block(
36403670 if let Some((bits, ref_mv_idx)) = best_new {
36413671 cands.push((
36423672 mv,
3643- symbol_bits(&cdf::NEW_MV[stack.new_mv_ctx], 0) + bits,
3673+ last_ref_bits + symbol_bits(&cdf::NEW_MV[stack.new_mv_ctx], 0) + bits,
36443674 InterInfo {
36453675 ref_frame: crate::mvstack::LAST_FRAME,
36463676 mode: InterMode::NewMv,
@@ -3650,12 +3680,52 @@ fn search_inter_block(
36503680 ));
36513681 }
36523682
3653- // One trial set per distinct vector: sort by vector, cheapest syntax
3654- // first, and drop the rest of each vector's run.
3655- cands.sort_by(|a, b| a.0.cmp(&b.0).then(a.1.total_cmp(&b.1)));
3656- cands.dedup_by_key(|c| c.0);
3683+ if let Some((_, gstack)) = golden {
3684+ let g_ref_bits = single_ref_bits(crate::mvstack::GOLDEN_FRAME);
3685+ let g_not_new = symbol_bits(&cdf::NEW_MV[gstack.new_mv_ctx], 1);
3686+ cands.push((
3687+ gstack.nearest_mv,
3688+ g_ref_bits
3689+ + g_not_new
3690+ + symbol_bits(&cdf::ZERO_MV[gstack.zero_mv_ctx], 1)
3691+ + symbol_bits(&cdf::REF_MV[gstack.ref_mv_ctx], 0),
3692+ InterInfo {
3693+ ref_frame: crate::mvstack::GOLDEN_FRAME,
3694+ mode: InterMode::NearestMv,
3695+ mv: gstack.nearest_mv,
3696+ ref_mv_idx: 0,
3697+ },
3698+ ));
3699+ cands.push((
3700+ (0, 0),
3701+ g_ref_bits + g_not_new + symbol_bits(&cdf::ZERO_MV[gstack.zero_mv_ctx], 0),
3702+ InterInfo {
3703+ ref_frame: crate::mvstack::GOLDEN_FRAME,
3704+ mode: InterMode::GlobalMv,
3705+ mv: (0, 0),
3706+ ref_mv_idx: 0,
3707+ },
3708+ ));
3709+ }
3710+
3711+ // One trial set per distinct (reference, vector) pair: sort, cheapest
3712+ // syntax first, and drop the rest of each pair's run.
3713+ cands.sort_by(|a, b| {
3714+ (a.2.ref_frame, a.0)
3715+ .cmp(&(b.2.ref_frame, b.0))
3716+ .then(a.1.total_cmp(&b.1))
3717+ });
3718+ cands.dedup_by_key(|c| (c.2.ref_frame, c.0));
36573719 {
36583720 for (mv, mode_bits_inter, info) in cands {
3721+ let (ref_luma, ref_u, ref_v) = match golden {
3722+ Some((g, _)) if info.ref_frame == crate::mvstack::GOLDEN_FRAME => (
3723+ (&g.y, g.width, luma.true_width, luma.true_height),
3724+ (&g.u, g.width / 2, chroma[0].true_width, chroma[0].true_height),
3725+ (&g.v, g.width / 2, chroma[1].true_width, chroma[1].true_height),
3726+ ),
3727+ _ => (ref_luma, ref_u, ref_v),
3728+ };
36593729 let luma_trial = mc_trial(
36603730 luma,
36613731 x,
@@ -3713,7 +3783,6 @@ fn search_inter_block(
37133783 + search.lambda
37143784 * (skip_bits(skip)
37153785 + intra_inter_bits(true)
3716- + single_ref_bits
37173786 + mode_bits_inter
37183787 + if skip {
37193788 0.0
@@ -3766,7 +3835,11 @@ pub(crate) fn encode_inter_frame(
37663835 // stored into the slot this one's `primary_ref_frame` names. `None`
37673836 // starts from the defaults, which is right only for the frame straight
37683837 // after a key frame.
3769- start_cdfs: Option<&crate::cdf_state::Cdfs>, fctx: &crate::decode::FrameCtx,
3838+ start_cdfs: Option<&crate::cdf_state::Cdfs>,
3839+ // The key frame's own (padded) reconstruction, which every frame of the
3840+ // GOP still holds in DPB slot 1 -- `GOLDEN_FRAME`. `None` codes the frame
3841+ // with `LAST_FRAME` alone, exactly as before.
3842+ golden: Option<&Picture>, fctx: &crate::decode::FrameCtx,
37703843 ) -> Result<Encoded> {
37713844 picture.check()?;
37723845 if !picture.width.is_multiple_of(SUPERBLOCK) || !picture.height.is_multiple_of(SUPERBLOCK) {
@@ -3901,6 +3974,18 @@ pub(crate) fn encode_inter_frame(
39013974 let (mi_row, mi_col) = (r32 * 8, c32 * 8);
39023975 let stack =
39033976 find_mv_stack(&grid, mi_row, mi_col, 8, 8, LAST_FRAME, mi_cols, mi_rows);
3977+ let golden_stack = golden.map(|_| {
3978+ find_mv_stack(
3979+ &grid,
3980+ mi_row,
3981+ mi_col,
3982+ 8,
3983+ 8,
3984+ crate::mvstack::GOLDEN_FRAME,
3985+ mi_cols,
3986+ mi_rows,
3987+ )
3988+ });
39043989
39053990 let base = snapshot(&luma, &chroma, (x, y), BLOCK);
39063991 let (block, mut cost_whole) = search_inter_block(
@@ -3910,7 +3995,8 @@ pub(crate) fn encode_inter_frame(
39103995 &search,
39113996 &mode_bits_table,
39123997 reference,
3913- &stack, fctx,
3998+ &stack,
3999+ golden.zip(golden_stack.as_ref()), fctx,
39144000 );
39154001 cost_whole += search.lambda * partition_bits(BLOCK, false);
39164002 let after_whole = snapshot(&luma, &chroma, (x, y), BLOCK);
@@ -4266,8 +4352,25 @@ pub(crate) fn encode_inter_frame(
42664352 v: crop_plane(&reference.v, reference.width / 2, fw / 2, fh / 2),
42674353 }
42684354 };
4355+ // `RefPix` is indexed by the reference NAME (`LAST_FRAME` = 1,
4356+ // `GOLDEN_FRAME` = 4), not by DPB slot: the trial decode of a frame whose
4357+ // blocks may name GOLDEN needs that plane too, cropped the same way.
4358+ let trial_golden = golden.map(|g| {
4359+ if (g.width, g.height) == (fw, fh) {
4360+ g.clone()
4361+ } else {
4362+ Picture {
4363+ width: fw,
4364+ height: fh,
4365+ y: crop_plane(&g.y, g.width, fw, fh),
4366+ u: crop_plane(&g.u, g.width / 2, fw / 2, fh / 2),
4367+ v: crop_plane(&g.v, g.width / 2, fw / 2, fh / 2),
4368+ }
4369+ }
4370+ });
42694371 let mut refs: [Option<&Picture>; 8] = [None; 8];
42704372 refs[1] = Some(&trial_ref);
4373+ refs[4] = trial_golden.as_ref();
42714374 let refpix = crate::decode::RefPix::ready(refs);
42724375 pick_and_apply_filters(
42734376 &mut header,
@@ -4388,6 +4491,10 @@ pub(crate) fn encode_sequence_with_ctx(
43884491 unspecified_color_config(), fctx,
43894492 )?;
43904493 let mut stream = key.stream.clone();
4494+ // Slot 1 keeps the key frame's own reconstruction for the whole GOP (the
4495+ // key frame refreshes every slot, each inter frame only slot 0), which is
4496+ // what `GOLDEN_FRAME` names.
4497+ let golden = key.reconstruction.clone();
43914498 let mut carried = key.next_cdfs.clone();
43924499 let mut reference = key.reconstruction.clone();
43934500 let mut frames = vec![crop_encoded(&key, render.0, render.1)];
@@ -4407,7 +4514,8 @@ pub(crate) fn encode_sequence_with_ctx(
44074514 deadzone,
44084515 order_hint,
44094516 render,
4410- Some(&carried.0), fctx,
4517+ Some(&carried.0),
4518+ Some(&golden), fctx,
44114519 )?;
44124520 stream.extend_from_slice(&inter.stream);
44134521 carried = inter.next_cdfs.clone();
@@ -6444,7 +6552,7 @@ mod tests {
64446552 let padded_pic = picture.padded_to(SUPERBLOCK);
64456553 let t = Instant::now();
64466554 let inter =
6447- encode_inter_frame(&padded_pic, &padded_ref, 100, 0.5, 1, (width, height), None, fctx).unwrap();
6555+ encode_inter_frame(&padded_pic, &padded_ref, 100, 0.5, 1, (width, height), None, None, fctx).unwrap();
64486556 let inter_t = t.elapsed();
64496557 eprintln!(
64506558 "inter frame vs its own key frame: {inter_t:>9.2?} ({} bytes, inter share \
@@ -6542,7 +6650,7 @@ mod tests {
65426650 stage_reset();
65436651 let t = Instant::now();
65446652 let inter =
6545- encode_inter_frame(&padded_pic, &padded_ref, 100, 0.5, 1, (width, height), None, fctx).unwrap();
6653+ encode_inter_frame(&padded_pic, &padded_ref, 100, 0.5, 1, (width, height), None, None, fctx).unwrap();
65466654 let total_t = t.elapsed();
65476655 let [motion_search, interpolation, transform_quant, entropy] = stage_read();
65486656 let accounted = motion_search + transform_quant + entropy;
@@ -6719,7 +6827,7 @@ mod tests {
67196827 q,
67206828 0.5,
67216829 1,
6722- (width, height), None, fctx,
6830+ (width, height), None, None, fctx,
67236831 )
67246832 .unwrap();
67256833 let baseline_psnr = psnr(&baseline.reconstruction.y, &inter_source.y);
@@ -6736,7 +6844,7 @@ mod tests {
67366844 q,
67376845 0.5,
67386846 1,
6739- (width, height), None, fctx,
6847+ (width, height), None, None, fctx,
67406848 )
67416849 .unwrap();
67426850 let pruned_psnr = psnr(&pruned.reconstruction.y, &inter_source.y);
@@ -7249,6 +7357,7 @@ mod tests {
72497357 let _ = take_uv_mode_hits();
72507358 let _ = crate::tile::take_inter_mode_hits();
72517359 let _ = crate::tile::take_drl_hits();
7360+ let _ = crate::tile::take_ref_hits();
72527361 let (ours, ours_wall) = our_ladder(&source, width, height, fctx);
72537362 // How often the inter split actually fired over this clip's four
72547363 // encodes, against the whole 32x32 that was the only outcome
@@ -7259,6 +7368,7 @@ mod tests {
72597368 // number cannot be crediting (gate-blind-to-feature).
72607369 let [nearest, near, global, new] = crate::tile::take_inter_mode_hits();
72617370 let [drl0, drl1, drl2, drl3] = crate::tile::take_drl_hits();
7371+ let refs = crate::tile::take_ref_hits();
72627372 let modes_total = (nearest + near + global + new).max(1);
72637373 eprintln!(
72647374 "{name}: inter modes NEAREST {nearest} ({:.1}%) NEAR {near} ({:.1}%) \
@@ -7269,6 +7379,10 @@ mod tests {
72697379 100.0 * global as f64 / modes_total as f64,
72707380 100.0 * new as f64 / modes_total as f64,
72717381 );
7382+ eprintln!(
7383+ "{name}: references LAST {} GOLDEN {} (LAST2 {} LAST3 {} BWD {} ALT2 {} ALT {})",
7384+ refs[0], refs[3], refs[1], refs[2], refs[4], refs[5], refs[6]
7385+ );
72727386 eprintln!(
72737387 "{name}: inter 32x32 split into 16s {split32} of {} blocks ({:.1}%); \
72747388 16x16 leaves split into 8s {split16} of {} ({:.1}%)",
crates/ec-av1/src/encoder.rsmodified+8 -0
@@ -231,6 +231,9 @@ pub struct Av1Encoder {
231231 /// must start from, since the header leaves
232232 /// `disable_frame_end_update_cdf` off. `None` before the first frame.
233233 carried_cdfs: Option<crate::encode::CdfSnapshot>,
234+ /// The last key frame's own (padded) reconstruction: `GOLDEN_FRAME`,
235+ /// which stays in DPB slot 1 until the next key frame refreshes it.
236+ golden: Option<Picture>,
234237 }
235238
236239 /// The encoder stays `Send` now that it owns a `FrameCtx` (whose cells are
@@ -257,6 +260,7 @@ impl Av1Encoder {
257260 Picture::grey(config.width, config.height).check_even()?;
258261 Ok(Self {
259262 carried_cdfs: None,
263+ golden: None,
260264 color_config: config.colour.color_config(),
261265 config,
262266 reference: None,
@@ -362,11 +366,15 @@ impl Av1Encoder {
362366 order as u32,
363367 render,
364368 self.carried_cdfs.as_ref().map(|c| &c.0),
369+ self.golden.as_ref(),
365370 &self.fctx,
366371 )?
367372 };
368373
369374 self.carried_cdfs = Some(encoded.next_cdfs.clone());
375+ if is_key {
376+ self.golden = Some(encoded.reconstruction.clone());
377+ }
370378 self.reference = Some(encoded.reconstruction.clone());
371379 self.next_index += 1;
372380 let cropped = crop_encoded(&encoded, render.0, render.1);
crates/ec-av1/src/tile.rsmodified+19 -0
@@ -2695,6 +2695,7 @@ fn write_single_ref(
26952695 above_ref: i8,
26962696 left_ref: i8,
26972697 ) {
2698+ REF_HITS[(ref_frame.max(1) - 1) as usize % 7].fetch_add(1, std::sync::atomic::Ordering::Relaxed);
26982699 use crate::mvstack::{
26992700 ALTREF2_FRAME, ALTREF_FRAME, BWDREF_FRAME, GOLDEN_FRAME, LAST2_FRAME, LAST3_FRAME,
27002701 single_ref_p1_ctx, single_ref_p2_ctx, single_ref_p3_ctx, single_ref_p4_ctx,
@@ -2757,6 +2758,24 @@ static DRL_HITS: [std::sync::atomic::AtomicUsize; 4] = [
27572758 std::sync::atomic::AtomicUsize::new(0),
27582759 ];
27592760
2761+/// One counter per reference name (`LAST`..`ALTREF`), for the gate's own
2762+/// census of what the encoder actually picks.
2763+static REF_HITS: [std::sync::atomic::AtomicUsize; 7] = [
2764+ std::sync::atomic::AtomicUsize::new(0),
2765+ std::sync::atomic::AtomicUsize::new(0),
2766+ std::sync::atomic::AtomicUsize::new(0),
2767+ std::sync::atomic::AtomicUsize::new(0),
2768+ std::sync::atomic::AtomicUsize::new(0),
2769+ std::sync::atomic::AtomicUsize::new(0),
2770+ std::sync::atomic::AtomicUsize::new(0),
2771+];
2772+
2773+/// Takes and clears the per-reference histogram.
2774+#[cfg(test)]
2775+pub(crate) fn take_ref_hits() -> [usize; 7] {
2776+ std::array::from_fn(|i| REF_HITS[i].swap(0, std::sync::atomic::Ordering::Relaxed))
2777+}
2778+
27602779 /// Bumps the two histograms for one coded inter block.
27612780 fn note_inter_mode(mode: usize, drl: usize) {
27622781 INTER_MODE_HITS[mode].fetch_add(1, std::sync::atomic::Ordering::Relaxed);