OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_ | |
6 #define MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_ | |
7 | |
8 #include <stddef.h> | |
9 #include <stdint.h> | |
10 | |
11 #include "media/base/yuv_convert.h" | |
12 | |
13 namespace media { | |
14 | |
15 // These methods are exported for testing purposes only. Library users should | |
16 // only call the methods listed in yuv_convert.h. | |
17 | |
18 MEDIA_EXPORT void ConvertYUVToRGB32_C(const uint8_t* yplane, | |
19 const uint8_t* uplane, | |
20 const uint8_t* vplane, | |
21 uint8_t* rgbframe, | |
22 int width, | |
23 int height, | |
24 int ystride, | |
25 int uvstride, | |
26 int rgbstride, | |
27 YUVType yuv_type); | |
28 | |
29 MEDIA_EXPORT void ConvertYUVToRGB32Row_C(const uint8_t* yplane, | |
30 const uint8_t* uplane, | |
31 const uint8_t* vplane, | |
32 uint8_t* rgbframe, | |
33 ptrdiff_t width, | |
34 const int16_t* convert_table); | |
35 | |
36 MEDIA_EXPORT void ConvertYUVAToARGB_C(const uint8_t* yplane, | |
37 const uint8_t* uplane, | |
38 const uint8_t* vplane, | |
39 const uint8_t* aplane, | |
40 uint8_t* rgbframe, | |
41 int width, | |
42 int height, | |
43 int ystride, | |
44 int uvstride, | |
45 int avstride, | |
46 int rgbstride, | |
47 YUVType yuv_type); | |
48 | |
49 MEDIA_EXPORT void ConvertYUVAToARGBRow_C(const uint8_t* yplane, | |
50 const uint8_t* uplane, | |
51 const uint8_t* vplane, | |
52 const uint8_t* aplane, | |
53 uint8_t* rgbframe, | |
54 ptrdiff_t width, | |
55 const int16_t* convert_table); | |
56 | |
57 MEDIA_EXPORT void ConvertYUVToRGB32_SSE(const uint8_t* yplane, | |
58 const uint8_t* uplane, | |
59 const uint8_t* vplane, | |
60 uint8_t* rgbframe, | |
61 int width, | |
62 int height, | |
63 int ystride, | |
64 int uvstride, | |
65 int rgbstride, | |
66 YUVType yuv_type); | |
67 | |
68 MEDIA_EXPORT void ConvertYUVAToARGB_MMX(const uint8_t* yplane, | |
69 const uint8_t* uplane, | |
70 const uint8_t* vplane, | |
71 const uint8_t* aplane, | |
72 uint8_t* rgbframe, | |
73 int width, | |
74 int height, | |
75 int ystride, | |
76 int uvstride, | |
77 int avstride, | |
78 int rgbstride, | |
79 YUVType yuv_type); | |
80 | |
81 MEDIA_EXPORT void ScaleYUVToRGB32Row_C(const uint8_t* y_buf, | |
82 const uint8_t* u_buf, | |
83 const uint8_t* v_buf, | |
84 uint8_t* rgb_buf, | |
85 ptrdiff_t width, | |
86 ptrdiff_t source_dx, | |
87 const int16_t* convert_table); | |
88 | |
89 MEDIA_EXPORT void LinearScaleYUVToRGB32Row_C(const uint8_t* y_buf, | |
90 const uint8_t* u_buf, | |
91 const uint8_t* v_buf, | |
92 uint8_t* rgb_buf, | |
93 ptrdiff_t width, | |
94 ptrdiff_t source_dx, | |
95 const int16_t* convert_table); | |
96 | |
97 MEDIA_EXPORT void LinearScaleYUVToRGB32RowWithRange_C( | |
98 const uint8_t* y_buf, | |
99 const uint8_t* u_buf, | |
100 const uint8_t* v_buf, | |
101 uint8_t* rgb_buf, | |
102 int dest_width, | |
103 int source_x, | |
104 int source_dx, | |
105 const int16_t* convert_table); | |
106 | |
107 } // namespace media | |
108 | |
109 // Assembly functions are declared without namespace. | |
110 extern "C" { | |
111 | |
112 // We use ptrdiff_t instead of int for yasm routine parameters to portably | |
113 // sign-extend int. On Win64, MSVC does not sign-extend the value in the stack | |
114 // home of int function parameters, and yasm routines are unaware of this lack | |
115 // of extension and fault. ptrdiff_t is portably sign-extended and fixes this | |
116 // issue on at least Win64. The C-equivalent RowProc versions' prototypes | |
117 // include the same change to ptrdiff_t to reuse the typedefs. | |
118 | |
119 MEDIA_EXPORT void ConvertYUVAToARGBRow_MMX(const uint8_t* yplane, | |
120 const uint8_t* uplane, | |
121 const uint8_t* vplane, | |
122 const uint8_t* aplane, | |
123 uint8_t* rgbframe, | |
124 ptrdiff_t width, | |
125 const int16_t* convert_table); | |
126 | |
127 MEDIA_EXPORT void ConvertYUVToRGB32Row_SSE(const uint8_t* yplane, | |
128 const uint8_t* uplane, | |
129 const uint8_t* vplane, | |
130 uint8_t* rgbframe, | |
131 ptrdiff_t width, | |
132 const int16_t* convert_table); | |
133 | |
134 MEDIA_EXPORT void ScaleYUVToRGB32Row_SSE(const uint8_t* y_buf, | |
135 const uint8_t* u_buf, | |
136 const uint8_t* v_buf, | |
137 uint8_t* rgb_buf, | |
138 ptrdiff_t width, | |
139 ptrdiff_t source_dx, | |
140 const int16_t* convert_table); | |
141 | |
142 MEDIA_EXPORT void ScaleYUVToRGB32Row_SSE2_X64(const uint8_t* y_buf, | |
143 const uint8_t* u_buf, | |
144 const uint8_t* v_buf, | |
145 uint8_t* rgb_buf, | |
146 ptrdiff_t width, | |
147 ptrdiff_t source_dx, | |
148 const int16_t* convert_table); | |
149 | |
150 MEDIA_EXPORT void LinearScaleYUVToRGB32Row_SSE(const uint8_t* y_buf, | |
151 const uint8_t* u_buf, | |
152 const uint8_t* v_buf, | |
153 uint8_t* rgb_buf, | |
154 ptrdiff_t width, | |
155 ptrdiff_t source_dx, | |
156 const int16_t* convert_table); | |
157 | |
158 MEDIA_EXPORT void LinearScaleYUVToRGB32Row_MMX_X64( | |
159 const uint8_t* y_buf, | |
160 const uint8_t* u_buf, | |
161 const uint8_t* v_buf, | |
162 uint8_t* rgb_buf, | |
163 ptrdiff_t width, | |
164 ptrdiff_t source_dx, | |
165 const int16_t* convert_table); | |
166 | |
167 } // extern "C" | |
168 | |
169 #endif // MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_ | |
OLD | NEW |