diff options
Diffstat (limited to 'vp8/encoder')
-rw-r--r-- | vp8/encoder/bitstream.c | 142 | ||||
-rw-r--r-- | vp8/encoder/boolhuff.c | 2 | ||||
-rw-r--r-- | vp8/encoder/boolhuff.h | 2 | ||||
-rw-r--r-- | vp8/encoder/encodeframe.c | 19 | ||||
-rw-r--r-- | vp8/encoder/modecosts.c | 7 | ||||
-rw-r--r-- | vp8/encoder/onyx_if.c | 68 | ||||
-rw-r--r-- | vp8/encoder/onyx_int.h | 26 | ||||
-rw-r--r-- | vp8/encoder/rdopt.c | 27 | ||||
-rw-r--r-- | vp8/encoder/tokenize.c | 10 |
9 files changed, 7 insertions, 296 deletions
diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c index 3d0119572..db3e30982 100644 --- a/vp8/encoder/bitstream.c +++ b/vp8/encoder/bitstream.c @@ -55,7 +55,6 @@ int count_mb_seg[4] = { 0, 0, 0, 0 }; #define vp8_cost_upd ((int)(vp8_cost_one(upd) - vp8_cost_zero(upd)) >> 8) #define vp8_cost_upd256 ((int)(vp8_cost_one(upd) - vp8_cost_zero(upd))) -#if CONFIG_NEWUPDATE #define SEARCH_NEWP static int update_bits[255]; @@ -96,7 +95,6 @@ static int prob_diff_update_cost(vp8_prob newp, vp8_prob oldp) { int delp = remap_prob(newp, oldp); return update_bits[delp] * 256; } -#endif static void update_mode( vp8_writer *const w, @@ -153,7 +151,6 @@ static void update_mbintra_mode_probs(VP8_COMP *cpi) { } void update_skip_probs(VP8_COMP *cpi) { -#if CONFIG_NEWENTROPY VP8_COMMON *const pc = & cpi->common; int prob_skip_false[3] = {0, 0, 0}; int k; @@ -174,25 +171,6 @@ void update_skip_probs(VP8_COMP *cpi) { pc->mbskip_pred_probs[k] = prob_skip_false[k]; } - -#else - int prob_skip_false = 0; - - if ((cpi->skip_false_count + cpi->skip_true_count)) { - prob_skip_false = cpi->skip_false_count * 256 / - (cpi->skip_false_count + cpi->skip_true_count); - - if (prob_skip_false <= 1) - prob_skip_false = 1; - - if (prob_skip_false > 255) - prob_skip_false = 255; - } else - prob_skip_false = 128; - - cpi->prob_skip_false = prob_skip_false; - -#endif } // This function updates the reference frame prediction stats @@ -282,7 +260,6 @@ static int prob_update_savings(const unsigned int *ct, return (old_b - new_b - update_b); } -#if CONFIG_NEWUPDATE static int prob_diff_update_savings(const unsigned int *ct, const vp8_prob oldp, const vp8_prob newp, const vp8_prob upd) { @@ -316,7 +293,6 @@ static int prob_diff_update_savings_search(const unsigned int *ct, *bestp = bestnewp; return bestsavings; } -#endif static void pack_tokens_c(vp8_writer *w, const TOKENEXTRA *p, int xcount) { const TOKENEXTRA *const stop = p + xcount; @@ -716,16 +692,11 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) { #endif if (pc->mb_no_coeff_skip) { -#if CONFIG_NEWENTROPY int k; update_skip_probs(cpi); for (k = 0; k < MBSKIP_CONTEXTS; ++k) vp8_write_literal(w, pc->mbskip_pred_probs[k], 8); -#else - update_skip_probs(cpi); - vp8_write_literal(w, cpi->prob_skip_false, 8); -#endif } #if CONFIG_PRED_FILTER @@ -847,12 +818,8 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) { if (pc->mb_no_coeff_skip && (!segfeature_active(xd, segment_id, SEG_LVL_EOB) || (get_segdata(xd, segment_id, SEG_LVL_EOB) != 0))) { -#if CONFIG_NEWENTROPY vp8_encode_bool(w, mi->mb_skip_coeff, get_pred_prob(pc, xd, PRED_MBSKIP)); -#else - vp8_encode_bool(w, mi->mb_skip_coeff, cpi->prob_skip_false); -#endif } // Encode the reference frame. @@ -994,9 +961,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) { #endif write_split(w, mi->partitioning, cpi->common.fc.mbsplit_prob); -#if CONFIG_ADAPTIVE_ENTROPY cpi->mbsplit_count[mi->partitioning]++; -#endif do { B_PREDICTION_MODE blockmode; @@ -1022,9 +987,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) { write_sub_mv_ref(w, blockmode, cpi->common.fc.sub_mv_ref_prob [mv_contz]); -#if CONFIG_ADAPTIVE_ENTROPY cpi->sub_mv_ref_count[mv_contz][blockmode - LEFT4X4]++; -#endif if (blockmode == NEW4X4) { #ifdef ENTROPY_STATS active_section = 11; @@ -1092,18 +1055,13 @@ static void write_kfmodes(VP8_COMP *cpi) { int i; int row, col; int mb_row, mb_col; -#if CONFIG_NEWENTROPY int prob_skip_false[3] = {0, 0, 0}; -#else - int prob_skip_false = 0; -#endif int row_delta[4] = { 0, +1, 0, -1}; int col_delta[4] = { +1, -1, +1, +1}; // printf("write_kfmodes\n"); if (c->mb_no_coeff_skip) { // Divide by 0 check. 0 case possible with segment features -#if CONFIG_NEWENTROPY int k; for (k = 0; k < MBSKIP_CONTEXTS; ++k) { if ((cpi->skip_false_count[k] + cpi->skip_true_count[k])) { @@ -1121,22 +1079,6 @@ static void write_kfmodes(VP8_COMP *cpi) { c->mbskip_pred_probs[k] = prob_skip_false[k]; vp8_write_literal(bc, prob_skip_false[k], 8); } -#else - if ((cpi->skip_false_count + cpi->skip_true_count)) { - prob_skip_false = cpi->skip_false_count * 256 / - (cpi->skip_false_count + cpi->skip_true_count); - - if (prob_skip_false <= 1) - prob_skip_false = 1; - - if (prob_skip_false > 255) - prob_skip_false = 255; - } else - prob_skip_false = 255; - - cpi->prob_skip_false = prob_skip_false; - vp8_write_literal(bc, prob_skip_false, 8); -#endif } if (!c->kf_ymode_probs_update) { @@ -1179,12 +1121,8 @@ static void write_kfmodes(VP8_COMP *cpi) { if (c->mb_no_coeff_skip && (!segfeature_active(xd, segment_id, SEG_LVL_EOB) || (get_segdata(xd, segment_id, SEG_LVL_EOB) != 0))) { -#if CONFIG_NEWENTROPY vp8_encode_bool(bc, m->mbmi.mb_skip_coeff, get_pred_prob(c, xd, PRED_MBSKIP)); -#else - vp8_encode_bool(bc, m->mbmi.mb_skip_coeff, prob_skip_false); -#endif } kfwrite_ymode(bc, ym, c->kf_ymode_prob[c->kf_ymode_probs_index]); @@ -1284,10 +1222,8 @@ void build_coeff_contexts(VP8_COMP *cpi) { #ifdef ENTROPY_STATS int t; #endif -#if CONFIG_EXPANDED_COEF_CONTEXT if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) continue; -#endif vp8_tree_probs_from_distribution( MAX_ENTROPY_TOKENS, vp8_coef_encodings, vp8_coef_tree, cpi->frame_coef_probs [i][j][k], @@ -1323,10 +1259,8 @@ void build_coeff_contexts(VP8_COMP *cpi) { #ifdef ENTROPY_STATS int t = 0; /* token/prob index */ #endif -#if CONFIG_EXPANDED_COEF_CONTEXT if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) continue; -#endif vp8_tree_probs_from_distribution( MAX_ENTROPY_TOKENS, vp8_coef_encodings, vp8_coef_tree, cpi->frame_coef_probs_8x8 [i][j][k], @@ -1351,7 +1285,6 @@ void build_coeff_contexts(VP8_COMP *cpi) { } -#if CONFIG_NEWUPDATE static void update_coef_probs3(VP8_COMP *cpi) { const vp8_prob grpupd = 216; int i, j, k, t; @@ -1377,10 +1310,8 @@ static void update_coef_probs3(VP8_COMP *cpi) { const vp8_prob upd = COEF_UPDATE_PROB; int s; int u = 0; -#if CONFIG_EXPANDED_COEF_CONTEXT if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) continue; -#endif #if defined(SEARCH_NEWP) s = prob_diff_update_savings_search( @@ -1414,10 +1345,8 @@ static void update_coef_probs3(VP8_COMP *cpi) { int s; int u = 0; -#if CONFIG_EXPANDED_COEF_CONTEXT if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) continue; -#endif #if defined(SEARCH_NEWP) s = prob_diff_update_savings_search( cpi->frame_branch_ct [i][j][k][t], *Pold, &newp, upd); @@ -1459,10 +1388,8 @@ static void update_coef_probs3(VP8_COMP *cpi) { int s; int u = 0; -#if CONFIG_EXPANDED_COEF_CONTEXT if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) continue; -#endif #if defined(SEARCH_NEWP) s = prob_diff_update_savings_search( cpi->frame_branch_ct_8x8 [i][j][k][t], @@ -1498,10 +1425,8 @@ static void update_coef_probs3(VP8_COMP *cpi) { int s; int u = 0; -#if CONFIG_EXPANDED_COEF_CONTEXT if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) continue; -#endif #if defined(SEARCH_NEWP) s = prob_diff_update_savings_search( cpi->frame_branch_ct_8x8 [i][j][k][t], @@ -1555,10 +1480,8 @@ static void update_coef_probs2(VP8_COMP *cpi) { const vp8_prob upd = COEF_UPDATE_PROB; int s; int u = 0; -#if CONFIG_EXPANDED_COEF_CONTEXT if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) continue; -#endif #if defined(SEARCH_NEWP) s = prob_diff_update_savings_search( @@ -1593,10 +1516,8 @@ static void update_coef_probs2(VP8_COMP *cpi) { const vp8_prob upd = COEF_UPDATE_PROB; int s; int u = 0; -#if CONFIG_EXPANDED_COEF_CONTEXT if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) continue; -#endif #if defined(SEARCH_NEWP) s = prob_diff_update_savings_search( cpi->frame_branch_ct [i][j][k][t], *Pold, &newp, upd); @@ -1635,10 +1556,8 @@ static void update_coef_probs2(VP8_COMP *cpi) { const vp8_prob upd = COEF_UPDATE_PROB_8X8; int s; int u = 0; -#if CONFIG_EXPANDED_COEF_CONTEXT if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) continue; -#endif #if defined(SEARCH_NEWP) s = prob_diff_update_savings_search( cpi->frame_branch_ct_8x8 [i][j][k][t], @@ -1675,10 +1594,8 @@ static void update_coef_probs2(VP8_COMP *cpi) { const vp8_prob upd = COEF_UPDATE_PROB_8X8; int s; int u = 0; -#if CONFIG_EXPANDED_COEF_CONTEXT if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) continue; -#endif #if defined(SEARCH_NEWP) s = prob_diff_update_savings_search( cpi->frame_branch_ct_8x8 [i][j][k][t], @@ -1707,7 +1624,6 @@ static void update_coef_probs2(VP8_COMP *cpi) { } } } -#endif static void update_coef_probs(VP8_COMP *cpi) { int i = 0; @@ -1726,11 +1642,7 @@ static void update_coef_probs(VP8_COMP *cpi) { /* dry run to see if there is any udpate at all needed */ savings = 0; do { -#if CONFIG_NEWUPDATE int j = !i; -#else - int j = 0; /* token/prob index */ -#endif do { int k = 0; int prev_coef_savings[ENTROPY_NODES] = {0}; @@ -1742,11 +1654,9 @@ static void update_coef_probs(VP8_COMP *cpi) { const vp8_prob upd = COEF_UPDATE_PROB; int s = prev_coef_savings[t]; int u = 0; -#if CONFIG_EXPANDED_COEF_CONTEXT if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) continue; -#endif -#if CONFIG_NEWUPDATE && defined(SEARCH_NEWP) +#if defined(SEARCH_NEWP) s = prob_diff_update_savings_search( cpi->frame_branch_ct [i][j][k][t], *Pold, &newp, upd); @@ -1774,22 +1684,14 @@ static void update_coef_probs(VP8_COMP *cpi) { // printf("Update %d %d, savings %d\n", update[0], update[1], savings); /* Is coef updated at all */ -#if CONFIG_NEWUPDATE if (update[1] == 0 || savings < 0) -#else - if (update[1] == 0) -#endif { vp8_write_bit(w, 0); } else { vp8_write_bit(w, 1); i = 0; do { -#if CONFIG_NEWUPDATE int j = !i; -#else - int j = 0; /* token/prob index */ -#endif do { int k = 0; int prev_coef_savings[ENTROPY_NODES] = {0}; @@ -1803,12 +1705,10 @@ static void update_coef_probs(VP8_COMP *cpi) { const vp8_prob upd = COEF_UPDATE_PROB; int s = prev_coef_savings[t]; int u = 0; -#if CONFIG_EXPANDED_COEF_CONTEXT if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) continue; -#endif -#if CONFIG_NEWUPDATE && defined(SEARCH_NEWP) +#if defined(SEARCH_NEWP) s = prob_diff_update_savings_search( cpi->frame_branch_ct [i][j][k][t], *Pold, &newp, upd); @@ -1830,11 +1730,7 @@ static void update_coef_probs(VP8_COMP *cpi) { #endif if (u) { /* send/use new probability */ -#if CONFIG_NEWUPDATE write_prob_diff_update(w, newp, *Pold); -#else - vp8_write_literal(w, newp, 8); -#endif *Pold = newp; } } while (++t < ENTROPY_NODES); @@ -1852,11 +1748,7 @@ static void update_coef_probs(VP8_COMP *cpi) { savings = 0; i = 0; do { -#if CONFIG_NEWUPDATE int j = !i; -#else - int j = 0; /* token/prob index */ -#endif do { int k = 0; do { @@ -1869,11 +1761,9 @@ static void update_coef_probs(VP8_COMP *cpi) { const vp8_prob oldp = *Pold; int s, u; const vp8_prob upd = COEF_UPDATE_PROB_8X8; -#if CONFIG_EXPANDED_COEF_CONTEXT if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) continue; -#endif -#if CONFIG_NEWUPDATE && defined(SEARCH_NEWP) +#if defined(SEARCH_NEWP) s = prob_diff_update_savings_search(ct, oldp, &newp, upd); u = s > 0 && newp != oldp ? 1 : 0; if (u) @@ -1893,22 +1783,14 @@ static void update_coef_probs(VP8_COMP *cpi) { } while (++j < COEF_BANDS); } while (++i < BLOCK_TYPES_8X8); -#if CONFIG_NEWUPDATE if (update[1] == 0 || savings < 0) -#else - if (update[1] == 0) -#endif { vp8_write_bit(w, 0); } else { vp8_write_bit(w, 1); i = 0; do { -#if CONFIG_NEWUPDATE int j = !i; -#else - int j = 0; /* token/prob index */ -#endif do { int k = 0; do { @@ -1920,12 +1802,10 @@ static void update_coef_probs(VP8_COMP *cpi) { const vp8_prob oldp = *Pold; const vp8_prob upd = COEF_UPDATE_PROB_8X8; int s, u; -#if CONFIG_EXPANDED_COEF_CONTEXT if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) continue; -#endif -#if CONFIG_NEWUPDATE && defined(SEARCH_NEWP) +#if defined(SEARCH_NEWP) s = prob_diff_update_savings_search(ct, oldp, &newp, upd); u = s > 0 && newp != oldp ? 1 : 0; #else @@ -1939,11 +1819,7 @@ static void update_coef_probs(VP8_COMP *cpi) { #endif if (u) { /* send/use new probability */ -#if CONFIG_NEWUPDATE write_prob_diff_update(w, newp, oldp); -#else - vp8_write_literal(w, newp, 8); -#endif *Pold = newp; } } while (++t < MAX_ENTROPY_TOKENS - 1); @@ -2034,9 +1910,7 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size) Sectionbits[active_section = 1] += sizeof(VP8_HEADER) * 8 * 256; #endif -#if CONFIG_NEWUPDATE compute_update_table(); -#endif // vp8_kf_default_bmode_probs() is called in vp8_setup_key_frame() once for each // K frame before encode frame. pc->kf_bmode_prob doesn't get changed anywhere @@ -2351,7 +2225,6 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size) vp8_clear_system_state(); // __asm emms; -#if CONFIG_ADAPTIVE_ENTROPY vp8_copy(cpi->common.fc.pre_coef_probs, cpi->common.fc.coef_probs); vp8_copy(cpi->common.fc.pre_coef_probs_8x8, cpi->common.fc.coef_probs_8x8); vp8_copy(cpi->common.fc.pre_ymode_prob, cpi->common.fc.ymode_prob); @@ -2368,10 +2241,9 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size) vp8_zero(cpi->mbsplit_count); vp8_zero(cpi->common.fc.mv_ref_ct) vp8_zero(cpi->common.fc.mv_ref_ct_a) -#endif -#if CONFIG_NEWUPDATE && COEFUPDATETYPE == 2 +#if COEFUPDATETYPE == 2 update_coef_probs2(cpi); -#elif CONFIG_NEWUPDATE && COEFUPDATETYPE == 3 +#elif COEFUPDATETYPE == 3 update_coef_probs3(cpi); #else update_coef_probs(cpi); @@ -2393,9 +2265,7 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size) #endif } else { pack_inter_mode_mvs(cpi); -#if CONFIG_ADAPTIVE_ENTROPY == 0 vp8_update_mode_context(&cpi->common); -#endif #ifdef ENTROPY_STATS active_section = 1; diff --git a/vp8/encoder/boolhuff.c b/vp8/encoder/boolhuff.c index e23d32e85..15fe24136 100644 --- a/vp8/encoder/boolhuff.c +++ b/vp8/encoder/boolhuff.c @@ -65,7 +65,6 @@ void vp8_encode_value(BOOL_CODER *br, int data, int bits) { } -#if CONFIG_NEWUPDATE int recenter_nonneg(int v, int m) { if (v > (m << 1)) return v; else if (v >= m) return ((v - m) << 1); @@ -153,4 +152,3 @@ int vp8_count_term_subexp(int word, int k, int num_syms) { } return count; } -#endif diff --git a/vp8/encoder/boolhuff.h b/vp8/encoder/boolhuff.h index 5b81b0670..ac9426911 100644 --- a/vp8/encoder/boolhuff.h +++ b/vp8/encoder/boolhuff.h @@ -40,13 +40,11 @@ extern void vp8_encode_value(BOOL_CODER *br, int data, int bits); extern void vp8_stop_encode(BOOL_CODER *bc); extern const unsigned int vp8_prob_cost[256]; -#if CONFIG_NEWENTROPY extern void vp8_encode_uniform(BOOL_CODER *bc, int v, int n); extern void vp8_encode_term_subexp(BOOL_CODER *bc, int v, int k, int n); extern int vp8_count_uniform(int v, int n); extern int vp8_count_term_subexp(int v, int k, int n); extern int recenter_nonneg(int v, int m); -#endif DECLARE_ALIGNED(16, extern const unsigned char, vp8_norm[256]); diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c index c8ee52fad..737348ace 100644 --- a/vp8/encoder/encodeframe.c +++ b/vp8/encoder/encodeframe.c @@ -411,14 +411,12 @@ static void update_state(VP8_COMP *cpi, MACROBLOCK *x, PICK_MODE_CONTEXT *ctx) { THR_DC /*DC_PRED*/, THR_V_PRED /*V_PRED*/, THR_H_PRED /*H_PRED*/, -#if CONFIG_NEWINTRAMODES THR_D45_PRED /*D45_PRED*/, THR_D135_PRED /*D135_PRED*/, THR_D117_PRED /*D117_PRED*/, THR_D153_PRED /*D153_PRED*/, THR_D27_PRED /*D27_PRED*/, THR_D63_PRED /*D63_PRED*/, -#endif THR_TM /*TM_PRED*/, THR_I8X8_PRED /*I8X8_PRED*/, THR_B_PRED /*B_PRED*/, @@ -1052,10 +1050,8 @@ void init_encode_frame_mb_context(VP8_COMP *cpi) { vp8_zero(cpi->y_uv_mode_count) vp8_zero(cpi->sub_mv_ref_count) vp8_zero(cpi->mbsplit_count) -#if CONFIG_ADAPTIVE_ENTROPY vp8_zero(cpi->common.fc.mv_ref_ct) vp8_zero(cpi->common.fc.mv_ref_ct_a) -#endif // vp8_zero(cpi->uv_mode_count) x->mvc = cm->fc.mvc; @@ -1169,13 +1165,8 @@ static void encode_frame_internal(VP8_COMP *cpi) { cpi->prediction_error = 0; cpi->intra_error = 0; -#if CONFIG_NEWENTROPY cpi->skip_true_count[0] = cpi->skip_true_count[1] = cpi->skip_true_count[2] = 0; cpi->skip_false_count[0] = cpi->skip_false_count[1] = cpi->skip_false_count[2] = 0; -#else - cpi->skip_true_count = 0; - cpi->skip_false_count = 0; -#endif #if CONFIG_PRED_FILTER if (cm->current_video_frame == 0) { @@ -1689,29 +1680,19 @@ void vp8cx_encode_inter_macroblock } #endif } else { -#if CONFIG_NEWENTROPY int mb_skip_context = cpi->common.mb_no_coeff_skip ? (x->e_mbd.mode_info_context - 1)->mbmi.mb_skip_coeff + (x->e_mbd.mode_info_context - cpi->common.mode_info_stride)->mbmi.mb_skip_coeff : 0; -#endif if (cpi->common.mb_no_coeff_skip) { xd->mode_info_context->mbmi.mb_skip_coeff = 1; -#if CONFIG_NEWENTROPY cpi->skip_true_count[mb_skip_context]++; -#else - cpi->skip_true_count++; -#endif vp8_fix_contexts(xd); } else { vp8_stuff_mb(cpi, xd, t); xd->mode_info_context->mbmi.mb_skip_coeff = 0; -#if CONFIG_NEWENTROPY cpi->skip_false_count[mb_skip_context]++; -#else - cpi->skip_false_count++; -#endif } } } diff --git a/vp8/encoder/modecosts.c b/vp8/encoder/modecosts.c index 7a9c19a82..8752eead7 100644 --- a/vp8/encoder/modecosts.c +++ b/vp8/encoder/modecosts.c @@ -32,13 +32,8 @@ void vp8_init_mode_costs(VP8_COMP *c) { vp8_cost_tokens((int *)c->mb.inter_bmode_costs, x->fc.bmode_prob, T); } -#if CONFIG_ADAPTIVE_ENTROPY vp8_cost_tokens((int *)c->mb.inter_bmode_costs, - vp8_sub_mv_ref_prob, vp8_sub_mv_ref_tree); -#else - vp8_cost_tokens(c->mb.inter_bmode_costs, - vp8_sub_mv_ref_prob, vp8_sub_mv_ref_tree); -#endif + x->fc.sub_mv_ref_prob[0], vp8_sub_mv_ref_tree); vp8_cost_tokens(c->mb.mbmode_cost[1], x->fc.ymode_prob, vp8_ymode_tree); vp8_cost_tokens(c->mb.mbmode_cost[0], diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 7a9022a1d..05fe0ff75 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -173,11 +173,7 @@ extern void (*vp8_short_fdct8x4)(short *input, short *output, int pitch); extern void vp8cx_init_quantizer(VP8_COMP *cpi); -#if CONFIG_NEWENTROPY int vp8cx_base_skip_false_prob[QINDEX_RANGE][3]; -#else -int vp8cx_base_skip_false_prob[QINDEX_RANGE]; -#endif // Tables relating active max Q to active min Q static int kf_low_motion_minq[QINDEX_RANGE]; @@ -265,7 +261,6 @@ void init_base_skip_probs() { skip_prob = 1; else if (skip_prob > 255) skip_prob = 255; -#if CONFIG_NEWENTROPY vp8cx_base_skip_false_prob[i][1] = skip_prob; skip_prob = t * 0.75; @@ -281,9 +276,6 @@ void init_base_skip_probs() { else if (skip_prob > 255) skip_prob = 255; vp8cx_base_skip_false_prob[i][0] = skip_prob; -#else - vp8cx_base_skip_false_prob[i] = skip_prob; -#endif } } void update_base_skip_probs(VP8_COMP *cpi) { @@ -293,41 +285,25 @@ void update_base_skip_probs(VP8_COMP *cpi) { update_skip_probs(cpi); if (cm->refresh_alt_ref_frame) { -#if CONFIG_NEWENTROPY int k; for (k = 0; k < MBSKIP_CONTEXTS; ++k) cpi->last_skip_false_probs[2][k] = cm->mbskip_pred_probs[k]; -#else - cpi->last_skip_false_probs[2] = cpi->prob_skip_false; -#endif cpi->last_skip_probs_q[2] = cm->base_qindex; } else if (cpi->common.refresh_golden_frame) { -#if CONFIG_NEWENTROPY int k; for (k = 0; k < MBSKIP_CONTEXTS; ++k) cpi->last_skip_false_probs[1][k] = cm->mbskip_pred_probs[k]; -#else - cpi->last_skip_false_probs[1] = cpi->prob_skip_false; -#endif cpi->last_skip_probs_q[1] = cm->base_qindex; } else { -#if CONFIG_NEWENTROPY int k; for (k = 0; k < MBSKIP_CONTEXTS; ++k) cpi->last_skip_false_probs[0][k] = cm->mbskip_pred_probs[k]; -#else - cpi->last_skip_false_probs[0] = cpi->prob_skip_false; -#endif cpi->last_skip_probs_q[0] = cm->base_qindex; // update the baseline table for the current q -#if CONFIG_NEWENTROPY for (k = 0; k < MBSKIP_CONTEXTS; ++k) cpi->base_skip_false_prob[cm->base_qindex][k] = cm->mbskip_pred_probs[k]; -#else - cpi->base_skip_false_prob[cm->base_qindex] = cpi->prob_skip_false; -#endif } } @@ -755,14 +731,12 @@ void vp8_set_speed_features(VP8_COMP *cpi) { sf->thresh_mult[THR_V_PRED ] = 1000; sf->thresh_mult[THR_H_PRED ] = 1000; -#if CONFIG_NEWINTRAMODES sf->thresh_mult[THR_D45_PRED ] = 1000; sf->thresh_mult[THR_D135_PRED] = 1000; sf->thresh_mult[THR_D117_PRED] = 1000; sf->thresh_mult[THR_D153_PRED] = 1000; sf->thresh_mult[THR_D27_PRED ] = 1000; sf->thresh_mult[THR_D63_PRED ] = 1000; -#endif sf->thresh_mult[THR_B_PRED ] = 2000; sf->thresh_mult[THR_I8X8_PRED] = 2000; sf->thresh_mult[THR_TM ] = 1000; @@ -810,14 +784,12 @@ void vp8_set_speed_features(VP8_COMP *cpi) { sf->thresh_mult[THR_NEARMV_FILT ] = 0; sf->thresh_mult[THR_V_PRED ] = 1000; sf->thresh_mult[THR_H_PRED ] = 1000; -#if CONFIG_NEWINTRAMODES sf->thresh_mult[THR_D45_PRED ] = 1000; sf->thresh_mult[THR_D135_PRED] = 1000; sf->thresh_mult[THR_D117_PRED] = 1000; sf->thresh_mult[THR_D153_PRED] = 1000; sf->thresh_mult[THR_D27_PRED ] = 1000; sf->thresh_mult[THR_D63_PRED ] = 1000; -#endif sf->thresh_mult[THR_B_PRED ] = 2500; sf->thresh_mult[THR_I8X8_PRED] = 2500; sf->thresh_mult[THR_TM ] = 1000; @@ -868,14 +840,12 @@ void vp8_set_speed_features(VP8_COMP *cpi) { sf->thresh_mult[THR_NEARMV ] = 0; sf->thresh_mult[THR_V_PRED ] = 1000; sf->thresh_mult[THR_H_PRED ] = 1000; -#if CONFIG_NEWINTRAMODES sf->thresh_mult[THR_D45_PRED ] = 1000; sf->thresh_mult[THR_D135_PRED] = 1000; sf->thresh_mult[THR_D117_PRED] = 1000; sf->thresh_mult[THR_D153_PRED] = 1000; sf->thresh_mult[THR_D27_PRED ] = 1000; sf->thresh_mult[THR_D63_PRED ] = 1000; -#endif sf->thresh_mult[THR_B_PRED ] = 2500; sf->thresh_mult[THR_I8X8_PRED] = 2500; sf->thresh_mult[THR_TM ] = 1000; @@ -952,14 +922,12 @@ void vp8_set_speed_features(VP8_COMP *cpi) { sf->thresh_mult[THR_TM ] = 1500; sf->thresh_mult[THR_V_PRED ] = 1500; sf->thresh_mult[THR_H_PRED ] = 1500; -#if CONFIG_NEWINTRAMODES sf->thresh_mult[THR_D45_PRED ] = 1500; sf->thresh_mult[THR_D135_PRED] = 1500; sf->thresh_mult[THR_D117_PRED] = 1500; sf->thresh_mult[THR_D153_PRED] = 1500; sf->thresh_mult[THR_D27_PRED ] = 1500; sf->thresh_mult[THR_D63_PRED ] = 1500; -#endif sf->thresh_mult[THR_B_PRED ] = 5000; sf->thresh_mult[THR_I8X8_PRED] = 5000; @@ -1029,14 +997,12 @@ void vp8_set_speed_features(VP8_COMP *cpi) { sf->thresh_mult[THR_TM ] = 2000; sf->thresh_mult[THR_V_PRED ] = 2000; sf->thresh_mult[THR_H_PRED ] = 2000; -#if CONFIG_NEWINTRAMODES sf->thresh_mult[THR_D45_PRED ] = 2000; sf->thresh_mult[THR_D135_PRED] = 2000; sf->thresh_mult[THR_D117_PRED] = 2000; sf->thresh_mult[THR_D153_PRED] = 2000; sf->thresh_mult[THR_D27_PRED ] = 2000; sf->thresh_mult[THR_D63_PRED ] = 2000; -#endif sf->thresh_mult[THR_B_PRED ] = 7500; sf->thresh_mult[THR_I8X8_PRED] = 7500; @@ -3243,51 +3209,31 @@ static void encode_frame_to_data_rate // setup skip prob for costing in mode/mv decision if (cpi->common.mb_no_coeff_skip) { -#if CONFIG_NEWENTROPY int k; for (k = 0; k < MBSKIP_CONTEXTS; k++) cm->mbskip_pred_probs[k] = cpi->base_skip_false_prob[Q][k]; -#else - cpi->prob_skip_false = cpi->base_skip_false_prob[Q]; -#endif if (cm->frame_type != KEY_FRAME) { if (cpi->common.refresh_alt_ref_frame) { -#if CONFIG_NEWENTROPY for (k = 0; k < MBSKIP_CONTEXTS; k++) { if (cpi->last_skip_false_probs[2][k] != 0) cm->mbskip_pred_probs[k] = cpi->last_skip_false_probs[2][k]; } -#else - if (cpi->last_skip_false_probs[2] != 0) - cpi->prob_skip_false = cpi->last_skip_false_probs[2]; -#endif } else if (cpi->common.refresh_golden_frame) { -#if CONFIG_NEWENTROPY for (k = 0; k < MBSKIP_CONTEXTS; k++) { if (cpi->last_skip_false_probs[1][k] != 0) cm->mbskip_pred_probs[k] = cpi->last_skip_false_probs[1][k]; } -#else - if (cpi->last_skip_false_probs[1] != 0) - cpi->prob_skip_false = cpi->last_skip_false_probs[1]; -#endif } else { -#if CONFIG_NEWENTROPY int k; for (k = 0; k < MBSKIP_CONTEXTS; k++) { if (cpi->last_skip_false_probs[0][k] != 0) cm->mbskip_pred_probs[k] = cpi->last_skip_false_probs[0][k]; } -#else - if (cpi->last_skip_false_probs[0] != 0) - cpi->prob_skip_false = cpi->last_skip_false_probs[0]; -#endif } // as this is for cost estimate, let's make sure it does not // get extreme either way -#if CONFIG_NEWENTROPY { int k; for (k = 0; k < MBSKIP_CONTEXTS; ++k) { @@ -3301,18 +3247,6 @@ static void encode_frame_to_data_rate cm->mbskip_pred_probs[k] = 1; } } -#else - if (cpi->prob_skip_false < 5) - cpi->prob_skip_false = 5; - - if (cpi->prob_skip_false > 250) - cpi->prob_skip_false = 250; - - if (cpi->is_src_frame_alt_ref) - cpi->prob_skip_false = 1; -#endif - - } } @@ -3648,7 +3582,6 @@ static void encode_frame_to_data_rate #endif update_reference_frames(cm); -#if CONFIG_ADAPTIVE_ENTROPY vp8_copy(cpi->common.fc.coef_counts, cpi->coef_counts); vp8_copy(cpi->common.fc.coef_counts_8x8, cpi->coef_counts_8x8); vp8_adapt_coef_probs(&cpi->common); @@ -3668,7 +3601,6 @@ static void encode_frame_to_data_rate vp8_adapt_mv_probs(&cpi->common); vp8_update_mode_context(&cpi->common); } -#endif /* CONFIG_ADAPTIVE_ENTROPY */ /* Move storing frame_type out of the above loop since it is also * needed in motion search besides loopfilter */ diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h index 1fa8b0588..cf7193324 100644 --- a/vp8/encoder/onyx_int.h +++ b/vp8/encoder/onyx_int.h @@ -44,17 +44,9 @@ #define ARF_DECAY_THRESH 12 #if CONFIG_PRED_FILTER -#if CONFIG_NEWINTRAMODES #define MAX_MODES 54 -#else -#define MAX_MODES 48 -#endif #else // CONFIG_PRED_FILTER -#if CONFIG_NEWINTRAMODES #define MAX_MODES 42 -#else -#define MAX_MODES 36 -#endif #endif // CONFIG_PRED_FILTER #define MIN_THRESHMULT 32 @@ -195,14 +187,12 @@ typedef enum { THR_V_PRED, THR_H_PRED, -#if CONFIG_NEWINTRAMODES THR_D45_PRED, THR_D135_PRED, THR_D117_PRED, THR_D153_PRED, THR_D27_PRED, THR_D63_PRED, -#endif THR_TM, THR_NEWMV, @@ -259,14 +249,12 @@ typedef enum { THR_V_PRED, THR_H_PRED, -#if CONFIG_NEWINTRAMODES THR_D45_PRED, THR_D135_PRED, THR_D117_PRED, THR_D153_PRED, THR_D27_PRED, THR_D63_PRED, -#endif THR_TM, THR_NEWMV, @@ -585,12 +573,7 @@ typedef struct VP8_COMP { int vert_scale; int pass; -#if CONFIG_NEWENTROPY vp8_prob last_skip_false_probs[3][MBSKIP_CONTEXTS]; -#else - vp8_prob prob_skip_false; - vp8_prob last_skip_false_probs[3]; -#endif int last_skip_probs_q[3]; int recent_ref_frame_usage[MAX_REF_FRAMES]; @@ -606,13 +589,8 @@ typedef struct VP8_COMP { int inter_zz_count; int gf_bad_count; int gf_update_recommended; -#if CONFIG_NEWENTROPY int skip_true_count[3]; int skip_false_count[3]; -#else - int skip_true_count; - int skip_false_count; -#endif int t4x4_count; int t8x8_count; @@ -636,11 +614,7 @@ typedef struct VP8_COMP { unsigned int time_pick_lpf; unsigned int time_encode_mb_row; -#if CONFIG_NEWENTROPY int base_skip_false_prob[QINDEX_RANGE][3]; -#else - int base_skip_false_prob[QINDEX_RANGE]; -#endif struct twopass_rc { unsigned int section_intra_rating; diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index 761663682..cd45074b7 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -112,14 +112,12 @@ const MODE_DEFINITION vp8_mode_order[MAX_MODES] = { {V_PRED, INTRA_FRAME, 0, 0}, {H_PRED, INTRA_FRAME, 0, 0}, -#if CONFIG_NEWINTRAMODES {D45_PRED, INTRA_FRAME, 0, 0}, {D135_PRED, INTRA_FRAME, 0, 0}, {D117_PRED, INTRA_FRAME, 0, 0}, {D153_PRED, INTRA_FRAME, 0, 0}, {D27_PRED, INTRA_FRAME, 0, 0}, {D63_PRED, INTRA_FRAME, 0, 0}, -#endif {TM_PRED, INTRA_FRAME, 0, 0}, @@ -177,14 +175,12 @@ const MODE_DEFINITION vp8_mode_order[MAX_MODES] = { {V_PRED, INTRA_FRAME, 0}, {H_PRED, INTRA_FRAME, 0}, -#if CONFIG_NEWINTRAMODES {D45_PRED, INTRA_FRAME, 0}, {D135_PRED, INTRA_FRAME, 0}, {D117_PRED, INTRA_FRAME, 0}, {D153_PRED, INTRA_FRAME, 0}, {D27_PRED, INTRA_FRAME, 0}, {D63_PRED, INTRA_FRAME, 0}, -#endif {TM_PRED, INTRA_FRAME, 0}, @@ -2406,14 +2402,12 @@ void rd_update_mvcount(VP8_COMP *cpi, MACROBLOCK *x, - best_ref_mv->as_mv.row)]++; cpi->MVcount_hp[1][mv_max_hp + (x->partition_info->bmi[i].mv.as_mv.col - best_ref_mv->as_mv.col)]++; -#if CONFIG_ADAPTIVE_ENTROPY if (x->e_mbd.mode_info_context->mbmi.second_ref_frame) { cpi->MVcount_hp[0][mv_max_hp + (x->partition_info->bmi[i].second_mv.as_mv.row - second_best_ref_mv->as_mv.row)]++; cpi->MVcount_hp[1][mv_max_hp + (x->partition_info->bmi[i].second_mv.as_mv.col - second_best_ref_mv->as_mv.col)]++; } -#endif } else #endif { @@ -2421,14 +2415,12 @@ void rd_update_mvcount(VP8_COMP *cpi, MACROBLOCK *x, - best_ref_mv->as_mv.row) >> 1)]++; cpi->MVcount[1][mv_max + ((x->partition_info->bmi[i].mv.as_mv.col - best_ref_mv->as_mv.col) >> 1)]++; -#if CONFIG_ADAPTIVE_ENTROPY if (x->e_mbd.mode_info_context->mbmi.second_ref_frame) { cpi->MVcount[0][mv_max + ((x->partition_info->bmi[i].second_mv.as_mv.row - second_best_ref_mv->as_mv.row) >> 1)]++; cpi->MVcount[1][mv_max + ((x->partition_info->bmi[i].second_mv.as_mv.col - second_best_ref_mv->as_mv.col) >> 1)]++; } -#endif } } } @@ -2439,14 +2431,12 @@ void rd_update_mvcount(VP8_COMP *cpi, MACROBLOCK *x, - best_ref_mv->as_mv.row)]++; cpi->MVcount_hp[1][mv_max_hp + (x->e_mbd.mode_info_context->mbmi.mv.as_mv.col - best_ref_mv->as_mv.col)]++; -#if CONFIG_ADAPTIVE_ENTROPY if (x->e_mbd.mode_info_context->mbmi.second_ref_frame) { cpi->MVcount_hp[0][mv_max_hp + (x->e_mbd.mode_info_context->mbmi.second_mv.as_mv.row - second_best_ref_mv->as_mv.row)]++; cpi->MVcount_hp[1][mv_max_hp + (x->e_mbd.mode_info_context->mbmi.second_mv.as_mv.col - second_best_ref_mv->as_mv.col)]++; } -#endif } else #endif { @@ -2454,14 +2444,12 @@ void rd_update_mvcount(VP8_COMP *cpi, MACROBLOCK *x, - best_ref_mv->as_mv.row) >> 1)]++; cpi->MVcount[1][mv_max + ((x->e_mbd.mode_info_context->mbmi.mv.as_mv.col - best_ref_mv->as_mv.col) >> 1)]++; -#if CONFIG_ADAPTIVE_ENTROPY if (x->e_mbd.mode_info_context->mbmi.second_ref_frame) { cpi->MVcount[0][mv_max + ((x->e_mbd.mode_info_context->mbmi.second_mv.as_mv.row - second_best_ref_mv->as_mv.row) >> 1)]++; cpi->MVcount[1][mv_max + ((x->e_mbd.mode_info_context->mbmi.second_mv.as_mv.col - second_best_ref_mv->as_mv.col) >> 1)]++; } -#endif } } } @@ -3004,14 +2992,12 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int vp8_cost_bit(get_pred_prob(cm, xd, PRED_COMP), 0); } break; -#if CONFIG_NEWINTRAMODES case D45_PRED: case D135_PRED: case D117_PRED: case D153_PRED: case D27_PRED: case D63_PRED: -#endif case DC_PRED: case V_PRED: case H_PRED: @@ -3479,7 +3465,6 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int int prob_skip_cost; // Cost the skip mb case -#if CONFIG_NEWENTROPY vp8_prob skip_prob = get_pred_prob(cm, &x->e_mbd, PRED_MBSKIP); @@ -3488,24 +3473,12 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int rate2 += prob_skip_cost; other_cost += prob_skip_cost; } -#else - if (cpi->prob_skip_false) { - prob_skip_cost = - vp8_cost_bit(cpi->prob_skip_false, 1); - rate2 += prob_skip_cost; - other_cost += prob_skip_cost; - } -#endif } } // Add in the cost of the no skip flag. else if (mb_skip_allowed) { -#if CONFIG_NEWENTROPY int prob_skip_cost = vp8_cost_bit( get_pred_prob(cm, &x->e_mbd, PRED_MBSKIP), 0); -#else - int prob_skip_cost = vp8_cost_bit(cpi->prob_skip_false, 0); -#endif rate2 += prob_skip_cost; other_cost += prob_skip_cost; } diff --git a/vp8/encoder/tokenize.c b/vp8/encoder/tokenize.c index 673c2dd45..50a31643d 100644 --- a/vp8/encoder/tokenize.c +++ b/vp8/encoder/tokenize.c @@ -630,9 +630,7 @@ void vp8_tokenize_mb(VP8_COMP *cpi, MACROBLOCKD *x, TOKENEXTRA **t) { int has_y2_block; int b; int tx_type = x->mode_info_context->mbmi.txfm_size; -#if CONFIG_NEWENTROPY int mb_skip_context = get_pred_context(&cpi->common, x, PRED_MBSKIP); -#endif // If the MB is going to be skipped because of a segment level flag // exclude this from the skip count stats used to calculate the @@ -661,11 +659,7 @@ void vp8_tokenize_mb(VP8_COMP *cpi, MACROBLOCKD *x, TOKENEXTRA **t) { mb_is_skippable(x, has_y2_block)); if (x->mode_info_context->mbmi.mb_skip_coeff) { -#if CONFIG_NEWENTROPY cpi->skip_true_count[mb_skip_context] += skip_inc; -#else - cpi->skip_true_count += skip_inc; -#endif if (!cpi->common.mb_no_coeff_skip) { if (tx_type == TX_8X8) @@ -679,11 +673,7 @@ void vp8_tokenize_mb(VP8_COMP *cpi, MACROBLOCKD *x, TOKENEXTRA **t) { return; } -#if CONFIG_NEWENTROPY cpi->skip_false_count[mb_skip_context] += skip_inc; -#else - cpi->skip_false_count += skip_inc; -#endif plane_type = 3; if (has_y2_block) { |