diff --git a/README.chromium b/README.chromium index 202ce92b1..288bd7617 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 800 +Version: 801 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 52f264bc9..4b78d341c 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 800 +#define LIBYUV_VERSION 801 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/planar_functions.cc b/source/planar_functions.cc index acc898b84..de7675546 100644 --- a/source/planar_functions.cc +++ b/source/planar_functions.cc @@ -1533,7 +1533,13 @@ int ARGBBlur(const uint8* src_argb, int src_stride_argb, src_argb = src_argb + (height - 1) * src_stride_argb; src_stride_argb = -src_stride_argb; } - void (*ComputeCumulativeSumRow)(const uint8* row, int32* cumsum, + if (radius > height) { + radius = height; + } + if (radius > width) { + radius = width; + } + void (*ComputeCumulativeSumRow)(const uint8 *row, int32 *cumsum, const int32* previous_cumsum, int width) = ComputeCumulativeSumRow_C; void (*CumulativeSumToAverageRow)(const int32* topleft, const int32* botleft, int width, int area, uint8* dst, int count) = CumulativeSumToAverageRow_C; @@ -1810,8 +1816,10 @@ LIBYUV_API int ARGBSobel(const uint8* src_argb, int src_stride_argb, uint8* dst_argb, int dst_stride_argb, int width, int height) { + const int kMaxRow = kMaxStride / 4; + const int kEdge = 16; // Extra pixels at start of row for extrude/align. if (!src_argb || !dst_argb || - width <= 0 || height == 0 || width > (kMaxStride / 4)) { + width <= 0 || height == 0 || width > (kMaxRow - kEdge)) { return -1; } // Negative height means invert the image. @@ -1878,15 +1886,15 @@ int ARGBSobel(const uint8* src_argb, int src_stride_argb, } #endif - const int kEdge = 16; // Extra pixels at start of row for extrude/align. - SIMD_ALIGNED(uint8 row_y[(kMaxStride / 4 + kEdge) * 3 + kEdge]); - SIMD_ALIGNED(uint8 row_sobelx[kMaxStride / 4]); - SIMD_ALIGNED(uint8 row_sobely[kMaxStride / 4]); + // 3 rows with edges before/after. + SIMD_ALIGNED(uint8 row_y[kEdge + kMaxRow * 3]); + SIMD_ALIGNED(uint8 row_sobelx[kMaxRow]); + SIMD_ALIGNED(uint8 row_sobely[kMaxRow]); // Convert first row. uint8* row_y0 = row_y + kEdge; - uint8* row_y1 = row_y0 + kMaxStride / 4; - uint8* row_y2 = row_y1 + kMaxStride / 4; + uint8* row_y1 = row_y0 + kMaxRow; + uint8* row_y2 = row_y1 + kMaxRow; ARGBToBayerRow(src_argb, row_y0, 0x0d090501, width); row_y0[-1] = row_y0[0]; memset(row_y0 + width, row_y0[width - 1], 16); // extrude 16 pixels. @@ -1925,8 +1933,10 @@ LIBYUV_API int ARGBSobelXY(const uint8* src_argb, int src_stride_argb, uint8* dst_argb, int dst_stride_argb, int width, int height) { + const int kMaxRow = kMaxStride / 4; + const int kEdge = 16; // Extra pixels at start of row for extrude/align. if (!src_argb || !dst_argb || - width <= 0 || height == 0 || width > kMaxStride / 4) { + width <= 0 || height == 0 || width > (kMaxRow - kEdge)) { return -1; } // Negative height means invert the image. @@ -1993,15 +2003,14 @@ int ARGBSobelXY(const uint8* src_argb, int src_stride_argb, } #endif - const int kEdge = 16; // Extra pixels at start of row for extrude/align. - SIMD_ALIGNED(uint8 row_y[(kMaxStride / 4 + kEdge) * 3 + kEdge]); - SIMD_ALIGNED(uint8 row_sobelx[kMaxStride / 4]); - SIMD_ALIGNED(uint8 row_sobely[kMaxStride / 4]); + SIMD_ALIGNED(uint8 row_y[kEdge + kMaxRow * 3]); + SIMD_ALIGNED(uint8 row_sobelx[kMaxRow]); + SIMD_ALIGNED(uint8 row_sobely[kMaxRow]); // Convert first row. uint8* row_y0 = row_y + kEdge; - uint8* row_y1 = row_y0 + kMaxStride / 4; - uint8* row_y2 = row_y1 + kMaxStride / 4; + uint8* row_y1 = row_y0 + kMaxRow; + uint8* row_y2 = row_y1 + kMaxRow; ARGBToBayerRow(src_argb, row_y0, 0x0d090501, width); row_y0[-1] = row_y0[0]; memset(row_y0 + width, row_y0[width - 1], 16); // extrude 16 pixels.