forge
Explore
Log in

Don't you dare go Hollow

Lane-rdoq report -- instrument table, design, 12-frame gate

Browse files at this commit

0986e5bddc532083503052e73f100ef6e734d37fAhmet Kaan GümüşParent: eb7b07c
  • docs
    • lane-rdoq report -- instrument table, design, 12-frame gate
Show full message
docs(av1): lane-rdoq report -- instrument table, design, 12-frame gate
crates/ec-av1/src/encode.rsmodified+8 -1
@@ -13480,7 +13480,14 @@ mod tests {
13480 let mut wall = 0.0;13480 let mut wall = 0.0;
13481 for &q in &[150u8, 120, 90, 60] {13481 for &q in &[150u8, 120, 90, 60] {
13482 let start = std::time::Instant::now();13482 let start = std::time::Instant::now();
13483- let encoded = encode_sequence_with_ctx(source, q, 0.5, fctx).unwrap();13483+ // lane-rdoq: the deadzone was fitted WITHOUT the RDOQ pass, so
13484+ // the gate has to be able to re-sweep it. 0.5 is the shipped one
13485+ // (`crate::encoder::DEADZONE`).
13486+ let deadzone = std::env::var("EC_AV1_DEADZONE")
13487+ .ok()
13488+ .and_then(|v| v.parse().ok())
13489+ .unwrap_or(0.5);
13490+ let encoded = encode_sequence_with_ctx(source, q, deadzone, fctx).unwrap();
13484 wall += start.elapsed().as_secs_f64();13491 wall += start.elapsed().as_secs_f64();
13485 let decoded = ffmpeg_decode_sequence(&encoded.stream, width, height, source.len());13492 let decoded = ffmpeg_decode_sequence(&encoded.stream, width, height, source.len());
13486 let ours = crate::stream::decode_stream(&encoded.stream).expect("our decoder");13493 let ours = crate::stream::decode_stream(&encoded.stream).expect("our decoder");
lanes/rdoq-dz42.logadded+6 -0
@@ -0,0 +1,6 @@
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+|---|---|---|---|---|
lanes/rdoq-l07.logmodified+40 -0
@@ -4,3 +4,43 @@ test encode::tests::bd_rate_screen_native ...
4 native crop, 12 frames, gop=12; tiles (0, 0), tile threads 1, intrabc false, palette maxcolors 1284 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) |5 | clip | ours PSNR/bytes per point | BD-rate vs libaom | BD-rate vs rav1e | wall ours:libaom:rav1e (noisy) |
6 |---|---|---|---|---|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=17 real=185
9+bars 1080p: motion_mode 32x32 SIMPLE=50342 OBMC=0 WARP=206 | 16x16 SIMPLE=4645 OBMC=0 WARP=465 | 8x8 SIMPLE=17599 OBMC=0 WARP=3022 (0.0% OBMC / 4.8% WARP of 76279 eligible)
10+bars 1080p: inter var-tx depths of 10791 blocks -- leaf single 0=1480 1=1089 (42.4% split) | leaf compound 0=683 1=650 (48.8% split) | 32x32 single 0=735 1=1873 (71.8% split) | 32x32 compound 0=2018 1=2263 (52.9% 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=true blocks 28856 (modes DC=7054 V=3364 H=5198 D157=8711 PAETH=4529)
13+| bars 1080p 1920x1024 | 43.95 dB/209056 B, 47.59 dB/310313 B, 51.02 dB/431567 B, 54.22 dB/581391 B | +0.1% | -15.9% | 166.7s:7.9s:22.1s |
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=178
16+bars 2160p: motion_mode 32x32 SIMPLE=43482 OBMC=0 WARP=259 | 16x16 SIMPLE=3019 OBMC=0 WARP=516 | 8x8 SIMPLE=7998 OBMC=0 WARP=281 (0.0% OBMC / 1.9% WARP of 55555 eligible)
17+bars 2160p: inter var-tx depths of 9056 blocks -- leaf single 0=1221 1=543 (30.8% split) | leaf compound 0=885 1=288 (24.6% split) | 32x32 single 0=353 1=1325 (79.0% split) | 32x32 compound 0=147 1=4294 (96.7% 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=true blocks 13087 (modes DC=3548 V=824 H=2617 D157=4343 PAETH=1755)
20+| bars 2160p 1920x1024 | 43.51 dB/220831 B, 47.51 dB/333369 B, 51.13 dB/446688 B, 54.49 dB/575926 B | +10.9% | -11.4% | 161.0s:6.2s:16.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=20 real=213
23+film A (1080p source): motion_mode 32x32 SIMPLE=46969 OBMC=0 WARP=1946 | 16x16 SIMPLE=17334 OBMC=0 WARP=1855 | 8x8 SIMPLE=4461 OBMC=0 WARP=889 (0.0% OBMC / 6.4% WARP of 73454 eligible)
24+film A (1080p source): inter var-tx depths of 73190 blocks -- leaf single 0=13048 1=2237 (14.6% split) | leaf compound 0=28209 1=4803 (14.5% split) | 32x32 single 0=6979 1=4959 (41.5% split) | 32x32 compound 0=8085 1=4870 (37.6% 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=true blocks 20566 (modes DC=5070 V=3091 H=3922 D157=5883 PAETH=2600)
27+| film A (1080p source) 1920x768 | 44.15 dB/70752 B, 45.74 dB/113043 B, 47.01 dB/194105 B, 48.27 dB/467715 B | +27.6% | +0.3% | 153.2s:10.4s:15.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=19 real=187
30+film B (2160p HDR source): motion_mode 32x32 SIMPLE=55373 OBMC=0 WARP=1355 | 16x16 SIMPLE=10352 OBMC=0 WARP=779 | 8x8 SIMPLE=1571 OBMC=0 WARP=345 (0.0% OBMC / 3.6% WARP of 69775 eligible)
31+film B (2160p HDR source): inter var-tx depths of 65418 blocks -- leaf single 0=12499 1=1810 (12.6% split) | leaf compound 0=25271 1=3661 (12.7% split) | 32x32 single 0=6921 1=4896 (41.4% split) | 32x32 compound 0=6708 1=3652 (35.3% 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=true blocks 13105 (modes DC=3415 V=1767 H=2116 D157=4528 PAETH=1279)
34+| film B (2160p HDR source) 1920x1024 | 46.68 dB/31941 B, 47.97 dB/59344 B, 49.10 dB/129813 B, 50.23 dB/348623 B | +39.5% | +11.6% | 128.4s:22.2s:19.3s |
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=152 real=0
37+screen capture (2026-07-25 02-09-04.mkv): motion_mode 32x32 SIMPLE=23726 OBMC=0 WARP=338 | 16x16 SIMPLE=1593 OBMC=0 WARP=383 | 8x8 SIMPLE=619 OBMC=0 WARP=671 (0.0% OBMC / 5.1% WARP of 27330 eligible)
38+screen capture (2026-07-25 02-09-04.mkv): inter var-tx depths of 16221 blocks -- leaf single 0=2169 1=3148 (59.2% split) | leaf compound 0=975 1=1330 (57.7% split) | 32x32 single 0=2487 1=5141 (67.4% split) | 32x32 compound 0=428 1=543 (55.9% split)
39+screen capture (2026-07-25 02-09-04.mkv): screen frames on=48 off=0 (100.0% on); palette blocks luma 7897 chroma 857; intrabc blocks 0 (searched 0 / valid 0 / won 0)
40+screen capture (2026-07-25 02-09-04.mkv): filter intra on=true blocks 6953 (modes DC=42 V=1986 H=4645 D157=207 PAETH=73)
41+| screen capture (2026-07-25 02-09-04.mkv) 1920x1024 | 45.66 dB/39179 B, 48.37 dB/49225 B, 50.67 dB/61201 B, 52.94 dB/76435 B | +29.6% | -25.5% | 101.0s:11.9s:13.4s |
42+ok
43+
44+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 603 filtered out; finished in 880.48s
45+
46+RC=0
lanes/rdoq-l13.logadded+6 -0
@@ -0,0 +1,6 @@
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+|---|---|---|---|---|
lanes/rdoq-r2.logmodified+45 -0
@@ -4,3 +4,48 @@ test encode::tests::bd_rate_screen_native ...
4 native crop, 12 frames, gop=12; tiles (0, 0), tile threads 1, intrabc false, palette maxcolors 1284 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) |5 | clip | ours PSNR/bytes per point | BD-rate vs libaom | BD-rate vs rav1e | wall ours:libaom:rav1e (noisy) |
6 |---|---|---|---|---|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=17 real=185
9+bars 1080p: rdoq blocks=11259830 coeffs=243326272 (+-1 63.5%, trailing +-1 3.6%) zeroed=5470210 lowered=786604 trial bits 1093274731 -> 1065966524 (-2.50%)
10+bars 1080p: motion_mode 32x32 SIMPLE=50142 OBMC=0 WARP=283 | 16x16 SIMPLE=5006 OBMC=0 WARP=474 | 8x8 SIMPLE=16634 OBMC=0 WARP=3044 (0.0% OBMC / 5.0% WARP of 75583 eligible)
11+bars 1080p: inter var-tx depths of 10786 blocks -- leaf single 0=1588 1=1154 (42.1% split) | leaf compound 0=583 1=626 (51.8% split) | 32x32 single 0=712 1=1890 (72.6% split) | 32x32 compound 0=1988 1=2245 (53.0% split)
12+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)
13+bars 1080p: filter intra on=true blocks 28760 (modes DC=6807 V=3220 H=5385 D157=8687 PAETH=4661)
14+| bars 1080p 1920x1024 | 43.87 dB/205901 B, 47.55 dB/307565 B, 50.99 dB/428574 B, 54.18 dB/577932 B | -0.4% | -16.3% | 169.9s:9.0s:22.7s |
15+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 })
16+bars 2160p: pricer armings default=14 real=176
17+bars 2160p: rdoq blocks=9960545 coeffs=225797515 (+-1 60.9%, trailing +-1 3.5%) zeroed=4420725 lowered=741205 trial bits 1006746036 -> 985746544 (-2.09%)
18+bars 2160p: motion_mode 32x32 SIMPLE=42532 OBMC=0 WARP=180 | 16x16 SIMPLE=2892 OBMC=0 WARP=506 | 8x8 SIMPLE=7853 OBMC=0 WARP=317 (0.0% OBMC / 1.8% WARP of 54280 eligible)
19+bars 2160p: inter var-tx depths of 8885 blocks -- leaf single 0=1169 1=504 (30.1% split) | leaf compound 0=847 1=251 (22.9% split) | 32x32 single 0=355 1=1330 (78.9% split) | 32x32 compound 0=140 1=4289 (96.8% split)
20+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)
21+bars 2160p: filter intra on=true blocks 12507 (modes DC=3378 V=868 H=2555 D157=3895 PAETH=1811)
22+| bars 2160p 1920x1024 | 43.43 dB/216078 B, 47.46 dB/332485 B, 51.09 dB/443004 B, 54.45 dB/574371 B | +10.5% | -11.7% | 161.9s:6.1s:16.9s |
23+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 })
24+film A (1080p source): pricer armings default=20 real=211
25+film A (1080p source): rdoq blocks=30682389 coeffs=124231889 (+-1 68.7%, trailing +-1 14.2%) zeroed=10110721 lowered=540367 trial bits 653763817 -> 586353258 (-10.31%)
26+film A (1080p source): motion_mode 32x32 SIMPLE=47681 OBMC=0 WARP=1902 | 16x16 SIMPLE=16606 OBMC=0 WARP=1693 | 8x8 SIMPLE=4239 OBMC=0 WARP=853 (0.0% OBMC / 6.1% WARP of 72974 eligible)
27+film A (1080p source): inter var-tx depths of 70256 blocks -- leaf single 0=12755 1=2096 (14.1% split) | leaf compound 0=26968 1=4438 (14.1% split) | 32x32 single 0=6838 1=5003 (42.3% split) | 32x32 compound 0=7553 1=4605 (37.9% split)
28+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)
29+film A (1080p source): filter intra on=true blocks 20284 (modes DC=4964 V=2991 H=3721 D157=5880 PAETH=2728)
30+| film A (1080p source) 1920x768 | 44.11 dB/69530 B, 45.69 dB/110687 B, 46.98 dB/188914 B, 48.25 dB/452101 B | +26.3% | -0.5% | 158.7s:10.7s:15.8s |
31+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 })
32+film B (2160p HDR source): pricer armings default=19 real=190
33+film B (2160p HDR source): rdoq blocks=28563479 coeffs=68533899 (+-1 78.1%, trailing +-1 17.6%) zeroed=8085091 lowered=307421 trial bits 390011300 -> 331638448 (-14.97%)
34+film B (2160p HDR source): motion_mode 32x32 SIMPLE=58186 OBMC=0 WARP=1635 | 16x16 SIMPLE=9860 OBMC=0 WARP=780 | 8x8 SIMPLE=1636 OBMC=0 WARP=312 (0.0% OBMC / 3.8% WARP of 72409 eligible)
35+film B (2160p HDR source): inter var-tx depths of 61962 blocks -- leaf single 0=12285 1=1725 (12.3% split) | leaf compound 0=23852 1=3265 (12.0% split) | 32x32 single 0=6611 1=4652 (41.3% split) | 32x32 compound 0=6205 1=3367 (35.2% split)
36+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)
37+film B (2160p HDR source): filter intra on=true blocks 13232 (modes DC=3468 V=1788 H=2123 D157=4419 PAETH=1434)
38+| film B (2160p HDR source) 1920x1024 | 46.65 dB/31097 B, 47.94 dB/57392 B, 49.06 dB/123574 B, 50.20 dB/334775 B | +37.5% | +9.7% | 134.1s:25.6s:17.5s |
39+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
40+screen capture (2026-07-25 02-09-04.mkv): pricer armings default=152 real=0
41+screen capture (2026-07-25 02-09-04.mkv): rdoq blocks=13924721 coeffs=89750156 (+-1 61.8%, trailing +-1 6.8%) zeroed=3447315 lowered=247787 trial bits 437139390 -> 413934549 (-5.31%)
42+screen capture (2026-07-25 02-09-04.mkv): motion_mode 32x32 SIMPLE=23119 OBMC=0 WARP=333 | 16x16 SIMPLE=1398 OBMC=0 WARP=313 | 8x8 SIMPLE=518 OBMC=0 WARP=627 (0.0% OBMC / 4.8% WARP of 26308 eligible)
43+screen capture (2026-07-25 02-09-04.mkv): inter var-tx depths of 14001 blocks -- leaf single 0=2075 1=2719 (56.7% split) | leaf compound 0=691 1=949 (57.9% split) | 32x32 single 0=2122 1=4679 (68.8% split) | 32x32 compound 0=251 1=515 (67.2% split)
44+screen capture (2026-07-25 02-09-04.mkv): screen frames on=48 off=0 (100.0% on); palette blocks luma 8735 chroma 966; intrabc blocks 0 (searched 0 / valid 0 / won 0)
45+screen capture (2026-07-25 02-09-04.mkv): filter intra on=true blocks 7153 (modes DC=72 V=2090 H=4705 D157=215 PAETH=71)
46+| screen capture (2026-07-25 02-09-04.mkv) 1920x1024 | 45.57 dB/38841 B, 48.32 dB/49046 B, 50.58 dB/60521 B, 52.86 dB/75609 B | +29.1% | -25.7% | 104.6s:9.2s:11.9s |
47+ok
48+
49+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 603 filtered out; finished in 898.70s
50+
51+RC=0
lanes/rdoq.report.mdadded+70 -0
@@ -0,0 +1,70 @@
1+# lane-rdoq — rate-distortion optimised quantisation
2+
3+Head: off main `bfb88c88`. Scope: the coefficient quantiser and its two call
4+sites in the search; no decoder change.
5+
6+## What was missing
7+
8+`transform::quantize` rounded every coefficient on its own with a fixed
9+deadzone, blind to what the level costs through the coefficient CDFs. Every
10+reference has the pass that decides that against the entropy coder (libaom
11+`av1_optimize_txb`, rav1e `optimize_txb`). Coefficient bits are 53.6% of our
12+stream (`lanes/census-longgop-v2.md`).
13+
14+## Instrument — what the quantiser hands the pass (`EC_AV1_RDOQ_CENSUS=1`)
15+
16+Over every TRIAL block of a 12-frame native-gate row (four quantizers), i.e.
17+the bits at stake inside the search, not in the bitstream:
18+
19+| row | blocks | coded coeffs | +-1 | trailing +-1 | zeroed by RDOQ | lowered | trial bits |
20+|---|---|---|---|---|---|---|---|
21+| bars 1080p | 11.26 M | 243.3 M | 63.5% | 3.6% | 5.47 M | 0.79 M | -2.50% |
22+| bars 2160p | 9.96 M | 225.8 M | 60.9% | 3.5% | 4.42 M | 0.74 M | -2.09% |
23+| film A | 30.68 M | 124.2 M | 68.7% | 14.2% | 10.11 M | 0.54 M | -10.31% |
24+| film B | 28.56 M | 68.5 M | 78.1% | 17.6% | 8.09 M | 0.31 M | -14.97% |
25+| screen | 13.92 M | 89.8 M | 61.8% | 6.8% | 3.45 M | 0.25 M | -5.31% |
26+
27+Two thirds to four fifths of every coded coefficient is a `+-1`, and on the
28+two real films one coefficient in six is a `+-1` sitting in the run at the END
29+of the scan -- the levels an eob-shortening pass takes back whole.
30+
31+## The pass (`tile::rdoq`)
32+
33+* candidates per coefficient `{level, level-1, ..., 0}`, one step at a time,
34+ walked in REVERSE scan order so the tail is decided first and a dropped tail
35+ is retried against the shorter eob it leaves;
36+* every candidate priced by re-coding the whole block through `coeff_bits` --
37+ the same CDFs, q-context, neighbour `skip_ctx`/`sign_ctx` and `write_coeffs`
38+ the search already prices with and the writer will code with, so no second
39+ cost model can drift from the writer;
40+* distortion in the transform domain, mirroring the dequantizer: a level's
41+ pixel-domain error is `(coeff - level * q) / 8`
42+ (`INVERSE_GAIN_RECIPROCAL`), so `step^2 = (ac_q/8)^2` divides out of every
43+ comparison and the DC's `(dc_q/ac_q)^2` is the only per-position weight;
44+* lambda = the search's own `LAMBDA_SCALE` in those units
45+ (`EC_AV1_RDOQ_LAMBDA` multiplies it);
46+* run INSIDE the trial loop: the reconstruction, the price the search ranks by
47+ and the levels the writer takes are all the pass's grid, so the search
48+ decides on RDOQ'd blocks.
49+
50+Bounded, because a candidate here costs a whole `write_coeffs` where rav1e's
51+incremental model costs a table lookup: levels above 2 are never candidates,
52+and a block spends at most 24 prices, taken from the tail backwards
53+(`EC_AV1_RDOQ_MAXLEVEL` / `EC_AV1_RDOQ_BUDGET`). Unbounded the q=150 pin is
54+9853 -> 8959 B at +256% wall on that clip; bounded it is 9059 B at +26%.
55+
56+## 12-frame `bd_rate_screen_native` (1920-wide crops, 4 quantizers, vs libaom cpu-used 6 / rav1e speed 6)
57+
58+| row | control (`EC_AV1_RDOQ=0`) | RDOQ, lambda x1.0 | lambda x0.7 |
59+|---|---|---|---|
60+| bars 1080p | +2.2 / -14.0 | -0.4 / -16.3 | +0.1 / -15.9 |
61+| bars 2160p | +12.7 / -9.8 | +10.5 / -11.7 | +10.9 / -11.4 |
62+| film A | +37.1 / +7.3 | **+26.3 / -0.5** | +27.6 / +0.3 |
63+| film B | +52.5 / +22.3 | **+37.5 / +9.7** | +39.5 / +11.6 |
64+| screen | +33.4 / -23.8 | **+29.1 / -25.7** | +29.6 / -25.5 |
65+
66+The control row-for-row reproduces the charter's numbers on this head, so the
67+baseline is not stale. The keep rule (both film rows down on both columns,
68+screen not worse by 0.3) passes with room: film A -10.8 / -7.8, film B
69+-15.0 / -12.6, and the screen capture comes DOWN on both columns too.
70+lambda x0.7 is worse than x1.0 on every row.