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 #ifndef MEDIA_BASE_YUV_CONVERT_H_ | 5 #ifndef MEDIA_BASE_YUV_CONVERT_H_ |
6 #define MEDIA_BASE_YUV_CONVERT_H_ | 6 #define MEDIA_BASE_YUV_CONVERT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
11 | 11 |
12 // Visual Studio 2010 does not support MMX intrinsics on x64. | |
13 // Some win64 yuv_convert code paths use SSE+MMX yasm, so without rewriting | |
14 // them, we use yasm EmptyRegisterState_MMX in place of _mm_empty() or | |
15 // hide the versions implemented with heavy use of MMX intrinsics. | |
16 // TODO(wolenetz): Use MMX intrinsics when compiling win64 with Visual | |
17 // Studio 2012? (crbug.com/173450) | |
scherkus (not reviewing)
2013/02/01 01:13:17
pedantic nit: use "http://crbug.com/173450: withou
wolenetz
2013/02/01 02:42:07
Done.
| |
18 #if defined(ARCH_CPU_X86_64) && defined(COMPILER_MSVC) | |
19 #define MEDIA_DO_NOT_USE_MMX_INTRINSICS | |
scherkus (not reviewing)
2013/02/01 01:13:17
nit: it'd be clearer to negate the define i.e., US
wolenetz
2013/02/01 02:42:07
Done.
| |
20 #endif | |
scherkus (not reviewing)
2013/02/01 01:13:17
I believe this can be moved to the .cc
wolenetz
2013/02/01 02:42:07
Done.
| |
21 | |
12 // Type of YUV surface. | 22 // Type of YUV surface. |
13 // The value of these enums matter as they are used to shift vertical indices. | 23 // The value of these enums matter as they are used to shift vertical indices. |
14 enum YUVType { | 24 enum YUVType { |
15 YV16 = 0, // YV16 is half width and full height chroma channels. | 25 YV16 = 0, // YV16 is half width and full height chroma channels. |
16 YV12 = 1, // YV12 is half width and half height chroma channels. | 26 YV12 = 1, // YV12 is half width and half height chroma channels. |
17 }; | 27 }; |
18 | 28 |
19 // Mirror means flip the image horizontally, as in looking in a mirror. | 29 // Mirror means flip the image horizontally, as in looking in a mirror. |
20 // Rotate happens after mirroring. | 30 // Rotate happens after mirroring. |
21 enum Rotate { | 31 enum Rotate { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 int height); | 124 int height); |
115 | 125 |
116 void ConvertNV21ToYUV(const uint8* src, | 126 void ConvertNV21ToYUV(const uint8* src, |
117 uint8* yplane, | 127 uint8* yplane, |
118 uint8* uplane, | 128 uint8* uplane, |
119 uint8* vplane, | 129 uint8* vplane, |
120 int width, | 130 int width, |
121 int height); | 131 int height); |
122 | 132 |
123 // Empty SIMD register state after calling optimized scaler functions. | 133 // Empty SIMD register state after calling optimized scaler functions. |
124 // This method is only used in unit test after calling SIMD functions. | |
125 void EmptyRegisterState(); | 134 void EmptyRegisterState(); |
126 | 135 |
127 } // namespace media | 136 } // namespace media |
128 | 137 |
129 #endif // MEDIA_BASE_YUV_CONVERT_H_ | 138 #endif // MEDIA_BASE_YUV_CONVERT_H_ |
OLD | NEW |