]> granicus.if.org Git - libvpx/commitdiff
Remove CONFIG_DEBUG guards from assert()
authorJohann <johannkoenig@google.com>
Sat, 27 Aug 2016 01:08:35 +0000 (18:08 -0700)
committerJohann <johannkoenig@google.com>
Thu, 1 Sep 2016 06:01:57 +0000 (23:01 -0700)
When 'NDEBUG' is set, assert() generates no code.

Change-Id: Icf61cfc1a8f6e5f0770b3626d8c73ae968df1108

vp8/common/treecoder.c
vp8/decoder/decodemv.c
vp8/encoder/bitstream.c

index d04af0b793a9b42029258584e47f82227540c9c4..9feb40a5a7c2a8f86e4149bbc483ea3049894dc1 100644 (file)
@@ -8,12 +8,10 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#if CONFIG_DEBUG
 #include <assert.h>
-#endif
 #include <stdio.h>
 
-#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;
index 0acba1a364052219258fcf81fb79ff48fb79b518..b946ab73d0ba7d1c856395e63ae96de50230101f 100644 (file)
@@ -14,9 +14,6 @@
 #include "onyxd_int.h"
 #include "vp8/common/findnearmv.h"
 
-#if CONFIG_DEBUG
-#include <assert.h>
-#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);
 
index d10b7cbe46058e0421e3d50499801f5dd647d44e..06c2f624f5fbdb8667c362ff75d99de84ebc2dc2 100644 (file)
@@ -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));
 }