shithub: libvpx

Download patch

ref: 7bb35db8725ca7a2358f6786ce12aafb8fbb9a62
parent: 690fcd793bce93216917fd164ecdfeae20f905fa
parent: fd85664ae67e9ae6d309cf6d229ce39c217e92fd
author: James Zern <jzern@google.com>
date: Wed Jul 20 15:34:59 EDT 2016

Merge changes from topic 'clang-tidy'

* changes:
  vp8/{bitstream,rdopt},y4minput: correct break placement
  y4minput.c: correct empty loop formatting
  vp8: simplify a few #if's
  vp8: remove extra semicolons

--- a/vp8/common/postproc.c
+++ b/vp8/common/postproc.c
@@ -160,7 +160,6 @@
   int mb_rows = cm->mb_rows;
   int mb_cols = cm->mb_cols;
   unsigned char *limits = cm->pp_limits_buffer;
-  ;
   (void)post;
   (void)low_var_thresh;
   (void)flag;
--- a/vp8/encoder/bitstream.c
+++ b/vp8/encoder/bitstream.c
@@ -568,14 +568,9 @@
 
               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);
+                assert(k < 16);
               }
-#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);
@@ -589,7 +584,8 @@
                 write_mv(w, &blockmv.as_mv, &best_mv, (const MV_CONTEXT *)mvc);
               }
             } while (++j < cpi->mb.partition_info->count);
-          } break;
+            break;
+          }
           default: break;
         }
       }
--- a/vp8/encoder/mcomp.c
+++ b/vp8/encoder/mcomp.c
@@ -587,7 +587,6 @@
           this_mv.as_mv.col = (startmv.as_mv.col - 8) | 6;
           thismse = vfp->svf(y - 1, y_stride, 6, this_mv.as_mv.row & 7, z,
                              b->src_stride, &sse);
-          ;
         }
       } else {
         this_mv.as_mv.row = (startmv.as_mv.row - 8) | 6;
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -1949,7 +1949,8 @@
           this_rd = INT_MAX;
           disable_skip = 1;
         }
-      } break;
+        break;
+      }
 
       case SPLITMV: {
         int tmp_rd;
@@ -1983,7 +1984,8 @@
           this_rd = INT_MAX;
           disable_skip = 1;
         }
-      } break;
+        break;
+      }
       case DC_PRED:
       case V_PRED:
       case H_PRED:
@@ -2004,7 +2006,8 @@
         rd.rate_uv = uv_intra_rate_tokenonly;
         rd.distortion2 += uv_intra_distortion;
         rd.distortion_uv = uv_intra_distortion;
-      } break;
+        break;
+      }
 
       case NEWMV: {
         int thissme;
--- a/vp8/encoder/vp8_quantize.c
+++ b/vp8/encoder/vp8_quantize.c
@@ -212,7 +212,6 @@
     invert_quant(cpi->sf.improved_quant, cpi->UVquant[Q] + 0,
                  cpi->UVquant_shift[Q] + 0, quant_val);
     cpi->UVzbin[Q][0] = ((qzbin_factors[Q] * quant_val) + 64) >> 7;
-    ;
     cpi->UVround[Q][0] = (qrounding_factors[Q] * quant_val) >> 7;
     cpi->common.UVdequant[Q][0] = quant_val;
     cpi->zrun_zbin_boost_uv[Q][0] = (quant_val * zbin_boost[0]) >> 7;
--- a/vp8/vp8_dx_iface.c
+++ b/vp8/vp8_dx_iface.c
@@ -473,17 +473,15 @@
     vp8_zero(flags);
 
     if (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC) {
-      flags.post_proc_flag =
-          ctx->postproc_cfg.post_proc_flag
+      flags.post_proc_flag = ctx->postproc_cfg.post_proc_flag;
 #if CONFIG_POSTPROC_VISUALIZER
-
-          | ((ctx->dbg_color_ref_frame_flag != 0) ? VP8D_DEBUG_CLR_FRM_REF_BLKS
-                                                  : 0) |
+      flags.post_proc_flag |=
+          ((ctx->dbg_color_ref_frame_flag != 0) ? VP8D_DEBUG_CLR_FRM_REF_BLKS
+                                                : 0) |
           ((ctx->dbg_color_mb_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0) |
           ((ctx->dbg_color_b_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0) |
-          ((ctx->dbg_display_mv_flag != 0) ? VP8D_DEBUG_DRAW_MV : 0)
+          ((ctx->dbg_display_mv_flag != 0) ? VP8D_DEBUG_DRAW_MV : 0);
 #endif
-          ;
       flags.deblocking_level = ctx->postproc_cfg.deblocking_level;
       flags.noise_level = ctx->postproc_cfg.noise_level;
 #if CONFIG_POSTPROC_VISUALIZER
--- a/y4minput.c
+++ b/y4minput.c
@@ -66,40 +66,46 @@
     /*If that's all we have, stop.*/
     if (p[0] == '\0') break;
     /*Find the end of this tag.*/
-    for (q = p + 1; *q != '\0' && *q != ' '; q++)
-      ;
+    for (q = p + 1; *q != '\0' && *q != ' '; q++) {
+    }
     /*Process the tag.*/
     switch (p[0]) {
       case 'W': {
         if (sscanf(p + 1, "%d", &_y4m->pic_w) != 1) return -1;
         got_w = 1;
-      } break;
+        break;
+      }
       case 'H': {
         if (sscanf(p + 1, "%d", &_y4m->pic_h) != 1) return -1;
         got_h = 1;
-      } break;
+        break;
+      }
       case 'F': {
         if (sscanf(p + 1, "%d:%d", &_y4m->fps_n, &_y4m->fps_d) != 2) {
           return -1;
         }
         got_fps = 1;
-      } break;
+        break;
+      }
       case 'I': {
         _y4m->interlace = p[1];
         got_interlace = 1;
-      } break;
+        break;
+      }
       case 'A': {
         if (sscanf(p + 1, "%d:%d", &_y4m->par_n, &_y4m->par_d) != 2) {
           return -1;
         }
         got_par = 1;
-      } break;
+        break;
+      }
       case 'C': {
         if (q - p > 16) return -1;
         memcpy(_y4m->chroma_type, p + 1, q - p - 1);
         _y4m->chroma_type[q - p - 1] = '\0';
         got_chroma = 1;
-      } break;
+        break;
+      }
         /*Ignore unknown tags.*/
     }
   }
@@ -337,7 +343,8 @@
         }
         _dst += c_sz - c_w;
         tmp -= c_w;
-      } break;
+        break;
+      }
       case 2: {
         /*Slide C_r down a quarter-pel.
           This is the same as the horizontal filter.*/
@@ -373,7 +380,8 @@
           _dst++;
           tmp++;
         }
-      } break;
+        break;
+      }
     }
     /*For actual interlaced material, this would have to be done separately on
        each field, and the shift amounts would be different.