| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
| 9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 static const int kBpp = 4; | 32 static const int kBpp = 4; |
| 33 | 33 |
| 34 // Surface sizes for various test files. | 34 // Surface sizes for various test files. |
| 35 static const int kYUV12Size = kSourceYSize * 12 / 8; | 35 static const int kYUV12Size = kSourceYSize * 12 / 8; |
| 36 static const int kYUV16Size = kSourceYSize * 16 / 8; | 36 static const int kYUV16Size = kSourceYSize * 16 / 8; |
| 37 static const int kRGBSize = kSourceYSize * kBpp; | 37 static const int kRGBSize = kSourceYSize * kBpp; |
| 38 static const int kRGBSizeScaled = kScaledWidth * kScaledHeight * kBpp; | 38 static const int kRGBSizeScaled = kScaledWidth * kScaledHeight * kBpp; |
| 39 static const int kRGB24Size = kSourceYSize * 3; | 39 static const int kRGB24Size = kSourceYSize * 3; |
| 40 static const int kRGBSizeConverted = kSourceYSize * kBpp; | 40 static const int kRGBSizeConverted = kSourceYSize * kBpp; |
| 41 | 41 |
| 42 #if !defined(ARCH_CPU_ARM_FAMILY) && !defined(ARCH_CPU_MIPS_FAMILY) | 42 #if !defined(ARCH_CPU_ARM_FAMILY) && !defined(ARCH_CPU_MIPS_FAMILY) && \ |
| 43 !defined(OS_ANDROID) |
| 43 static const int kSourceAOffset = kSourceYSize * 12 / 8; | 44 static const int kSourceAOffset = kSourceYSize * 12 / 8; |
| 44 static const int kYUVA12Size = kSourceYSize * 20 / 8; | 45 static const int kYUVA12Size = kSourceYSize * 20 / 8; |
| 45 #endif | 46 #endif |
| 46 | 47 |
| 47 // Helper for reading test data into a scoped_ptr<uint8_t[]>. | 48 // Helper for reading test data into a scoped_ptr<uint8_t[]>. |
| 48 static void ReadData(const base::FilePath::CharType* filename, | 49 static void ReadData(const base::FilePath::CharType* filename, |
| 49 int expected_size, | 50 int expected_size, |
| 50 scoped_ptr<uint8_t[]>* data) { | 51 scoped_ptr<uint8_t[]>* data) { |
| 51 data->reset(new uint8_t[expected_size]); | 52 data->reset(new uint8_t[expected_size]); |
| 52 | 53 |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(), | 860 EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(), |
| 860 rgb_bytes_converted.get(), | 861 rgb_bytes_converted.get(), |
| 861 kWidth * kBpp)); | 862 kWidth * kBpp)); |
| 862 } | 863 } |
| 863 | 864 |
| 864 #endif // defined(ARCH_CPU_X86_64) | 865 #endif // defined(ARCH_CPU_X86_64) |
| 865 | 866 |
| 866 #endif // defined(ARCH_CPU_X86_FAMILY) | 867 #endif // defined(ARCH_CPU_X86_FAMILY) |
| 867 | 868 |
| 868 } // namespace media | 869 } // namespace media |
| OLD | NEW |