diff --git a/README.chromium b/README.chromium index 7ab7338b5..abd88b789 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 604 +Version: 605 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 3ffb78a74..48a06f4b0 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 604 +#define LIBYUV_VERSION 605 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/convert_from.cc b/source/convert_from.cc index c3b05f607..a087e886a 100644 --- a/source/convert_from.cc +++ b/source/convert_from.cc @@ -237,6 +237,17 @@ int I422ToYUY2(const uint8* src_y, int src_stride_y, dst_yuy2 = dst_yuy2 + (height - 1) * dst_stride_yuy2; dst_stride_yuy2 = -dst_stride_yuy2; } + // Coalesce contiguous rows. + if (src_stride_y == width && + src_stride_u * 2 == width && + src_stride_v * 2 == width && + dst_stride_yuy2 == width * 2) { + return I422ToYUY2(src_y, 0, + src_u, 0, + src_v, 0, + dst_yuy2, 0, + width * height, 1); + } void (*I422ToYUY2Row)(const uint8* src_y, const uint8* src_u, const uint8* src_v, uint8* dst_yuy2, int width) = I422ToYUY2Row_C; @@ -336,6 +347,17 @@ int I422ToUYVY(const uint8* src_y, int src_stride_y, dst_uyvy = dst_uyvy + (height - 1) * dst_stride_uyvy; dst_stride_uyvy = -dst_stride_uyvy; } + // Coalesce contiguous rows. + if (src_stride_y == width && + src_stride_u * 2 == width && + src_stride_v * 2 == width && + dst_stride_uyvy == width * 2) { + return I422ToUYVY(src_y, 0, + src_u, 0, + src_v, 0, + dst_uyvy, 0, + width * height, 1); + } void (*I422ToUYVYRow)(const uint8* src_y, const uint8* src_u, const uint8* src_v, uint8* dst_uyvy, int width) = I422ToUYVYRow_C; @@ -439,8 +461,19 @@ int I420ToNV12(const uint8* src_y, int src_stride_y, dst_stride_y = -dst_stride_y; dst_stride_uv = -dst_stride_uv; } - + // Coalesce contiguous rows. int halfwidth = (width + 1) >> 1; + int halfheight = (height + 1) >> 1; + if (src_stride_y == width && + src_stride_u * 2 == width && + src_stride_v * 2 == width && + dst_stride_y == width && + dst_stride_uv == width) { + width = width * height; + height = 1; + halfwidth = halfwidth * halfheight; + halfheight = 1; + } void (*MergeUVRow_)(const uint8* src_u, const uint8* src_v, uint8* dst_uv, int width) = MergeUVRow_C; #if defined(HAS_MERGEUVROW_SSE2) @@ -476,7 +509,6 @@ int I420ToNV12(const uint8* src_y, int src_stride_y, #endif CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, width, height); - int halfheight = (height + 1) >> 1; for (int y = 0; y < halfheight; ++y) { // Merge a row of U and V into a row of UV. MergeUVRow_(src_u, src_v, dst_uv, halfwidth); diff --git a/source/row_any.cc b/source/row_any.cc index 36859a4b4..cc801cfae 100644 --- a/source/row_any.cc +++ b/source/row_any.cc @@ -271,8 +271,6 @@ YANY(ARGBAttenuateRow_Any_NEON, ARGBAttenuateRow_NEON, ARGBAttenuateRow_C, #endif #undef YANY - - // RGB/YUV to UV does multiple of 16 with SIMD and remainder with C. #define UVANY(NAMEANY, ANYTOUV_SIMD, ANYTOUV_C, BPP, MASK) \ void NAMEANY(const uint8* src_argb, int src_stride_argb, \