Fixing ClangTidy issues reported by downstream integration
authorkyslov <kyslov@google.com>
Thu, 7 Feb 2019 20:15:19 +0000 (12:15 -0800)
committerkyslov <kyslov@google.com>
Thu, 7 Feb 2019 21:35:34 +0000 (13:35 -0800)
ClangTidy reported 16 issues. All are around typecasting and
straightforward

Change-Id: Ie8f9fc2ba7992dd44fef65b121fe65966a1a1297

test/yuv_temporal_filter_test.cc
vp9/decoder/vp9_decodeframe.c
vp9/encoder/vp9_temporal_filter.c

index 9fb170bc359ddc2c95cb1aa646f816a352e8c84d..fcfcf937e50c21cf532a4be542794156d4a10b72 100644 (file)
@@ -144,16 +144,16 @@ void ApplyReferenceFilter(
   const int rounding = (1 << strength) >> 1;
 
   // Get the square diffs
-  for (int row = 0; row < (int)block_height; row++) {
-    for (int col = 0; col < (int)block_width; col++) {
+  for (int row = 0; row < static_cast<int>(block_height); row++) {
+    for (int col = 0; col < static_cast<int>(block_width); col++) {
       const int diff = y_src_ptr[row * y_src_stride + col] -
                        y_pre_ptr[row * y_pre_stride + col];
       y_diff_ptr[row * y_diff_stride + col] = diff * diff;
     }
   }
 
-  for (int row = 0; row < (int)uv_block_height; row++) {
-    for (int col = 0; col < (int)uv_block_width; col++) {
+  for (int row = 0; row < uv_block_height; row++) {
+    for (int col = 0; col < uv_block_width; col++) {
       const int u_diff = u_src_ptr[row * uv_src_stride + col] -
                          u_pre_ptr[row * uv_pre_stride + col];
       const int v_diff = v_src_ptr[row * uv_src_stride + col] -
@@ -164,8 +164,8 @@ void ApplyReferenceFilter(
   }
 
   // Apply the filter to luma
-  for (int row = 0; row < (int)block_height; row++) {
-    for (int col = 0; col < (int)block_width; col++) {
+  for (int row = 0; row < static_cast<int>(block_height); row++) {
+    for (int col = 0; col < static_cast<int>(block_width); col++) {
       const int uv_row = row >> ss_y;
       const int uv_col = col >> ss_x;
       const int filter_weight = GetFilterWeight(row, col, block_height,
@@ -182,8 +182,8 @@ void ApplyReferenceFilter(
           const int sub_row = row + row_step;
           const int sub_col = col + col_step;
 
-          if (sub_row >= 0 && sub_row < (int)block_height && sub_col >= 0 &&
-              sub_col < (int)block_width) {
+          if (sub_row >= 0 && sub_row < static_cast<int>(block_height) &&
+              sub_col >= 0 && sub_col < static_cast<int>(block_width)) {
             y_mod += y_diff_ptr[sub_row * y_diff_stride + sub_col];
             y_num_used++;
           }
@@ -208,8 +208,8 @@ void ApplyReferenceFilter(
   }
 
   // Apply the filter to chroma
-  for (int uv_row = 0; uv_row < (int)uv_block_height; uv_row++) {
-    for (int uv_col = 0; uv_col < (int)uv_block_width; uv_col++) {
+  for (int uv_row = 0; uv_row < uv_block_height; uv_row++) {
+    for (int uv_col = 0; uv_col < uv_block_width; uv_col++) {
       const int y_row = uv_row << ss_y;
       const int y_col = uv_col << ss_x;
       const int filter_weight = GetFilterWeight(
index 41072d5e0aba4d9bf061b7297312be3644d00ad0..c75c3d9a44ce27f6dd8c97aeba85acf7d33e1479 100644 (file)
@@ -2327,8 +2327,7 @@ static const uint8_t *decode_tiles_row_wise_mt(VP9Decoder *pbi,
   // Initialize thread frame counts.
   if (!cm->frame_parallel_decoding_mode) {
     for (col = 0; col < tile_cols; ++col) {
-      TileWorkerData *const tile_data =
-          (TileWorkerData *)&pbi->tile_worker_data[col];
+      TileWorkerData *const tile_data = &pbi->tile_worker_data[col];
       vp9_zero(tile_data->counts);
     }
   }
@@ -2372,8 +2371,7 @@ static const uint8_t *decode_tiles_row_wise_mt(VP9Decoder *pbi,
   // Accumulate thread frame counts.
   if (!cm->frame_parallel_decoding_mode) {
     for (i = 0; i < tile_cols; ++i) {
-      TileWorkerData *const tile_data =
-          (TileWorkerData *)&pbi->tile_worker_data[i];
+      TileWorkerData *const tile_data = &pbi->tile_worker_data[i];
       vp9_accumulate_frame_counts(&cm->counts, &tile_data->counts, 1);
     }
   }
index 0b636b85c5fad2cf206c4fe0770e8a3e9ffddd58..370af86424db03bd4ded9bbc05e1a02ae1dc4cd1 100644 (file)
@@ -424,8 +424,8 @@ void vp9_highbd_apply_temporal_filter_c(
     }
   }
 
-  for (row = 0; row < (int)uv_block_height; row++) {
-    for (col = 0; col < (int)uv_block_width; col++) {
+  for (row = 0; row < uv_block_height; row++) {
+    for (col = 0; col < uv_block_width; col++) {
       const int u_diff =
           u_src[row * uv_src_stride + col] - u_pre[row * uv_pre_stride + col];
       const int v_diff =
@@ -480,8 +480,8 @@ void vp9_highbd_apply_temporal_filter_c(
   }
 
   // Apply the filter to chroma
-  for (uv_row = 0; uv_row < (int)uv_block_height; uv_row++) {
-    for (uv_col = 0; uv_col < (int)uv_block_width; uv_col++) {
+  for (uv_row = 0; uv_row < uv_block_height; uv_row++) {
+    for (uv_col = 0; uv_col < uv_block_width; uv_col++) {
       const int y_row = uv_row << ss_y;
       const int y_col = uv_col << ss_x;
       const int filter_weight = get_filter_weight(