Merge changes from topic 'Wundef'

* changes:
  Enable -Wundef by default
  Define VP8_TEMPORAL_ALT_REF to !CONFIG_REALTIME_ONLY
  Remove CONFIG_DEBUG guards from assert()
  Remove unused function vpx_de_mblock
  Fix -Wundef warning for OUTPUT_FPF
  Fix -Wundef warning for __SANITIZE_ADDRESS__
This commit is contained in:
Johann Koenig
2016-09-02 01:39:17 +00:00
committed by Gerrit Code Review
8 changed files with 8 additions and 34 deletions

3
configure vendored
View File

@@ -574,6 +574,9 @@ process_toolchain() {
check_add_cflags -Wimplicit-function-declaration check_add_cflags -Wimplicit-function-declaration
check_add_cflags -Wuninitialized check_add_cflags -Wuninitialized
check_add_cflags -Wunused check_add_cflags -Wunused
# check_add_cflags also adds to cxxflags. gtest does not do well with
# -Wundef so add it explicitly to CFLAGS only.
check_cflags -Wundef && add_cflags_only -Wundef
case ${CC} in case ${CC} in
*clang*) *clang*)
# libvpx and/or clang have issues with aliasing: # libvpx and/or clang have issues with aliasing:

View File

@@ -8,12 +8,10 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#if CONFIG_DEBUG
#include <assert.h> #include <assert.h>
#endif
#include <stdio.h> #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, static void tree2tok(struct vp8_token_struct *const p, vp8_tree t, int i, int v,
int L) { int L) {
@@ -48,9 +46,7 @@ static void branch_counts(int n, /* n = size of alphabet */
const int tree_len = n - 1; const int tree_len = n - 1;
int t = 0; int t = 0;
#if CONFIG_DEBUG
assert(tree_len); assert(tree_len);
#endif
do { do {
branch_ct[t][0] = branch_ct[t][1] = 0; branch_ct[t][0] = branch_ct[t][1] = 0;
@@ -68,17 +64,13 @@ static void branch_counts(int n, /* n = size of alphabet */
do { do {
const int b = (enc >> --L) & 1; const int b = (enc >> --L) & 1;
const int j = i >> 1; const int j = i >> 1;
#if CONFIG_DEBUG
assert(j < tree_len && 0 <= L); assert(j < tree_len && 0 <= L);
#endif
branch_ct[j][b] += ct; branch_ct[j][b] += ct;
i = tree[i + b]; i = tree[i + b];
} while (i > 0); } while (i > 0);
#if CONFIG_DEBUG
assert(!L); assert(!L);
#endif
} while (++t < n); } 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 *const c = branch_ct[t];
const unsigned int tot = c[0] + c[1]; const unsigned int tot = c[0] + c[1];
#if CONFIG_DEBUG
assert(tot < (1 << 24)); /* no overflow below */ assert(tot < (1 << 24)); /* no overflow below */
#endif
if (tot) { if (tot) {
const unsigned int p = ((c[0] * Pfac) + (rd ? tot >> 1 : 0)) / tot; const unsigned int p = ((c[0] * Pfac) + (rd ? tot >> 1 : 0)) / tot;

View File

@@ -14,9 +14,6 @@
#include "onyxd_int.h" #include "onyxd_int.h"
#include "vp8/common/findnearmv.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) { static B_PREDICTION_MODE read_bmode(vp8_reader *bc, const vp8_prob *p) {
const int i = vp8_treed_read(bc, vp8_bmode_tree, p); const int i = vp8_treed_read(bc, vp8_bmode_tree, p);

View 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, static void write_mv_ref(vp8_writer *w, MB_PREDICTION_MODE m,
const vp8_prob *p) { const vp8_prob *p) {
#if CONFIG_DEBUG
assert(NEARESTMV <= m && m <= SPLITMV); assert(NEARESTMV <= m && m <= SPLITMV);
#endif
vp8_write_token(w, vp8_mv_ref_tree, p, vp8_write_token(w, vp8_mv_ref_tree, p,
vp8_mv_ref_encoding_array + (m - NEARESTMV)); vp8_mv_ref_encoding_array + (m - NEARESTMV));
} }
static void write_sub_mv_ref(vp8_writer *w, B_PREDICTION_MODE m, static void write_sub_mv_ref(vp8_writer *w, B_PREDICTION_MODE m,
const vp8_prob *p) { const vp8_prob *p) {
#if CONFIG_DEBUG
assert(LEFT4X4 <= m && m <= NEW4X4); assert(LEFT4X4 <= m && m <= NEW4X4);
#endif
vp8_write_token(w, vp8_sub_mv_ref_tree, p, vp8_write_token(w, vp8_sub_mv_ref_tree, p,
vp8_sub_mv_ref_encoding_array + (m - LEFT4X4)); vp8_sub_mv_ref_encoding_array + (m - LEFT4X4));
} }

View File

@@ -33,7 +33,7 @@
#include "encodemv.h" #include "encodemv.h"
#include "encodeframe.h" #include "encodeframe.h"
/* #define OUTPUT_FPF 1 */ #define OUTPUT_FPF 0
extern void vp8cx_frame_init_quantizer(VP8_COMP *cpi); extern void vp8cx_frame_init_quantizer(VP8_COMP *cpi);

View File

@@ -55,9 +55,7 @@ extern "C" {
#define MV_ZBIN_BOOST 4 #define MV_ZBIN_BOOST 4
#define ZBIN_OQ_MAX 192 #define ZBIN_OQ_MAX 192
#if !(CONFIG_REALTIME_ONLY) #define VP8_TEMPORAL_ALT_REF !CONFIG_REALTIME_ONLY
#define VP8_TEMPORAL_ALT_REF 1
#endif
typedef struct { typedef struct {
int kf_indicated; int kf_indicated;

View File

@@ -190,13 +190,3 @@ void vpx_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols,
} }
} }
} }
#if CONFIG_POSTPROC
static void vpx_de_mblock(YV12_BUFFER_CONFIG *post, int q) {
vpx_mbpost_proc_across_ip(post->y_buffer, post->y_stride, post->y_height,
post->y_width, q2mbl(q));
vpx_mbpost_proc_down(post->y_buffer, post->y_stride, post->y_height,
post->y_width, q2mbl(q));
}
#endif

View File

@@ -53,10 +53,10 @@
#define __has_feature(x) 0 #define __has_feature(x) 0
#endif // !defined(__has_feature) #endif // !defined(__has_feature)
#if __has_feature(address_sanitizer) || __SANITIZE_ADDRESS__ #if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
#define VPX_WITH_ASAN 1 #define VPX_WITH_ASAN 1
#else #else
#define VPX_WITH_ASAN 0 #define VPX_WITH_ASAN 0
#endif // __has_feature(address_sanitizer) || __SANITIZE_ADDRESS #endif // __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
#endif // VPX_PORTS_MEM_H_ #endif // VPX_PORTS_MEM_H_