From 18b66911057dcac1423a2363d9648423e8c6047a Mon Sep 17 00:00:00 2001 From: Johann Date: Fri, 26 Aug 2016 18:08:35 -0700 Subject: Remove CONFIG_DEBUG guards from assert() When 'NDEBUG' is set, assert() generates no code. Change-Id: Icf61cfc1a8f6e5f0770b3626d8c73ae968df1108 --- vp8/common/treecoder.c | 12 +----------- vp8/decoder/decodemv.c | 3 --- vp8/encoder/bitstream.c | 4 ---- 3 files changed, 1 insertion(+), 18 deletions(-) (limited to 'vp8') diff --git a/vp8/common/treecoder.c b/vp8/common/treecoder.c index d04af0b79..9feb40a5a 100644 --- a/vp8/common/treecoder.c +++ b/vp8/common/treecoder.c @@ -8,12 +8,10 @@ * be found in the AUTHORS file in the root of the source tree. */ -#if CONFIG_DEBUG #include -#endif #include -#include "treecoder.h" +#include "vp8/common/treecoder.h" static void tree2tok(struct vp8_token_struct *const p, vp8_tree t, int i, int v, int L) { @@ -48,9 +46,7 @@ static void branch_counts(int n, /* n = size of alphabet */ const int tree_len = n - 1; int t = 0; -#if CONFIG_DEBUG assert(tree_len); -#endif do { branch_ct[t][0] = branch_ct[t][1] = 0; @@ -68,17 +64,13 @@ static void branch_counts(int n, /* n = size of alphabet */ do { const int b = (enc >> --L) & 1; const int j = i >> 1; -#if CONFIG_DEBUG assert(j < tree_len && 0 <= L); -#endif branch_ct[j][b] += ct; i = tree[i + b]; } while (i > 0); -#if CONFIG_DEBUG assert(!L); -#endif } while (++t < n); } @@ -97,9 +89,7 @@ void vp8_tree_probs_from_distribution(int n, /* n = size of alphabet */ const unsigned int *const c = branch_ct[t]; const unsigned int tot = c[0] + c[1]; -#if CONFIG_DEBUG assert(tot < (1 << 24)); /* no overflow below */ -#endif if (tot) { const unsigned int p = ((c[0] * Pfac) + (rd ? tot >> 1 : 0)) / tot; diff --git a/vp8/decoder/decodemv.c b/vp8/decoder/decodemv.c index 0acba1a36..b946ab73d 100644 --- a/vp8/decoder/decodemv.c +++ b/vp8/decoder/decodemv.c @@ -14,9 +14,6 @@ #include "onyxd_int.h" #include "vp8/common/findnearmv.h" -#if CONFIG_DEBUG -#include -#endif static B_PREDICTION_MODE read_bmode(vp8_reader *bc, const vp8_prob *p) { const int i = vp8_treed_read(bc, vp8_bmode_tree, p); diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c index d10b7cbe4..06c2f624f 100644 --- a/vp8/encoder/bitstream.c +++ b/vp8/encoder/bitstream.c @@ -338,18 +338,14 @@ static void pack_mb_row_tokens(VP8_COMP *cpi, vp8_writer *w) { static void write_mv_ref(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 + (m - NEARESTMV)); } static void write_sub_mv_ref(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 + (m - LEFT4X4)); } -- cgit v1.2.3