Change point down sampling to x = dx / 2 which matches ffmpeg and is lossless on up and then down sample.

BUG=232
TEST=convert.exe -f 0 faces_640x480_P420.yuv face2_352x288_P420.yuv
R=johannkoenig@google.com, ryanpetrie@google.com

Review URL: https://webrtc-codereview.appspot.com/1581005

git-svn-id: http://libyuv.googlecode.com/svn/trunk@707 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
fbarchard@google.com 2013-05-29 17:40:50 +00:00
parent fcc1b95592
commit 83408b85e4
4 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 706
Version: 707
License: BSD
License File: LICENSE

View File

@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 706
#define LIBYUV_VERSION 707
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT

View File

@ -3232,8 +3232,8 @@ static void ScalePlaneSimple(int src_width, int src_height,
const uint8* src_ptr, uint8* dst_ptr) {
int dx = (Abs(src_width) << 16) / dst_width;
int dy = (src_height << 16) / dst_height;
int x = (dx >= 65536) ? ((dx >> 1) - 32768) : (dx >> 1);
int y = (dy >= 65536) ? ((dy >> 1) - 32768) : (dy >> 1);
int x = dx >> 1;
int y = dy >> 1;
// Negative src_width means horizontally mirror.
if (src_width < 0) {
x += (dst_width - 1) * dx;

View File

@ -1081,8 +1081,8 @@ static void ScaleARGB(const uint8* src, int src_stride,
// Scale step for point sampling duplicates all pixels equally.
dx = (Abs(src_width) << 16) / dst_width;
dy = (src_height << 16) / dst_height;
x = (dx >= 65536) ? ((dx >> 1) - 32768) : (dx >> 1);
y = (dy >= 65536) ? ((dy >> 1) - 32768) : (dy >> 1);
x = dx >> 1;
y = dy >> 1;
}
// Negative src_width means horizontally mirror.
if (src_width < 0) {