mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-08 01:36:47 +08:00
Scale up point use step / 2 as initial coordinate, which is more symetric and matches ffmpeg exactly.
BUG=232 TEST=convert.exe -f 0 faces_352x288_P420.yuv faces_640x480_P420.yuv R=ryanpetrie@google.com Review URL: https://webrtc-codereview.appspot.com/1580005 git-svn-id: http://libyuv.googlecode.com/svn/trunk@706 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
parent
a14b5cdfb3
commit
fcc1b95592
@ -1,6 +1,6 @@
|
||||
Name: libyuv
|
||||
URL: http://code.google.com/p/libyuv/
|
||||
Version: 705
|
||||
Version: 706
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||
#define INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
#define LIBYUV_VERSION 705
|
||||
#define LIBYUV_VERSION 706
|
||||
|
||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||
|
||||
@ -3232,20 +3232,14 @@ 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 = 0;
|
||||
int y = 0;
|
||||
if (dst_width <= Abs(src_width)) {
|
||||
x = (dx >> 1) - 32768;
|
||||
}
|
||||
int x = (dx >= 65536) ? ((dx >> 1) - 32768) : (dx >> 1);
|
||||
int y = (dy >= 65536) ? ((dy >> 1) - 32768) : (dy >> 1);
|
||||
// Negative src_width means horizontally mirror.
|
||||
if (src_width < 0) {
|
||||
x += (dst_width - 1) * dx;
|
||||
dx = -dx;
|
||||
src_width = -src_width;
|
||||
}
|
||||
if (dst_height <= src_height) {
|
||||
y = (dy >> 1) - 32768;
|
||||
}
|
||||
|
||||
for (int j = 0; j < dst_height; ++j) {
|
||||
int xs = x;
|
||||
|
||||
@ -1081,12 +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;
|
||||
if (dst_width <= Abs(src_width)) {
|
||||
x = (dx >> 1) - 32768;
|
||||
}
|
||||
if (dst_height <= src_height) {
|
||||
y = (dy >> 1) - 32768;
|
||||
}
|
||||
x = (dx >= 65536) ? ((dx >> 1) - 32768) : (dx >> 1);
|
||||
y = (dy >= 65536) ? ((dy >> 1) - 32768) : (dy >> 1);
|
||||
}
|
||||
// Negative src_width means horizontally mirror.
|
||||
if (src_width < 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user