Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(746)

Unified Diff: unit_test/convert_test.cc

Issue 1423663007: add unittest that compares ABGR to ARGB (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/libyuv/version.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: unit_test/convert_test.cc
diff --git a/unit_test/convert_test.cc b/unit_test/convert_test.cc
index 0f8065539a1b017a0bd52768d110d13c1ef524fe..8ab007be83a4e1d9662b5d67fd9b5c047dee46c3 100644
--- a/unit_test/convert_test.cc
+++ b/unit_test/convert_test.cc
@@ -1691,4 +1691,39 @@ TEST_F(LibYUVConvertTest, NAME) { \
TESTPTOB(TestYUY2ToNV12, YUY2ToI420, YUY2ToNV12)
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
« no previous file with comments | « include/libyuv/version.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698