Replacing VP9_COMBINEENTROPYCONTEXTS macro with function.

Change-Id: I3bbc31840af69481e1d9bb4427c9ee25abf82946
This commit is contained in:
Dmitry Kovalev 2013-04-16 15:30:28 -07:00
parent 07cde4fdc8
commit 9087d6d470
5 changed files with 9 additions and 7 deletions

View File

@ -51,8 +51,10 @@ typedef struct {
ENTROPY_CONTEXT v[2];
} ENTROPY_CONTEXT_PLANES;
#define VP9_COMBINEENTROPYCONTEXTS(Dest, A, B) \
Dest = ((A)!=0) + ((B)!=0);
static INLINE int combine_entropy_contexts(ENTROPY_CONTEXT a,
ENTROPY_CONTEXT b) {
return (a != 0) + (b != 0);
}
typedef enum {
KEY_FRAME = 0,

View File

@ -235,7 +235,7 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
break;
}
VP9_COMBINEENTROPYCONTEXTS(pt, above_ec, left_ec);
pt = combine_entropy_contexts(above_ec, left_ec);
nb = vp9_get_coef_neighbors_handle(scan, &pad);
while (1) {

View File

@ -582,7 +582,7 @@ static void optimize_b(VP9_COMMON *const cm,
/* Now pick the best path through the whole trellis. */
band = get_coef_band(scan, tx_size, i + 1);
VP9_COMBINEENTROPYCONTEXTS(pt, *a, *l);
pt = combine_entropy_contexts(*a, *l);
rate0 = tokens[next][0].rate;
rate1 = tokens[next][1].rate;
error0 = tokens[next][0].error;

View File

@ -491,7 +491,7 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
}
assert(eob <= seg_eob);
VP9_COMBINEENTROPYCONTEXTS(pt, a_ec, l_ec);
pt = combine_entropy_contexts(a_ec, l_ec);
nb = vp9_get_coef_neighbors_handle(scan, &pad);
default_eob = seg_eob;

View File

@ -250,7 +250,7 @@ static void tokenize_b(VP9_COMP *cpi,
break;
}
VP9_COMBINEENTROPYCONTEXTS(pt, a_ec, l_ec);
pt = combine_entropy_contexts(a_ec, l_ec);
nb = vp9_get_coef_neighbors_handle(scan, &pad);
default_eob = seg_eob;
@ -773,7 +773,7 @@ static void stuff_b(VP9_COMP *cpi,
#if CONFIG_CODE_NONZEROCOUNT
if (!nzc_used) {
#endif
VP9_COMBINEENTROPYCONTEXTS(pt, a_ec, l_ec);
pt = combine_entropy_contexts(a_ec, l_ec);
band = 0;
t->Token = DCT_EOB_TOKEN;
t->context_tree = probs[type][ref][band][pt];