diff --git a/README.chromium b/README.chromium index c1a2b7d11..114352369 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 982 +Version: 984 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 6796fe51a..ef9001336 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 982 +#define LIBYUV_VERSION 984 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/scale_argb.cc b/source/scale_argb.cc index 39e780e8b..a248e2e1f 100644 --- a/source/scale_argb.cc +++ b/source/scale_argb.cc @@ -181,8 +181,12 @@ static void ScaleARGBBilinearDown(int src_width, int src_height, int64 xr = (dx >= 0) ? xlast : x; int clip_src_width; xl = (xl >> 16) & ~3; // Left edge aligned. - xr = (xr >> 16) + 1; // Right most pixel used. - clip_src_width = (((xr - xl) + 1 + 3) & ~3) * 4; // Width aligned to 4. + xr = (xr >> 16) + 1; // Right most pixel used. Bilinear uses 2 pixels. + xr = (xr + 1 + 3) & ~3; // 1 beyond 4 pixel aligned right most pixel. + if (xr > src_width) { + xr = src_width; + } + clip_src_width = (xr - xl) * 4; // Width aligned to 4. src_argb += xl * 4; x -= (int)(xl << 16); #if defined(HAS_INTERPOLATEROW_SSE2) diff --git a/unit_test/scale_argb_test.cc b/unit_test/scale_argb_test.cc index 0ffc2e2a9..6a2bc7954 100644 --- a/unit_test/scale_argb_test.cc +++ b/unit_test/scale_argb_test.cc @@ -22,21 +22,21 @@ namespace libyuv { static int ARGBTestFilter(int src_width, int src_height, int dst_width, int dst_height, FilterMode f, int benchmark_iterations) { - const int b = 128; int i, j; + const int b = 0; // 128 to test for padding/stride. int src_argb_plane_size = (Abs(src_width) + b * 2) * (Abs(src_height) + b * 2) * 4; int src_stride_argb = (b * 2 + Abs(src_width)) * 4; - align_buffer_64(src_argb, src_argb_plane_size); + align_buffer_page_end(src_argb, src_argb_plane_size); srandom(time(NULL)); MemRandomize(src_argb, src_argb_plane_size); int dst_argb_plane_size = (dst_width + b * 2) * (dst_height + b * 2) * 4; int dst_stride_argb = (b * 2 + dst_width) * 4; - align_buffer_64(dst_argb_c, dst_argb_plane_size); - align_buffer_64(dst_argb_opt, dst_argb_plane_size); + align_buffer_page_end(dst_argb_c, dst_argb_plane_size); + align_buffer_page_end(dst_argb_opt, dst_argb_plane_size); memset(dst_argb_c, 2, dst_argb_plane_size); memset(dst_argb_opt, 3, dst_argb_plane_size); @@ -90,9 +90,9 @@ static int ARGBTestFilter(int src_width, int src_height, } } - free_aligned_buffer_64(dst_argb_c); - free_aligned_buffer_64(dst_argb_opt); - free_aligned_buffer_64(src_argb); + free_aligned_buffer_page_end(dst_argb_c); + free_aligned_buffer_page_end(dst_argb_opt); + free_aligned_buffer_page_end(src_argb); return max_diff; } @@ -262,6 +262,7 @@ TEST_FACTOR(3by4, 3 / 4, 3 / 4) TEST_SCALETO(ARGBScale, 1, 1) TEST_SCALETO(ARGBScale, 320, 240) TEST_SCALETO(ARGBScale, 352, 288) +TEST_SCALETO(ARGBScale, 569, 480) TEST_SCALETO(ARGBScale, 640, 360) TEST_SCALETO(ARGBScale, 1280, 720) #undef TEST_SCALETO1 diff --git a/unit_test/scale_test.cc b/unit_test/scale_test.cc index a42de3216..366c5fdb2 100644 --- a/unit_test/scale_test.cc +++ b/unit_test/scale_test.cc @@ -22,7 +22,7 @@ static int TestFilter(int src_width, int src_height, int dst_width, int dst_height, FilterMode f, int benchmark_iterations) { int i, j; - const int b = 128; + const int b = 0; // 128 to test for padding/stride. int src_width_uv = (Abs(src_width) + 1) >> 1; int src_height_uv = (Abs(src_height) + 1) >> 1; @@ -180,6 +180,7 @@ TEST_FACTOR(3by4, 3 / 4, 3 / 4) TEST_SCALETO(Scale, 1, 1) TEST_SCALETO(Scale, 320, 240) TEST_SCALETO(Scale, 352, 288) +TEST_SCALETO(Scale, 569, 480) TEST_SCALETO(Scale, 640, 360) TEST_SCALETO(Scale, 1280, 720) #undef TEST_SCALETO1