forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 00c1b3ff2d80d84fef71bb6208110dedbbd95fc4Filtered to crates/ec-av1/src/superres.rsClear filter

2026-09-01

feat(av1): bit-depth-generic film grain synthesis and superres upscaleAhmet Kaan Gümüş · a67e457
feat(av1): bit-depth-generic film grain synthesis and superres upscale

Lifts the last two `bit_depth != 8` refusals. Film grain (spec 7.18.3 /
libaom grain_synthesis.c): grain_center = 128 << (bd-8), gauss_sec_shift =
12 - bd + grain_scale_shift, scale_LUT interpolation over the 256-entry LUT,
cb/cr offsets and clip_to_restricted_range ranges shifted by (bd-8).
Superres (spec 7.16): planes stay u16 end to end, output clamp is
(1 << bd) - 1; the filter/Round2/edge-margin path is unchanged and its three
libaom pins still hold at 8-bit.

Gated by two real-aomenc 10-bit gates (--film-grain-test=1 and
--superres-mode=1 --superres-denominator=12), both pixel-exact vs ffmpeg's
own 10-bit decode and both hard-asserting bit_depth==10 plus a firing
counter (grain_hits / superres_hits). Forcing bit_depth=8 back into either
call site fails its gate, so neither is vacuous.

Measured on his library: ReelB sets apply_grain on 25 of its first 50
frames with a real luma scaling LUT at 10 bit; neither film uses superres
(enable_superres=false in both sequence headers).

2026-08-30

Merge branch 'main' into lane-superresAhmet Kaan Gümüş · 17c9a9c
Merge branch 'main' into lane-superres

Resolves the scaled-MC conflict in decode.rs in favour of the lane's
structure, and widens predict_scaled to u16 for main's high-bit-depth
sample type (fixture included).

Lane state after the merge: 264 passed, 1 failed -- the lane's own gate
a_real_aomenc_key_and_inter_superres_sequence_decodes_pixel_exact. That
is the lane's deliverable, not merge fallout, so this does not go to
main yet.
wip(av1): lane-superres stage-3 gate in progress, committed at the 75-turn capAhmet Kaan Gümüş · 0e6258a
wip(av1): lane-superres stage-3 gate in progress, committed at the 75-turn cap

Committed verbatim by the orchestrator so the work survives the cap; state
unverified (suite not run on this tree by me).
feat(av1): superres upscaler, pinned against real libaom codeAhmet Kaan Gümüş · c262edf
feat(av1): superres upscaler, pinned against real libaom code

crates/ec-av1/src/superres.rs: spec 7.16 horizontal-only linear-filter
upscale (av1_upscale_normative_rows/upscale_normative_rect/
av1_convolve_horiz_rs_c in libaom resize.c/convolve.c), coefficient
table + constants transcribed verbatim.

Corrects the charter's anchor note: libaom's decodeframe.c calls
superres_post_decode() BETWEEN av1_cdef_frame and
av1_loop_restoration_filter_frame, not after LR -- superres runs
before loop restoration, on the frame that will then be LR-filtered
at the upscaled size. Not yet load-bearing here since this decoder
still refuses any loop_restoration.uses_lr stream outright.

Pinned against libaom's own compiled code, not a second transcription:
a standalone C harness links ~/.cache/aom-oracle/build/libaom.a and
calls the real exported av1_get_upscale_convolve_step/
av1_convolve_horiz_rs_c/av1_resize_filter_normative directly (only the
one-line static get_upscale_convolve_x0 formula is copied in both
places) -- guards the class shared-oracle-blindness. Two captured rows
(8->12, 8->16) plus a flat-row unity-gain sanity check, 3/3 green.

Not yet wired into decode_stream (stage 3 next); module currently
unused, hence the dead_code warnings.