From 03b91992a3bfb889f9212eba596571c310774aa8 Mon Sep 17 00:00:00 2001 From: Joose Sainio Date: Mon, 14 Nov 2022 11:24:43 +0200 Subject: [PATCH] [mtt] fix dual tree --- src/encode_coding_tree.c | 4 ++-- src/search.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/encode_coding_tree.c b/src/encode_coding_tree.c index dbcf9abe..67676dda 100644 --- a/src/encode_coding_tree.c +++ b/src/encode_coding_tree.c @@ -561,7 +561,7 @@ static void encode_transform_unit( } bool joint_chroma = cur_pu->joint_cb_cr != 0; - if (cur_pu->log2_height + cur_pu->log2_width < 6) { + if (cur_pu->log2_height + cur_pu->log2_width < 6 && tree_type != UVG_CHROMA_T) { // For size 4x4 luma transform the corresponding chroma transforms are // also of size 4x4 covering 8x8 luma pixels. The residual is coded in // the last transform unit. @@ -1772,7 +1772,7 @@ double uvg_mock_encode_coding_unit( if(tree_type != UVG_CHROMA_T) { uvg_encode_intra_luma_coding_unit(state, cabac, cur_cu, cu_loc, lcu, &bits); } - if((cur_cu->log2_height + cur_cu->log2_width >= 6 || (x % 8 != 0 && y % 8 != 0)) && state->encoder_control->chroma_format != UVG_CSP_400 && tree_type != UVG_LUMA_T) { + if((cur_cu->log2_height + cur_cu->log2_width >= 6 || (x % 8 != 0 && y % 8 != 0) || tree_type == UVG_CHROMA_T) && state->encoder_control->chroma_format != UVG_CSP_400 && tree_type != UVG_LUMA_T) { encode_chroma_intra_cu(cabac, cur_cu, state->encoder_control->cfg.cclm, &bits); } } diff --git a/src/search.c b/src/search.c index 9d9e7d14..dd78a69d 100644 --- a/src/search.c +++ b/src/search.c @@ -1080,7 +1080,7 @@ static double search_cu( int8_t intra_mode = intra_search.pred_cu.intra.mode; // TODO: This heavily relies to square CUs - if ((cur_cu->log2_height + cur_cu->log2_width >= 6 || (x % 8 && y % 8)) + if ((cur_cu->log2_height + cur_cu->log2_width >= 6 || (x % 8 && y % 8) || tree_type == UVG_CHROMA_T) && state->encoder_control->chroma_format != UVG_CSP_400 && tree_type != UVG_LUMA_T) { intra_search.pred_cu.joint_cb_cr = 0; @@ -1176,7 +1176,8 @@ static double search_cu( recon_luma, recon_chroma); - if(cur_cu->log2_height + cur_cu->log2_width < 6 && x % 8 && y % 8 && tree_type != UVG_LUMA_T && state->encoder_control->chroma_format != UVG_CSP_400) { + if((cur_cu->log2_height + cur_cu->log2_width < 6 && x % 8 && y % 8 && tree_type != UVG_LUMA_T && state->encoder_control->chroma_format != UVG_CSP_400 ) + || tree_type == UVG_CHROMA_T) { intra_search.pred_cu.intra.mode_chroma = cur_cu->intra.mode_chroma; uvg_intra_recon_cu(state, &intra_search, cu_loc,