[mtt] fix dual tree

This commit is contained in:
Joose Sainio 2022-11-14 11:24:43 +02:00 committed by Marko Viitanen
parent 536c0ff2ef
commit 03b91992a3
2 changed files with 5 additions and 4 deletions

View file

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

View file

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