diff --git a/README.chromium b/README.chromium index 499366e12..d9a8bf0cf 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 942 +Version: 946 License: BSD License File: LICENSE diff --git a/include/libyuv/scale_row.h b/include/libyuv/scale_row.h index e74448688..53e040383 100644 --- a/include/libyuv/scale_row.h +++ b/include/libyuv/scale_row.h @@ -140,6 +140,8 @@ void ScaleARGBRowDownEvenBox_C(const uint8* src_argb, uint8* dst_argb, int dst_width); void ScaleARGBCols_C(uint8* dst_argb, const uint8* src_argb, int dst_width, int x, int dx); +void ScaleARGBCols64_C(uint8* dst_argb, const uint8* src_argb, + int dst_width, int x, int dx); void ScaleARGBColsUp2_C(uint8* dst_argb, const uint8* src_argb, int dst_width, int, int); void ScaleARGBFilterCols_C(uint8* dst_argb, const uint8* src_argb, diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 4e6894ed4..5a77ae714 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 942 +#define LIBYUV_VERSION 946 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/scale_argb.cc b/source/scale_argb.cc index 6b32768fd..079d7400f 100644 --- a/source/scale_argb.cc +++ b/source/scale_argb.cc @@ -322,8 +322,9 @@ static void ScaleARGBBilinearUp(int src_width, int src_height, void (*ScaleARGBFilterCols)(uint8* dst_argb, const uint8* src_argb, int dst_width, int x, int dx) = filtering ? ScaleARGBFilterCols_C : ScaleARGBCols_C; - if (filtering && src_width >= 32768) { - ScaleARGBFilterCols = ScaleARGBFilterCols64_C; + if (src_width >= 32768) { + ScaleARGBFilterCols = filtering ? + ScaleARGBFilterCols64_C : ScaleARGBCols64_C; } #if defined(HAS_SCALEARGBFILTERCOLS_SSSE3) if (filtering && TestCpuFlag(kCpuHasSSSE3) && src_width < 32768) { @@ -508,8 +509,9 @@ static void ScaleYUVToARGBBilinearUp(int src_width, int src_height, void (*ScaleARGBFilterCols)(uint8* dst_argb, const uint8* src_argb, int dst_width, int x, int dx) = filtering ? ScaleARGBFilterCols_C : ScaleARGBCols_C; - if (filtering && src_width >= 32768) { - ScaleARGBFilterCols = ScaleARGBFilterCols64_C; + if (src_width >= 32768) { + ScaleARGBFilterCols = filtering ? + ScaleARGBFilterCols64_C : ScaleARGBCols64_C; } #if defined(HAS_SCALEARGBFILTERCOLS_SSSE3) if (filtering && TestCpuFlag(kCpuHasSSSE3) && src_width < 32768) { @@ -622,9 +624,10 @@ static void ScaleARGBSimple(int src_width, int src_height, const uint8* src_argb, uint8* dst_argb, int x, int dx, int y, int dy) { void (*ScaleARGBCols)(uint8* dst_argb, const uint8* src_argb, - int dst_width, int x, int dx) = ScaleARGBCols_C; + int dst_width, int x, int dx) = + (src_width >= 32768) ? ScaleARGBCols64_C : ScaleARGBCols_C; #if defined(HAS_SCALEARGBCOLS_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { + if (TestCpuFlag(kCpuHasSSE2) && src_width < 32768) { ScaleARGBCols = ScaleARGBCols_SSE2; } #endif diff --git a/source/scale_common.cc b/source/scale_common.cc index 5ee289c93..6efa2c4bf 100644 --- a/source/scale_common.cc +++ b/source/scale_common.cc @@ -427,6 +427,23 @@ void ScaleARGBCols_C(uint8* dst_argb, const uint8* src_argb, } } +void ScaleARGBCols64_C(uint8* dst_argb, const uint8* src_argb, + int dst_width, int x32, int dx) { + int64 x = static_cast(x32); + const uint32* src = reinterpret_cast(src_argb); + uint32* dst = reinterpret_cast(dst_argb); + for (int j = 0; j < dst_width - 1; j += 2) { + dst[0] = src[x >> 16]; + x += dx; + dst[1] = src[x >> 16]; + x += dx; + dst += 2; + } + if (dst_width & 1) { + dst[0] = src[x >> 16]; + } +} + // Scales a single row of pixels up by 2x using point sampling. void ScaleARGBColsUp2_C(uint8* dst_argb, const uint8* src_argb, int dst_width, int, int) {