The top ARF codes its delta_q at 1.5x the preset's strength
Browse files at this commit29220f1a7a91f9256ab918f4863f1d2aa6f6c198Parent: 657e043- feat
- the top ARF codes its delta_q at 1.5x the preset's strength
2 changed files +29 -4
crates/ec-av1/src/encode.rsmodified+6 -1
| @@ -16813,7 +16813,12 @@ mod tests { | |||
| 16813 | // quantizer grid -- and every decision priced against it -- moved | 16813 | // quantizer grid -- and every decision priced against it -- moved |
| 16814 | // (8325 -> 8419 / 33014 -> 33029 on its own base); re-taken once more | 16814 | // (8325 -> 8419 / 33014 -> 33029 on its own base); re-taken once more |
| 16815 | // at the merge of both lanes. | 16815 | // at the merge of both lanes. |
| 16816 | - let pins: [(u8, usize, u64); 2] = [(150, 8252, 0x5b6e40a2b5498988), (60, 33053, 0x9a0abfc234eccc37)]; | 16816 | + // Re-taken on lane-arfq: the top ARF of a mini-GOP codes its |
| 16817 | + // per-superblock `delta_qindex` at 1.5x the preset's strength | ||
| 16818 | + // ([`crate::speed::DQ_LEVEL_K`]), so the hidden frames' quantizer | ||
| 16819 | + // grids -- and every decision priced against them -- moved: | ||
| 16820 | + // 8252 -> 8269 bytes at q=150 and 33053 -> 33044 at q=60. | ||
| 16821 | + let pins: [(u8, usize, u64); 2] = [(150, 8269, 0xf0a10bafe7b45fe2), (60, 33044, 0x077e9c22ff6f41fb)]; | ||
| 16817 | let coded: Vec<(u8, usize, u64)> = pins | 16822 | let coded: Vec<(u8, usize, u64)> = pins |
| 16818 | .iter() | 16823 | .iter() |
| 16819 | .map(|&(q, _, _)| { | 16824 | .map(|&(q, _, _)| { |
crates/ec-av1/src/speed.rsmodified+23 -3
| @@ -342,9 +342,29 @@ pub(crate) const DQ_TPL_K: [f64; 11] = [0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, | |||
| 342 | /// [`crate::encode::DqLevel`] -- `[top ARF, mid ARF, leaf]`. The key frame is | 342 | /// [`crate::encode::DqLevel`] -- `[top ARF, mid ARF, leaf]`. The key frame is |
| 343 | /// absent because it codes no `delta_q` syntax at all. | 343 | /// absent because it codes no `delta_q` syntax at all. |
| 344 | /// | 344 | /// |
| 345 | -/// `EC_AV1_DQ_K=<top>:<mid>:<leaf>` overrides it for an A/B. The default is | 345 | +/// `EC_AV1_DQ_K=<top>:<mid>:<leaf>` overrides it for an A/B. |
| 346 | -/// flat: see `lanes/arfq.report.md` for the sweep this table records. | 346 | +/// |
| 347 | -pub(crate) const DQ_LEVEL_K: [f64; 3] = [1.0, 1.0, 1.0]; | 347 | +/// The top ARF is coded 1.5x the preset's strength (0.375 at preset 0, where |
| 348 | +/// the leaves keep 0.25): it feeds a whole mini-GOP, and the census | ||
| 349 | +/// (`EC_AV1_DQ_CENSUS=1`, film B 48 pictures) says the objective mapping is | ||
| 350 | +/// normalised BY the frame's own dependence ratio, so the top ARF's much | ||
| 351 | +/// higher `r_frame` (2.91 vs the leaves' 1.74) buys it nothing at all -- | ||
| 352 | +/// what a level's strength moves is the CONTRAST inside that frame. Long-GOP | ||
| 353 | +/// gate (48 pictures, BD vs libaom / rav1e): | ||
| 354 | +/// | ||
| 355 | +/// | top-ARF strength | film A | film B | | ||
| 356 | +/// |---|---|---| | ||
| 357 | +/// | 0.25 (flat, control) | +24.0/-7.6 | +85.8/+7.1 | | ||
| 358 | +/// | **0.375** | **+23.5/-8.0** | **+85.3/+6.7** | | ||
| 359 | +/// | 0.5 | +23.0/-8.2 | +86.0/+7.3 | | ||
| 360 | +/// | 0.75 | +22.7/-8.4 | +86.8/+7.8 | | ||
| 361 | +/// | 1.0 | +21.8/-8.9 | +88.7/+9.1 | | ||
| 362 | +/// | ||
| 363 | +/// Film A goes on improving with strength and film B turns at 0.375, which is | ||
| 364 | +/// the last point down on all four columns; 0.5 is also the point where the | ||
| 365 | +/// 12-frame gate hands film B back 0.4 (0.375 costs it 0.1). See | ||
| 366 | +/// `lanes/arfq.report.md`. | ||
| 367 | +pub(crate) const DQ_LEVEL_K: [f64; 3] = [1.5, 1.0, 1.0]; | ||
| 348 | 368 | ||
| 349 | /// `encode::SPLIT_RD_THRESHOLD`: how cheap a block has to be before its split | 369 | /// `encode::SPLIT_RD_THRESHOLD`: how cheap a block has to be before its split |
| 350 | /// trial is withheld. The single biggest wall lever in the tile search. | 370 | /// trial is withheld. The single biggest wall lever in the tile search. |