diff --git a/README.chromium b/README.chromium index eac70427b..5fb25d1b6 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 923 +Version: 924 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index beb4ecacc..e5e853242 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 923 +#define LIBYUV_VERSION 924 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/format_conversion.cc b/source/format_conversion.cc index cf7d6ea3a..1870502d8 100644 --- a/source/format_conversion.cc +++ b/source/format_conversion.cc @@ -287,9 +287,6 @@ int BayerToI420(const uint8* src_bayer, int src_stride_bayer, uint8* dst_v, int dst_stride_v, int width, int height, uint32 src_fourcc_bayer) { - if (width * 4 > kMaxStride) { - return -1; // Size too large for row buffer - } // Negative height means invert the image. if (height < 0) { height = -height; @@ -358,14 +355,16 @@ int BayerToI420(const uint8* src_bayer, int src_stride_bayer, return -1; // Bad FourCC } - SIMD_ALIGNED(uint8 row[kMaxStride * 2]); + // Allocate 2 rows of ARGB. + const int kRowSize = (width * 4 + 15) & ~15; + align_buffer_64(row, kRowSize * 2); for (int y = 0; y < height - 1; y += 2) { BayerRow0(src_bayer, src_stride_bayer, row, width); BayerRow1(src_bayer + src_stride_bayer, -src_stride_bayer, - row + kMaxStride, width); - ARGBToUVRow(row, kMaxStride, dst_u, dst_v, width); + row + kRowSize, width); + ARGBToUVRow(row, kRowSize, dst_u, dst_v, width); ARGBToYRow(row, dst_y, width); - ARGBToYRow(row + kMaxStride, dst_y + dst_stride_y, width); + ARGBToYRow(row + kRowSize, dst_y + dst_stride_y, width); src_bayer += src_stride_bayer * 2; dst_y += dst_stride_y * 2; dst_u += dst_stride_u; @@ -376,6 +375,7 @@ int BayerToI420(const uint8* src_bayer, int src_stride_bayer, ARGBToUVRow(row, 0, dst_u, dst_v, width); ARGBToYRow(row, dst_y, width); } + free_aligned_buffer_64(row); return 0; } @@ -387,9 +387,6 @@ int I420ToBayer(const uint8* src_y, int src_stride_y, uint8* dst_bayer, int dst_stride_bayer, int width, int height, uint32 dst_fourcc_bayer) { - if (width * 4 > kMaxStride) { - return -1; // Size too large for row buffer - } // Negative height means invert the image. if (height < 0) { height = -height; @@ -439,7 +436,6 @@ int I420ToBayer(const uint8* src_y, int src_stride_y, } #endif - SIMD_ALIGNED(uint8 row[kMaxStride]); void (*ARGBToBayerRow)(const uint8* src_argb, uint8* dst_bayer, uint32 selector, int pix) = ARGBToBayerRow_C; #if defined(HAS_ARGBTOBAYERROW_SSSE3) @@ -466,7 +462,8 @@ int I420ToBayer(const uint8* src_y, int src_stride_y, dst_fourcc_bayer, index_map)) { return -1; // Bad FourCC } - + // Allocate a row of ARGB. + align_buffer_64(row, width * 4); for (int y = 0; y < height; ++y) { I422ToARGBRow(src_y, src_u, src_v, row, width); ARGBToBayerRow(row, dst_bayer, index_map[y & 1], width); @@ -477,6 +474,7 @@ int I420ToBayer(const uint8* src_y, int src_stride_y, src_v += src_stride_v; } } + free_aligned_buffer_64(row); return 0; }