diff --git a/src/encode_coding_tree.c b/src/encode_coding_tree.c index 33964b4a..f9e9c85f 100644 --- a/src/encode_coding_tree.c +++ b/src/encode_coding_tree.c @@ -1515,7 +1515,7 @@ void uvg_encode_coding_tree( } // When not in MAX_DEPTH, insert split flag and split the blocks if needed - if (depth != MAX_DEPTH) { + if (depth != MAX_DEPTH && !(tree_type == KVZ_CHROMA_T && depth == MAX_DEPTH -1)) { const int split_flag = uvg_write_split_flag(state, cabac, left_cu, above_cu, GET_SPLITDATA(cur_cu, depth), depth, cu_width, x, y, tree_type,NULL); @@ -1725,7 +1725,8 @@ void uvg_encode_coding_tree( // For 4x4 the chroma PU/TU is coded after the last if (state->encoder_control->chroma_format != UVG_CSP_400 && - ((depth == 4 && x % 8 && y % 8) || tree_type == KVZ_CHROMA_T)) { + ((depth == 4 && x % 8 && y % 8) || tree_type == KVZ_CHROMA_T) && + tree_type != KVZ_LUMA_T) { encode_chroma_intra_cu(cabac, cur_cu, state->encoder_control->cfg.cclm, NULL); // LFNST constraints must be reset here. Otherwise the left over values will interfere when calculating new constraints cu_info_t* tmp = uvg_cu_array_at(frame->cu_array, x, y); diff --git a/src/search.c b/src/search.c index 158e91c8..dccec495 100644 --- a/src/search.c +++ b/src/search.c @@ -832,6 +832,9 @@ static double search_cu( pu_depth_intra.min = ctrl->cfg.pu_depth_intra.min[gop_layer] >= 0 ? ctrl->cfg.pu_depth_intra.min[gop_layer] : ctrl->cfg.pu_depth_intra.min[0]; pu_depth_intra.max = ctrl->cfg.pu_depth_intra.max[gop_layer] >= 0 ? ctrl->cfg.pu_depth_intra.max[gop_layer] : ctrl->cfg.pu_depth_intra.max[0]; } + if(tree_type == KVZ_CHROMA_T) { + pu_depth_intra.max = MIN(3, pu_depth_intra.max); + } pu_depth_inter.min = ctrl->cfg.pu_depth_inter.min[gop_layer] >= 0 ? ctrl->cfg.pu_depth_inter.min[gop_layer] : ctrl->cfg.pu_depth_inter.min[0]; pu_depth_inter.max = ctrl->cfg.pu_depth_inter.max[gop_layer] >= 0 ? ctrl->cfg.pu_depth_inter.max[gop_layer] : ctrl->cfg.pu_depth_inter.max[0];