From 72ece1308b40c7ccbfe00352ae51726d9d211e33 Mon Sep 17 00:00:00 2001 From: James Zern Date: Wed, 10 Dec 2014 18:11:17 -0800 Subject: [PATCH] vp9: move encoder-only member from common allow_comp_inter_inter VP9_COMMON -> VP9_COMP Change-Id: I6d9dc25d1cdd7e2ab62f5be69cd9fa883d21dbb6 --- vp9/common/vp9_onyxc_int.h | 1 - vp9/encoder/vp9_bitstream.c | 2 +- vp9/encoder/vp9_encodeframe.c | 6 +++--- vp9/encoder/vp9_encoder.h | 2 ++ vp9/encoder/vp9_rdopt.c | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index 55a1f86c7..0ac68dd47 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -182,7 +182,6 @@ typedef struct VP9Common { struct segmentation seg; // Context probabilities for reference frame prediction - int allow_comp_inter_inter; MV_REFERENCE_FRAME comp_fixed_ref; MV_REFERENCE_FRAME comp_var_ref[2]; REFERENCE_MODE reference_mode; diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c index 20368f096..4154a6f8a 100644 --- a/vp9/encoder/vp9_bitstream.c +++ b/vp9/encoder/vp9_bitstream.c @@ -1183,7 +1183,7 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) { vp9_cond_prob_diff_update(&header_bc, &fc->intra_inter_prob[i], counts->intra_inter[i]); - if (cm->allow_comp_inter_inter) { + if (cpi->allow_comp_inter_inter) { const int use_compound_pred = cm->reference_mode != SINGLE_REFERENCE; const int use_hybrid_pred = cm->reference_mode == REFERENCE_MODE_SELECT; diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 756393f31..5cb5fd015 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -3716,9 +3716,9 @@ void vp9_encode_frame(VP9_COMP *cpi) { cm->ref_frame_sign_bias[GOLDEN_FRAME]) || (cm->ref_frame_sign_bias[ALTREF_FRAME] == cm->ref_frame_sign_bias[LAST_FRAME])) { - cm->allow_comp_inter_inter = 0; + cpi->allow_comp_inter_inter = 0; } else { - cm->allow_comp_inter_inter = 1; + cpi->allow_comp_inter_inter = 1; cm->comp_fixed_ref = ALTREF_FRAME; cm->comp_var_ref[0] = LAST_FRAME; cm->comp_var_ref[1] = GOLDEN_FRAME; @@ -3742,7 +3742,7 @@ void vp9_encode_frame(VP9_COMP *cpi) { const int is_alt_ref = frame_type == ALTREF_FRAME; /* prediction (compound, single or hybrid) mode selection */ - if (is_alt_ref || !cm->allow_comp_inter_inter) + if (is_alt_ref || !cpi->allow_comp_inter_inter) cm->reference_mode = SINGLE_REFERENCE; else if (mode_thrs[COMPOUND_REFERENCE] > mode_thrs[SINGLE_REFERENCE] && mode_thrs[COMPOUND_REFERENCE] > diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h index 14f7c7f0c..a58a90e1e 100644 --- a/vp9/encoder/vp9_encoder.h +++ b/vp9/encoder/vp9_encoder.h @@ -339,6 +339,8 @@ typedef struct VP9_COMP { unsigned int max_mv_magnitude; int mv_step_param; + int allow_comp_inter_inter; + // Default value is 1. From first pass stats, encode_breakout may be disabled. ENCODE_BREAKOUT_TYPE allow_encode_breakout; diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 600a3eb1a..c47dccd7f 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -3065,7 +3065,7 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, comp_pred = second_ref_frame > INTRA_FRAME; if (comp_pred) { - if (!cm->allow_comp_inter_inter) + if (!cpi->allow_comp_inter_inter) continue; // Skip compound inter modes if ARF is not available. @@ -3715,7 +3715,7 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, comp_pred = second_ref_frame > INTRA_FRAME; if (comp_pred) { - if (!cm->allow_comp_inter_inter) + if (!cpi->allow_comp_inter_inter) continue; if (!(cpi->ref_frame_flags & flag_list[second_ref_frame])) continue;