Replacing VP9_COMBINEENTROPYCONTEXTS macro with function.
Change-Id: I3bbc31840af69481e1d9bb4427c9ee25abf82946
diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h
index 95bfcd3..40d7b40 100644
--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -51,8 +51,10 @@
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,
diff --git a/vp9/decoder/vp9_detokenize.c b/vp9/decoder/vp9_detokenize.c
index d98d5eb..a6b3394 100644
--- a/vp9/decoder/vp9_detokenize.c
+++ b/vp9/decoder/vp9_detokenize.c
@@ -235,7 +235,7 @@
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) {
diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c
index 6ecaaa5..f42e2d8 100644
--- a/vp9/encoder/vp9_encodemb.c
+++ b/vp9/encoder/vp9_encodemb.c
@@ -582,7 +582,7 @@
/* 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;
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 4b59fa1..6884b16 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -491,7 +491,7 @@
}
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;
diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c
index 6c44ebd..343ad19 100644
--- a/vp9/encoder/vp9_tokenize.c
+++ b/vp9/encoder/vp9_tokenize.c
@@ -250,7 +250,7 @@
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 @@
#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];