OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // yuv_row internal functions to handle YUV conversion and scaling to RGB. | 5 // yuv_row internal functions to handle YUV conversion and scaling to RGB. |
6 // These functions are used from both yuv_convert.cc and yuv_scale.cc. | 6 // These functions are used from both yuv_convert.cc and yuv_scale.cc. |
7 | 7 |
8 // TODO(fbarchard): Write function that can handle rotation and scaling. | 8 // TODO(fbarchard): Write function that can handle rotation and scaling. |
9 | 9 |
10 #ifndef MEDIA_BASE_YUV_ROW_H_ | 10 #ifndef MEDIA_BASE_YUV_ROW_H_ |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // This is the slowest of the scalers. | 56 // This is the slowest of the scalers. |
57 void ScaleYUVToRGB32Row(const uint8* y_buf, | 57 void ScaleYUVToRGB32Row(const uint8* y_buf, |
58 const uint8* u_buf, | 58 const uint8* u_buf, |
59 const uint8* v_buf, | 59 const uint8* v_buf, |
60 uint8* rgb_buf, | 60 uint8* rgb_buf, |
61 int width, | 61 int width, |
62 int scaled_dx); | 62 int scaled_dx); |
63 } // extern "C" | 63 } // extern "C" |
64 | 64 |
65 #if !defined(USE_MMX) | 65 #if !defined(USE_MMX) |
66 // Windows, Mac and Linux x86 use MMX; x64 and other CPUs do not. | 66 #if defined(_MSC_VER) |
67 #if defined(OS_WIN) || defined(ARCH_CPU_X86) | 67 #define USE_MMX 1 |
| 68 #elif defined(OS_LINUX) && defined(ARCH_CPU_X86) |
68 #define USE_MMX 1 | 69 #define USE_MMX 1 |
69 #else | 70 #else |
70 #define USE_MMX 0 | 71 #define USE_MMX 0 |
71 #endif | 72 #endif |
72 #endif | 73 #endif |
73 | 74 |
74 #if USE_MMX | 75 #if USE_MMX |
75 #if defined(_MSC_VER) | 76 #if defined(_MSC_VER) |
76 #define EMMS() __asm emms | 77 #define EMMS() __asm emms |
77 #else | 78 #else |
78 #define EMMS() asm("emms") | 79 #define EMMS() asm("emms") |
79 #endif | 80 #endif |
80 #else | 81 #else |
81 #define EMMS() | 82 #define EMMS() |
82 #endif | 83 #endif |
83 | 84 |
84 #endif // MEDIA_BASE_YUV_ROW_H_ | 85 #endif // MEDIA_BASE_YUV_ROW_H_ |
OLD | NEW |