Commit 83408b85 authored by fbarchard@google.com's avatar fbarchard@google.com

Change point down sampling to x = dx / 2 which matches ffmpeg and is lossless on…

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
parent fcc1b955
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 706
Version: 707
License: BSD
License File: LICENSE
......
......@@ -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
......@@ -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;
......
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment