From ad2bb20f230b8e03f4a5b21841735f7b471b914f Mon Sep 17 00:00:00 2001 From: Joose Sainio Date: Fri, 16 Dec 2022 09:37:56 +0200 Subject: [PATCH] [mtt] Fix deblock for isp and properly set the limit for cclm --- src/encode_coding_tree.c | 2 +- src/search.c | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/encode_coding_tree.c b/src/encode_coding_tree.c index a2ecf5a9..94d39f2d 100644 --- a/src/encode_coding_tree.c +++ b/src/encode_coding_tree.c @@ -1439,7 +1439,7 @@ void uvg_encode_coding_tree( DBG_YUVIEW_VALUE(state->frame->poc, DBG_YUVIEW_CU_TYPE, abs_x, abs_y, cu_width, cu_height, cur_cu->type-1); - // fprintf(stderr, "%4d %4d %2d %2d %d %d\n", x, y, cu_width, cu_height, has_chroma, cur_cu->split_tree); + // fprintf(stderr, "%4d %4d %2d %2d %d %d %d\n", x, y, cu_width, cu_height, has_chroma, tree_type, cur_cu->split_tree); if (ctrl->cfg.lossless) { cabac->cur_ctx = &cabac->ctx.cu_transquant_bypass; diff --git a/src/search.c b/src/search.c index dee9bbbe..7efdb004 100644 --- a/src/search.c +++ b/src/search.c @@ -450,7 +450,7 @@ static void downsample_cclm_rec(encoder_state_t *state, int x, int y, int width, if((y + height * 2) % 64 == 0) { int line = y / 64 * stride2 / 2; y_rec -= LCU_WIDTH; - for (int i = 0; i < width && i + x < stride2 / 2; ++i) { + for (int i = 0; i < width && i + x / 2 < stride2 / 2; ++i) { int s = 2; s += y_rec[i * 2] * 2; s += y_rec[i * 2 + 1]; @@ -1555,6 +1555,31 @@ static double search_cu( is_separate_tree, x_local, y_local); + if (cur_cu->type == CU_INTRA && cur_cu->intra.isp_mode != ISP_MODE_NO_ISP && tree_type != UVG_CHROMA_T) { + const int split_num = uvg_get_isp_split_num( cu_width, cu_height, cur_cu->intra.isp_mode,true); + for (int i = 1; i < split_num; i++) { + cu_loc_t isp_loc; + uvg_get_isp_split_loc( + &isp_loc, + x, + y, + cu_width, + cu_height, + i, + cur_cu->intra.isp_mode, + true); + if (x % 4 || y % 4) continue; + mark_deblocking( + &isp_loc, + chroma_loc, + lcu, + UVG_LUMA_T, + false, + false, + isp_loc.local_x, + isp_loc.local_y); + } + } } bool can_split_cu =