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 // This webpage shows layout of YV12 and other YUV formats | 5 // This webpage shows layout of YV12 and other YUV formats |
6 // http://www.fourcc.org/yuv.php | 6 // http://www.fourcc.org/yuv.php |
7 // The actual conversion is best described here | 7 // The actual conversion is best described here |
8 // http://en.wikipedia.org/wiki/YUV | 8 // http://en.wikipedia.org/wiki/YUV |
9 // An article on optimizing YUV conversion using tables instead of multiplies | 9 // An article on optimizing YUV conversion using tables instead of multiplies |
10 // http://lestourtereaux.free.fr/papers/data/yuvrgb.pdf | 10 // http://lestourtereaux.free.fr/papers/data/yuvrgb.pdf |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "media/base/simd/filter_yuv.h" | 26 #include "media/base/simd/filter_yuv.h" |
27 | 27 |
28 #if defined(ARCH_CPU_X86_FAMILY) | 28 #if defined(ARCH_CPU_X86_FAMILY) |
29 #if defined(COMPILER_MSVC) | 29 #if defined(COMPILER_MSVC) |
30 #include <intrin.h> | 30 #include <intrin.h> |
31 #else | 31 #else |
32 #include <mmintrin.h> | 32 #include <mmintrin.h> |
33 #endif | 33 #endif |
34 #endif | 34 #endif |
35 | 35 |
36 // Visual Studio 2010 does not support MMX intrinsics on x64. | |
37 // Some win64 yuv_convert code paths use SSE+MMX yasm, so without rewriting | |
38 // them, we use yasm EmptyRegisterState_MMX in place of _mm_empty() or | |
39 // hide the versions implemented with heavy use of MMX intrinsics. | |
40 // TODO(wolenetz): Use MMX intrinsics when compiling win64 with Visual | |
41 // Studio 2012? http://crbug.com/173450 | |
42 #if !(defined(ARCH_CPU_X86_64) && defined(COMPILER_MSVC)) | |
43 #define MEDIA_MMX_INTRINSICS_AVAILABLE | |
44 #endif | |
45 | |
46 // Assembly functions are declared without namespace. | 36 // Assembly functions are declared without namespace. |
47 extern "C" { | 37 extern "C" { |
48 void EmptyRegisterState_MMX(); | 38 void EmptyRegisterState_MMX(); |
49 } // extern "C" | 39 } // extern "C" |
50 | 40 |
51 namespace media { | 41 namespace media { |
52 | 42 |
53 static FilterYUVRowsProc ChooseFilterYUVRowsProc() { | 43 static FilterYUVRowsProc ChooseFilterYUVRowsProc() { |
54 #if defined(ARCH_CPU_X86_FAMILY) | 44 #if defined(ARCH_CPU_X86_FAMILY) |
55 base::CPU cpu; | 45 base::CPU cpu; |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 else | 597 else |
608 convert_proc = &ConvertYUVToRGB32_C; | 598 convert_proc = &ConvertYUVToRGB32_C; |
609 } | 599 } |
610 | 600 |
611 convert_proc(yplane, uplane, vplane, rgbframe, | 601 convert_proc(yplane, uplane, vplane, rgbframe, |
612 width, height, ystride, uvstride, rgbstride, yuv_type); | 602 width, height, ystride, uvstride, rgbstride, yuv_type); |
613 #endif | 603 #endif |
614 } | 604 } |
615 | 605 |
616 } // namespace media | 606 } // namespace media |
OLD | NEW |