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_SIMD_CONVERT_YUV_TO_RGB_H_ | 5 #ifndef MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_ |
6 #define MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_ | 6 #define MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "media/base/yuv_convert.h" | 9 #include "media/base/yuv_convert.h" |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 int ystride, | 52 int ystride, |
53 int uvstride, | 53 int uvstride, |
54 int rgbstride, | 54 int rgbstride, |
55 YUVType yuv_type); | 55 YUVType yuv_type); |
56 | 56 |
57 } // namespace media | 57 } // namespace media |
58 | 58 |
59 // Assembly functions are declared without namespace. | 59 // Assembly functions are declared without namespace. |
60 extern "C" { | 60 extern "C" { |
61 | 61 |
| 62 // We use ptrdiff_t instead of int for yasm routine parameters to portably |
| 63 // sign-extend int. On Win64, MSVC does not sign-extend the value in the stack |
| 64 // home of int function parameters, and yasm routines are unaware of this lack |
| 65 // of extension and fault. ptrdiff_t is portably sign-extended and fixes this |
| 66 // issue on at least Win64. The C-equivalent RowProc versions' prototypes |
| 67 // include the same change to ptrdiff_t to reuse the typedefs. |
| 68 |
62 typedef void (*ConvertYUVToRGB32RowProc)(const uint8*, | 69 typedef void (*ConvertYUVToRGB32RowProc)(const uint8*, |
63 const uint8*, | 70 const uint8*, |
64 const uint8*, | 71 const uint8*, |
65 uint8*, | 72 uint8*, |
66 int); | 73 ptrdiff_t); |
| 74 |
67 typedef void (*ScaleYUVToRGB32RowProc)(const uint8*, | 75 typedef void (*ScaleYUVToRGB32RowProc)(const uint8*, |
68 const uint8*, | 76 const uint8*, |
69 const uint8*, | 77 const uint8*, |
70 uint8*, | 78 uint8*, |
71 int, | 79 ptrdiff_t, |
72 int); | 80 ptrdiff_t); |
73 | 81 |
74 void ConvertYUVToRGB32Row_C(const uint8* yplane, | 82 void ConvertYUVToRGB32Row_C(const uint8* yplane, |
75 const uint8* uplane, | 83 const uint8* uplane, |
76 const uint8* vplane, | 84 const uint8* vplane, |
77 uint8* rgbframe, | 85 uint8* rgbframe, |
78 int width); | 86 ptrdiff_t width); |
79 | 87 |
80 void ConvertYUVToRGB32Row_MMX(const uint8* yplane, | 88 void ConvertYUVToRGB32Row_MMX(const uint8* yplane, |
81 const uint8* uplane, | 89 const uint8* uplane, |
82 const uint8* vplane, | 90 const uint8* vplane, |
83 uint8* rgbframe, | 91 uint8* rgbframe, |
84 int width); | 92 ptrdiff_t width); |
85 | 93 |
86 void ConvertYUVToRGB32Row_SSE(const uint8* yplane, | 94 void ConvertYUVToRGB32Row_SSE(const uint8* yplane, |
87 const uint8* uplane, | 95 const uint8* uplane, |
88 const uint8* vplane, | 96 const uint8* vplane, |
89 uint8* rgbframe, | 97 uint8* rgbframe, |
90 int width); | 98 ptrdiff_t width); |
91 | 99 |
92 void ScaleYUVToRGB32Row_C(const uint8* y_buf, | 100 void ScaleYUVToRGB32Row_C(const uint8* y_buf, |
93 const uint8* u_buf, | 101 const uint8* u_buf, |
94 const uint8* v_buf, | 102 const uint8* v_buf, |
95 uint8* rgb_buf, | 103 uint8* rgb_buf, |
96 int width, | 104 ptrdiff_t width, |
97 int source_dx); | 105 ptrdiff_t source_dx); |
98 | 106 |
99 void ScaleYUVToRGB32Row_MMX(const uint8* y_buf, | 107 void ScaleYUVToRGB32Row_MMX(const uint8* y_buf, |
100 const uint8* u_buf, | 108 const uint8* u_buf, |
101 const uint8* v_buf, | 109 const uint8* v_buf, |
102 uint8* rgb_buf, | 110 uint8* rgb_buf, |
103 int width, | 111 ptrdiff_t width, |
104 int source_dx); | 112 ptrdiff_t source_dx); |
105 | 113 |
106 void ScaleYUVToRGB32Row_SSE(const uint8* y_buf, | 114 void ScaleYUVToRGB32Row_SSE(const uint8* y_buf, |
107 const uint8* u_buf, | 115 const uint8* u_buf, |
108 const uint8* v_buf, | 116 const uint8* v_buf, |
109 uint8* rgb_buf, | 117 uint8* rgb_buf, |
110 int width, | 118 ptrdiff_t width, |
111 int source_dx); | 119 ptrdiff_t source_dx); |
112 | 120 |
113 void ScaleYUVToRGB32Row_SSE2_X64(const uint8* y_buf, | 121 void ScaleYUVToRGB32Row_SSE2_X64(const uint8* y_buf, |
114 const uint8* u_buf, | 122 const uint8* u_buf, |
115 const uint8* v_buf, | 123 const uint8* v_buf, |
116 uint8* rgb_buf, | 124 uint8* rgb_buf, |
117 int width, | 125 ptrdiff_t width, |
118 int source_dx); | 126 ptrdiff_t source_dx); |
119 | 127 |
120 void LinearScaleYUVToRGB32Row_C(const uint8* y_buf, | 128 void LinearScaleYUVToRGB32Row_C(const uint8* y_buf, |
121 const uint8* u_buf, | 129 const uint8* u_buf, |
122 const uint8* v_buf, | 130 const uint8* v_buf, |
123 uint8* rgb_buf, | 131 uint8* rgb_buf, |
124 int width, | 132 ptrdiff_t width, |
125 int source_dx); | 133 ptrdiff_t source_dx); |
126 | 134 |
127 void LinearScaleYUVToRGB32RowWithRange_C(const uint8* y_buf, | 135 void LinearScaleYUVToRGB32RowWithRange_C(const uint8* y_buf, |
128 const uint8* u_buf, | 136 const uint8* u_buf, |
129 const uint8* v_buf, | 137 const uint8* v_buf, |
130 uint8* rgb_buf, | 138 uint8* rgb_buf, |
131 int dest_width, | 139 int dest_width, |
132 int source_x, | 140 int source_x, |
133 int source_dx); | 141 int source_dx); |
134 | 142 |
135 void LinearScaleYUVToRGB32Row_MMX(const uint8* y_buf, | 143 void LinearScaleYUVToRGB32Row_MMX(const uint8* y_buf, |
136 const uint8* u_buf, | 144 const uint8* u_buf, |
137 const uint8* v_buf, | 145 const uint8* v_buf, |
138 uint8* rgb_buf, | 146 uint8* rgb_buf, |
139 int width, | 147 ptrdiff_t width, |
140 int source_dx); | 148 ptrdiff_t source_dx); |
141 | 149 |
142 void LinearScaleYUVToRGB32Row_SSE(const uint8* y_buf, | 150 void LinearScaleYUVToRGB32Row_SSE(const uint8* y_buf, |
143 const uint8* u_buf, | 151 const uint8* u_buf, |
144 const uint8* v_buf, | 152 const uint8* v_buf, |
145 uint8* rgb_buf, | 153 uint8* rgb_buf, |
146 int width, | 154 ptrdiff_t width, |
147 int source_dx); | 155 ptrdiff_t source_dx); |
148 | 156 |
149 void LinearScaleYUVToRGB32Row_MMX_X64(const uint8* y_buf, | 157 void LinearScaleYUVToRGB32Row_MMX_X64(const uint8* y_buf, |
150 const uint8* u_buf, | 158 const uint8* u_buf, |
151 const uint8* v_buf, | 159 const uint8* v_buf, |
152 uint8* rgb_buf, | 160 uint8* rgb_buf, |
153 int width, | 161 ptrdiff_t width, |
154 int source_dx); | 162 ptrdiff_t source_dx); |
155 | 163 |
156 } // extern "C" | 164 } // extern "C" |
157 | 165 |
158 #endif // MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_ | 166 #endif // MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_ |
OLD | NEW |