From 9e95b16368d9a46e8195451a4c3fe255025a8514 Mon Sep 17 00:00:00 2001 From: Jaakko Laitinen Date: Thu, 9 Dec 2021 18:04:58 +0200 Subject: [PATCH] [Deblock] Fix chroma deblocking issues when inter is enabled Added cbf_copy() calls for chroma components in the lcu_fill_cbf() function since deblocking now uses that information for chroma as well. --- src/filter.c | 1 + src/search.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/filter.c b/src/filter.c index aa42c22b..bdaab081 100644 --- a/src/filter.c +++ b/src/filter.c @@ -1305,6 +1305,7 @@ static void filter_deblock_lcu_rightmost(encoder_state_t * const state, // - Luma deblocking on a 4x4 grid // - Deblocking filter for subblock boundaries // - Allow loop filtering across slice/tile boundaries? +// - Account for bi-pred and multi ref P frames void kvz_filter_deblock_lcu(encoder_state_t * const state, int x_px, int y_px) { assert(!state->encoder_control->cfg.lossless); diff --git a/src/search.c b/src/search.c index 13fa66a7..a06628d9 100644 --- a/src/search.c +++ b/src/search.c @@ -200,8 +200,10 @@ static void lcu_fill_cbf(lcu_t *lcu, int x_local, int y_local, int width, cu_inf cu_info_t *cu_from = LCU_GET_CU_AT_PX(lcu, x & mask, y & mask); cu_info_t *cu_to = LCU_GET_CU_AT_PX(lcu, x, y); if (cu_from != cu_to) { - // Chroma coeff data is not used, luma is needed for deblocking + // Chroma and luma coeff data is needed for deblocking cbf_copy(&cu_to->cbf, cu_from->cbf, COLOR_Y); + cbf_copy(&cu_to->cbf, cu_from->cbf, COLOR_U); + cbf_copy(&cu_to->cbf, cu_from->cbf, COLOR_V); } } }