stream: hoist the narrow-kernel gate's FRAMES assert above its oracle call
Browse files at this commit6e9d8a0eda29027d10d9cd3a492fde1192d075a8Parent: a2f865b1 changed file +12 -6
- crates/ec-av1/src/stream.rs +12 -6
crates/ec-av1/src/stream.rsmodified+12 -6
| @@ -42959,6 +42959,18 @@ pub(crate) mod tests { | |||
| 42959 | } | 42959 | } |
| 42960 | }; | 42960 | }; |
| 42961 | let narrow = crate::mc::rect_narrow_kern_hits(); | 42961 | 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 | + ); | ||
| 42962 | let ffmpeg_frames = if depth == 10 { | 42974 | let ffmpeg_frames = if depth == 10 { |
| 42963 | ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) | 42975 | ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) |
| 42964 | } else { | 42976 | } else { |
| @@ -42969,12 +42981,6 @@ pub(crate) mod tests { | |||
| 42969 | frames.len(), | 42981 | frames.len(), |
| 42970 | "{NAME}: ffmpeg frame count ({width}x{height}, depth={depth}, cq={cq})" | 42982 | "{NAME}: ffmpeg frame count ({width}x{height}, depth={depth}, cq={cq})" |
| 42971 | ); | 42983 | ); |
| 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 | - ); | ||
| 42978 | for (i, (got, want)) in frames.iter().zip(&ffmpeg_frames).enumerate() { | 42984 | for (i, (got, want)) in frames.iter().zip(&ffmpeg_frames).enumerate() { |
| 42979 | assert_eq!( | 42985 | assert_eq!( |
| 42980 | got.y, want.y, | 42986 | got.y, want.y, |