[mtt] Fix deblock for isp and properly set the limit for cclm

This commit is contained in:
Joose Sainio 2022-12-16 09:37:56 +02:00 committed by Marko Viitanen
parent c89ebf8bf1
commit ad2bb20f23
2 changed files with 27 additions and 2 deletions

View file

@ -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;

View file

@ -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 =