forge
Explore
Log in

Don't you dare go Hollow

RDOQ on to preset 6

Browse files at this commit

4e24be37e5849bbea28f47cf76dac63588f1f6e1Ahmet Kaan GümüşParent: eeae32a
  • feat
    • RDOQ on to preset 6
    • re-pin the encoder's own streams
Show full message
feat(av1): RDOQ on to preset 6; re-pin the encoder's own streams

Preset-6 gate says it dominates the ladder (preset 6 with RDOQ beats preset 0
without it on every row and both columns, at less wall), so the lever is on to
6 and withheld from the unmeasured real-time rungs. Pins 9853 -> 8618 at q=150
and 35866 -> 33339 at q=60; EC_AV1_RDOQ=0 restores both.
crates/ec-av1/src/encode.rsmodified+6 -1
@@ -13747,8 +13747,13 @@ mod tests {
1374713747 // (`crate::encoder::arf_altref`) instead of the key frame it already
1374813748 // reads as `GOLDEN` -- 9859 -> 9853 at q=150 and 35904 -> 35866 at
1374913749 // q=60. `EC_AV1_ARF_ALTREF=0` restores these.
13750+ // Re-taken on lane-rdoq: the coefficient quantiser runs the
13751+ // rate-distortion pass ([`crate::tile::rdoq`]) now, so every block of
13752+ // these four pictures codes the levels that pass settled on -- 9853
13753+ // -> 8618 at q=150 and 35866 -> 33339 at q=60. `EC_AV1_RDOQ=0`
13754+ // restores 9853 / 35866.
1375013755 let pins: [(u8, usize, u64); 2] =
13751- [(150, 9853, 0x0f6d_bbc8_b72c_ceb3), (60, 35866, 0xbd00_f4ed_e283_3ce4)];
13756+ [(150, 8618, 0xc238_83cc_3cfc_bb3e), (60, 33339, 0xfff4_a39f_0cd8_285f)];
1375213757 for (q, bytes, hash) in pins {
1375313758 let encoded = encode_sequence(&source, q, 0.5).unwrap();
1375413759 assert_eq!(
crates/ec-av1/src/speed.rsmodified+17 -3
@@ -170,10 +170,24 @@ pub(crate) fn at<T: Copy>(table: &[T; 11]) -> T {
170170 pub(crate) const B64_ROOT: [bool; 11] = [crate::encode::B64_ROOT; 11];
171171
172172 /// `encode::rdoq_on`: rate-distortion optimised quantisation
173-/// ([`crate::tile::rdoq`], lane-rdoq). Provisional table -- the wall/BD
174-/// measurement per preset is in `lanes/rdoq.report.md`.
173+/// ([`crate::tile::rdoq`], lane-rdoq). MEASURED at both ends of the range on
174+/// the 12-frame native gate (BD vs libaom `cpu-used 6` / rav1e `speed 6`,
175+/// our wall):
176+///
177+/// | row | preset 0 off | preset 0 on | preset 6 off | preset 6 on |
178+/// |---|---|---|---|---|
179+/// | film A | +37.1 / +7.3 (77s) | +24.4 / -1.8 (138s) | +46.0 / +14.5 (32s) | +30.4 / +2.9 (60s) |
180+/// | film B | +52.5 / +22.3 (78s) | +35.5 / +7.6 (130s) | +67.8 / +35.0 (30s) | +43.5 / +14.2 (51s) |
181+/// | screen | +33.4 / -23.8 (45s) | +28.1 / -25.7 (79s) | +40.3 / -20.0 (15s) | +34.9 / -22.0 (34s) |
182+///
183+/// It costs about 2x wall and pays at BOTH ends, and it DOMINATES the ladder:
184+/// preset 6 with it on is better than preset 0 with it off on every row and
185+/// on both columns, at less wall. So it is on up to preset 6. The top rungs
186+/// (7..=10) are the real-time ones and are UNMEASURED here, so they keep the
187+/// cheaper choice rather than an assumed one; `EC_AV1_RDOQ=1` turns it on
188+/// there.
175189 pub(crate) const RDOQ: [bool; 11] = [
176- true, true, true, false, false, false, false, false, false, false, false,
190+ true, true, true, true, true, true, true, false, false, false, false,
177191 ];
178192
179193 /// `encode::SPLIT_RD_THRESHOLD`: how cheap a block has to be before its split
lanes/rdoq-lgop.logmodified+7 -0
@@ -4,3 +4,10 @@ test encode::tests::bd_rate_film_long_gop ...
44 native crop, 48 frames, gop=48; tiles (0, 0), tile threads 1, intrabc false, palette maxcolors 128
55 | clip | ours PSNR/bytes per point | BD-rate vs libaom | BD-rate vs rav1e | wall ours:libaom:rav1e (noisy) |
66 |---|---|---|---|---|
7+film A (1080p source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
8+film A (1080p source): pricer armings default=20 real=895
9+film A (1080p source): motion_mode 32x32 SIMPLE=192900 OBMC=0 WARP=7450 | 16x16 SIMPLE=57575 OBMC=0 WARP=6884 | 8x8 SIMPLE=24687 OBMC=0 WARP=3239 (0.0% OBMC / 6.0% WARP of 292735 eligible)
10+film A (1080p source): inter var-tx depths of 259566 blocks -- leaf single 0=42208 1=6041 (12.5% split) | leaf compound 0=105604 1=17598 (14.3% split) | 32x32 single 0=23152 1=14905 (39.2% split) | 32x32 compound 0=30637 1=19421 (38.8% split)
11+film A (1080p source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
12+film A (1080p source): filter intra on=true blocks 92991 (modes DC=21700 V=14106 H=18102 D157=25835 PAETH=13248)
13+| film A (1080p source) 1920x768 | 43.99 dB/188841 B, 45.66 dB/321714 B, 46.92 dB/542939 B, 48.11 dB/1196594 B | +29.4% | -3.9% | 575.7s:41.6s:60.6s |
lanes/rdoq-s6off.logadded+46 -0
@@ -0,0 +1,46 @@
1+
2+running 1 test
3+test encode::tests::bd_rate_screen_native ...
4+native crop, 12 frames, gop=12; tiles (0, 0), tile threads 1, intrabc false, palette maxcolors 128
5+| clip | ours PSNR/bytes per point | BD-rate vs libaom | BD-rate vs rav1e | wall ours:libaom:rav1e (noisy) |
6+|---|---|---|---|---|
7+bars 1080p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
8+bars 1080p: pricer armings default=14 real=155
9+bars 1080p: motion_mode 32x32 SIMPLE=0 OBMC=0 WARP=0 | 16x16 SIMPLE=0 OBMC=0 WARP=0 | 8x8 SIMPLE=0 OBMC=0 WARP=0 (0.0% OBMC / 0.0% WARP of 0 eligible)
10+bars 1080p: inter var-tx depths of 0 blocks -- leaf single 0=0 1=0 (0.0% split) | leaf compound 0=0 1=0 (0.0% split) | 32x32 single 0=0 1=0 (0.0% split) | 32x32 compound 0=0 1=0 (0.0% split)
11+bars 1080p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
12+bars 1080p: filter intra on=false blocks 0 (modes DC=0 V=0 H=0 D157=0 PAETH=0)
13+| bars 1080p 1920x1024 | 41.95 dB/270702 B, 45.99 dB/457826 B, 49.74 dB/646368 B, 53.19 dB/853166 B | +73.4% | +45.9% | 26.7s:10.8s:27.9s |
14+bars 2160p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
15+bars 2160p: pricer armings default=14 real=155
16+bars 2160p: motion_mode 32x32 SIMPLE=0 OBMC=0 WARP=0 | 16x16 SIMPLE=0 OBMC=0 WARP=0 | 8x8 SIMPLE=0 OBMC=0 WARP=0 (0.0% OBMC / 0.0% WARP of 0 eligible)
17+bars 2160p: inter var-tx depths of 0 blocks -- leaf single 0=0 1=0 (0.0% split) | leaf compound 0=0 1=0 (0.0% split) | 32x32 single 0=0 1=0 (0.0% split) | 32x32 compound 0=0 1=0 (0.0% split)
18+bars 2160p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
19+bars 2160p: filter intra on=false blocks 0 (modes DC=0 V=0 H=0 D157=0 PAETH=0)
20+| bars 2160p 1920x1024 | 42.18 dB/277456 B, 46.12 dB/442877 B, 49.96 dB/619605 B, 53.64 dB/805687 B | +69.0% | +34.4% | 24.2s:7.0s:19.9s |
21+film A (1080p source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
22+film A (1080p source): pricer armings default=16 real=175
23+film A (1080p source): motion_mode 32x32 SIMPLE=0 OBMC=0 WARP=0 | 16x16 SIMPLE=0 OBMC=0 WARP=0 | 8x8 SIMPLE=0 OBMC=0 WARP=0 (0.0% OBMC / 0.0% WARP of 0 eligible)
24+film A (1080p source): inter var-tx depths of 0 blocks -- leaf single 0=0 1=0 (0.0% split) | leaf compound 0=0 1=0 (0.0% split) | 32x32 single 0=0 1=0 (0.0% split) | 32x32 compound 0=0 1=0 (0.0% split)
25+film A (1080p source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
26+film A (1080p source): filter intra on=false blocks 0 (modes DC=0 V=0 H=0 D157=0 PAETH=0)
27+| film A (1080p source) 1920x768 | 43.99 dB/74036 B, 45.60 dB/124285 B, 46.93 dB/216333 B, 48.20 dB/511129 B | +46.0% | +14.5% | 31.9s:10.3s:16.3s |
28+film B (2160p HDR source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
29+film B (2160p HDR source): pricer armings default=16 real=159
30+film B (2160p HDR source): motion_mode 32x32 SIMPLE=0 OBMC=0 WARP=0 | 16x16 SIMPLE=0 OBMC=0 WARP=0 | 8x8 SIMPLE=0 OBMC=0 WARP=0 (0.0% OBMC / 0.0% WARP of 0 eligible)
31+film B (2160p HDR source): inter var-tx depths of 0 blocks -- leaf single 0=0 1=0 (0.0% split) | leaf compound 0=0 1=0 (0.0% split) | 32x32 single 0=0 1=0 (0.0% split) | 32x32 compound 0=0 1=0 (0.0% split)
32+film B (2160p HDR source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
33+film B (2160p HDR source): filter intra on=false blocks 0 (modes DC=0 V=0 H=0 D157=0 PAETH=0)
34+| film B (2160p HDR source) 1920x1024 | 46.52 dB/34162 B, 47.86 dB/69448 B, 49.05 dB/148408 B, 50.21 dB/392984 B | +67.8% | +35.0% | 29.9s:21.5s:16.8s |
35+screen capture (2026-07-25 02-09-04.mkv): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective None
36+screen capture (2026-07-25 02-09-04.mkv): pricer armings default=150 real=0
37+screen capture (2026-07-25 02-09-04.mkv): motion_mode 32x32 SIMPLE=0 OBMC=0 WARP=0 | 16x16 SIMPLE=0 OBMC=0 WARP=0 | 8x8 SIMPLE=0 OBMC=0 WARP=0 (0.0% OBMC / 0.0% WARP of 0 eligible)
38+screen capture (2026-07-25 02-09-04.mkv): inter var-tx depths of 0 blocks -- leaf single 0=0 1=0 (0.0% split) | leaf compound 0=0 1=0 (0.0% split) | 32x32 single 0=0 1=0 (0.0% split) | 32x32 compound 0=0 1=0 (0.0% split)
39+screen capture (2026-07-25 02-09-04.mkv): screen frames on=48 off=0 (100.0% on); palette blocks luma 6931 chroma 1319; intrabc blocks 0 (searched 0 / valid 0 / won 0)
40+screen capture (2026-07-25 02-09-04.mkv): filter intra on=false blocks 0 (modes DC=0 V=0 H=0 D157=0 PAETH=0)
41+| screen capture (2026-07-25 02-09-04.mkv) 1920x1024 | 45.67 dB/41570 B, 48.41 dB/52646 B, 50.68 dB/66384 B, 52.82 dB/82870 B | +40.3% | -20.0% | 14.5s:10.6s:13.1s |
42+ok
43+
44+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 603 filtered out; finished in 309.81s
45+
46+RC=0
lanes/rdoq-s6on.logmodified+40 -0
@@ -4,3 +4,43 @@ test encode::tests::bd_rate_screen_native ...
44 native crop, 12 frames, gop=12; tiles (0, 0), tile threads 1, intrabc false, palette maxcolors 128
55 | clip | ours PSNR/bytes per point | BD-rate vs libaom | BD-rate vs rav1e | wall ours:libaom:rav1e (noisy) |
66 |---|---|---|---|---|
7+bars 1080p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
8+bars 1080p: pricer armings default=14 real=155
9+bars 1080p: motion_mode 32x32 SIMPLE=0 OBMC=0 WARP=0 | 16x16 SIMPLE=0 OBMC=0 WARP=0 | 8x8 SIMPLE=0 OBMC=0 WARP=0 (0.0% OBMC / 0.0% WARP of 0 eligible)
10+bars 1080p: inter var-tx depths of 0 blocks -- leaf single 0=0 1=0 (0.0% split) | leaf compound 0=0 1=0 (0.0% split) | 32x32 single 0=0 1=0 (0.0% split) | 32x32 compound 0=0 1=0 (0.0% split)
11+bars 1080p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
12+bars 1080p: filter intra on=false blocks 0 (modes DC=0 V=0 H=0 D157=0 PAETH=0)
13+| bars 1080p 1920x1024 | 41.49 dB/223627 B, 45.59 dB/427038 B, 49.51 dB/627517 B, 53.03 dB/822694 B | +68.7% | +40.5% | 90.2s:7.1s:17.6s |
14+bars 2160p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
15+bars 2160p: pricer armings default=14 real=155
16+bars 2160p: motion_mode 32x32 SIMPLE=0 OBMC=0 WARP=0 | 16x16 SIMPLE=0 OBMC=0 WARP=0 | 8x8 SIMPLE=0 OBMC=0 WARP=0 (0.0% OBMC / 0.0% WARP of 0 eligible)
17+bars 2160p: inter var-tx depths of 0 blocks -- leaf single 0=0 1=0 (0.0% split) | leaf compound 0=0 1=0 (0.0% split) | 32x32 single 0=0 1=0 (0.0% split) | 32x32 compound 0=0 1=0 (0.0% split)
18+bars 2160p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
19+bars 2160p: filter intra on=false blocks 0 (modes DC=0 V=0 H=0 D157=0 PAETH=0)
20+| bars 2160p 1920x1024 | 41.77 dB/235891 B, 45.76 dB/414770 B, 49.65 dB/592370 B, 53.45 dB/787194 B | +63.9% | +29.3% | 81.0s:6.4s:17.2s |
21+film A (1080p source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
22+film A (1080p source): pricer armings default=16 real=170
23+film A (1080p source): motion_mode 32x32 SIMPLE=0 OBMC=0 WARP=0 | 16x16 SIMPLE=0 OBMC=0 WARP=0 | 8x8 SIMPLE=0 OBMC=0 WARP=0 (0.0% OBMC / 0.0% WARP of 0 eligible)
24+film A (1080p source): inter var-tx depths of 0 blocks -- leaf single 0=0 1=0 (0.0% split) | leaf compound 0=0 1=0 (0.0% split) | 32x32 single 0=0 1=0 (0.0% split) | 32x32 compound 0=0 1=0 (0.0% split)
25+film A (1080p source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
26+film A (1080p source): filter intra on=false blocks 0 (modes DC=0 V=0 H=0 D157=0 PAETH=0)
27+| film A (1080p source) 1920x768 | 43.66 dB/63290 B, 45.31 dB/101375 B, 46.70 dB/167805 B, 48.02 dB/400919 B | +30.4% | +2.9% | 60.1s:10.5s:14.9s |
28+film B (2160p HDR source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
29+film B (2160p HDR source): pricer armings default=15 real=157
30+film B (2160p HDR source): motion_mode 32x32 SIMPLE=0 OBMC=0 WARP=0 | 16x16 SIMPLE=0 OBMC=0 WARP=0 | 8x8 SIMPLE=0 OBMC=0 WARP=0 (0.0% OBMC / 0.0% WARP of 0 eligible)
31+film B (2160p HDR source): inter var-tx depths of 0 blocks -- leaf single 0=0 1=0 (0.0% split) | leaf compound 0=0 1=0 (0.0% split) | 32x32 single 0=0 1=0 (0.0% split) | 32x32 compound 0=0 1=0 (0.0% split)
32+film B (2160p HDR source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
33+film B (2160p HDR source): filter intra on=false blocks 0 (modes DC=0 V=0 H=0 D157=0 PAETH=0)
34+| film B (2160p HDR source) 1920x1024 | 46.33 dB/27609 B, 47.64 dB/50415 B, 48.84 dB/106427 B, 50.00 dB/285711 B | +43.5% | +14.2% | 51.1s:22.7s:19.5s |
35+screen capture (2026-07-25 02-09-04.mkv): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective None
36+screen capture (2026-07-25 02-09-04.mkv): pricer armings default=150 real=0
37+screen capture (2026-07-25 02-09-04.mkv): motion_mode 32x32 SIMPLE=0 OBMC=0 WARP=0 | 16x16 SIMPLE=0 OBMC=0 WARP=0 | 8x8 SIMPLE=0 OBMC=0 WARP=0 (0.0% OBMC / 0.0% WARP of 0 eligible)
38+screen capture (2026-07-25 02-09-04.mkv): inter var-tx depths of 0 blocks -- leaf single 0=0 1=0 (0.0% split) | leaf compound 0=0 1=0 (0.0% split) | 32x32 single 0=0 1=0 (0.0% split) | 32x32 compound 0=0 1=0 (0.0% split)
39+screen capture (2026-07-25 02-09-04.mkv): screen frames on=48 off=0 (100.0% on); palette blocks luma 6956 chroma 1305; intrabc blocks 0 (searched 0 / valid 0 / won 0)
40+screen capture (2026-07-25 02-09-04.mkv): filter intra on=false blocks 0 (modes DC=0 V=0 H=0 D157=0 PAETH=0)
41+| screen capture (2026-07-25 02-09-04.mkv) 1920x1024 | 45.08 dB/39630 B, 47.98 dB/49482 B, 50.13 dB/60751 B, 52.35 dB/75439 B | +34.9% | -22.0% | 33.9s:10.4s:13.5s |
42+ok
43+
44+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 603 filtered out; finished in 478.83s
45+
46+RC=0