Lane-arftf report -- strength sweep, window and mid-ARF arms
Browse files at this commitb9d6edbde2615cba3ded5a5e6366e6d95ff6eeb9Parent: 0717f83- docs
- lane-arftf report -- strength sweep, window and mid-ARF arms
1 changed file +116 -0
- lanes/arftf.report.md +116 -0
lanes/arftf.report.mdadded+116 -0
| @@ -0,0 +1,116 @@ | ||
| 1 | +# lane-arftf — the ARF temporal filter's strength, window and level | |
| 2 | + | |
| 3 | +Worktree `edith_codecs-arftf`, branch `lane-arftf` off main `8d9d056b`. | |
| 4 | +Deciding gate `encode::tests::bd_rate_film_long_gop` (48 pictures, both film | |
| 5 | +rows, BD vs libaom `cpu-used 6` / rav1e `speed 6`, lower is better). | |
| 6 | +**Control RUN, not quoted: film A +22.7 / −7.9, film B +79.0 / +2.7 — the | |
| 7 | +charter's numbers to the digit.** | |
| 8 | + | |
| 9 | +lane-arfpred shipped the filter at strength 3 with only that one point on the | |
| 10 | +gate; its two-point probe mispredicted the SIGN of this lever, so every arm | |
| 11 | +here is a gate arm. | |
| 12 | + | |
| 13 | +## 1. Strength sweep — the shipped point moves 3 → 2 | |
| 14 | + | |
| 15 | +| strength | film A | film B | | |
| 16 | +|---|---|---| | |
| 17 | +| 1 | +22.6 / −8.1 | +81.6 / +4.8 | | |
| 18 | +| 2 **(ships)** | **+22.2 / −8.2** | **+78.6 / +2.7** | | |
| 19 | +| 3 (was) | +22.7 / −7.9 | +79.0 / +2.7 | | |
| 20 | +| 5 | +23.9 / −7.4 | +83.6 / +5.1 | | |
| 21 | + | |
| 22 | +Single-peaked and BRACKETED on both sides. 2 is down on all four columns | |
| 23 | +against the shipped 3 (film A −0.5 / −0.3, film B −0.4 / 0.0), which clears | |
| 24 | +the keep rule outright. Both neighbours are worse on the film B libaom | |
| 25 | +column by 2.6 (s1) and 5.0 (s5), so this peak is not a noise artefact. | |
| 26 | + | |
| 27 | +## 2. The ±2 window — the future half is NOT buffered, past-only ±2 loses | |
| 28 | + | |
| 29 | +`Av1Encoder::drain_pending` codes the group's top ARF as the group's LAST | |
| 30 | +picture (`group.last()`), and `encode_frames` pushes into `pending` and drains | |
| 31 | +the whole group before the next picture arrives, so **when the top ARF is | |
| 32 | +coded no picture after it exists in the encoder at all**. `tpl_window(pos, | |
| 33 | +true)` hands it `group[..pos]` reversed — display-PAST neighbours only, up to | |
| 34 | +`tpl_depth() − 1` of them (7 at the default preset). A symmetric ±2 needs a | |
| 35 | +one-group lookahead this encoder does not have; that is the blocker, and it | |
| 36 | +is a picture-buffer change, not a filter change. | |
| 37 | + | |
| 38 | +What IS available is more past, so the charter's fallback was measured: | |
| 39 | +`speed::ARF_TF_WIN` (new, `EC_AV1_ARF_TF_WIN=<n>`) widens the neighbour count | |
| 40 | +from the literal 2 to any n. | |
| 41 | + | |
| 42 | +| window | film A | film B | | |
| 43 | +|---|---|---| | |
| 44 | +| 2 past (ships) | +22.2 / −8.2 | +78.6 / +2.7 | | |
| 45 | +| 4 past (±2 one-sided) | +22.8 / −7.8 | +78.9 / +2.8 | | |
| 46 | + | |
| 47 | +REFUTED on three of the four columns. `arf_pred_census`'s 14.3% SAD removal | |
| 48 | +was measured with two neighbours on EACH side; four pictures of one-sided past | |
| 49 | +is a different window, and the anchor drifts away from the leaves that have to | |
| 50 | +predict from it. | |
| 51 | + | |
| 52 | +## 3. The mid ARF — filtering it a second level down does not pay | |
| 53 | + | |
| 54 | +`speed::ARF_TF_MID` (new, `EC_AV1_ARF_TF_MID=<strength>`) runs the same filter | |
| 55 | +on the group's second hidden frame, whose own window is `tpl_window(at, | |
| 56 | +false)` — the group's LATER leaves, i.e. it filters forward where the top ARF | |
| 57 | +filters backward, and those pictures ARE buffered. | |
| 58 | + | |
| 59 | +| arm | film A | film B | | |
| 60 | +|---|---|---| | |
| 61 | +| top ARF only, s = 2 | +22.2 / −8.2 | +78.6 / +2.7 | | |
| 62 | +| top + mid, both s = 2 | +22.2 / −8.3 | +78.9 / +2.6 | | |
| 63 | + | |
| 64 | +Inside the noise on three columns and 0.3 WORSE on film B's libaom one, so it | |
| 65 | +ships OFF (`ARF_TF_MID = 0`). Deviation from the charter, named: the mid arm | |
| 66 | +was run at strength 2, not 3, because the sweep had already put 2 above 3 at | |
| 67 | +the top level and a 3 there would have confounded the level with the strength. | |
| 68 | + | |
| 69 | +Per-block weight refinement was left alone (charter: out of scope unless | |
| 70 | +one line — it is not). | |
| 71 | + | |
| 72 | +## 4. Guard rows — `bd_rate_screen_native`, 12 pictures, all five rows | |
| 73 | + | |
| 74 | +| clip | control (s = 3) | s = 2 | Δ | | |
| 75 | +|---|---|---|---| | |
| 76 | +| bars 1080p | −2.9 / −18.6 | −3.2 / −18.8 | −0.3 / −0.2 | | |
| 77 | +| bars 2160p | +9.1 / −13.3 | +9.1 / −13.4 | 0.0 / −0.1 | | |
| 78 | +| film A | +18.3 / −6.0 | +18.5 / −5.9 | +0.2 / +0.1 | | |
| 79 | +| film B | +24.6 / −2.1 | +24.6 / −2.0 | 0.0 / +0.1 | | |
| 80 | +| screen capture | +14.6 / −33.2 | +14.6 / −33.2 | byte-identical | | |
| 81 | + | |
| 82 | +Control reproduces the charter's numbers exactly. Nothing moves by more than | |
| 83 | +0.3; the two bars rows actually improve, and the screen sequence codes no | |
| 84 | +pyramid ARF at all so the filter never runs there. | |
| 85 | + | |
| 86 | +## 5. Invariants | |
| 87 | + | |
| 88 | +* Byte pins re-taken (the filtered anchors' pixels move by construction): | |
| 89 | + `(150, 8218 → 8307)`, and `(60, 33017)` keeps its LENGTH with a different | |
| 90 | + hash. Green at the default AND at `EC_AV1_SPEED=6`. | |
| 91 | +* `encoder::tests::bitrate_target_lands_within_5_percent_over_48_frames` is | |
| 92 | + green in the split suite below (it sits near its bound at the rate loop's | |
| 93 | + quantizer floor; `ARF_TF_QMIN = 16` still keeps the filter off there). | |
| 94 | +* Split suite on the shipped default: `--skip stream::` **343 passed / 0 | |
| 95 | + failed**, `stream:: --skip 10bit` **202 passed / 0 failed**, `10bit` | |
| 96 | + **42 passed / 0 failed** (587 in all). | |
| 97 | +* `--ignored --exact | |
| 98 | + encoder::tests::every_speed_preset_decodes_sample_exact_through_both_decoders` | |
| 99 | + 1 passed. | |
| 100 | +* `cargo check --workspace --all-targets -j4`: 0 errors, 0 `ec-av1` warnings | |
| 101 | + (the 25 warnings are `ec-opus` / `ec-vorbis`, pre-existing). | |
| 102 | + | |
| 103 | +## 6. What this lane did NOT do | |
| 104 | + | |
| 105 | +* `deferred: the symmetric ±2 window — the census's best filter shape needs | |
| 106 | + the two DISPLAY-FUTURE neighbours of the top ARF, which the encoder does | |
| 107 | + not hold when it codes it — unblocked by a lane that gives | |
| 108 | + Av1Encoder::drain_pending one group of lookahead (buffer group N+1's | |
| 109 | + sources before coding group N's ARF).` | |
| 110 | +* `deferred: per-block weight refinement (libaom weights each 16x16 block by | |
| 111 | + its own error against each neighbour separately, and uses up to 7 frames) — | |
| 112 | + out of the charter's scope and not a one-liner — unblocked by a lane that | |
| 113 | + ports libaom's temporal_filter weighting.` | |
| 114 | +* `deferred: a mid-ARF strength of its own (only 2 was measured there, and it | |
| 115 | + was flat-to-worse) — unblocked by a lane with spare long-GOP arms; the knob | |
| 116 | + ships wired (EC_AV1_ARF_TF_MID) so the arm is env-only.` |