The seven encode-then-decode stream gates take the encoder's own superblock size
Browse files at this commit8ef9abd084d4bf3a66cad8e36b5203568894af71Parent: 44a12af- test
- the seven encode-then-decode stream gates take the encoder's own superblock size
1 changed file +10 -7
- crates/ec-av1/src/stream.rs +10 -7
crates/ec-av1/src/stream.rsmodified+10 -7
| @@ -3014,7 +3014,10 @@ pub(crate) mod tests { | |||
| 3014 | /// the encoder's own reconstruction, at an even and an odd size. | 3014 | /// the encoder's own reconstruction, at an even and an odd size. |
| 3015 | #[test] | 3015 | #[test] |
| 3016 | fn decode_stream_matches_the_tile_path_on_a_key_frame() { | 3016 | 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(); | ||
| 3018 | for &(width, height) in &[(64usize, 64usize), (216, 96)] { | 3021 | for &(width, height) in &[(64usize, 64usize), (216, 96)] { |
| 3019 | let picture = test_card(width, height); | 3022 | let picture = test_card(width, height); |
| 3020 | let encoded = encode_key_frame_with_ctx(&picture, 100, 0.5, fctx).unwrap(); | 3023 | let encoded = encode_key_frame_with_ctx(&picture, 100, 0.5, fctx).unwrap(); |
| @@ -3085,7 +3088,7 @@ pub(crate) mod tests { | |||
| 3085 | 3088 | ||
| 3086 | #[test] | 3089 | #[test] |
| 3087 | fn decode_stream_round_trips_a_gop() { | 3090 | fn decode_stream_round_trips_a_gop() { |
| 3088 | - let fctx = &crate::decode::FrameCtx::new(); | 3091 | + let fctx = &crate::decode::FrameCtx::for_encoder(); |
| 3089 | gop_round_trips(128, 64, fctx); | 3092 | gop_round_trips(128, 64, fctx); |
| 3090 | } | 3093 | } |
| 3091 | 3094 | ||
| @@ -3093,7 +3096,7 @@ pub(crate) mod tests { | |||
| 3093 | /// the inter frame's 16x16-leaf split path is exercised too. | 3096 | /// the inter frame's 16x16-leaf split path is exercised too. |
| 3094 | #[test] | 3097 | #[test] |
| 3095 | fn decode_stream_round_trips_an_odd_size_gop() { | 3098 | fn decode_stream_round_trips_an_odd_size_gop() { |
| 3096 | - let fctx = &crate::decode::FrameCtx::new(); | 3099 | + let fctx = &crate::decode::FrameCtx::for_encoder(); |
| 3097 | gop_round_trips(216, 96, fctx); | 3100 | gop_round_trips(216, 96, fctx); |
| 3098 | } | 3101 | } |
| 3099 | 3102 | ||
| @@ -3105,7 +3108,7 @@ pub(crate) mod tests { | |||
| 3105 | /// decode indices non-decreasing, and an `Err` from the sink aborting. | 3108 | /// decode indices non-decreasing, and an `Err` from the sink aborting. |
| 3106 | #[test] | 3109 | #[test] |
| 3107 | fn streaming_decode_matches_the_collecting_one() { | 3110 | fn streaming_decode_matches_the_collecting_one() { |
| 3108 | - let fctx = &crate::decode::FrameCtx::new(); | 3111 | + let fctx = &crate::decode::FrameCtx::for_encoder(); |
| 3109 | let pictures: Vec<_> = (0..4).map(|i| panned_test_card(128, 64, i * 3)).collect(); | 3112 | let pictures: Vec<_> = (0..4).map(|i| panned_test_card(128, 64, i * 3)).collect(); |
| 3110 | let stream = encode_sequence_with_ctx(&pictures, 100, 0.5, fctx).unwrap().stream; | 3113 | let stream = encode_sequence_with_ctx(&pictures, 100, 0.5, fctx).unwrap().stream; |
| 3111 | let collected = decode_stream(&stream).unwrap(); | 3114 | let collected = decode_stream(&stream).unwrap(); |
| @@ -3402,7 +3405,7 @@ pub(crate) mod tests { | |||
| 3402 | /// independent decoder, not just this crate checking its own tile path. | 3405 | /// independent decoder, not just this crate checking its own tile path. |
| 3403 | #[test] | 3406 | #[test] |
| 3404 | fn decode_stream_agrees_with_ffmpeg_on_a_gop() { | 3407 | fn decode_stream_agrees_with_ffmpeg_on_a_gop() { |
| 3405 | - let fctx = &crate::decode::FrameCtx::new(); | 3408 | + let fctx = &crate::decode::FrameCtx::for_encoder(); |
| 3406 | if !have_ffmpeg() { | 3409 | if !have_ffmpeg() { |
| 3407 | eprintln!("SKIP decode_stream_agrees_with_ffmpeg_on_a_gop: no ffmpeg"); | 3410 | eprintln!("SKIP decode_stream_agrees_with_ffmpeg_on_a_gop: no ffmpeg"); |
| 3408 | return; | 3411 | return; |
| @@ -3456,7 +3459,7 @@ pub(crate) mod tests { | |||
| 3456 | /// geometry that never fires it. | 3459 | /// geometry that never fires it. |
| 3457 | #[test] | 3460 | #[test] |
| 3458 | fn a_sweep_of_doubly_straddling_sizes_round_trips_through_ffmpeg() { | 3461 | 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(); |
| 3460 | if !have_ffmpeg() { | 3463 | if !have_ffmpeg() { |
| 3461 | eprintln!("SKIP a_sweep_of_doubly_straddling_sizes_round_trips_through_ffmpeg: no ffmpeg"); | 3464 | eprintln!("SKIP a_sweep_of_doubly_straddling_sizes_round_trips_through_ffmpeg: no ffmpeg"); |
| 3462 | return; | 3465 | return; |
| @@ -3516,7 +3519,7 @@ pub(crate) mod tests { | |||
| 3516 | /// reconstruction, and ffmpeg. | 3519 | /// reconstruction, and ffmpeg. |
| 3517 | #[test] | 3520 | #[test] |
| 3518 | fn a_doubly_cut_superblock_root_round_trips_in_every_plane() { | 3521 | 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(); |
| 3520 | if !have_ffmpeg() { | 3523 | if !have_ffmpeg() { |
| 3521 | eprintln!("SKIP a_doubly_cut_superblock_root_round_trips_in_every_plane: no ffmpeg"); | 3524 | eprintln!("SKIP a_doubly_cut_superblock_root_round_trips_in_every_plane: no ffmpeg"); |
| 3522 | return; | 3525 | return; |