forge
Explore
Log in

Don't you dare go Hollow

The seven encode-then-decode stream gates take the encoder's own superblock size

Browse files at this commit

8ef9abd084d4bf3a66cad8e36b5203568894af71Ahmet Kaan GümüşParent: 44a12af
  • test
    • the seven encode-then-decode stream gates take the encoder's own superblock size
Show full message
test(av1): the seven encode-then-decode stream gates take the encoder's own superblock size

Each built a plain FrameCtx (superblock 64) and handed it to
encode_*_with_ctx, so under EC_AV1_SB128=1 the writer coded a 128 root
while the encoder's own trial decode -- and the raw tile decode beside it
-- read at 64. First divergent symbol on the key-frame gate at 216x96:
index 33, the writer's 8-symbol partition_w128 (SPLIT), which the reader
skipped straight past into the 10-symbol partition_w64. The other six
surfaced as the arf refusing a reference slot inside the encoder's trial
decode. Same class the lane-b128 merge swept through ten of their
neighbours; these seven were the rest of it.
crates/ec-av1/src/stream.rsmodified+10 -7
@@ -3014,7 +3014,10 @@ pub(crate) mod tests {
30143014 /// the encoder's own reconstruction, at an even and an odd size.
30153015 #[test]
30163016 fn decode_stream_matches_the_tile_path_on_a_key_frame() {
3017- let fctx = &crate::decode::FrameCtx::new();
3017+ // lane-b128m: the ENCODER writes at this process's superblock size, so
3018+ // its own trial decode -- and the raw tile decode below -- must be given
3019+ // that size too (class: stale header in the test harness).
3020+ let fctx = &crate::decode::FrameCtx::for_encoder();
30183021 for &(width, height) in &[(64usize, 64usize), (216, 96)] {
30193022 let picture = test_card(width, height);
30203023 let encoded = encode_key_frame_with_ctx(&picture, 100, 0.5, fctx).unwrap();
@@ -3085,7 +3088,7 @@ pub(crate) mod tests {
30853088
30863089 #[test]
30873090 fn decode_stream_round_trips_a_gop() {
3088- let fctx = &crate::decode::FrameCtx::new();
3091+ let fctx = &crate::decode::FrameCtx::for_encoder();
30893092 gop_round_trips(128, 64, fctx);
30903093 }
30913094
@@ -3093,7 +3096,7 @@ pub(crate) mod tests {
30933096 /// the inter frame's 16x16-leaf split path is exercised too.
30943097 #[test]
30953098 fn decode_stream_round_trips_an_odd_size_gop() {
3096- let fctx = &crate::decode::FrameCtx::new();
3099+ let fctx = &crate::decode::FrameCtx::for_encoder();
30973100 gop_round_trips(216, 96, fctx);
30983101 }
30993102
@@ -3105,7 +3108,7 @@ pub(crate) mod tests {
31053108 /// decode indices non-decreasing, and an `Err` from the sink aborting.
31063109 #[test]
31073110 fn streaming_decode_matches_the_collecting_one() {
3108- let fctx = &crate::decode::FrameCtx::new();
3111+ let fctx = &crate::decode::FrameCtx::for_encoder();
31093112 let pictures: Vec<_> = (0..4).map(|i| panned_test_card(128, 64, i * 3)).collect();
31103113 let stream = encode_sequence_with_ctx(&pictures, 100, 0.5, fctx).unwrap().stream;
31113114 let collected = decode_stream(&stream).unwrap();
@@ -3402,7 +3405,7 @@ pub(crate) mod tests {
34023405 /// independent decoder, not just this crate checking its own tile path.
34033406 #[test]
34043407 fn decode_stream_agrees_with_ffmpeg_on_a_gop() {
3405- let fctx = &crate::decode::FrameCtx::new();
3408+ let fctx = &crate::decode::FrameCtx::for_encoder();
34063409 if !have_ffmpeg() {
34073410 eprintln!("SKIP decode_stream_agrees_with_ffmpeg_on_a_gop: no ffmpeg");
34083411 return;
@@ -3456,7 +3459,7 @@ pub(crate) mod tests {
34563459 /// geometry that never fires it.
34573460 #[test]
34583461 fn a_sweep_of_doubly_straddling_sizes_round_trips_through_ffmpeg() {
3459- let fctx = &crate::decode::FrameCtx::new();
3462+ let fctx = &crate::decode::FrameCtx::for_encoder();
34603463 if !have_ffmpeg() {
34613464 eprintln!("SKIP a_sweep_of_doubly_straddling_sizes_round_trips_through_ffmpeg: no ffmpeg");
34623465 return;
@@ -3516,7 +3519,7 @@ pub(crate) mod tests {
35163519 /// reconstruction, and ffmpeg.
35173520 #[test]
35183521 fn a_doubly_cut_superblock_root_round_trips_in_every_plane() {
3519- let fctx = &crate::decode::FrameCtx::new();
3522+ let fctx = &crate::decode::FrameCtx::for_encoder();
35203523 if !have_ffmpeg() {
35213524 eprintln!("SKIP a_doubly_cut_superblock_root_round_trips_in_every_plane: no ffmpeg");
35223525 return;