Files
FFmpeg/libavcodec/hevc
Jun Zhao e5a08f7c0e avcodec/hevc: fix chroma SAO filtering with 16x16 CTB
When CtbSizeY is 16 and chroma is horizontally subsampled (4:2:0 or 4:2:2),
horizontal chroma deblocking is deferred for the whole CTB width
(8 * (1 << hshift) = 16 luma pixels).

In the current pipelined loop filter implementation, ff_hevc_hls_filter()
ran sao_filter_CTB() for CTB (x - ctb_size, ...) immediately after
deblocking_filter_CTB() at x. This caused SAO edge offset classes 0 and 2
on the rightmost column of the 8x8 chroma CTB to fetch unfiltered chroma
pixels from the right neighboring CTB, leading to incorrect offsets and
MD5 mismatch.

Fix this by delaying SAO execution by 2 * ctb_size horizontally when
ctb_size == 16 and sps->hshift[1] != 0. The remaining columns are caught up
at the end of each CTB row.

Fixes: ticket #24870
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2026-10-07 09:28:59 +08:00
..
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…