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 | |
wolenetz
2013/02/12 19:52:12
I'll remove this extra space in PS3. Sorry this o
wolenetz
2013/02/12 22:30:05
Done.
| |
69 | |
62 typedef void (*ConvertYUVToRGB32RowProc)(const uint8*, | 70 typedef void (*ConvertYUVToRGB32RowProc)(const uint8*, |
63 const uint8*, | 71 const uint8*, |
64 const uint8*, | 72 const uint8*, |
65 uint8*, | 73 uint8*, |
66 int); | 74 ptrdiff_t); |
75 | |
67 typedef void (*ScaleYUVToRGB32RowProc)(const uint8*, | 76 typedef void (*ScaleYUVToRGB32RowProc)(const uint8*, |
68 const uint8*, | 77 const uint8*, |
69 const uint8*, | 78 const uint8*, |
70 uint8*, | 79 uint8*, |
71 int, | 80 ptrdiff_t, |
72 int); | 81 ptrdiff_t); |
73 | 82 |
74 void ConvertYUVToRGB32Row_C(const uint8* yplane, | 83 void ConvertYUVToRGB32Row_C(const uint8* yplane, |
75 const uint8* uplane, | 84 const uint8* uplane, |
76 const uint8* vplane, | 85 const uint8* vplane, |
77 uint8* rgbframe, | 86 uint8* rgbframe, |
78 int width); | 87 ptrdiff_t width); |
79 | 88 |
80 void ConvertYUVToRGB32Row_MMX(const uint8* yplane, | 89 void ConvertYUVToRGB32Row_MMX(const uint8* yplane, |
81 const uint8* uplane, | 90 const uint8* uplane, |
82 const uint8* vplane, | 91 const uint8* vplane, |
83 uint8* rgbframe, | 92 uint8* rgbframe, |
84 int width); | 93 ptrdiff_t width); |
85 | 94 |
86 void ConvertYUVToRGB32Row_SSE(const uint8* yplane, | 95 void ConvertYUVToRGB32Row_SSE(const uint8* yplane, |
87 const uint8* uplane, | 96 const uint8* uplane, |
88 const uint8* vplane, | 97 const uint8* vplane, |
89 uint8* rgbframe, | 98 uint8* rgbframe, |
90 int width); | 99 ptrdiff_t width); |
91 | 100 |
92 void ScaleYUVToRGB32Row_C(const uint8* y_buf, | 101 void ScaleYUVToRGB32Row_C(const uint8* y_buf, |
93 const uint8* u_buf, | 102 const uint8* u_buf, |
94 const uint8* v_buf, | 103 const uint8* v_buf, |
95 uint8* rgb_buf, | 104 uint8* rgb_buf, |
96 int width, | 105 ptrdiff_t width, |
97 int source_dx); | 106 ptrdiff_t source_dx); |
98 | 107 |
99 void ScaleYUVToRGB32Row_MMX(const uint8* y_buf, | 108 void ScaleYUVToRGB32Row_MMX(const uint8* y_buf, |
100 const uint8* u_buf, | 109 const uint8* u_buf, |
101 const uint8* v_buf, | 110 const uint8* v_buf, |
102 uint8* rgb_buf, | 111 uint8* rgb_buf, |
103 int width, | 112 ptrdiff_t width, |
104 int source_dx); | 113 ptrdiff_t source_dx); |
105 | 114 |
106 void ScaleYUVToRGB32Row_SSE(const uint8* y_buf, | 115 void ScaleYUVToRGB32Row_SSE(const uint8* y_buf, |
107 const uint8* u_buf, | 116 const uint8* u_buf, |
108 const uint8* v_buf, | 117 const uint8* v_buf, |
109 uint8* rgb_buf, | 118 uint8* rgb_buf, |
110 int width, | 119 ptrdiff_t width, |
111 int source_dx); | 120 ptrdiff_t source_dx); |
112 | 121 |
113 void ScaleYUVToRGB32Row_SSE2_X64(const uint8* y_buf, | 122 void ScaleYUVToRGB32Row_SSE2_X64(const uint8* y_buf, |
114 const uint8* u_buf, | 123 const uint8* u_buf, |
115 const uint8* v_buf, | 124 const uint8* v_buf, |
116 uint8* rgb_buf, | 125 uint8* rgb_buf, |
117 int width, | 126 ptrdiff_t width, |
118 int source_dx); | 127 ptrdiff_t source_dx); |
119 | 128 |
120 void LinearScaleYUVToRGB32Row_C(const uint8* y_buf, | 129 void LinearScaleYUVToRGB32Row_C(const uint8* y_buf, |
121 const uint8* u_buf, | 130 const uint8* u_buf, |
122 const uint8* v_buf, | 131 const uint8* v_buf, |
123 uint8* rgb_buf, | 132 uint8* rgb_buf, |
124 int width, | 133 ptrdiff_t width, |
125 int source_dx); | 134 ptrdiff_t source_dx); |
126 | 135 |
127 void LinearScaleYUVToRGB32RowWithRange_C(const uint8* y_buf, | 136 void LinearScaleYUVToRGB32RowWithRange_C(const uint8* y_buf, |
128 const uint8* u_buf, | 137 const uint8* u_buf, |
129 const uint8* v_buf, | 138 const uint8* v_buf, |
130 uint8* rgb_buf, | 139 uint8* rgb_buf, |
131 int dest_width, | 140 int dest_width, |
132 int source_x, | 141 int source_x, |
133 int source_dx); | 142 int source_dx); |
134 | 143 |
135 void LinearScaleYUVToRGB32Row_MMX(const uint8* y_buf, | 144 void LinearScaleYUVToRGB32Row_MMX(const uint8* y_buf, |
136 const uint8* u_buf, | 145 const uint8* u_buf, |
137 const uint8* v_buf, | 146 const uint8* v_buf, |
138 uint8* rgb_buf, | 147 uint8* rgb_buf, |
139 int width, | 148 ptrdiff_t width, |
140 int source_dx); | 149 ptrdiff_t source_dx); |
141 | 150 |
142 void LinearScaleYUVToRGB32Row_SSE(const uint8* y_buf, | 151 void LinearScaleYUVToRGB32Row_SSE(const uint8* y_buf, |
143 const uint8* u_buf, | 152 const uint8* u_buf, |
144 const uint8* v_buf, | 153 const uint8* v_buf, |
145 uint8* rgb_buf, | 154 uint8* rgb_buf, |
146 int width, | 155 ptrdiff_t width, |
147 int source_dx); | 156 ptrdiff_t source_dx); |
148 | 157 |
149 void LinearScaleYUVToRGB32Row_MMX_X64(const uint8* y_buf, | 158 void LinearScaleYUVToRGB32Row_MMX_X64(const uint8* y_buf, |
150 const uint8* u_buf, | 159 const uint8* u_buf, |
151 const uint8* v_buf, | 160 const uint8* v_buf, |
152 uint8* rgb_buf, | 161 uint8* rgb_buf, |
153 int width, | 162 ptrdiff_t width, |
154 int source_dx); | 163 ptrdiff_t source_dx); |
155 | 164 |
156 } // extern "C" | 165 } // extern "C" |
157 | 166 |
158 #endif // MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_ | 167 #endif // MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_ |
OLD | NEW |