From 35aa92a1ea1bbcca6bf97e69e7a65f1caa987675 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Tue, 28 Apr 2015 18:41:04 +0000 Subject: [PATCH] fixed unused variables/code warnings in scale box function BUG=libyuv:432 TESTED=local windows build with chromium_code =1 R=bcornell@google.com Review URL: https://webrtc-codereview.appspot.com/49849004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@1385 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- source/scale.cc | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/source/scale.cc b/source/scale.cc index 501d391c3..1791fb37b 100644 --- a/source/scale.cc +++ b/source/scale.cc @@ -833,8 +833,8 @@ static void ScalePlaneBox(int src_width, int src_height, int iy = y >> 16; const uint8* src = src_ptr + iy * src_stride; y += dy; - if (y > (src_height << 16)) { - y = (src_height << 16); + if (y > max_y) { + y = max_y; } boxheight = MIN1((y >> 16) - iy); ScaleAddRows(src, src_stride, (uint16*)(row16), src_width, boxheight); @@ -859,24 +859,6 @@ static void ScalePlaneBox_16(int src_width, int src_height, ScaleSlope(src_width, src_height, dst_width, dst_height, kFilterBox, &x, &y, &dx, &dy); src_width = Abs(src_width); - // TODO(fbarchard): Remove this and make AddRows handle odd width. - if (!IS_ALIGNED(src_width, 16)) { - uint16* dst = dst_ptr; - int j; - for (j = 0; j < dst_height; ++j) { - int boxheight; - int iy = y >> 16; - const uint16* src = src_ptr + iy * src_stride; - y += dy; - if (y > max_y) { - y = max_y; - } - boxheight = MIN1((y >> 16) - iy); - ScalePlaneBoxRow_16_C(dst_width, boxheight, x, dx, src_stride, src, dst); - dst += dst_stride; - } - return; - } { // Allocate a row buffer of uint32. align_buffer_64(row32, src_width * 4); @@ -897,14 +879,12 @@ static void ScalePlaneBox_16(int src_width, int src_height, int iy = y >> 16; const uint16* src = src_ptr + iy * src_stride; y += dy; - if (y > (src_height << 16)) { - y = (src_height << 16); + if (y > max_y) { + y = max_y; } boxheight = MIN1((y >> 16) - iy); - ScaleAddRows(src, src_stride, (uint32*)(row32), - src_width, boxheight); - ScaleAddCols(dst_width, boxheight, x, dx, (uint32*)(row32), - dst_ptr); + ScaleAddRows(src, src_stride, (uint32*)(row32), src_width, boxheight); + ScaleAddCols(dst_width, boxheight, x, dx, (uint32*)(row32), dst_ptr); dst_ptr += dst_stride; } free_aligned_buffer_64(row32);