| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <inttypes.h> | 5 #include <inttypes.h> |
| 6 #include <stddef.h> | 6 #include <stddef.h> |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 #ifdef ARCH_CPU_ARMEL | 159 #ifdef ARCH_CPU_ARMEL |
| 160 // ARM performs CPU cache management with CPU cache line granularity. We thus | 160 // ARM performs CPU cache management with CPU cache line granularity. We thus |
| 161 // need to ensure our buffers are CPU cache line-aligned (64 byte-aligned). | 161 // need to ensure our buffers are CPU cache line-aligned (64 byte-aligned). |
| 162 // Otherwise newer kernels will refuse to accept them, and on older kernels | 162 // Otherwise newer kernels will refuse to accept them, and on older kernels |
| 163 // we'll be treating ourselves to random corruption. | 163 // we'll be treating ourselves to random corruption. |
| 164 // Moreover, some hardware codecs require 128-byte alignment for physical | 164 // Moreover, some hardware codecs require 128-byte alignment for physical |
| 165 // buffers. | 165 // buffers. |
| 166 const size_t kPlatformBufferAlignment = 128; | 166 const size_t kPlatformBufferAlignment = 128; |
| 167 #else | 167 #else |
| 168 const size_t kPlatformBufferAlignment = 1; | 168 const size_t kPlatformBufferAlignment = 8; |
| 169 #endif | 169 #endif |
| 170 | 170 |
| 171 inline static size_t AlignToPlatformRequirements(size_t value) { | 171 inline static size_t AlignToPlatformRequirements(size_t value) { |
| 172 return base::bits::Align(value, kPlatformBufferAlignment); | 172 return base::bits::Align(value, kPlatformBufferAlignment); |
| 173 } | 173 } |
| 174 | 174 |
| 175 // An aligned STL allocator. | 175 // An aligned STL allocator. |
| 176 template <typename T, size_t ByteAlignment> | 176 template <typename T, size_t ByteAlignment> |
| 177 class AlignedAllocator : public std::allocator<T> { | 177 class AlignedAllocator : public std::allocator<T> { |
| 178 public: | 178 public: |
| (...skipping 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1941 | 1941 |
| 1942 media::g_env = | 1942 media::g_env = |
| 1943 reinterpret_cast<media::VideoEncodeAcceleratorTestEnvironment*>( | 1943 reinterpret_cast<media::VideoEncodeAcceleratorTestEnvironment*>( |
| 1944 testing::AddGlobalTestEnvironment( | 1944 testing::AddGlobalTestEnvironment( |
| 1945 new media::VideoEncodeAcceleratorTestEnvironment( | 1945 new media::VideoEncodeAcceleratorTestEnvironment( |
| 1946 std::move(test_stream_data), log_path, run_at_fps, | 1946 std::move(test_stream_data), log_path, run_at_fps, |
| 1947 needs_encode_latency, verify_all_output))); | 1947 needs_encode_latency, verify_all_output))); |
| 1948 | 1948 |
| 1949 return RUN_ALL_TESTS(); | 1949 return RUN_ALL_TESTS(); |
| 1950 } | 1950 } |
| OLD | NEW |