mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-07 17:26:49 +08:00
Use 64 bit fixed point for scaling columns if source is 32k or wider.
BUG=302 TESTED=out\release\libyuv_unittest --gtest_filter=*I*ToI* R=tpsiaki@google.com Review URL: https://webrtc-codereview.appspot.com/6509004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@942 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
parent
88c0b01cdd
commit
90a36b29d3
@ -1,6 +1,6 @@
|
||||
Name: libyuv
|
||||
URL: http://code.google.com/p/libyuv/
|
||||
Version: 941
|
||||
Version: 942
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
||||
@ -112,6 +112,8 @@ void ScaleColsUp2_C(uint8* dst_ptr, const uint8* src_ptr,
|
||||
int dst_width, int, int);
|
||||
void ScaleFilterCols_C(uint8* dst_ptr, const uint8* src_ptr,
|
||||
int dst_width, int x, int dx);
|
||||
void ScaleFilterCols64_C(uint8* dst_ptr, const uint8* src_ptr,
|
||||
int dst_width, int x, int dx);
|
||||
void ScaleRowDown38_C(const uint8* src_ptr, ptrdiff_t /* src_stride */,
|
||||
uint8* dst, int dst_width);
|
||||
void ScaleRowDown38_3_Box_C(const uint8* src_ptr,
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||
#define INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
#define LIBYUV_VERSION 941
|
||||
#define LIBYUV_VERSION 942
|
||||
|
||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||
|
||||
@ -511,9 +511,11 @@ void ScalePlaneBilinearDown(int src_width, int src_height,
|
||||
#endif
|
||||
|
||||
void (*ScaleFilterCols)(uint8* dst_ptr, const uint8* src_ptr,
|
||||
int dst_width, int x, int dx) = ScaleFilterCols_C;
|
||||
int dst_width, int x, int dx) =
|
||||
(src_width >= 32768) ? ScaleFilterCols64_C : ScaleFilterCols_C;
|
||||
|
||||
#if defined(HAS_SCALEFILTERCOLS_SSSE3)
|
||||
if (TestCpuFlag(kCpuHasSSSE3)) {
|
||||
if (TestCpuFlag(kCpuHasSSSE3) && src_width < 32768) {
|
||||
ScaleFilterCols = ScaleFilterCols_SSSE3;
|
||||
}
|
||||
#endif
|
||||
@ -614,8 +616,11 @@ void ScalePlaneBilinearUp(int src_width, int src_height,
|
||||
void (*ScaleFilterCols)(uint8* dst_ptr, const uint8* src_ptr,
|
||||
int dst_width, int x, int dx) =
|
||||
filtering ? ScaleFilterCols_C : ScaleCols_C;
|
||||
if (filtering && src_width >= 32768) {
|
||||
ScaleFilterCols = ScaleFilterCols64_C;
|
||||
}
|
||||
#if defined(HAS_SCALEFILTERCOLS_SSSE3)
|
||||
if (filtering && TestCpuFlag(kCpuHasSSSE3)) {
|
||||
if (filtering && TestCpuFlag(kCpuHasSSSE3) && src_width < 32768) {
|
||||
ScaleFilterCols = ScaleFilterCols_SSSE3;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -229,6 +229,30 @@ void ScaleFilterCols_C(uint8* dst_ptr, const uint8* src_ptr,
|
||||
dst_ptr[0] = BLENDER(a, b, x & 0xffff);
|
||||
}
|
||||
}
|
||||
|
||||
void ScaleFilterCols64_C(uint8* dst_ptr, const uint8* src_ptr,
|
||||
int dst_width, int x32, int dx) {
|
||||
int64 x = static_cast<int64>(x32);
|
||||
for (int j = 0; j < dst_width - 1; j += 2) {
|
||||
int64 xi = x >> 16;
|
||||
int a = src_ptr[xi];
|
||||
int b = src_ptr[xi + 1];
|
||||
dst_ptr[0] = BLENDER(a, b, x & 0xffff);
|
||||
x += dx;
|
||||
xi = x >> 16;
|
||||
a = src_ptr[xi];
|
||||
b = src_ptr[xi + 1];
|
||||
dst_ptr[1] = BLENDER(a, b, x & 0xffff);
|
||||
x += dx;
|
||||
dst_ptr += 2;
|
||||
}
|
||||
if (dst_width & 1) {
|
||||
int64 xi = x >> 16;
|
||||
int a = src_ptr[xi];
|
||||
int b = src_ptr[xi + 1];
|
||||
dst_ptr[0] = BLENDER(a, b, x & 0xffff);
|
||||
}
|
||||
}
|
||||
#undef BLENDER
|
||||
|
||||
void ScaleRowDown38_C(const uint8* src_ptr, ptrdiff_t /* src_stride */,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user