Make the 8x8-OBMC gate's recipe searchable (it has never fired)
Browse files at this commit62aad8fbfc0dc29eb61005b690b11ffbcb49911bParent: 1db238b- test
- make the 8x8-OBMC gate's recipe searchable (it has never fired)
1 changed file +13 -3
- crates/ec-av1/src/stream.rs +13 -3
crates/ec-av1/src/stream.rsmodified+13 -3
| @@ -3183,11 +3183,21 @@ mod tests { | ||
| 3183 | 3183 | let mut refusals = Vec::new(); |
| 3184 | 3184 | let mut never_fired = 0u32; |
| 3185 | 3185 | let mut total_obmc8 = 0usize; |
| 3186 | - for attempt in 0..80u32 { | |
| 3186 | + let n_attempts: u32 = std::env::var("EC_OBMC8_ATTEMPTS") | |
| 3187 | + .ok() | |
| 3188 | + .and_then(|s| s.parse().ok()) | |
| 3189 | + .unwrap_or(80); | |
| 3190 | + for attempt in 0..n_attempts { | |
| 3187 | 3191 | let seed = 42 + attempt % 40; |
| 3188 | 3192 | let duration = frame_count as f64 / 25.0; |
| 3189 | - let source = | |
| 3190 | - format!("gradients=size={width}x{height}:seed={seed}:duration={duration}:rate=25"); | |
| 3193 | + // Recipe search hook: `gradients` is smooth, so aomenc's RD never | |
| 3194 | + // splits below 16x16 and this gate never fired one 8x8 OBMC block | |
| 3195 | + // in 45 attempts -- it "passed" by skipping (gate-blind-to-feature). | |
| 3196 | + // EC_AV1_OBMC8_SOURCE overrides the lavfi source so a firing recipe | |
| 3197 | + // can be searched for without a rebuild. | |
| 3198 | + let source = std::env::var("EC_AV1_OBMC8_SOURCE").unwrap_or_else(|_| { | |
| 3199 | + format!("gradients=size={width}x{height}:seed={seed}:duration={duration}:rate=25") | |
| 3200 | + }); | |
| 3191 | 3201 | let y4m = Command::new("ffmpeg") |
| 3192 | 3202 | .args([ |
| 3193 | 3203 | "-v", |