Wrapped asserts in critical code with CONFIG_DEBUG
Change-Id: I5b0aaca06f2e0f40588cb24fb0642b6865da8970
diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c
index ced9635..e93d30d 100644
--- a/vp8/encoder/bitstream.c
+++ b/vp8/encoder/bitstream.c
@@ -776,9 +776,9 @@
vp8_writer *w, MB_PREDICTION_MODE m, const vp8_prob *p
)
{
-
+#if CONFIG_DEBUG
assert(NEARESTMV <= m && m <= SPLITMV);
-
+#endif
vp8_write_token(w, vp8_mv_ref_tree, p,
vp8_mv_ref_encoding_array - NEARESTMV + m);
}
@@ -788,8 +788,9 @@
vp8_writer *w, B_PREDICTION_MODE m, const vp8_prob *p
)
{
+#if CONFIG_DEBUG
assert(LEFT4X4 <= m && m <= NEW4X4);
-
+#endif
vp8_write_token(w, vp8_sub_mv_ref_tree, p,
vp8_sub_mv_ref_encoding_array - LEFT4X4 + m);
}
@@ -1017,11 +1018,13 @@
blockmode = cpi->mb.partition_info->bmi[j].mode;
blockmv = cpi->mb.partition_info->bmi[j].mv;
-
+#if CONFIG_DEBUG
while (j != L[++k])
if (k >= 16)
assert(0);
-
+#else
+ while (j != L[++k]);
+#endif
leftmv.as_int = left_block_mv(m, k);
abovemv.as_int = above_block_mv(m, k, mis);
mv_contz = vp8_mv_cont(&leftmv, &abovemv);
diff --git a/vp8/encoder/tokenize.c b/vp8/encoder/tokenize.c
index 1c59238..2101432 100644
--- a/vp8/encoder/tokenize.c
+++ b/vp8/encoder/tokenize.c
@@ -120,9 +120,9 @@
{
int rc = vp8_default_zig_zag1d[c];
const int v = qcoeff_ptr[rc];
-
+#if CONFIG_DEBUG
assert(-DCT_MAX_VALUE <= v && v < (DCT_MAX_VALUE));
-
+#endif
t->Extra = vp8_dct_value_tokens_ptr[v].Extra;
x = vp8_dct_value_tokens_ptr[v].Token;
}
@@ -173,9 +173,9 @@
{
int rc = vp8_default_zig_zag1d[c];
const int v = qcoeff_ptr[rc];
-
+#if CONFIG_DEBUG
assert(-DCT_MAX_VALUE <= v && v < (DCT_MAX_VALUE));
-
+#endif
t->Extra = vp8_dct_value_tokens_ptr[v].Extra;
x = vp8_dct_value_tokens_ptr[v].Token;
}