OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/base_paths.h" | 5 #include "base/base_paths.h" |
6 #include "base/cpu.h" | 6 #include "base/cpu.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "media/base/djb2.h" | 10 #include "media/base/djb2.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 | 70 |
71 static void ReadRGB24Data(scoped_ptr<uint8[]>* data) { | 71 static void ReadRGB24Data(scoped_ptr<uint8[]>* data) { |
72 ReadData(FILE_PATH_LITERAL("bali_640x360_RGB24.rgb"), kRGB24Size, data); | 72 ReadData(FILE_PATH_LITERAL("bali_640x360_RGB24.rgb"), kRGB24Size, data); |
73 } | 73 } |
74 | 74 |
75 static void ReadYUY2Data(scoped_ptr<uint8[]>* data) { | 75 static void ReadYUY2Data(scoped_ptr<uint8[]>* data) { |
76 ReadData(FILE_PATH_LITERAL("bali_640x360_YUY2.yuv"), kYUY2Size, data); | 76 ReadData(FILE_PATH_LITERAL("bali_640x360_YUY2.yuv"), kYUY2Size, data); |
77 } | 77 } |
78 | 78 |
| 79 namespace media { |
| 80 |
79 TEST(YUVConvertTest, YV12) { | 81 TEST(YUVConvertTest, YV12) { |
80 // Allocate all surfaces. | 82 // Allocate all surfaces. |
81 scoped_ptr<uint8[]> yuv_bytes; | 83 scoped_ptr<uint8[]> yuv_bytes; |
82 scoped_ptr<uint8[]> rgb_bytes(new uint8[kRGBSize]); | 84 scoped_ptr<uint8[]> rgb_bytes(new uint8[kRGBSize]); |
83 scoped_ptr<uint8[]> rgb_converted_bytes(new uint8[kRGBSizeConverted]); | 85 scoped_ptr<uint8[]> rgb_converted_bytes(new uint8[kRGBSizeConverted]); |
84 | 86 |
85 // Read YUV reference data from file. | 87 // Read YUV reference data from file. |
86 ReadYV12Data(&yuv_bytes); | 88 ReadYV12Data(&yuv_bytes); |
87 | 89 |
88 // Convert a frame of YUV to 32 bit ARGB. | 90 // Convert a frame of YUV to 32 bit ARGB. |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 kSourceDx); | 934 kSourceDx); |
933 media::EmptyRegisterState(); | 935 media::EmptyRegisterState(); |
934 EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(), | 936 EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(), |
935 rgb_bytes_converted.get(), | 937 rgb_bytes_converted.get(), |
936 kWidth * kBpp)); | 938 kWidth * kBpp)); |
937 } | 939 } |
938 | 940 |
939 #endif // defined(ARCH_CPU_X86_64) | 941 #endif // defined(ARCH_CPU_X86_64) |
940 | 942 |
941 #endif // defined(ARCH_CPU_X86_FAMILY) | 943 #endif // defined(ARCH_CPU_X86_FAMILY) |
| 944 |
| 945 } // namespace media |
OLD | NEW |