Commit 9087d6d4 authored by Dmitry Kovalev's avatar Dmitry Kovalev

Replacing VP9_COMBINEENTROPYCONTEXTS macro with function.

Change-Id: I3bbc31840af69481e1d9bb4427c9ee25abf82946
parent 07cde4fd
......@@ -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,
......
......@@ -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) {
......
......@@ -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;
......
......@@ -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;
......
......@@ -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];
......
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