From 74df2a521d3d5f991884cc0484894fd6fa150ade Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Mon, 6 May 2013 21:57:25 +0000 Subject: [PATCH] Point upsample uncentered so last pixel is same width as first. BUG=none TEST=none Review URL: https://webrtc-codereview.appspot.com/1424004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@687 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- source/scale_argb.cc | 10 ++-------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/README.chromium b/README.chromium index e32073abd..75d474998 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 686 +Version: 687 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index e1ca20e96..a98463928 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 686 +#define LIBYUV_VERSION 687 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/scale_argb.cc b/source/scale_argb.cc index dd8188c3a..06daeae18 100644 --- a/source/scale_argb.cc +++ b/source/scale_argb.cc @@ -1046,15 +1046,12 @@ static void ScaleARGBSimple(int src_width, int src_height, ScaleARGBCols = ScaleARGBCols_SSE2; } #endif - int dx = 0; - int dy = 0; + int dx = (Abs(src_width) << 16) / dst_width; + int dy = (src_height << 16) / dst_height; int x = 0; int y = 0; if (dst_width <= Abs(src_width)) { - dx = (Abs(src_width) << 16) / dst_width; x = (dx >> 1) - 32768; - } else if (dst_width > 1) { - dx = ((Abs(src_width) - 1) << 16) / (dst_width - 1); } // Negative src_width means horizontally mirror. if (src_width < 0) { @@ -1063,10 +1060,7 @@ static void ScaleARGBSimple(int src_width, int src_height, src_width = -src_width; } if (dst_height <= src_height) { - dy = (src_height << 16) / dst_height; y = (dy >> 1) - 32768; - } else if (dst_height > 1) { - dy = ((src_height - 1) << 16) / (dst_height - 1); } for (int i = 0; i < dst_height; ++i) {