The stream pins are default-preset pins -- encode at speed 0 whatever EC_AV1_SPEED says
Browse files at this commita50740a9855ca468ddc8f34f9be3a39fbdd4e0d2Parent: 707505a- test
- the stream pins are default-preset pins -- encode at speed 0 whatever EC_AV1_SPEED says
2 changed files +23 -8
- crates/ec-av1/src/encode.rs +16 -8
- lanes/last2.report.md +7 -0
crates/ec-av1/src/encode.rsmodified+16 -8
| @@ -15618,7 +15618,12 @@ mod tests { | ||
| 15618 | 15618 | /// (`EC_AV1_ANGLE=0` restores that half). |
| 15619 | 15619 | #[test] |
| 15620 | 15620 | fn the_encoders_own_streams_are_byte_identical_to_their_pins() { |
| 15621 | - let _knobs = crate::speed::knob_read(); | |
| 15621 | + // These are DEFAULT-PRESET pins: a speed preset switches search levers | |
| 15622 | + // off, so it legitimately moves every byte. Encode at speed 0 whatever | |
| 15623 | + // `EC_AV1_SPEED` says (write guard: the preset is process-global). | |
| 15624 | + let _knobs = crate::speed::knob_write(); | |
| 15625 | + let was = crate::speed::speed(); | |
| 15626 | + crate::speed::set_speed(0); | |
| 15622 | 15627 | if !have_ffmpeg() { |
| 15623 | 15628 | eprintln!("SKIP the_encoders_own_streams_are_byte_identical_to_their_pins: no ffmpeg"); |
| 15624 | 15629 | return; |
| @@ -15681,13 +15686,16 @@ mod tests { | ||
| 15681 | 15686 | // now. `EC_AV1_I64=0` restores 8557 / 33345. |
| 15682 | 15687 | let pins: [(u8, usize, u64); 2] = |
| 15683 | 15688 | [(150, 8562, 0x66f5_4ffc_aacf_964f), (60, 33357, 0x1d61_9ca4_e960_b044)]; |
| 15684 | - for (q, bytes, hash) in pins { | |
| 15685 | - let encoded = encode_sequence(&source, q, 0.5).unwrap(); | |
| 15686 | - assert_eq!( | |
| 15687 | - (encoded.stream.len(), fnv(&encoded.stream)), | |
| 15688 | - (bytes, hash), | |
| 15689 | - "q={q}: the encoder's stream moved" | |
| 15690 | - ); | |
| 15689 | + let coded: Vec<(u8, usize, u64)> = pins | |
| 15690 | + .iter() | |
| 15691 | + .map(|&(q, _, _)| { | |
| 15692 | + let e = encode_sequence(&source, q, 0.5).unwrap(); | |
| 15693 | + (q, e.stream.len(), fnv(&e.stream)) | |
| 15694 | + }) | |
| 15695 | + .collect(); | |
| 15696 | + crate::speed::set_speed(was); | |
| 15697 | + for (&(q, bytes, hash), &got) in pins.iter().zip(&coded) { | |
| 15698 | + assert_eq!(got, (q, bytes, hash), "q={q}: the encoder's stream moved"); | |
| 15691 | 15699 | } |
| 15692 | 15700 | } |
| 15693 | 15701 |
lanes/last2.report.mdmodified+7 -0
| @@ -136,6 +136,13 @@ comes back (194 s / 171 s against the control's 208 s / 165 s, i.e. inside the | ||
| 136 | 136 | gate's own wall noise), so the cost of the searched arm was indeed the second |
| 137 | 137 | motion search — but the reference itself does not pay for its own syntax. |
| 138 | 138 | |
| 139 | +**The screen row** (`EC_AV1_NATIVE_SCREEN=1`, the keep rule's third column): | |
| 140 | +control and the search-free arm are BYTE-IDENTICAL at all four quantizers | |
| 141 | +(+19.8% / -30.5%, 143.6 s vs 144.1 s), and the census prints `LAST2 0 of 23942 | |
| 142 | +inter blocks` — the screen clip's leaves never take the older picture, so the | |
| 143 | +screen half of the keep rule is neutral either way and the decision rests on | |
| 144 | +the two film rows. | |
| 145 | + | |
| 139 | 146 | **Fire share, on the real film rows** (the census the gate now prints): |
| 140 | 147 | |
| 141 | 148 | | clip | LAST | LAST2 | GOLDEN | ALTREF | LAST2 share | |