Use a transform split for SMP and AMP blocks

This commit is contained in:
Arttu Ylä-Outinen 2018-01-11 11:00:28 +02:00
parent c74ede148b
commit fc43643ba5
2 changed files with 7 additions and 6 deletions

View file

@ -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; 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 // NOTE: When tr_depth_inter is equal to 0, the transform is still split
// to 1 for SMP and AMP partition units. We want to avoid the extra // for SMP and AMP partition units.
// transform split so we set tr_depth_inter to 1 when SMP or AMP encoder->tr_depth_inter = 0;
// partition modes are enabled.
encoder->tr_depth_inter = (encoder->cfg.smp_enable || encoder->cfg.amp_enable) ? 1 : 0;
//Tiles //Tiles
encoder->tiles_enable = encoder->cfg.tiles_width_count > 1 || encoder->tiles_enable = encoder->cfg.tiles_width_count > 1 ||

View file

@ -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) { } else if (cur_cu->type == CU_INTER) {
// Reset transform depth because intra messes with them. // Reset transform depth because intra messes with them.
// This will no longer be necessary if the transform depths are not shared. // 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); kvz_lcu_set_trdepth(lcu, x, y, depth, tr_depth);
const int num_pu = kvz_part_mode_num_parts[cur_cu->part_size]; const int num_pu = kvz_part_mode_num_parts[cur_cu->part_size];