From: kyslov Date: Thu, 7 Feb 2019 20:15:19 +0000 (-0800) Subject: Fixing ClangTidy issues reported by downstream integration X-Git-Tag: v1.8.1~251^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f50dc943df0b2f3b08c670968a64aeb41ca7f58;p=libvpx Fixing ClangTidy issues reported by downstream integration ClangTidy reported 16 issues. All are around typecasting and straightforward Change-Id: Ie8f9fc2ba7992dd44fef65b121fe65966a1a1297 --- diff --git a/test/yuv_temporal_filter_test.cc b/test/yuv_temporal_filter_test.cc index 9fb170bc3..fcfcf937e 100644 --- a/test/yuv_temporal_filter_test.cc +++ b/test/yuv_temporal_filter_test.cc @@ -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(block_height); row++) { + for (int col = 0; col < static_cast(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(block_height); row++) { + for (int col = 0; col < static_cast(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(block_height) && + sub_col >= 0 && sub_col < static_cast(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( diff --git a/vp9/decoder/vp9_decodeframe.c b/vp9/decoder/vp9_decodeframe.c index 41072d5e0..c75c3d9a4 100644 --- a/vp9/decoder/vp9_decodeframe.c +++ b/vp9/decoder/vp9_decodeframe.c @@ -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); } } diff --git a/vp9/encoder/vp9_temporal_filter.c b/vp9/encoder/vp9_temporal_filter.c index 0b636b85c..370af8642 100644 --- a/vp9/encoder/vp9_temporal_filter.c +++ b/vp9/encoder/vp9_temporal_filter.c @@ -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(