The hand-built GOLDEN fixture keeps its frames' CDF carry off
Browse files at this commit4db0da1ec2bdf310f17532b365e0b6aa568b5129Parent: e161916- test
- the hand-built GOLDEN fixture keeps its frames' CDF carry off
1 changed file +8 -1
crates/ec-av1/src/stream.rsmodified+8 -1
| @@ -3395,7 +3395,13 @@ mod tests { | |||
| 3395 | 3395 | ||
| 3396 | // Frame 1: hand-coded, intra-only, refreshes slot 0 with a flat | 3396 | // Frame 1: hand-coded, intra-only, refreshes slot 0 with a flat |
| 3397 | // 128 block (no neighbours to predict `DC_PRED` from). | 3397 | // 128 block (no neighbours to predict `DC_PRED` from). |
| 3398 | - let (_, header1) = inter_frame_headers(width, height, base_q_idx, 1, 0).unwrap(); | 3398 | + let (_, mut header1) = inter_frame_headers(width, height, base_q_idx, 1, 0).unwrap(); |
| 3399 | + // These two tiles are hand-coded from a FRESH `Cdfs`, so the | ||
| 3400 | + // frames must not carry CDF state the way the encoder's own inter | ||
| 3401 | + // frames now do (spec 7.20): with the bit set, what each frame | ||
| 3402 | + // stores is what it started from -- the defaults -- which is | ||
| 3403 | + // exactly what the next hand-coded tile assumes. | ||
| 3404 | + header1.disable_frame_end_update_cdf = true; | ||
| 3399 | let tile1 = { | 3405 | let tile1 = { |
| 3400 | let mut cdfs = Cdfs::new(q_ctx_of(base_q_idx)); | 3406 | let mut cdfs = Cdfs::new(q_ctx_of(base_q_idx)); |
| 3401 | let mut enc = SymbolEncoder::new(); | 3407 | let mut enc = SymbolEncoder::new(); |
| @@ -3413,6 +3419,7 @@ mod tests { | |||
| 3413 | // Frame 2: hand-coded, single_ref all the way to GOLDEN_FRAME, | 3419 | // Frame 2: hand-coded, single_ref all the way to GOLDEN_FRAME, |
| 3414 | // skip zero-MV NEARESTMV -- a direct copy of slot 3 (frame 0). | 3420 | // skip zero-MV NEARESTMV -- a direct copy of slot 3 (frame 0). |
| 3415 | let (_, mut header2) = inter_frame_headers(width, height, base_q_idx, 2, 0).unwrap(); | 3421 | let (_, mut header2) = inter_frame_headers(width, height, base_q_idx, 2, 0).unwrap(); |
| 3422 | + header2.disable_frame_end_update_cdf = true; | ||
| 3416 | header2.ref_frame_idx[3] = 3; // GOLDEN_FRAME's own slot: frame 0's, untouched by frame 1 | 3423 | header2.ref_frame_idx[3] = 3; // GOLDEN_FRAME's own slot: frame 0's, untouched by frame 1 |
| 3417 | let tile2 = { | 3424 | let tile2 = { |
| 3418 | let mut cdfs = Cdfs::new(q_ctx_of(base_q_idx)); | 3425 | let mut cdfs = Cdfs::new(q_ctx_of(base_q_idx)); |