Commit e8ee1755 authored by Frank Barchard's avatar Frank Barchard

add unittest that compares ABGR to ARGB

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

Review URL: https://codereview.chromium.org/1423663007 .
parent 2844662e
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 1523 Version: 1524
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -11,6 +11,6 @@ ...@@ -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 1523 #define LIBYUV_VERSION 1524
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
...@@ -1691,4 +1691,39 @@ TEST_F(LibYUVConvertTest, NAME) { \ ...@@ -1691,4 +1691,39 @@ TEST_F(LibYUVConvertTest, NAME) { \
TESTPTOB(TestYUY2ToNV12, YUY2ToI420, YUY2ToNV12) TESTPTOB(TestYUY2ToNV12, YUY2ToI420, YUY2ToNV12)
TESTPTOB(TestUYVYToNV12, UYVYToI420, UYVYToNV12) TESTPTOB(TestUYVYToNV12, UYVYToI420, UYVYToNV12)
TEST_F(LibYUVConvertTest, TestI444ToABGRvsARGB) {
align_buffer_64(src_y, benchmark_width_ * benchmark_height_);
align_buffer_64(src_u, benchmark_width_ * benchmark_height_);
align_buffer_64(src_v, benchmark_width_ * benchmark_height_);
align_buffer_64(dst_argb, benchmark_width_ * benchmark_height_ * 4);
align_buffer_64(dst_abgr, benchmark_width_ * benchmark_height_ * 4);
MemRandomize(src_y, benchmark_width_ * benchmark_height_);
MemRandomize(src_u, benchmark_width_ * benchmark_height_);
MemRandomize(src_v, benchmark_width_ * benchmark_height_);
MemRandomize(dst_argb, benchmark_width_ * benchmark_height_ * 4);
MemRandomize(dst_abgr, benchmark_width_ * benchmark_height_ * 4);
libyuv::I444ToARGB(src_y, benchmark_width_,
src_u, benchmark_width_,
src_v, benchmark_width_,
dst_argb, benchmark_width_ * 4,
benchmark_width_, benchmark_height_);
libyuv::I444ToABGR(src_y, benchmark_width_,
src_u, benchmark_width_,
src_v, benchmark_width_,
dst_abgr, benchmark_width_ * 4,
benchmark_width_, benchmark_height_);
// swap in place.
libyuv::ABGRToARGB(dst_abgr, benchmark_width_ * 4,
dst_abgr, benchmark_width_ * 4,
benchmark_width_, benchmark_height_);
for (int i = 0; i < benchmark_width_ * benchmark_height_ * 4; ++i) {
EXPECT_EQ(dst_abgr[i], dst_argb[i]);
}
free_aligned_buffer_64(src_y);
free_aligned_buffer_64(src_u);
free_aligned_buffer_64(src_v);
free_aligned_buffer_64(dst_argb);
free_aligned_buffer_64(dst_abgr);
}
} // namespace libyuv } // namespace libyuv
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment