docs(av1444edge) r3: the flag sweep the superres cell needed -- 7 of 29 combinations scale, and the verdict comes from the parsed header
Browse files at this commitc3f7cbf4d41228f7fd2ed4a8b7c3cac774d9224dParent: 2bc3af61 changed file +125 -0
- lanes/av1444edge.report.md +125 -0
lanes/av1444edge.report.mdmodified+125 -0
| @@ -481,3 +481,128 @@ both fixtures (§7); arm A is 11521 and 76404 samples off (§1). | |||
| 481 | 481 | ||
| 482 | Cleanup: `git worktree remove --force ~/.cache/wt/av1444fork` and | 482 | Cleanup: `git worktree remove --force ~/.cache/wt/av1444fork` and |
| 483 | `rm -rf ~/.cache/cargo-target-forkA ~/.cache/cargo-target-forkB`. | 483 | `rm -rf ~/.cache/cargo-target-forkA ~/.cache/cargo-target-forkB`. |
| 484 | + | ||
| 485 | +--- | ||
| 486 | + | ||
| 487 | +## 11. Appendix r3 — the 4:4:4 superres cell is REAL, and how to tell | ||
| 488 | + | ||
| 489 | +Main relayed a measurement from lane-av1gates444 that 256x128 is | ||
| 490 | +byte-identical with and without `--superres-mode=1`, and asked whether ANY | ||
| 491 | +aomenc recipe on this build can produce a stream whose PARSED header | ||
| 492 | +carries superres. Both are right, about different recipes, and the | ||
| 493 | +distinction is the deliverable. | ||
| 494 | + | ||
| 495 | +### 11a. The flag sweep: attempted flags -> PARSED denom | ||
| 496 | + | ||
| 497 | +Build: `~/.cache/aom-oracle/build/aomenc`, libaom `v3.13.3-7-g9bb526a` | ||
| 498 | +(oracle snapshot; `--version` is not an accepted flag on this build, so the | ||
| 499 | +version comes from the source tree the binary is built from). Common | ||
| 500 | +recipe, 256x128 yuv444p `testsrc2=size=256x128:rate=25 -frames:v 4`, with | ||
| 501 | +`--profile=1 --passes=1 --end-usage=q --cq-level=20 --cpu-used=2 | ||
| 502 | +--threads=1 --row-mt=0 --lag-in-frames=0 --kf-max-dist=100 --limit=4`. | ||
| 503 | +Every row's verdict is read from the stream's OWN parsed frame header, not | ||
| 504 | +from the flag. | ||
| 505 | + | ||
| 506 | +```text | ||
| 507 | +verdict | flags | parsed FH0 | sha256 | ||
| 508 | +no-op | (none, control) | frame=256x128 upscaled=256 use_superres=false denom=8 | 06621606 | ||
| 509 | +no-op | superres-mode=1 (no denom) | frame=256x128 upscaled=256 use_superres=false denom=8 | 06621606 | ||
| 510 | +SCALED | superres-mode=1 den=9 | frame=228x128 upscaled=256 use_superres=true denom=9 | 3d619ee0 | ||
| 511 | +SCALED | superres-mode=1 den=12 | frame=171x128 upscaled=256 use_superres=true denom=12 | 450caa3e | ||
| 512 | +SCALED | superres-mode=1 den=16 | frame=128x128 upscaled=256 use_superres=true denom=16 | 194450c4 | ||
| 513 | +SCALED | superres-mode=2 (no denom) | frame=186x128 upscaled=256 use_superres=true denom=11 | c18496cf | ||
| 514 | +SCALED | superres-mode=2 den=9/12/16 | frame=186x128 upscaled=256 use_superres=true denom=11 | c18496cf | ||
| 515 | +no-op | superres-mode=3, all den | frame=256x128 upscaled=256 use_superres=false denom=8 | 8dafaf38 | ||
| 516 | +no-op | superres-mode=4, all den | frame=256x128 upscaled=256 use_superres=false denom=8 | 8dafaf38 | ||
| 517 | +no-op | resize-mode=1,2,3 any den | frame=256x128 upscaled=256 use_superres=false denom=8 | 06621606 | ||
| 518 | +``` | ||
| 519 | + | ||
| 520 | +**7 of 29 combinations produce a real scaled stream.** Three findings | ||
| 521 | +behind that: | ||
| 522 | + | ||
| 523 | +1. **The reported no-op is real and is exactly the sweep's recipe.** | ||
| 524 | + `--superres-mode=1` with NO denominator gives sha256 `06621606…`, which | ||
| 525 | + is byte-identical to the no-flag control — so lane-av1gates444's | ||
| 526 | + measurement is correct, and the sweep's `sr444` bytes are that | ||
| 527 | + no-op stream. libaom picks the denominator itself | ||
| 528 | + (`get_superres_denom_for_qindex`, `av1/encoder/superres_scale.c:143`): | ||
| 529 | + it returns `SCALE_NUMERATOR` unless the frame is a KF/ARF update AND the | ||
| 530 | + horizontal-energy test passes, and on a smooth `testsrc2` source it | ||
| 531 | + returns 8. | ||
| 532 | +2. **Adding `--superres-denominator` is what makes the cell exist.** Mode 1 | ||
| 533 | + with an explicit denominator is scaled on every frame, and the parsed | ||
| 534 | + `denom` equals the flag. This is the route the r3 gate pins. | ||
| 535 | +3. **Mode 2 (random) scales with no denominator at all** — and IGNORES | ||
| 536 | + `--superres-denominator`: all four denominator values produce the same | ||
| 537 | + stream (`186x128 denom=11`, sha `c18496cf…`). So "set the denominator" | ||
| 538 | + is not the only working route, and a gate that asserted the flag value | ||
| 539 | + rather than the parsed value would pass on mode 2 while the numbers it | ||
| 540 | + printed were fiction. | ||
| 541 | + | ||
| 542 | +`--resize-mode` is a different feature and is never a superres witness: it | ||
| 543 | +downsizes the FRAME (`frame=171x85 upscaled=171`), whereas superres keeps | ||
| 544 | +`frame_width < upscaled_width`. Worth separating explicitly, because | ||
| 545 | +"denominator" appears in both flag families. | ||
| 546 | + | ||
| 547 | +Modes 3 (qthresh) and 4 (auto) are no-ops at every denominator tried, | ||
| 548 | +which is consistent with the committed census gate's own recorded finding | ||
| 549 | +that auto "picked denominator 8, so those two arms carry no scaling at | ||
| 550 | +all and prove nothing". | ||
| 551 | + | ||
| 552 | +### 11b. Our decoder on all four real scaled streams | ||
| 553 | + | ||
| 554 | +Every SCALED row above, compared against the instrumented aomdec in decode | ||
| 555 | +order with equal frame counts and equal per-frame byte lengths asserted | ||
| 556 | +first: | ||
| 557 | + | ||
| 558 | +```text | ||
| 559 | +mode=1 den=9 3d619ee0fda3 upscaled 228x128 f0 EXACT f1 EXACT f2 EXACT f3 EXACT | ||
| 560 | +mode=1 den=12 450caa3e3152 upscaled 171x128 f0 EXACT f1 EXACT f2 EXACT f3 EXACT | ||
| 561 | +mode=1 den=16 194450c4bf19 upscaled 128x128 f0 EXACT f1 EXACT f2 EXACT f3 EXACT | ||
| 562 | +mode=2 c18496cf3b7d upscaled 186x128 f0 EXACT f1 EXACT f2 EXACT f3 EXACT | ||
| 563 | +``` | ||
| 564 | + | ||
| 565 | +So the 4:4:4 superres class is byte-exact across denominators 9, 11, 12 | ||
| 566 | +and 16 and coded widths 128, 171, 186 and 228 at 256x128 — not one | ||
| 567 | +geometry. The gate pins the den=12 member and asserts its PARSED | ||
| 568 | +`use_superres` / `denom` / coded size, so a stream that stops being scaled | ||
| 569 | +goes red on a header assertion rather than becoming a differently-shaped | ||
| 570 | +exactness claim. `denom=9` (coded 228, the widest margin the frame | ||
| 571 | +allows) and `mode=2`'s `denom=11` are the obvious next pins and are not | ||
| 572 | +gated; recorded rather than quietly dropped. | ||
| 573 | + | ||
| 574 | +### 11c. The sweep claims that need correcting (NOT edited here) | ||
| 575 | + | ||
| 576 | +`lanes/av1formatsweep.report.md` is the sweep lane's file; these are the | ||
| 577 | +lines to fix, named rather than touched: | ||
| 578 | + | ||
| 579 | +- **line 438** — the `sr444` row: "4:4:4 **superres** 256x128 | ||
| 580 | + (`--superres-mode=1`) … **DIVERGENT** from f2, 76404 samples". Two | ||
| 581 | + errors: the stream carries `use_superres=false denom=8` (§11a), and its | ||
| 582 | + divergence is the H1 rect4-strip class, already localised and gated in | ||
| 583 | + `a_444_lossy_rect4_strip_stream_decodes_pixel_exact_at_odd_and_wide_geometries` | ||
| 584 | + (whose second arm is these exact 15239 bytes). The row should say the | ||
| 585 | + recipe was a no-op and name the class. | ||
| 586 | +- **line 83** — the §1 matrix row `| superres | – | – | – |` for 4:4:4. | ||
| 587 | + Should become `Y` at 8-bit: gated by | ||
| 588 | + `a_444_lossy_superres_stream_decodes_pixel_exact`. | ||
| 589 | +- **line 485** — "Matrix changes (§1): 4:4:4 row gains … `superres → D`". | ||
| 590 | + Should be `superres → Y` at 8-bit. | ||
| 591 | +- **line 442** — "Note the aomenc flag is `--superres-mode=1`; there is no | ||
| 592 | + `--enable-superres` in this build". True but incomplete, and it is the | ||
| 593 | + note that let the no-op recipe stand as a cell: the flag needs | ||
| 594 | + `--superres-denominator` (or mode 2) to do anything, and the verdict | ||
| 595 | + must come from the parsed header. | ||
| 596 | +- **line 492** — "Still not measured … 4:4:4 superres at 10/12 bits" is | ||
| 597 | + still true and still open; only the 8-bit cell is closed here. | ||
| 598 | + | ||
| 599 | +### 11d. Overlap to be aware of when merging | ||
| 600 | + | ||
| 601 | +lane-av1gates444's `a_444_lossy_256x128_stream_decodes_pixel_exact` already | ||
| 602 | +pins the plain 256x128 lossy geometry. My r1 gate's second arm uses the | ||
| 603 | +same 15239 bytes but claims something different — that the 4:4:4 1:4 | ||
| 604 | +inter-strip route fired (76 strips, 24 own-extent chroma gathers) and that | ||
| 605 | +the H1 fork is gone there — so it is not redundant with a geometry gate. | ||
| 606 | +The two fixtures are the same bytes, so whichever lands second should reuse | ||
| 607 | +the pin rather than add a second copy. Flagging it rather than resolving | ||
| 608 | +it: both claims are load-bearing and the merge order is Main's call. | ||