From 88b837c4f06271616e140d01d67b8149dbab3b2f Mon Sep 17 00:00:00 2001 From: Jaakko Laitinen Date: Wed, 6 Jan 2021 19:06:14 +0200 Subject: [PATCH] Fix more chroma deblocking issues --- src/filter.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/filter.c b/src/filter.c index dd9ba59f..11a826d8 100644 --- a/src/filter.c +++ b/src/filter.c @@ -990,14 +990,14 @@ static void filter_deblock_edge_chroma(encoder_state_t * const state, if (dir == EDGE_VER) { x_coord <<= 1; y_coord = (y + min_chroma_length * blk_idx) << 1; - cu_p = kvz_cu_array_at(frame->cu_array, (x - 1) << 1, y_coord); - cu_q = kvz_cu_array_at(frame->cu_array, x << 1, y_coord); + cu_p = kvz_cu_array_at(frame->cu_array, x_coord - 1, y_coord); + cu_q = kvz_cu_array_at(frame->cu_array, x_coord , y_coord); } else { x_coord = (x + min_chroma_length * blk_idx) << 1; y_coord <<= 1; - cu_p = kvz_cu_array_at(frame->cu_array, x_coord, (y - 1) << 1); - cu_q = kvz_cu_array_at(frame->cu_array, x_coord, (y ) << 1); + cu_p = kvz_cu_array_at(frame->cu_array, x_coord, y_coord - 1); + cu_q = kvz_cu_array_at(frame->cu_array, x_coord, y_coord ); } const int cu_size = LCU_WIDTH >> cu_q->depth; @@ -1021,7 +1021,7 @@ static void filter_deblock_edge_chroma(encoder_state_t * const state, const bool large_boundary = (max_filter_length_P >= 3 && max_filter_length_Q >= 3); const bool is_chroma_hor_CTB_boundary = (dir == EDGE_HOR && y_coord % LCU_WIDTH == 0); uint8_t c_strength[2] = { 0, 0 }; - bool use_long_filter = false; + if (cu_q->type == CU_INTRA || cu_p->type == CU_INTRA) { c_strength[0] = 2; @@ -1043,6 +1043,8 @@ static void filter_deblock_edge_chroma(encoder_state_t * const state, int32_t Tc = encoder->bitdepth < 10 ? ((kvz_g_tc_table_8x8[TC_index] + (1 << (9 - encoder->bitdepth))) >> (10 - encoder->bitdepth)) : (kvz_g_tc_table_8x8[TC_index] << (encoder->bitdepth - 10)); + bool use_long_filter = false; + // +-- edge_src // v // line0 p3 p2 p1 p0 q0 q1 q2 q3