Fix crash on inter search when --tr-depth-intra is used.

- Transform splits meant for intra modes were used for inter when inter mode
  was chosen, which caused an assert to be triggered if the split transform
  block didn't have any coefficients.
This commit is contained in:
Ari Koivula 2014-10-03 19:29:06 +03:00
parent bcf12567d0
commit 3868cc7ff1

View file

@ -1387,12 +1387,16 @@ static int search_cu(encoder_state * const encoder_state, int x, int y, int dept
intra_recon_lcu_luma(encoder_state, x, y, depth, intra_mode, &work_tree[depth]);
intra_recon_lcu_chroma(encoder_state, x, y, depth, &work_tree[depth]);
} else if (cur_cu->type == CU_INTER) {
int cbf;
// 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;
lcu_set_trdepth(&work_tree[depth], x, y, depth, tr_depth);
inter_recon_lcu(encoder_state, encoder_state->global->ref->images[cur_cu->inter.mv_ref], x, y, LCU_WIDTH>>depth, cur_cu->inter.mv, &work_tree[depth]);
quantize_lcu_luma_residual(encoder_state, x, y, depth, &work_tree[depth]);
quantize_lcu_chroma_residual(encoder_state, x, y, depth, &work_tree[depth]);
cbf = cbf_is_set(cur_cu->cbf.y, depth) || cbf_is_set(cur_cu->cbf.u, depth) || cbf_is_set(cur_cu->cbf.v, depth);
int cbf = cbf_is_set(cur_cu->cbf.y, depth) || cbf_is_set(cur_cu->cbf.u, depth) || cbf_is_set(cur_cu->cbf.v, depth);
if(cur_cu->merged && !cbf) {
cur_cu->merged = 0;