forge
Explore
Log in

Don't you dare go Hollow

stream: hoist the narrow-kernel gate's FRAMES assert above its oracle call

Browse files at this commit

6e9d8a0eda29027d10d9cd3a492fde1192d075a8Ahmet Kaan GümüşParent: a2f865b
a_real_aomenc_rect_inter_block_predicts_chroma_with_the_narrow_kernel already
had the right assert -- frames.len() == FRAMES, with 'const FRAMES: usize = 6'
driving both '-vframes {FRAMES}' and '--limit={FRAMES}' -- but BELOW the call,
so the oracle had already been handed frames.len(). Hoisted, not duplicated.

The 'rect_narrow_kern_hits()' read stays where it was, above the call, so a
mismatch report still says whether the arm fired; a first attempt at this edit
moved the assert above that read and dropped the binding, which would have left
the failure message unable to name the arm's hit count.

count-vacuity sweep: 5 unpinned -> 4.
crates/ec-av1/src/stream.rsmodified+12 -6
@@ -42959,6 +42959,18 @@ pub(crate) mod tests {
4295942959 }
4296042960 };
4296142961 let narrow = crate::mc::rect_narrow_kern_hits();
42962+ // The ENCODE's frame count, asserted ABOVE the oracle call, not
42963+ // our decode's length: `-vframes {FRAMES}` (42696) feeds aomenc
42964+ // exactly FRAMES frames and `--limit={FRAMES}` (42724) caps its
42965+ // output there. A decode that dropped a frame must red HERE,
42966+ // naming the encode, rather than hand the same short count to
42967+ // ffmpeg and let the helper's byte-length assert blame ffmpeg.
42968+ assert_eq!(
42969+ frames.len(),
42970+ FRAMES,
42971+ "{NAME}: not every coded frame was decoded ({width}x{height}, \
42972+ depth={depth}, cq={cq})"
42973+ );
4296242974 let ffmpeg_frames = if depth == 10 {
4296342975 ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len())
4296442976 } else {
@@ -42969,12 +42981,6 @@ pub(crate) mod tests {
4296942981 frames.len(),
4297042982 "{NAME}: ffmpeg frame count ({width}x{height}, depth={depth}, cq={cq})"
4297142983 );
42972- assert_eq!(
42973- frames.len(),
42974- FRAMES,
42975- "{NAME}: not every coded frame was decoded ({width}x{height}, \
42976- depth={depth}, cq={cq})"
42977- );
4297842984 for (i, (got, want)) in frames.iter().zip(&ffmpeg_frames).enumerate() {
4297942985 assert_eq!(
4298042986 got.y, want.y,