Disable TMVP in frames with zero L0 references

This commit is contained in:
Marko Viitanen 2017-01-05 14:03:55 +02:00
parent b4de1878be
commit 95effb00d0
2 changed files with 2 additions and 6 deletions

View file

@ -763,7 +763,7 @@ static void kvz_encoder_state_write_bitstream_slice_header_independent(
//WRITE_UE(stream, 0, "short_term_ref_pic_set_idx");
if (state->encoder_control->cfg.tmvp_enable) {
WRITE_U(stream, 1, 1, "slice_temporal_mvp_enabled_flag");
WRITE_U(stream, ref_negative?1:0, 1, "slice_temporal_mvp_enabled_flag");
}
}
@ -787,7 +787,7 @@ static void kvz_encoder_state_write_bitstream_slice_header_independent(
}
// Temporal Motion Vector Prediction flags
if (state->encoder_control->cfg->tmvp_enable && ref_negative > 1) {
if (state->encoder_control->cfg.tmvp_enable && ref_negative > 0) {
if (state->frame->slicetype == KVZ_SLICE_B) {
// Always use L0 for prediction
WRITE_U(stream, 1, 1, "collocated_from_l0_flag");

View file

@ -1360,13 +1360,9 @@ uint8_t kvz_inter_get_merge_cand(const encoder_state_t * const state,
cu_info_t *c3_L0 = NULL;
cu_info_t *h_L0 = NULL;
cu_info_t *c3_L1 = NULL;
cu_info_t *h_L1 = NULL;
// Fetch temporal candidates for the current CU, , L0[0]
kvz_inter_get_temporal_merge_candidates(state, x, y, width, height, &c3_L0, &h_L0, 1, 0);
//kvz_inter_get_temporal_merge_candidates(state, x, y, width, height, &c3_L1, &h_L1, 2, 0);
cu_info_t *selected_CU = NULL;