From 8af861bbf1b89982622c655b10ab5e3eb4b2fc85 Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Tue, 1 Nov 2016 12:12:11 -0700 Subject: [PATCH] Fix merge issues related --enable-ec-adapt 1. Avoid compiler warnings. 2. Enable prob_diff_update() required by update_txfm_probs(). Change-Id: I9081b645c55a8432bdaeb600e9ba901c0d0d96f5 --- aom_dsp/prob.h | 2 +- av1/decoder/decodeframe.c | 13 +++++++++---- av1/encoder/bitstream.c | 6 +----- av1/encoder/encodemv.c | 6 +++++- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/aom_dsp/prob.h b/aom_dsp/prob.h index 28ea49c46..9384ffe65 100644 --- a/aom_dsp/prob.h +++ b/aom_dsp/prob.h @@ -33,7 +33,7 @@ typedef uint16_t aom_cdf_prob; typedef int8_t aom_tree_index; -#define TREE_SIZE(leaf_count) (2 * (leaf_count)-2) +#define TREE_SIZE(leaf_count) (-2 + 2 * (leaf_count)) #define aom_complement(x) (255 - x) diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c index 0eb773745..b1de763c9 100644 --- a/av1/decoder/decodeframe.c +++ b/av1/decoder/decodeframe.c @@ -134,8 +134,8 @@ static void read_switchable_interp_probs(FRAME_CONTEXT *fc, aom_reader *r) { #endif static void read_inter_mode_probs(FRAME_CONTEXT *fc, aom_reader *r) { - int i; #if CONFIG_REF_MV + int i; for (i = 0; i < NEWMV_MODE_CONTEXTS; ++i) av1_diff_update_prob(r, &fc->newmv_prob[i], ACCT_STR); for (i = 0; i < ZEROMV_MODE_CONTEXTS; ++i) @@ -148,12 +148,15 @@ static void read_inter_mode_probs(FRAME_CONTEXT *fc, aom_reader *r) { av1_diff_update_prob(r, &fc->new2mv_prob, ACCT_STR); #endif // CONFIG_EXT_INTER #else - int j; #if !CONFIG_EC_ADAPT + int i, j; for (i = 0; i < INTER_MODE_CONTEXTS; ++i) { for (j = 0; j < INTER_MODES - 1; ++j) av1_diff_update_prob(r, &fc->inter_mode_probs[i][j], ACCT_STR); } +#else + (void)fc; + (void)r; #endif #endif } @@ -3712,7 +3715,10 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data, #endif FRAME_CONTEXT *const fc = cm->fc; aom_reader r; - int k, i, j; + int k, i; +#if !CONFIG_EC_ADAPT + int j; +#endif #if !CONFIG_ANS if (aom_reader_init(&r, data, partition_size, pbi->decrypt_cb, @@ -3845,7 +3851,6 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data, if (cm->reference_mode != SINGLE_REFERENCE) setup_compound_reference_mode(cm); - read_frame_reference_mode_probs(cm, &r); #if !CONFIG_EC_ADAPT diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c index e232a8796..effa0f423 100644 --- a/av1/encoder/bitstream.c +++ b/av1/encoder/bitstream.c @@ -314,7 +314,6 @@ static void encode_unsigned_max(struct aom_write_bit_buffer *wb, int data, aom_wb_write_literal(wb, data, get_unsigned_bits(max)); } -#if !CONFIG_EC_ADAPT || !CONFIG_DAALA_EC static void prob_diff_update(const aom_tree_index *tree, aom_prob probs[/*n - 1*/], const unsigned int counts[/*n - 1*/], int n, @@ -330,6 +329,7 @@ static void prob_diff_update(const aom_tree_index *tree, av1_cond_prob_diff_update(w, &probs[i], branch_ct[i], probwt); } +#if !CONFIG_EC_ADAPT static int prob_diff_update_savings(const aom_tree_index *tree, aom_prob probs[/*n - 1*/], const unsigned int counts[/*n - 1*/], int n, @@ -2911,7 +2911,6 @@ static void write_txfm_mode(TX_MODE mode, struct aom_write_bit_buffer *wb) { if (mode != TX_MODE_SELECT) aom_wb_write_literal(wb, mode, 2); } -#if !CONFIG_EC_ADAPT static void update_txfm_probs(AV1_COMMON *cm, aom_writer *w, FRAME_COUNTS *counts) { #if CONFIG_TILE_GROUPS @@ -2927,7 +2926,6 @@ static void update_txfm_probs(AV1_COMMON *cm, aom_writer *w, counts->tx_size[i][j], i + 2, probwt, w); } } -#endif static void write_interp_filter(InterpFilter filter, struct aom_write_bit_buffer *wb) { @@ -3702,9 +3700,7 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) { #if CONFIG_LOOP_RESTORATION encode_restoration(cm, header_bc); #endif // CONFIG_LOOP_RESTORATION -#if !CONFIG_EC_ADAPT update_txfm_probs(cm, header_bc, counts); -#endif update_coef_probs(cpi, header_bc); #if CONFIG_VAR_TX diff --git a/av1/encoder/encodemv.c b/av1/encoder/encodemv.c index 40929ef24..8a6ad189a 100644 --- a/av1/encoder/encodemv.c +++ b/av1/encoder/encodemv.c @@ -169,7 +169,7 @@ static void write_mv_update(const aom_tree_index *tree, void av1_write_nmv_probs(AV1_COMMON *cm, int usehp, aom_writer *w, nmv_context_counts *const nmv_counts) { - int i, j; + int i; #if CONFIG_REF_MV int nmv_ctx = 0; for (nmv_ctx = 0; nmv_ctx < NMV_CONTEXTS; ++nmv_ctx) { @@ -180,6 +180,7 @@ void av1_write_nmv_probs(AV1_COMMON *cm, int usehp, aom_writer *w, w); for (i = 0; i < 2; ++i) { + int j; nmv_component *comp = &mvc->comps[i]; nmv_component_counts *comp_counts = &counts->comps[i]; @@ -193,6 +194,7 @@ void av1_write_nmv_probs(AV1_COMMON *cm, int usehp, aom_writer *w, } for (i = 0; i < 2; ++i) { + int j; for (j = 0; j < CLASS0_SIZE; ++j) write_mv_update(av1_mv_fp_tree, mvc->comps[i].class0_fp[j], counts->comps[i].class0_fp[j], MV_FP_SIZE, w); @@ -218,6 +220,7 @@ void av1_write_nmv_probs(AV1_COMMON *cm, int usehp, aom_writer *w, write_mv_update(av1_mv_joint_tree, mvc->joints, counts->joints, MV_JOINTS, w); for (i = 0; i < 2; ++i) { + int j; nmv_component *comp = &mvc->comps[i]; nmv_component_counts *comp_counts = &counts->comps[i]; @@ -231,6 +234,7 @@ void av1_write_nmv_probs(AV1_COMMON *cm, int usehp, aom_writer *w, } for (i = 0; i < 2; ++i) { + int j; for (j = 0; j < CLASS0_SIZE; ++j) { write_mv_update(av1_mv_fp_tree, mvc->comps[i].class0_fp[j], counts->comps[i].class0_fp[j], MV_FP_SIZE, w); -- GitLab