From 95effb00d0f7c4e911ff6a83b24135bee39c7e25 Mon Sep 17 00:00:00 2001 From: Marko Viitanen Date: Thu, 5 Jan 2017 14:03:55 +0200 Subject: [PATCH] Disable TMVP in frames with zero L0 references --- src/encoder_state-bitstream.c | 4 ++-- src/inter.c | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/encoder_state-bitstream.c b/src/encoder_state-bitstream.c index 56aace1f..f085bd09 100644 --- a/src/encoder_state-bitstream.c +++ b/src/encoder_state-bitstream.c @@ -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"); diff --git a/src/inter.c b/src/inter.c index 32b63c3b..6cd14f5b 100644 --- a/src/inter.c +++ b/src/inter.c @@ -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;