Merge branch 'lane-av1tpl' (73bc3ef9): per-superblock temporal lambda from a one-frame lookahead referenced-ness map (k=0.5)
Browse files at this commit2 changed files +238 -6
- crates/ec-av1/src/encode.rs +232 -6
- crates/ec-av1/src/encoder.rs +6 -0
crates/ec-av1/src/encode.rsmodified+232 -6
| @@ -4859,6 +4859,7 @@ fn mode_bits(above_mode: u8, left_mode: u8) -> [f64; 13] { | ||
| 4859 | 4859 | } |
| 4860 | 4860 | |
| 4861 | 4861 | /// What the luma mode search picks between, and under what terms. |
| 4862 | +#[derive(Clone, Copy)] | |
| 4862 | 4863 | struct Search<'a> { |
| 4863 | 4864 | /// This frame's `allow_screen_content_tools` ([`screen_content`]): the |
| 4864 | 4865 | /// luma search then offers a palette candidate beside the intra modes. |
| @@ -7293,6 +7294,161 @@ fn search_inter_block( | ||
| 7293 | 7294 | ) |
| 7294 | 7295 | } |
| 7295 | 7296 | |
| 7297 | +/// lane-av1tpl: the strength `k` of the temporal lambda weighting | |
| 7298 | +/// ([`tpl_sb_factors`]). 0 keeps every block at the frame's own lambda, which | |
| 7299 | +/// is what every measurement before this lane was taken on. Swept by | |
| 7300 | +/// `EC_AV1_TPL=<k>`. | |
| 7301 | +/// | |
| 7302 | +/// SWEPT on lane-av1tpl at the native gate (1920x1024, 12 frames, BD-rate vs | |
| 7303 | +/// libaom `cpu-used 6` / rav1e `speed 6`); `k=0` reproduces the pre-lane | |
| 7304 | +/// baseline exactly, which is the control the rest of the table is read | |
| 7305 | +/// against: | |
| 7306 | +/// | |
| 7307 | +/// | k | film 1080p | film 2160p | screen | | |
| 7308 | +/// |---|---|---|---| | |
| 7309 | +/// | 0 | +16.2/-1.1 | +46.6/+18.8 | +51.3/-14.4 | | |
| 7310 | +/// | 0.25 | +16.4/-0.7 | +46.6/+18.8 | +51.2/-14.4 | | |
| 7311 | +/// | **0.5** | **+15.9/-1.3** | **+46.5/+18.7** | **+51.2/-14.4** | | |
| 7312 | +/// | 1 | +16.2/-0.9 | +46.6/+18.8 | +51.2/-14.4 | | |
| 7313 | +/// | 2 | +16.5/-0.7 | +46.7/+19.0 | +51.1/-14.4 | | |
| 7314 | +/// | |
| 7315 | +/// 0.5 is the only arm that is at least flat on every row and down on five of | |
| 7316 | +/// the six columns, so it ships as the default. The lookahead pass that feeds | |
| 7317 | +/// it costs 1.5 ms per 1920x1024 frame against a ~0.8 s encode (0.2%). | |
| 7318 | +const TPL_STRENGTH: f64 = 0.5; | |
| 7319 | + | |
| 7320 | +fn tpl_strength() -> f64 { | |
| 7321 | + std::env::var("EC_AV1_TPL") | |
| 7322 | + .ok() | |
| 7323 | + .and_then(|v| v.parse::<f64>().ok()) | |
| 7324 | + .filter(|k| k.is_finite() && *k >= 0.0) | |
| 7325 | + .unwrap_or(TPL_STRENGTH) | |
| 7326 | +} | |
| 7327 | + | |
| 7328 | +/// Nanoseconds the lookahead pass ([`tpl_reference_map`]) has spent this | |
| 7329 | +/// process, so the gate can price it against the encode it rides on. | |
| 7330 | +static TPL_NANOS: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0); | |
| 7331 | + | |
| 7332 | +/// How much of THIS frame the next one will predict from, per 16x16 cell: one | |
| 7333 | +/// coarse full-pel motion pass of the next SOURCE frame against this one | |
| 7334 | +/// (libaom's `tpl` lookahead in its cheapest possible shape -- no transform, | |
| 7335 | +/// no propagation chain, just referenced area). A cell's value is the area of | |
| 7336 | +/// it that the next frame's blocks land on, in units of its own area, so 1.0 | |
| 7337 | +/// is "referenced exactly once". | |
| 7338 | +/// | |
| 7339 | +/// Deterministic: integer SADs, a fixed 3-step pattern seeded at zero and at | |
| 7340 | +/// the left/above winners, first-best tie-break. The map is built once on the | |
| 7341 | +/// frame's own thread and read-only afterwards, so it cannot make a tile's | |
| 7342 | +/// bytes depend on the thread count. | |
| 7343 | +fn tpl_reference_map(cur: &[u8], next: &[u8], width: usize, height: usize) -> Vec<f64> { | |
| 7344 | + let start = std::time::Instant::now(); | |
| 7345 | + let (cells_x, cells_y) = (width / 16, height / 16); | |
| 7346 | + let mut area = vec![0.0f64; cells_x * cells_y]; | |
| 7347 | + // SAD of the next frame's 16x16 block at (bx, by) against this frame at | |
| 7348 | + // that block displaced by (mx, my); a displacement that leaves the frame | |
| 7349 | + // is not a candidate at all. | |
| 7350 | + let sad = |bx: usize, by: usize, (mx, my): (i32, i32)| -> u32 { | |
| 7351 | + let (sx, sy) = (bx as i32 + mx, by as i32 + my); | |
| 7352 | + if sx < 0 || sy < 0 || sx as usize + 16 > width || sy as usize + 16 > height { | |
| 7353 | + return u32::MAX; | |
| 7354 | + } | |
| 7355 | + let (sx, sy) = (sx as usize, sy as usize); | |
| 7356 | + let mut sum = 0u32; | |
| 7357 | + for r in 0..16 { | |
| 7358 | + let a = &next[(by + r) * width + bx..][..16]; | |
| 7359 | + let b = &cur[(sy + r) * width + sx..][..16]; | |
| 7360 | + sum += a.iter().zip(b).map(|(&p, &q)| u32::from(p.abs_diff(q))).sum::<u32>(); | |
| 7361 | + } | |
| 7362 | + sum | |
| 7363 | + }; | |
| 7364 | + let mut above = vec![(0i32, 0i32); cells_x]; | |
| 7365 | + for cy in 0..cells_y { | |
| 7366 | + let mut left = (0i32, 0i32); | |
| 7367 | + for cx in 0..cells_x { | |
| 7368 | + let (bx, by) = (cx * 16, cy * 16); | |
| 7369 | + let mut best = (sad(bx, by, (0, 0)), (0i32, 0i32)); | |
| 7370 | + for cand in [left, above[cx]] { | |
| 7371 | + if cand != (0, 0) { | |
| 7372 | + let s = sad(bx, by, cand); | |
| 7373 | + if s < best.0 { | |
| 7374 | + best = (s, cand); | |
| 7375 | + } | |
| 7376 | + } | |
| 7377 | + } | |
| 7378 | + for step in [8i32, 4, 2, 1] { | |
| 7379 | + let centre = best.1; | |
| 7380 | + for (dx, dy) in [(step, 0), (-step, 0), (0, step), (0, -step)] { | |
| 7381 | + let mv = (centre.0 + dx, centre.1 + dy); | |
| 7382 | + if mv.0.abs() > 32 || mv.1.abs() > 32 { | |
| 7383 | + continue; | |
| 7384 | + } | |
| 7385 | + let s = sad(bx, by, mv); | |
| 7386 | + if s < best.0 { | |
| 7387 | + best = (s, mv); | |
| 7388 | + } | |
| 7389 | + } | |
| 7390 | + } | |
| 7391 | + let (mv, _) = (best.1, best.0); | |
| 7392 | + left = mv; | |
| 7393 | + above[cx] = mv; | |
| 7394 | + // The 16x16 window of THIS frame that block referenced, spread | |
| 7395 | + // over the (at most four) cells it overlaps. | |
| 7396 | + let (x0, y0) = ((bx as i32 + mv.0) as usize, (by as i32 + mv.1) as usize); | |
| 7397 | + for ci in x0 / 16..=((x0 + 15) / 16).min(cells_x - 1) { | |
| 7398 | + let ox = (x0 + 16).min(ci * 16 + 16) - x0.max(ci * 16); | |
| 7399 | + for ri in y0 / 16..=((y0 + 15) / 16).min(cells_y - 1) { | |
| 7400 | + let oy = (y0 + 16).min(ri * 16 + 16) - y0.max(ri * 16); | |
| 7401 | + area[ri * cells_x + ci] += (ox * oy) as f64 / 256.0; | |
| 7402 | + } | |
| 7403 | + } | |
| 7404 | + } | |
| 7405 | + } | |
| 7406 | + TPL_NANOS.fetch_add( | |
| 7407 | + start.elapsed().as_nanos() as u64, | |
| 7408 | + std::sync::atomic::Ordering::Relaxed, | |
| 7409 | + ); | |
| 7410 | + area | |
| 7411 | +} | |
| 7412 | + | |
| 7413 | +/// [`tpl_reference_map`]'s per-cell referenced-ness turned into one lambda | |
| 7414 | +/// factor per 64x64 superblock: `f = (1 + k) / (1 + k * w_rel)`, where | |
| 7415 | +/// `w_rel` is the superblock's mean referenced-ness over the FRAME's mean. | |
| 7416 | +/// Decreasing in referenced-ness (a block the next frame leans on is coded | |
| 7417 | +/// more distortion-averse) and 1.0 at the frame's own mean, so the frame's | |
| 7418 | +/// total lambda scale is only redistributed, never moved -- a global move is | |
| 7419 | +/// the thing lane-av1lambda already measured inert. | |
| 7420 | +fn tpl_sb_factors(map: &[f64], cells_x: usize, cells_y: usize, k: f64) -> Vec<f64> { | |
| 7421 | + let (sb_cols, sb_rows) = (cells_x / 4, cells_y / 4); | |
| 7422 | + let mean = (map.iter().sum::<f64>() / map.len().max(1) as f64).max(1e-6); | |
| 7423 | + let mut out = Vec::with_capacity(sb_cols * sb_rows); | |
| 7424 | + for sr in 0..sb_rows { | |
| 7425 | + for sc in 0..sb_cols { | |
| 7426 | + let mut sum = 0.0; | |
| 7427 | + for r in 0..4 { | |
| 7428 | + for c in 0..4 { | |
| 7429 | + sum += map[(sr * 4 + r) * cells_x + sc * 4 + c]; | |
| 7430 | + } | |
| 7431 | + } | |
| 7432 | + let w_rel = sum / 16.0 / mean; | |
| 7433 | + out.push(((1.0 + k) / (1.0 + k * w_rel)).clamp(0.25, 4.0)); | |
| 7434 | + } | |
| 7435 | + } | |
| 7436 | + if std::env::var("EC_AV1_TPL_HIST").ok().as_deref() == Some("1") { | |
| 7437 | + let mut hist = [0usize; 8]; | |
| 7438 | + for w in map { | |
| 7439 | + hist[((w / mean * 2.0) as usize).min(7)] += 1; | |
| 7440 | + } | |
| 7441 | + let (lo, hi) = out.iter().fold((f64::MAX, 0.0f64), |(l, h), &f| (l.min(f), h.max(f))); | |
| 7442 | + eprintln!( | |
| 7443 | + "tpl k={k}: {} cells mean w={mean:.3}, w/mean hist (0-.5,.5-1,..,>3.5) {hist:?}, \ | |
| 7444 | + sb factor {lo:.3}..{hi:.3}, lookahead wall {:.1} ms cumulative", | |
| 7445 | + map.len(), | |
| 7446 | + TPL_NANOS.load(std::sync::atomic::Ordering::Relaxed) as f64 / 1e6, | |
| 7447 | + ); | |
| 7448 | + } | |
| 7449 | + out | |
| 7450 | +} | |
| 7451 | + | |
| 7296 | 7452 | /// Where one inter frame sits in a coding-order pyramid: which DPB slots its |
| 7297 | 7453 | /// references name, which slot it refreshes, whether it is shown when it is |
| 7298 | 7454 | /// coded, and the `ref_frame_sign_bias` that follows from all of it. `None` |
| @@ -7352,6 +7508,11 @@ pub(crate) fn encode_inter_frame( | ||
| 7352 | 7508 | // Where this frame sits in the coding-order pyramid; `None` is the flat |
| 7353 | 7509 | // one-shown-frame-per-picture stream this encoder wrote before. |
| 7354 | 7510 | pyramid: Option<PyramidFrame>, |
| 7511 | + // lane-av1tpl: the NEXT picture's source, padded like this one. Present, | |
| 7512 | + // it buys the one-frame lookahead the per-superblock lambda weighting | |
| 7513 | + // reads ([`tpl_reference_map`]); `None` (every streaming caller, which | |
| 7514 | + // has no lookahead buffer) codes the frame at one lambda, as before. | |
| 7515 | + lookahead: Option<&Picture>, | |
| 7355 | 7516 | ) -> Result<Encoded> { |
| 7356 | 7517 | picture.check()?; |
| 7357 | 7518 | if !picture.width.is_multiple_of(SUPERBLOCK) || !picture.height.is_multiple_of(SUPERBLOCK) { |
| @@ -7510,6 +7671,19 @@ pub(crate) fn encode_inter_frame( | ||
| 7510 | 7671 | screen, |
| 7511 | 7672 | }; |
| 7512 | 7673 | let mode_bits_table = inter_mode_bits(); |
| 7674 | + // lane-av1tpl: one lambda factor per 64x64 superblock, from how much of | |
| 7675 | + // this frame the NEXT one predicts from. Off (`None`) without a | |
| 7676 | + // lookahead picture or at strength 0. | |
| 7677 | + let tpl_k = tpl_strength(); | |
| 7678 | + let tpl_factors: Option<Vec<f64>> = lookahead | |
| 7679 | + .filter(|_| tpl_k > 0.0) | |
| 7680 | + .filter(|n| n.width == picture.width && n.height == picture.height) | |
| 7681 | + .map(|n| { | |
| 7682 | + let next_y8: Vec<u8> = n.y.iter().map(|&v| v as u8).collect(); | |
| 7683 | + let map = tpl_reference_map(&picture_y8, &next_y8, picture.width, picture.height); | |
| 7684 | + tpl_sb_factors(&map, picture.width / 16, picture.height / 16, tpl_k) | |
| 7685 | + }); | |
| 7686 | + let tpl_sb_cols = picture.width / SUPERBLOCK; | |
| 7513 | 7687 | |
| 7514 | 7688 | // The true grid ([`crate::tile::block_grid`]'s ceiling), not the padded |
| 7515 | 7689 | // coding surface's: `blocks` carries one entry per 32x32 block the tile |
| @@ -7578,6 +7752,16 @@ pub(crate) fn encode_inter_frame( | ||
| 7578 | 7752 | let mut blocks: Vec<(usize, Quadrant)> = Vec::new(); |
| 7579 | 7753 | for sb_r in rect.sb_row0 as usize..rect.sb_row1 as usize { |
| 7580 | 7754 | for sb_c in rect.sb_col0 as usize..rect.sb_col1 as usize { |
| 7755 | + // lane-av1tpl: this superblock's own lambda -- every RD decision | |
| 7756 | + // under it (partition, mode, tx, motion) reads `search.lambda`, | |
| 7757 | + // so scaling the one field here scales all of them. | |
| 7758 | + let search = match &tpl_factors { | |
| 7759 | + Some(f) => Search { | |
| 7760 | + lambda: search.lambda * f[sb_r * tpl_sb_cols + sb_c], | |
| 7761 | + ..search | |
| 7762 | + }, | |
| 7763 | + None => search, | |
| 7764 | + }; | |
| 7581 | 7765 | for quadrant in 0..4 { |
| 7582 | 7766 | let (r32, c32) = (sb_r * 2 + quadrant / 2, sb_c * 2 + quadrant % 2); |
| 7583 | 7767 | // Same filter as the tile writer's: a quadrant whose own mi |
| @@ -8289,6 +8473,10 @@ pub(crate) fn encode_sequence_with_ctx( | ||
| 8289 | 8473 | let mut frames = vec![crop_encoded(&key, render.0, render.1)]; |
| 8290 | 8474 | for (i, picture) in rest.iter().enumerate() { |
| 8291 | 8475 | picture.check_even()?; |
| 8476 | + // lane-av1tpl: the one-frame lookahead the per-superblock lambda | |
| 8477 | + // weighting reads -- the NEXT picture's source at this frame's coded | |
| 8478 | + // (padded) size. The last frame of the sequence has none. | |
| 8479 | + let lookahead = rest.get(i + 1).map(|n| n.padded_to(SUPERBLOCK)); | |
| 8292 | 8480 | if (picture.width, picture.height) != render { |
| 8293 | 8481 | return Err(Error::unsupported( |
| 8294 | 8482 | "AV1 encode", |
| @@ -8308,6 +8496,7 @@ pub(crate) fn encode_sequence_with_ctx( | ||
| 8308 | 8496 | Some(&golden), |
| 8309 | 8497 | prev2.as_ref(), fctx, |
| 8310 | 8498 | None, |
| 8499 | + lookahead.as_ref(), | |
| 8311 | 8500 | )?; |
| 8312 | 8501 | stream.extend_from_slice(&inter.stream); |
| 8313 | 8502 | carried = inter.next_cdfs.clone(); |
| @@ -8323,6 +8512,41 @@ pub(crate) fn encode_sequence_with_ctx( | ||
| 8323 | 8512 | #[cfg(test)] |
| 8324 | 8513 | mod tests { |
| 8325 | 8514 | |
| 8515 | + /// lane-av1tpl's map and its lambda factors, on the two properties every | |
| 8516 | + /// decision under them rests on: a frame the next one repeats exactly is | |
| 8517 | + /// referenced once per cell (w = 1 everywhere, so every factor is 1 and | |
| 8518 | + /// the weighting is a no-op), and the factor DECREASES in | |
| 8519 | + /// referenced-ness -- a block the next frame leans on twice as hard as | |
| 8520 | + /// the frame's mean is coded at a smaller lambda (more distortion-averse) | |
| 8521 | + /// than one nothing points at. | |
| 8522 | + #[test] | |
| 8523 | + fn tpl_map_is_flat_on_a_repeated_frame_and_its_factor_falls_with_referencedness() { | |
| 8524 | + let (w, h) = (64usize, 64usize); | |
| 8525 | + let frame: Vec<u8> = (0..w * h).map(|i| ((i * 37) % 251) as u8).collect(); | |
| 8526 | + let map = super::tpl_reference_map(&frame, &frame, w, h); | |
| 8527 | + assert_eq!(map.len(), 16, "4x4 cells of 16x16"); | |
| 8528 | + for (i, &v) in map.iter().enumerate() { | |
| 8529 | + assert!((v - 1.0).abs() < 1e-9, "cell {i} referenced {v} times, want exactly 1"); | |
| 8530 | + } | |
| 8531 | + let factors = super::tpl_sb_factors(&map, 4, 4, 1.0); | |
| 8532 | + assert_eq!(factors.len(), 1); | |
| 8533 | + assert!((factors[0] - 1.0).abs() < 1e-9, "a flat map must not move any lambda"); | |
| 8534 | + | |
| 8535 | + // Two superblocks of cells side by side, 8 cells wide and 4 tall: | |
| 8536 | + // superblock 0 covers columns 0..4 and is referenced four times as | |
| 8537 | + // much as superblock 1 in columns 4..8, so its factor must be the | |
| 8538 | + // smaller of the two and the frame mean must sit between them. | |
| 8539 | + let by_col: Vec<f64> = (0..32) | |
| 8540 | + .map(|i| if (i % 8) < 4 { 2.0 } else { 0.5 }) | |
| 8541 | + .collect(); | |
| 8542 | + for k in [0.25f64, 0.5, 1.0, 2.0] { | |
| 8543 | + let f = super::tpl_sb_factors(&by_col, 8, 4, k); | |
| 8544 | + assert_eq!(f.len(), 2); | |
| 8545 | + assert!(f[0] < 1.0 && f[1] > 1.0, "k={k}: factors {f:?} must straddle 1"); | |
| 8546 | + assert!(f[0] < f[1], "k={k}: the referenced half must get the smaller lambda"); | |
| 8547 | + } | |
| 8548 | + } | |
| 8549 | + | |
| 8326 | 8550 | /// lane-rectx r5: libaom lays `has_tr_*`/`has_bl_*` out row-major for a |
| 8327 | 8551 | /// 128x128 superblock -- `MAX_MIB_SIZE_LOG2 = 5` mi columns per row, so a |
| 8328 | 8552 | /// row holds `32 >> bw_in_mi_log2` bits and the table holds |
| @@ -10787,7 +11011,7 @@ mod tests { | ||
| 10787 | 11011 | let padded_pic = picture.padded_to(SUPERBLOCK); |
| 10788 | 11012 | let t = Instant::now(); |
| 10789 | 11013 | let inter = |
| 10790 | - encode_inter_frame(&padded_pic, &padded_ref, 100, 0.5, 1, flat_order_hints(1, 0, false), (width, height), None, None, None, fctx, None).unwrap(); | |
| 11014 | + encode_inter_frame(&padded_pic, &padded_ref, 100, 0.5, 1, flat_order_hints(1, 0, false), (width, height), None, None, None, fctx, None, None).unwrap(); | |
| 10791 | 11015 | let inter_t = t.elapsed(); |
| 10792 | 11016 | eprintln!( |
| 10793 | 11017 | "inter frame vs its own key frame: {inter_t:>9.2?} ({} bytes, inter share \ |
| @@ -10885,7 +11109,7 @@ mod tests { | ||
| 10885 | 11109 | stage_reset(); |
| 10886 | 11110 | let t = Instant::now(); |
| 10887 | 11111 | let inter = |
| 10888 | - encode_inter_frame(&padded_pic, &padded_ref, 100, 0.5, 1, flat_order_hints(1, 0, false), (width, height), None, None, None, fctx, None).unwrap(); | |
| 11112 | + encode_inter_frame(&padded_pic, &padded_ref, 100, 0.5, 1, flat_order_hints(1, 0, false), (width, height), None, None, None, fctx, None, None).unwrap(); | |
| 10889 | 11113 | let total_t = t.elapsed(); |
| 10890 | 11114 | let [motion_search, interpolation, transform_quant, entropy] = stage_read(); |
| 10891 | 11115 | let accounted = motion_search + transform_quant + entropy; |
| @@ -11063,7 +11287,7 @@ mod tests { | ||
| 11063 | 11287 | 0.5, |
| 11064 | 11288 | 1, |
| 11065 | 11289 | flat_order_hints(1, 0, false), |
| 11066 | - (width, height), None, None, None, fctx, None, | |
| 11290 | + (width, height), None, None, None, fctx, None, None, | |
| 11067 | 11291 | ) |
| 11068 | 11292 | .unwrap(); |
| 11069 | 11293 | let baseline_psnr = psnr(&baseline.reconstruction.y, &inter_source.y); |
| @@ -11081,7 +11305,7 @@ mod tests { | ||
| 11081 | 11305 | 0.5, |
| 11082 | 11306 | 1, |
| 11083 | 11307 | flat_order_hints(1, 0, false), |
| 11084 | - (width, height), None, None, None, fctx, None, | |
| 11308 | + (width, height), None, None, None, fctx, None, None, | |
| 11085 | 11309 | ) |
| 11086 | 11310 | .unwrap(); |
| 11087 | 11311 | let pruned_psnr = psnr(&pruned.reconstruction.y, &inter_source.y); |
| @@ -11628,7 +11852,9 @@ mod tests { | ||
| 11628 | 11852 | /// search moved with it. Re-pinned on lane-av1rejudge: local warp is on |
| 11629 | 11853 | /// by default ([`warp_on`], a sequence/frame header bit and a new |
| 11630 | 11854 | /// motion_mode symbol on eligible blocks) and |
| 11631 | - /// [`LEAF_SECOND_NEW_MARGIN`] moved 0.8 -> 1.2. | |
| 11855 | + /// [`LEAF_SECOND_NEW_MARGIN`] moved 0.8 -> 1.2. Re-pinned on lane-av1tpl: | |
| 11856 | + /// every inter frame's superblocks now code at their own lambda | |
| 11857 | + /// ([`TPL_STRENGTH`]), so every RD decision in an inter frame moved. | |
| 11632 | 11858 | #[test] |
| 11633 | 11859 | fn the_encoders_own_streams_are_byte_identical_to_their_pins() { |
| 11634 | 11860 | if !have_ffmpeg() { |
| @@ -11650,7 +11876,7 @@ mod tests { | ||
| 11650 | 11876 | }) |
| 11651 | 11877 | }; |
| 11652 | 11878 | let pins: [(u8, usize, u64); 2] = |
| 11653 | - [(150, 7139, 0x4d35_5d6d_8a54_1c6d), (60, 26461, 0xa52e_1445_7f69_b4c1)]; | |
| 11879 | + [(150, 7128, 0x8ee1_5c87_bdb4_a8c5), (60, 26353, 0x50fc_c10f_9eab_b638)]; | |
| 11654 | 11880 | for (q, bytes, hash) in pins { |
| 11655 | 11881 | let encoded = encode_sequence(&source, q, 0.5).unwrap(); |
| 11656 | 11882 | assert_eq!( |
crates/ec-av1/src/encoder.rsmodified+6 -0
| @@ -803,6 +803,9 @@ impl Av1Encoder { | ||
| 803 | 803 | self.prev2.as_ref(), |
| 804 | 804 | &self.fctx, |
| 805 | 805 | None, |
| 806 | + // The streaming facade holds no lookahead buffer | |
| 807 | + // (lane-av1tpl). | |
| 808 | + None, | |
| 806 | 809 | )? |
| 807 | 810 | }; |
| 808 | 811 | |
| @@ -959,6 +962,9 @@ impl Av1Encoder { | ||
| 959 | 962 | show_frame, |
| 960 | 963 | sign_bias, |
| 961 | 964 | }), |
| 965 | + // The streaming facade holds no lookahead buffer, so the | |
| 966 | + // temporal lambda weighting is off on this path (lane-av1tpl). | |
| 967 | + None, | |
| 962 | 968 | ) }(); |
| 963 | 969 | // Name the pyramid position in any failure: an error out of the tile |
| 964 | 970 | // writer or the filter search is otherwise indistinguishable between |