mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-11-06 21:37:26 +00:00
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>