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

Unified Diff: media/base/yuv_convert_unittest.cc

Issue 242643011: Add correct support for videos with YUVJ420P color format, in the software conversion path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@yuvnopic
Patch Set: YUVJ browsertest now passes, update expectation Created 6 years, 8 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 | « media/base/yuv_convert_perftest.cc ('k') | media/filters/skcanvas_video_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/yuv_convert_unittest.cc
diff --git a/media/base/yuv_convert_unittest.cc b/media/base/yuv_convert_unittest.cc
index 7c964f3771a5e4ee13f1999c299ef0ae6c0256a8..73deb1ff9192d3ef6df596f05c0bbb148d07a6e7 100644
--- a/media/base/yuv_convert_unittest.cc
+++ b/media/base/yuv_convert_unittest.cc
@@ -11,6 +11,7 @@
#include "media/base/simd/convert_rgb_to_yuv.h"
#include "media/base/simd/convert_yuv_to_rgb.h"
#include "media/base/simd/filter_yuv.h"
+#include "media/base/simd/yuv_to_rgb_table.h"
#include "media/base/yuv_convert.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/rect.h"
@@ -162,6 +163,7 @@ class YUVScaleTest : public ::testing::TestWithParam<YUVScaleTestData> {
YUVScaleTest() {
switch (GetParam().yuv_type) {
case media::YV12:
+ case media::YV12J:
ReadYV12Data(&yuv_bytes_);
break;
case media::YV16:
@@ -178,6 +180,7 @@ class YUVScaleTest : public ::testing::TestWithParam<YUVScaleTestData> {
uint8* v_plane() {
switch (GetParam().yuv_type) {
case media::YV12:
+ case media::YV12J:
return yuv_bytes_.get() + kSourceVOffset;
case media::YV16:
return yuv_bytes_.get() + kSourceYSize * 3 / 2;
@@ -618,12 +621,14 @@ TEST(YUVConvertTest, ConvertYUVToRGB32Row_MMX) {
yuv_bytes.get() + kSourceUOffset,
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_reference.get(),
- kWidth);
+ kWidth,
+ GetLookupTable(YV12));
ConvertYUVToRGB32Row_MMX(yuv_bytes.get(),
yuv_bytes.get() + kSourceUOffset,
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_converted.get(),
- kWidth);
+ kWidth,
+ GetLookupTable(YV12));
media::EmptyRegisterState();
EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(),
rgb_bytes_converted.get(),
@@ -647,12 +652,14 @@ TEST(YUVConvertTest, ConvertYUVToRGB32Row_SSE) {
yuv_bytes.get() + kSourceUOffset,
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_reference.get(),
- kWidth);
+ kWidth,
+ GetLookupTable(YV12));
ConvertYUVToRGB32Row_SSE(yuv_bytes.get(),
yuv_bytes.get() + kSourceUOffset,
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_converted.get(),
- kWidth);
+ kWidth,
+ GetLookupTable(YV12));
media::EmptyRegisterState();
EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(),
rgb_bytes_converted.get(),
@@ -678,13 +685,15 @@ TEST(YUVConvertTest, ScaleYUVToRGB32Row_MMX) {
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_reference.get(),
kWidth,
- kSourceDx);
+ kSourceDx,
+ GetLookupTable(YV12));
ScaleYUVToRGB32Row_MMX(yuv_bytes.get(),
yuv_bytes.get() + kSourceUOffset,
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_converted.get(),
kWidth,
- kSourceDx);
+ kSourceDx,
+ GetLookupTable(YV12));
media::EmptyRegisterState();
EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(),
rgb_bytes_converted.get(),
@@ -710,13 +719,15 @@ TEST(YUVConvertTest, ScaleYUVToRGB32Row_SSE) {
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_reference.get(),
kWidth,
- kSourceDx);
+ kSourceDx,
+ GetLookupTable(YV12));
ScaleYUVToRGB32Row_SSE(yuv_bytes.get(),
yuv_bytes.get() + kSourceUOffset,
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_converted.get(),
kWidth,
- kSourceDx);
+ kSourceDx,
+ GetLookupTable(YV12));
media::EmptyRegisterState();
EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(),
rgb_bytes_converted.get(),
@@ -742,13 +753,15 @@ TEST(YUVConvertTest, LinearScaleYUVToRGB32Row_MMX) {
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_reference.get(),
kWidth,
- kSourceDx);
+ kSourceDx,
+ GetLookupTable(YV12));
LinearScaleYUVToRGB32Row_MMX(yuv_bytes.get(),
yuv_bytes.get() + kSourceUOffset,
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_converted.get(),
kWidth,
- kSourceDx);
+ kSourceDx,
+ GetLookupTable(YV12));
media::EmptyRegisterState();
EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(),
rgb_bytes_converted.get(),
@@ -774,13 +787,15 @@ TEST(YUVConvertTest, LinearScaleYUVToRGB32Row_SSE) {
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_reference.get(),
kWidth,
- kSourceDx);
+ kSourceDx,
+ GetLookupTable(YV12));
LinearScaleYUVToRGB32Row_SSE(yuv_bytes.get(),
yuv_bytes.get() + kSourceUOffset,
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_converted.get(),
kWidth,
- kSourceDx);
+ kSourceDx,
+ GetLookupTable(YV12));
media::EmptyRegisterState();
EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(),
rgb_bytes_converted.get(),
@@ -924,13 +939,15 @@ TEST(YUVConvertTest, ScaleYUVToRGB32Row_SSE2_X64) {
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_reference.get(),
kWidth,
- kSourceDx);
+ kSourceDx,
+ GetLookupTable(YV12));
ScaleYUVToRGB32Row_SSE2_X64(yuv_bytes.get(),
yuv_bytes.get() + kSourceUOffset,
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_converted.get(),
kWidth,
- kSourceDx);
+ kSourceDx,
+ GetLookupTable(YV12));
media::EmptyRegisterState();
EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(),
rgb_bytes_converted.get(),
@@ -950,13 +967,15 @@ TEST(YUVConvertTest, LinearScaleYUVToRGB32Row_MMX_X64) {
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_reference.get(),
kWidth,
- kSourceDx);
+ kSourceDx,
+ GetLookupTable(YV12));
LinearScaleYUVToRGB32Row_MMX_X64(yuv_bytes.get(),
yuv_bytes.get() + kSourceUOffset,
yuv_bytes.get() + kSourceVOffset,
rgb_bytes_converted.get(),
kWidth,
- kSourceDx);
+ kSourceDx,
+ GetLookupTable(YV12));
media::EmptyRegisterState();
EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(),
rgb_bytes_converted.get(),
« no previous file with comments | « media/base/yuv_convert_perftest.cc ('k') | media/filters/skcanvas_video_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698