ref: 525745b17ab832000c36b9823f6874ef657c187d
parent: 455f2de20b3f821a4b8bb9edb7e250192d7736a0
author: Jingning Han <[email protected]>
date: Mon Jul 29 13:06:18 EDT 2013
Remove a redundant branching in tokenize_b The tokenize_b function is only called when output flag is on. Hence removing the conditional branch on it therein. Change-Id: Ib709f47f23f39ca05a695faf86fa3377f11f2dd0
--- a/vp9/encoder/vp9_tokenize.c
+++ b/vp9/encoder/vp9_tokenize.c
@@ -95,7 +95,6 @@
MACROBLOCKD *xd;
TOKENEXTRA **tp;
TX_SIZE tx_size;
- int dry_run;
};
static void set_entropy_context_b(int plane, int block, BLOCK_SIZE_TYPE bsize,
@@ -126,9 +125,7 @@
VP9_COMP *cpi = args->cpi;
MACROBLOCKD *xd = args->xd;
TOKENEXTRA **tp = args->tp;
- TX_SIZE tx_size = ss_txfrm_size / 2;
- int dry_run = args->dry_run;
-
+ TX_SIZE tx_size = ss_txfrm_size >> 1;
MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi;
int pt; /* near block/prev token context index */
int c = 0, rc = 0;
@@ -218,11 +215,10 @@
assert(vp9_coef_encodings[t->token].len - t->skip_eob_node > 0);
- if (!dry_run) {
- ++counts[type][ref][band][pt][token];
- if (!t->skip_eob_node)
- ++cpi->common.counts.eob_branch[tx_size][type][ref][band][pt];
- }
+ ++counts[type][ref][band][pt][token];
+ if (!t->skip_eob_node)
+ ++cpi->common.counts.eob_branch[tx_size][type][ref][band][pt];
+
token_cache[rc] = vp9_pt_energy_class[token];
++t;
} while (c < eob && ++c < seg_eob);
@@ -276,7 +272,7 @@
const int mb_skip_context = vp9_get_pred_context_mbskip(xd);
const int skip_inc = !vp9_segfeature_active(&xd->seg, mbmi->segment_id,
SEG_LVL_SKIP);
- struct tokenize_b_args arg = { cpi, xd, t, mbmi->txfm_size, dry_run };
+ struct tokenize_b_args arg = {cpi, xd, t, mbmi->txfm_size};
mbmi->mb_skip_coeff = vp9_sb_is_skippable(xd, bsize);
if (mbmi->mb_skip_coeff) {