From b939e05aa5a60bf5f61c12a318a6280ed21beeb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sun, 23 Aug 2026 19:10:29 +0300 Subject: [PATCH] docs(lane): record the three swept decision constants Chroma cost, the intra penalty in P pictures and the P_Skip rebate, with the per-QP rows showing the intra penalty was not a rate-quality trade, and why the synthetic fixture now disagrees in sign. --- lanes/h264x264-r1.report.md | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/lanes/h264x264-r1.report.md b/lanes/h264x264-r1.report.md index c902b4b9..b25ca8c6 100644 --- a/lanes/h264x264-r1.report.md +++ b/lanes/h264x264-r1.report.md @@ -152,3 +152,57 @@ Synthetic default -5.202 -> -5.140 dB, floor retightened to -5.25. Full `ec-h264 The same RD treatment has not been applied to Intra_8x8 mode selection, `choose_chroma_mode`, or `choose_inter` (still SATD + `motion_rate`). Those are the rest of the ~1.4 dB the `subme=1` ablation priced. P_8x8 sub-partitions remain unmeasured. + +## Round 3 -- the thumbs on the scale (main 81d18a3, 9268484, ff0baca) + + Three constants in the macroblock decision were checked by sweeping them. Two were wrong, + and one of them was worth more than everything in rounds 1 and 2 put together. + + **Chroma mode (81d18a3).** Picked on SAD with no rate term while everything else costs on + SATD. SATD plus the mode's ue(v) signalling, at no measurable time: + + | clip | all-intra | GOP 10 | + |---|---|---| + | 3840x1608 film | -0.620 -> -0.535 dB | -1.495 -> -1.404 dB | + | 2560x1440 screen capture | -0.231 -> -0.197 dB | -0.062 -> -0.033 dB | + + **The intra penalty in P pictures (9268484).** The comparison added eight bits to the intra + side, for "an intra macroblock also costs the next picture's prediction quality". Sweeping it: + + | penalty (bits) | film GOP 10 | + |---|---| + | 32 | -3.065 dB | + | 16 | -1.940 dB | + | 8 (what it was) | -1.404 dB | + | 4 | -0.704 dB | + | 0 | **-0.233 dB** | + | -1 / -2 / -4 / -8 | -0.140 / -0.113 / -0.106 / -0.115 dB | + + Zero is the flat part of the curve, not a tuned value. Per-QP, it is not a rate-quality + trade at all -- the unpenalised encoder is *smaller and better at every QP*: + + | QP | penalty 8 | penalty 0 | + |---|---|---| + | 22 | 23313152 b, 55.48 dB | 23253064 b, 55.63 dB | + | 26 | 16041512 b, 51.94 dB | 15986488 b, 52.93 dB | + | 30 | 11411616 b, 48.26 dB | 11360328 b, 49.73 dB | + | 34 | 8086824 b, 46.05 dB | 8035984 b, 47.28 dB | + + The suppressed intra macroblocks were what stopped drift accumulating across the GOP. + + **The P_Skip rebate (ff0baca).** Four bits, swept to 0/2/4/8: film reads + -0.113 / -0.110 / -0.233 / -0.708 dB. Set to two, the top of the flat region, since skipping + does save signalling. + + Where the film clip stands after the three: **-0.110 dB at GOP 10** (from -2.992 dB when the + lane opened) and the screen capture is **+0.068 dB**, i.e. ahead of x264. + +### The synthetic gate clip now disagrees in sign + + Removing the intra penalty costs the 352x288 `render_smooth` fixture 0.41 dB (-5.291 -> + -5.702), and the floor moved -5.40 -> -5.75. It spends 5% more bits for the same quality + there: smooth ramps are exactly what inter prediction is best at, so any intra macroblock in + a P picture is waste, and a SATD comparison cannot see that. Two contents disagreeing in + sign is the signal that this decision belongs on real coded cost -- both branches already + compute SSD-plus-real-bits internally (`intra_mb_bits`, `inter_mb_bits`), so the next slice + is to compare them there instead of tuning the threshold back toward the fixture.