From 314dbf71c32fd31b9a73258067564483b1f66d99 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Fri, 31 May 2013 00:56:33 +0000 Subject: [PATCH] ARGBScale to half size adjust address for filtering. BUG=238 TEST=libyuvTest.ARGBScaleDownBy4_Bilinear R=dingkai@google.com Review URL: https://webrtc-codereview.appspot.com/1589004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@711 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- source/scale_argb.cc | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.chromium b/README.chromium index e4a82a09d..5d03cd59c 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 710 +Version: 711 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 4a1170669..988802c8c 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 710 +#define LIBYUV_VERSION 711 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/scale_argb.cc b/source/scale_argb.cc index 3162f9e07..be13fc6f0 100644 --- a/source/scale_argb.cc +++ b/source/scale_argb.cc @@ -744,7 +744,11 @@ static void ScaleARGBDown2(int /* src_width */, int /* src_height */, assert(dx == 65536 * 2); // Test scale factor of 2. assert((dy & 0x1ffff) == 0); // Test vertical scale is multiple of 2. // Advance to odd row / even column. - src_argb += (y >> 16) * src_stride + ((x >> 16) - 1) * 4; + if (filtering) { + src_argb += (y >> 16) * src_stride + (x >> 16) * 4; + } else { + src_argb += (y >> 16) * src_stride + ((x >> 16) - 1) * 4; + } int row_stride = src_stride * (dy >> 16); void (*ScaleARGBRowDown2)(const uint8* src_argb, ptrdiff_t src_stride, uint8* dst_argb, int dst_width) =