From c5d48a11f9875f6d6aa30375fd66465971ef2327 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Mon, 6 Dec 2021 08:37:24 +0100 Subject: [PATCH] Fix -Wshadow. Bug: libyuv:910 Change-Id: I3b74cef99823ffc5e67a77dc223d560d5fdfd8b2 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3310893 Reviewed-by: Frank Barchard Commit-Queue: Mirko Bonadei --- util/psnr_main.cc | 4 ++-- util/yuvconvert.cc | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/util/psnr_main.cc b/util/psnr_main.cc index a930b202e..8b9fd9724 100644 --- a/util/psnr_main.cc +++ b/util/psnr_main.cc @@ -248,13 +248,13 @@ bool UpdateMetrics(uint8_t* ch_org, int number_of_frames, metric* cur_distortion_psnr, metric* distorted_frame, - bool do_psnr) { + bool compute_psnr) { const int uv_offset = (do_swap_uv ? uv_size : 0); const uint8_t* const u_org = ch_org + y_size + uv_offset; const uint8_t* const u_rec = ch_rec + y_size; const uint8_t* const v_org = ch_org + y_size + (uv_size - uv_offset); const uint8_t* const v_rec = ch_rec + y_size + uv_size; - if (do_psnr) { + if (compute_psnr) { #ifdef HAVE_JPEG double y_err = static_cast( libyuv::ComputeSumSquareError(ch_org, ch_rec, y_size)); diff --git a/util/yuvconvert.cc b/util/yuvconvert.cc index 27cdfe9e3..332699e30 100644 --- a/util/yuvconvert.cc +++ b/util/yuvconvert.cc @@ -165,23 +165,23 @@ static int TileARGBScale(const uint8_t* src_argb, int src_height, uint8_t* dst_argb, int dst_stride_argb, - int dst_width, - int dst_height, + int destination_width, + int destination_height, libyuv::FilterMode filtering) { - for (int y = 0; y < dst_height; y += kTileY) { - for (int x = 0; x < dst_width; x += kTileX) { + for (int y = 0; y < destination_height; y += kTileY) { + for (int x = 0; x < destination_width; x += kTileX) { int clip_width = kTileX; - if (x + clip_width > dst_width) { - clip_width = dst_width - x; + if (x + clip_width > destination_width) { + clip_width = destination_width - x; } int clip_height = kTileY; - if (y + clip_height > dst_height) { - clip_height = dst_height - y; + if (y + clip_height > destination_height) { + clip_height = destination_height - y; } int r = libyuv::ARGBScaleClip(src_argb, src_stride_argb, src_width, src_height, dst_argb, dst_stride_argb, - dst_width, dst_height, x, y, clip_width, - clip_height, filtering); + destination_width, destination_height, x, y, + clip_width, clip_height, filtering); if (r) { return r; }