forge
Explore
Log in

Don't you dare go Hollow

ec-av1: 4:4:4 loop filter byte-exact (filters-on witness)

Browse files at this commit

6f661bc726ad78caa279b066adb57c5cb08b5050Ahmet Kaan GümüşParent: a44ac26
deblock_plane_span clipped the chroma filter to frame_width/2 x
frame_height/2 (a hardcoded 4:2:0 halving), so at 4:4:4 no chroma edge
in the right/bottom three quarters of the plane was ever filtered.
The crop now follows the sequence subsampling; identical at 4:2:0.
libaom's own chroma filter rules needed no change: filter length
(dim==0 ? 4 : 6), mi mapping (scale | coord<<scale>>2), and the
uv-transform lookup (av1_get_max_uv_txsize) all already match
(set_lpf_parameters, av1_loopfilter.c:221).

Witnesses (aomenc, aomdec+ffmpeg cross-checked, 128x128 2 frames):
- 444 filters on (loop filter + CDEF + restoration): IDENTICAL
- 444 filters on, forced 64x64 blocks: IDENTICAL
- 420 filters on: IDENTICAL (regression)
- loop filter alone off, CDEF+LR on: IDENTICAL (isolates the fix)
crates/ec-av1/src/decode.rsmodified+7 -1
@@ -20825,8 +20825,14 @@ fn deblock_plane_span(
20825 // filter level there). r7's superres measurement is preserved: its frame20825 // filter level there). r7's superres measurement is preserved: its frame
20826 // was already 8-aligned, so this bound equals `frame_width` there and20826 // was already 8-aligned, so this bound equals `frame_width` there and
20827 // still excludes the superblock padding up to `true_width`.20827 // still excludes the superblock padding up to `true_width`.
20828+ // lane-av1-444: the chroma crop follows the sequence subsampling, not a
20829+ // hardcoded 4:2:0 halving -- at 4:4:4 the halved bound clipped the whole
20830+ // filter to the top-left quarter of each chroma plane.
20828 let (cw, ch) = if chroma {20831 let (cw, ch) = if chroma {
20829- (frame_width.div_ceil(2), frame_height.div_ceil(2))20832+ (
20833+ frame_width.div_ceil(1 << ss_x(fctx)),
20834+ frame_height.div_ceil(1 << ss_y(fctx)),
20835+ )
20830 } else {20836 } else {
20831 (frame_width, frame_height)20837 (frame_width, frame_height)
20832 };20838 };