Fix testi420 unittest for odd height

When the image height for unittests was set to an
odd height, the TestI420 unittest would not fill
the complete source buffer.  This change handles
the odd height test case.
No change to library code.

TBR=harryjin@google.com
BUG=libyuv:549

Review URL: https://codereview.chromium.org/1609103002 .
This commit is contained in:
Frank Barchard 2016-01-19 16:16:39 -08:00
parent 58cb534962
commit 8c196f4d4c
3 changed files with 15 additions and 3 deletions

View File

@ -1,6 +1,6 @@
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 1567 Version: 1568
License: BSD License: BSD
License File: LICENSE License File: LICENSE

View File

@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1567 #define LIBYUV_VERSION 1568
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT

View File

@ -81,7 +81,19 @@ namespace libyuv {
} \ } \
p += HN; \ p += HN; \
} \ } \
\ if ((benchmark_height_ & 1) && HS == 2) { \
for (int x = 0; x < benchmark_width_ - 1; x += 2) { \
uint8 r = static_cast<uint8>(fastrand()); \
p[0] = r; \
p[1] = r; \
p += 2; \
} \
if (benchmark_width_ & 1) { \
uint8 r = static_cast<uint8>(fastrand()); \
p[0] = r; \
p += 1; \
} \
} \
/* Start with YUV converted to ARGB. */ \ /* Start with YUV converted to ARGB. */ \
YUVTOARGB(orig_y, benchmark_width_, \ YUVTOARGB(orig_y, benchmark_width_, \
orig_u, (benchmark_width_ + 1) / 2, \ orig_u, (benchmark_width_ + 1) / 2, \