Commit 8af861bb authored by Yaowu Xu's avatar Yaowu Xu

Fix merge issues related --enable-ec-adapt

1. Avoid compiler warnings.
2. Enable prob_diff_update() required by update_txfm_probs().

Change-Id: I9081b645c55a8432bdaeb600e9ba901c0d0d96f5
parent 6043bfdb
...@@ -33,7 +33,7 @@ typedef uint16_t aom_cdf_prob; ...@@ -33,7 +33,7 @@ typedef uint16_t aom_cdf_prob;
typedef int8_t aom_tree_index; 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) #define aom_complement(x) (255 - x)
......
...@@ -134,8 +134,8 @@ static void read_switchable_interp_probs(FRAME_CONTEXT *fc, aom_reader *r) { ...@@ -134,8 +134,8 @@ static void read_switchable_interp_probs(FRAME_CONTEXT *fc, aom_reader *r) {
#endif #endif
static void read_inter_mode_probs(FRAME_CONTEXT *fc, aom_reader *r) { static void read_inter_mode_probs(FRAME_CONTEXT *fc, aom_reader *r) {
int i;
#if CONFIG_REF_MV #if CONFIG_REF_MV
int i;
for (i = 0; i < NEWMV_MODE_CONTEXTS; ++i) for (i = 0; i < NEWMV_MODE_CONTEXTS; ++i)
av1_diff_update_prob(r, &fc->newmv_prob[i], ACCT_STR); av1_diff_update_prob(r, &fc->newmv_prob[i], ACCT_STR);
for (i = 0; i < ZEROMV_MODE_CONTEXTS; ++i) for (i = 0; i < ZEROMV_MODE_CONTEXTS; ++i)
...@@ -148,12 +148,15 @@ static void read_inter_mode_probs(FRAME_CONTEXT *fc, aom_reader *r) { ...@@ -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); av1_diff_update_prob(r, &fc->new2mv_prob, ACCT_STR);
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#else #else
int j;
#if !CONFIG_EC_ADAPT #if !CONFIG_EC_ADAPT
int i, j;
for (i = 0; i < INTER_MODE_CONTEXTS; ++i) { for (i = 0; i < INTER_MODE_CONTEXTS; ++i) {
for (j = 0; j < INTER_MODES - 1; ++j) for (j = 0; j < INTER_MODES - 1; ++j)
av1_diff_update_prob(r, &fc->inter_mode_probs[i][j], ACCT_STR); av1_diff_update_prob(r, &fc->inter_mode_probs[i][j], ACCT_STR);
} }
#else
(void)fc;
(void)r;
#endif #endif
#endif #endif
} }
...@@ -3712,7 +3715,10 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data, ...@@ -3712,7 +3715,10 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
#endif #endif
FRAME_CONTEXT *const fc = cm->fc; FRAME_CONTEXT *const fc = cm->fc;
aom_reader r; aom_reader r;
int k, i, j; int k, i;
#if !CONFIG_EC_ADAPT
int j;
#endif
#if !CONFIG_ANS #if !CONFIG_ANS
if (aom_reader_init(&r, data, partition_size, pbi->decrypt_cb, 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, ...@@ -3845,7 +3851,6 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
if (cm->reference_mode != SINGLE_REFERENCE) if (cm->reference_mode != SINGLE_REFERENCE)
setup_compound_reference_mode(cm); setup_compound_reference_mode(cm);
read_frame_reference_mode_probs(cm, &r); read_frame_reference_mode_probs(cm, &r);
#if !CONFIG_EC_ADAPT #if !CONFIG_EC_ADAPT
......
...@@ -314,7 +314,6 @@ static void encode_unsigned_max(struct aom_write_bit_buffer *wb, int data, ...@@ -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)); 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, static void prob_diff_update(const aom_tree_index *tree,
aom_prob probs[/*n - 1*/], aom_prob probs[/*n - 1*/],
const unsigned int counts[/*n - 1*/], int n, const unsigned int counts[/*n - 1*/], int n,
...@@ -330,6 +329,7 @@ static void prob_diff_update(const aom_tree_index *tree, ...@@ -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); 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, static int prob_diff_update_savings(const aom_tree_index *tree,
aom_prob probs[/*n - 1*/], aom_prob probs[/*n - 1*/],
const unsigned int counts[/*n - 1*/], int n, 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) { ...@@ -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 (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, static void update_txfm_probs(AV1_COMMON *cm, aom_writer *w,
FRAME_COUNTS *counts) { FRAME_COUNTS *counts) {
#if CONFIG_TILE_GROUPS #if CONFIG_TILE_GROUPS
...@@ -2927,7 +2926,6 @@ static void update_txfm_probs(AV1_COMMON *cm, aom_writer *w, ...@@ -2927,7 +2926,6 @@ static void update_txfm_probs(AV1_COMMON *cm, aom_writer *w,
counts->tx_size[i][j], i + 2, probwt, w); counts->tx_size[i][j], i + 2, probwt, w);
} }
} }
#endif
static void write_interp_filter(InterpFilter filter, static void write_interp_filter(InterpFilter filter,
struct aom_write_bit_buffer *wb) { struct aom_write_bit_buffer *wb) {
...@@ -3702,9 +3700,7 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) { ...@@ -3702,9 +3700,7 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
#if CONFIG_LOOP_RESTORATION #if CONFIG_LOOP_RESTORATION
encode_restoration(cm, header_bc); encode_restoration(cm, header_bc);
#endif // CONFIG_LOOP_RESTORATION #endif // CONFIG_LOOP_RESTORATION
#if !CONFIG_EC_ADAPT
update_txfm_probs(cm, header_bc, counts); update_txfm_probs(cm, header_bc, counts);
#endif
update_coef_probs(cpi, header_bc); update_coef_probs(cpi, header_bc);
#if CONFIG_VAR_TX #if CONFIG_VAR_TX
......
...@@ -169,7 +169,7 @@ static void write_mv_update(const aom_tree_index *tree, ...@@ -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, void av1_write_nmv_probs(AV1_COMMON *cm, int usehp, aom_writer *w,
nmv_context_counts *const nmv_counts) { nmv_context_counts *const nmv_counts) {
int i, j; int i;
#if CONFIG_REF_MV #if CONFIG_REF_MV
int nmv_ctx = 0; int nmv_ctx = 0;
for (nmv_ctx = 0; nmv_ctx < NMV_CONTEXTS; ++nmv_ctx) { 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, ...@@ -180,6 +180,7 @@ void av1_write_nmv_probs(AV1_COMMON *cm, int usehp, aom_writer *w,
w); w);
for (i = 0; i < 2; ++i) { for (i = 0; i < 2; ++i) {
int j;
nmv_component *comp = &mvc->comps[i]; nmv_component *comp = &mvc->comps[i];
nmv_component_counts *comp_counts = &counts->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, ...@@ -193,6 +194,7 @@ void av1_write_nmv_probs(AV1_COMMON *cm, int usehp, aom_writer *w,
} }
for (i = 0; i < 2; ++i) { for (i = 0; i < 2; ++i) {
int j;
for (j = 0; j < CLASS0_SIZE; ++j) for (j = 0; j < CLASS0_SIZE; ++j)
write_mv_update(av1_mv_fp_tree, mvc->comps[i].class0_fp[j], write_mv_update(av1_mv_fp_tree, mvc->comps[i].class0_fp[j],
counts->comps[i].class0_fp[j], MV_FP_SIZE, w); 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, ...@@ -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); write_mv_update(av1_mv_joint_tree, mvc->joints, counts->joints, MV_JOINTS, w);
for (i = 0; i < 2; ++i) { for (i = 0; i < 2; ++i) {
int j;
nmv_component *comp = &mvc->comps[i]; nmv_component *comp = &mvc->comps[i];
nmv_component_counts *comp_counts = &counts->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, ...@@ -231,6 +234,7 @@ void av1_write_nmv_probs(AV1_COMMON *cm, int usehp, aom_writer *w,
} }
for (i = 0; i < 2; ++i) { for (i = 0; i < 2; ++i) {
int j;
for (j = 0; j < CLASS0_SIZE; ++j) { for (j = 0; j < CLASS0_SIZE; ++j) {
write_mv_update(av1_mv_fp_tree, mvc->comps[i].class0_fp[j], write_mv_update(av1_mv_fp_tree, mvc->comps[i].class0_fp[j],
counts->comps[i].class0_fp[j], MV_FP_SIZE, w); counts->comps[i].class0_fp[j], MV_FP_SIZE, w);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment