diff --git a/src/encoder.c b/src/encoder.c index 8c5a2298..2abf057c 100644 --- a/src/encoder.c +++ b/src/encoder.c @@ -349,11 +349,9 @@ encoder_control_t* kvz_encoder_control_init(const kvz_config *const cfg) encoder->lcu_dqp_enabled = cfg->target_bitrate > 0 || encoder->cfg.roi.dqps; - // When tr_depth_inter is equal to 0, inter transform split flag defaults - // to 1 for SMP and AMP partition units. We want to avoid the extra - // transform split so we set tr_depth_inter to 1 when SMP or AMP - // partition modes are enabled. - encoder->tr_depth_inter = (encoder->cfg.smp_enable || encoder->cfg.amp_enable) ? 1 : 0; + // NOTE: When tr_depth_inter is equal to 0, the transform is still split + // for SMP and AMP partition units. + encoder->tr_depth_inter = 0; //Tiles encoder->tiles_enable = encoder->cfg.tiles_width_count > 1 || diff --git a/src/search.c b/src/search.c index 149be298..cd639fcd 100644 --- a/src/search.c +++ b/src/search.c @@ -533,7 +533,10 @@ static double search_cu(encoder_state_t * const state, int x, int y, int depth, } else if (cur_cu->type == CU_INTER) { // Reset transform depth because intra messes with them. // This will no longer be necessary if the transform depths are not shared. - int tr_depth = depth > 0 ? depth : 1; + int tr_depth = MAX(1, depth); + if (cur_cu->part_size != SIZE_2Nx2N) { + tr_depth = depth + 1; + } kvz_lcu_set_trdepth(lcu, x, y, depth, tr_depth); const int num_pu = kvz_part_mode_num_parts[cur_cu->part_size];