bench: add --grain, a controlled grain axis on real content - #50
Merged
Conversation
The central claim is that reductive pre-encode filtering wins in proportion to removable impairment (ADR-0142). Testing that needs a controlled grain axis, and the corpus could not supply one. Measured, at the 640x360/48-frame corpus workload: real Blu-ray scan 1994 remux grain_sigma 0.0047-0.0101 flat 0.96-0.98 real Blu-ray scan 2000 grain_sigma 0.0079 flat 0.94 real film scan 1971 grain_sigma 0.0079 flat 0.73 netflix-bar (Chimera webm) grain_sigma 0.0124 flat 0.60 bbb (clean animation) grain_sigma 0.0131 flat 0.33 Real film scans measure LOWER grain than the public clips, not higher. Modern Blu-ray masters are frequently denoised, the public 4K sets are distribution re-encodes with the grain compressed out, and any downscale to the corpus resolution attenuates what survives -- grain is a per-pixel high-frequency signal and averaging 3-6 pixels into one removes it. So there is no grainy clip to pin; the honest axis is injection, not selection. --grain N overlays seeded noise on a REAL source and scores both arms against the clean original (implying --clean-reference), so a denoiser is not penalised for removing the impairment under test -- the same rationale as the deband 'wash' bug. Verified on netflix-bar: monotonic in both directions (sigma 0.0124 -> 0.0182, flat 0.600 -> 0.171 as grain goes 0 -> 20) and byte-reproducible under a fixed seed. It also stays in the estimator's supported regime, unlike the pre-existing --synth noise, which noises a flat grey plate and starves the estimator (no 3x3 neighbourhood stays under edge_thr, so flat collapses to ~0 and sigma is meaningless). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why the corpus couldn't supply one
The central claim is that reductive pre-encode filtering wins in proportion to removable impairment (ADR-0142). Testing that needs a controlled grain axis. I went looking for a grainy clip to pin and measured instead, at the 640x360/48-frame corpus workload:
grain_sigmagrain_flatnetflix-bar(Chimera, VP9 webm)bbb(clean animation)Real film scans measure lower grain than the public clips, not higher. Modern Blu-ray masters are frequently denoised; the public 4K sets are distribution re-encodes with the grain compressed out; and any downscale to the corpus resolution attenuates what survives, because grain is a per-pixel high-frequency signal and averaging 3–6 pixels into one removes it.
So there is no grainy clip to pin. The honest axis is injection, not selection.
What
--grain Noverlays seeded noise on a real source and scores both arms against the clean original (implying--clean-reference), so a denoiser isn't penalised for removing the impairment under test — the same rationale as the deband 'wash' bug.Verified on
netflix-bar, monotonic in both directions and byte-reproducible under a fixed seed:--graingrain_sigmagrain_flatWhy not the existing
--synth noiseIt noises a flat grey plate — the degenerate case. There's no content to preserve, and it starves the grain estimator: no 3x3 neighbourhood stays under
edge_thr, sograin_flatcollapses to ~0 and the sigma reading becomes meaningless.--grainkeeps the estimate in the supported regime (flat 0.60→0.17).Worth noting the historical
−88.94%BD-rate figure in bench-results came from a 'locked-off scene + seeded grain' setup; denoising a near-flat plate is trivially easy and inflates results.--grainon real content is the honest version of that experiment.Gates
21/21 fast suite, changelog in sync. Calibration used real film scans from the local media box; only aggregate statistics are recorded, no content.
🤖 Generated with Claude Code