]> granicus.if.org Git - libvpx/commitdiff
Add compiler warning flag -Wextra and fix related warnings.
authorUrvang Joshi <urvang@google.com>
Thu, 14 Jul 2016 19:33:48 +0000 (12:33 -0700)
committerJohann <johannkoenig@google.com>
Tue, 27 Sep 2016 19:05:01 +0000 (12:05 -0700)
Note: some of these warnings are enabled by a combination of -Wunused
(added earlier) and -Wextra.

Cherry-picked from AOM 4790a69faaec8f03d65f64ff070f6ab4307dbb16

Expands use of (void)x; on unused variables. AOM only supports one codec
in codec_factory.h

Does not include changes to HandleDecodeResult. AOM removed
invalid_file_test.cc which does use the video parameter.

Does not enable -Wextra yet. There are more issues to fix.

BUG=webm:1069

Change-Id: I322a1366bd4fd6c0dec9e758c2d5e88e003b1cbf

test/avg_test.cc
test/codec_factory.h
test/error_resilience_test.cc
vpx_dsp/arm/vpx_convolve8_avg_neon.c
vpx_dsp/arm/vpx_convolve8_neon.c
vpx_dsp/fastssim.c
vpx_dsp/x86/convolve.h

index 867a77aa0d14e6a48731531c0dbbde45860f1b2d..272b99695ee4c8d2f0413ed08f51bfa003813bd2 100644 (file)
@@ -53,7 +53,7 @@ class AverageTestBase : public ::testing::Test {
   }
 
   // Sum Pixels
-  unsigned int ReferenceAverage8x8(const uint8_t *source, int pitch) {
+  static unsigned int ReferenceAverage8x8(const uint8_t *source, int pitch) {
     unsigned int average = 0;
     for (int h = 0; h < 8; ++h) {
       for (int w = 0; w < 8; ++w) average += source[h * pitch + w];
@@ -61,7 +61,7 @@ class AverageTestBase : public ::testing::Test {
     return ((average + 32) >> 6);
   }
 
-  unsigned int ReferenceAverage4x4(const uint8_t *source, int pitch) {
+  static unsigned int ReferenceAverage4x4(const uint8_t *source, int pitch) {
     unsigned int average = 0;
     for (int h = 0; h < 4; ++h) {
       for (int w = 0; w < 4; ++w) average += source[h * pitch + w];
@@ -98,11 +98,12 @@ class AverageTest : public AverageTestBase,
 
  protected:
   void CheckAverages() {
+    const int block_size = GET_PARAM(3);
     unsigned int expected = 0;
-    if (GET_PARAM(3) == 8) {
+    if (block_size == 8) {
       expected =
           ReferenceAverage8x8(source_data_ + GET_PARAM(2), source_stride_);
-    } else if (GET_PARAM(3) == 4) {
+    } else if (block_size == 4) {
       expected =
           ReferenceAverage4x4(source_data_ + GET_PARAM(2), source_stride_);
     }
index e867dacafe20a6cb68eb83e971a4ee0d9032cb38..3415284ab1f74ee3a800ca4b0e55d55f4d7fa400 100644 (file)
@@ -115,6 +115,8 @@ class VP8CodecFactory : public CodecFactory {
 #if CONFIG_VP8_DECODER
     return new VP8Decoder(cfg, flags);
 #else
+    (void)cfg;
+    (void)flags;
     return NULL;
 #endif
   }
@@ -126,6 +128,10 @@ class VP8CodecFactory : public CodecFactory {
 #if CONFIG_VP8_ENCODER
     return new VP8Encoder(cfg, deadline, init_flags, stats);
 #else
+    (void)cfg;
+    (void)deadline;
+    (void)init_flags;
+    (void)stats;
     return NULL;
 #endif
   }
@@ -135,6 +141,8 @@ class VP8CodecFactory : public CodecFactory {
 #if CONFIG_VP8_ENCODER
     return vpx_codec_enc_config_default(&vpx_codec_vp8_cx_algo, cfg, usage);
 #else
+    (void)cfg;
+    (void)usage;
     return VPX_CODEC_INCAPABLE;
 #endif
   }
@@ -203,6 +211,8 @@ class VP9CodecFactory : public CodecFactory {
 #if CONFIG_VP9_DECODER
     return new VP9Decoder(cfg, flags);
 #else
+    (void)cfg;
+    (void)flags;
     return NULL;
 #endif
   }
@@ -214,6 +224,10 @@ class VP9CodecFactory : public CodecFactory {
 #if CONFIG_VP9_ENCODER
     return new VP9Encoder(cfg, deadline, init_flags, stats);
 #else
+    (void)cfg;
+    (void)deadline;
+    (void)init_flags;
+    (void)stats;
     return NULL;
 #endif
   }
@@ -223,6 +237,8 @@ class VP9CodecFactory : public CodecFactory {
 #if CONFIG_VP9_ENCODER
     return vpx_codec_enc_config_default(&vpx_codec_vp9_cx_algo, cfg, usage);
 #else
+    (void)cfg;
+    (void)usage;
     return VPX_CODEC_INCAPABLE;
 #endif
   }
index 4c7ede8cae7f625d9fd2121c5e5411f9ceebcdd3..030b67c572938acfbee81738ee9c8d0f583688b0 100644 (file)
@@ -90,8 +90,7 @@ class ErrorResilienceTestLarge
     return frame_flags;
   }
 
-  virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder * /*encoder*/) {
+  virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video) {
     frame_flags_ &=
         ~(VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF);
     // For temporal layer case.
index 69cb28400538d1f8767c7dc863d764206158c701..8e5373be0386551af4b89a73c634444df96fa324 100644 (file)
@@ -64,6 +64,10 @@ void vpx_convolve8_avg_horiz_neon(const uint8_t *src, ptrdiff_t src_stride,
 
   assert(x_step_q4 == 16);
 
+  (void)x_step_q4;
+  (void)y_step_q4;
+  (void)filter_y;
+
   q0s16 = vld1q_s16(filter_x);
 
   src -= 3;                // adjust for taps
@@ -240,6 +244,10 @@ void vpx_convolve8_avg_vert_neon(const uint8_t *src, ptrdiff_t src_stride,
 
   assert(y_step_q4 == 16);
 
+  (void)x_step_q4;
+  (void)y_step_q4;
+  (void)filter_x;
+
   src -= src_stride * 3;
   q0s16 = vld1q_s16(filter_y);
   for (; w > 0; w -= 4, src += 4, dst += 4) {  // loop_vert_h
index 514525696b0dd99922a4e0e7ab67394de1644310..951c425e26075176fc0939da842033dbdded16a7 100644 (file)
@@ -64,6 +64,10 @@ void vpx_convolve8_horiz_neon(const uint8_t *src, ptrdiff_t src_stride,
 
   assert(x_step_q4 == 16);
 
+  (void)x_step_q4;
+  (void)y_step_q4;
+  (void)filter_y;
+
   q0s16 = vld1q_s16(filter_x);
 
   src -= 3;  // adjust for taps
@@ -224,6 +228,10 @@ void vpx_convolve8_vert_neon(const uint8_t *src, ptrdiff_t src_stride,
 
   assert(y_step_q4 == 16);
 
+  (void)x_step_q4;
+  (void)y_step_q4;
+  (void)filter_x;
+
   src -= src_stride * 3;
   q0s16 = vld1q_s16(filter_y);
   for (; w > 0; w -= 4, src += 4, dst += 4) {  // loop_vert_h
index 4d5eb5a6ff12594a9c84fceb5ffb385bbe4a6409..0469071a176b5d86bee54b51876fd70850d524ad 100644 (file)
@@ -202,6 +202,7 @@ static void fs_apply_luminance(fs_ctx *_ctx, int _l, int bit_depth) {
   if (bit_depth == 12) ssim_c1 = SSIM_C1_12;
 #else
   assert(bit_depth == 8);
+  (void)bit_depth;
 #endif
   w = _ctx->level[_l].w;
   h = _ctx->level[_l].h;
@@ -326,6 +327,7 @@ static void fs_calc_structure(fs_ctx *_ctx, int _l, int bit_depth) {
   if (bit_depth == 12) ssim_c2 = SSIM_C2_12;
 #else
   assert(bit_depth == 8);
+  (void)bit_depth;
 #endif
 
   w = _ctx->level[_l].w;
index 2a0516cdc11156602151519680f5c8b6e308ff4d..d7468ad7ca56a912b35655b158f97b77c583b6e3 100644 (file)
@@ -25,6 +25,10 @@ typedef void filter8_1dfunction(const uint8_t *src_ptr, ptrdiff_t src_pitch,
       const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst,                \
       ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4,          \
       const int16_t *filter_y, int y_step_q4, int w, int h) {                \
+    (void)filter_x;                                                          \
+    (void)x_step_q4;                                                         \
+    (void)filter_y;                                                          \
+    (void)y_step_q4;                                                         \
     assert(filter[3] != 128);                                                \
     assert(step_q4 == 16);                                                   \
     if (filter[0] | filter[1] | filter[2]) {                                 \