| Index: media/base/yuv_convert_perftest.cc
|
| diff --git a/media/base/yuv_convert_perftest.cc b/media/base/yuv_convert_perftest.cc
|
| index 1600bcfd8ea3ebbddcb8d3265895d390821c6dab..0f30bebec8bb57a6f4fab330d22c290c1f270ab1 100644
|
| --- a/media/base/yuv_convert_perftest.cc
|
| +++ b/media/base/yuv_convert_perftest.cc
|
| @@ -64,6 +64,31 @@
|
| DISALLOW_COPY_AND_ASSIGN(YUVConvertPerfTest);
|
| };
|
|
|
| +TEST_F(YUVConvertPerfTest, ConvertYUVToRGB32Row_MMX) {
|
| + ASSERT_TRUE(base::CPU().has_mmx());
|
| +
|
| + base::TimeTicks start = base::TimeTicks::HighResNow();
|
| + for (int i = 0; i < kPerfTestIterations; ++i) {
|
| + for (int row = 0; row < kSourceHeight; ++row) {
|
| + int chroma_row = row / 2;
|
| + ConvertYUVToRGB32Row_MMX(
|
| + yuv_bytes_.get() + row * kSourceWidth,
|
| + yuv_bytes_.get() + kSourceUOffset + (chroma_row * kSourceWidth / 2),
|
| + yuv_bytes_.get() + kSourceVOffset + (chroma_row * kSourceWidth / 2),
|
| + rgb_bytes_converted_.get(),
|
| + kWidth,
|
| + GetLookupTable(YV12));
|
| + }
|
| + }
|
| + double total_time_seconds =
|
| + (base::TimeTicks::HighResNow() - start).InSecondsF();
|
| + perf_test::PrintResult(
|
| + "yuv_convert_perftest", "", "ConvertYUVToRGB32Row_MMX",
|
| + kPerfTestIterations / total_time_seconds, "runs/s", true);
|
| +
|
| + media::EmptyRegisterState();
|
| +}
|
| +
|
| TEST_F(YUVConvertPerfTest, ConvertYUVToRGB32Row_SSE) {
|
| ASSERT_TRUE(base::CPU().has_sse());
|
|
|
| @@ -88,6 +113,33 @@
|
| media::EmptyRegisterState();
|
| }
|
|
|
| +TEST_F(YUVConvertPerfTest, ScaleYUVToRGB32Row_MMX) {
|
| + ASSERT_TRUE(base::CPU().has_mmx());
|
| +
|
| + const int kSourceDx = 80000; // This value means a scale down.
|
| +
|
| + base::TimeTicks start = base::TimeTicks::HighResNow();
|
| + for (int i = 0; i < kPerfTestIterations; ++i) {
|
| + for (int row = 0; row < kSourceHeight; ++row) {
|
| + int chroma_row = row / 2;
|
| + ScaleYUVToRGB32Row_MMX(
|
| + yuv_bytes_.get() + row * kSourceWidth,
|
| + yuv_bytes_.get() + kSourceUOffset + (chroma_row * kSourceWidth / 2),
|
| + yuv_bytes_.get() + kSourceVOffset + (chroma_row * kSourceWidth / 2),
|
| + rgb_bytes_converted_.get(),
|
| + kWidth,
|
| + kSourceDx,
|
| + GetLookupTable(YV12));
|
| + }
|
| + }
|
| + double total_time_seconds =
|
| + (base::TimeTicks::HighResNow() - start).InSecondsF();
|
| + perf_test::PrintResult(
|
| + "yuv_convert_perftest", "", "ScaleYUVToRGB32Row_MMX",
|
| + kPerfTestIterations / total_time_seconds, "runs/s", true);
|
| + media::EmptyRegisterState();
|
| +}
|
| +
|
| TEST_F(YUVConvertPerfTest, ScaleYUVToRGB32Row_SSE) {
|
| ASSERT_TRUE(base::CPU().has_sse());
|
|
|
| @@ -115,6 +167,33 @@
|
| media::EmptyRegisterState();
|
| }
|
|
|
| +TEST_F(YUVConvertPerfTest, LinearScaleYUVToRGB32Row_MMX) {
|
| + ASSERT_TRUE(base::CPU().has_mmx());
|
| +
|
| + const int kSourceDx = 80000; // This value means a scale down.
|
| +
|
| + base::TimeTicks start = base::TimeTicks::HighResNow();
|
| + for (int i = 0; i < kPerfTestIterations; ++i) {
|
| + for (int row = 0; row < kSourceHeight; ++row) {
|
| + int chroma_row = row / 2;
|
| + LinearScaleYUVToRGB32Row_MMX(
|
| + yuv_bytes_.get() + row * kSourceWidth,
|
| + yuv_bytes_.get() + kSourceUOffset + (chroma_row * kSourceWidth / 2),
|
| + yuv_bytes_.get() + kSourceVOffset + (chroma_row * kSourceWidth / 2),
|
| + rgb_bytes_converted_.get(),
|
| + kWidth,
|
| + kSourceDx,
|
| + GetLookupTable(YV12));
|
| + }
|
| + }
|
| + double total_time_seconds =
|
| + (base::TimeTicks::HighResNow() - start).InSecondsF();
|
| + perf_test::PrintResult(
|
| + "yuv_convert_perftest", "", "LinearScaleYUVToRGB32Row_MMX",
|
| + kPerfTestIterations / total_time_seconds, "runs/s", true);
|
| + media::EmptyRegisterState();
|
| +}
|
| +
|
| TEST_F(YUVConvertPerfTest, LinearScaleYUVToRGB32Row_SSE) {
|
| ASSERT_TRUE(base::CPU().has_sse());
|
|
|
|
|