Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: media/base/simd/convert_yuv_to_rgb.h

Issue 242643011: Add correct support for videos with YUVJ420P color format, in the software conversion path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@yuvnopic
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 int height, 21 int height,
22 int ystride, 22 int ystride,
23 int uvstride, 23 int uvstride,
24 int rgbstride, 24 int rgbstride,
25 YUVType yuv_type); 25 YUVType yuv_type);
26 26
27 MEDIA_EXPORT void ConvertYUVToRGB32Row_C(const uint8* yplane, 27 MEDIA_EXPORT void ConvertYUVToRGB32Row_C(const uint8* yplane,
28 const uint8* uplane, 28 const uint8* uplane,
29 const uint8* vplane, 29 const uint8* vplane,
30 uint8* rgbframe, 30 uint8* rgbframe,
31 ptrdiff_t width); 31 ptrdiff_t width,
32 const int16 convert_table[1024][4]);
32 33
33 MEDIA_EXPORT void ConvertYUVAToARGB_C(const uint8* yplane, 34 MEDIA_EXPORT void ConvertYUVAToARGB_C(const uint8* yplane,
34 const uint8* uplane, 35 const uint8* uplane,
35 const uint8* vplane, 36 const uint8* vplane,
36 const uint8* aplane, 37 const uint8* aplane,
37 uint8* rgbframe, 38 uint8* rgbframe,
38 int width, 39 int width,
39 int height, 40 int height,
40 int ystride, 41 int ystride,
41 int uvstride, 42 int uvstride,
42 int avstride, 43 int avstride,
43 int rgbstride, 44 int rgbstride,
44 YUVType yuv_type); 45 YUVType yuv_type);
45 46
46 MEDIA_EXPORT void ConvertYUVAToARGBRow_C(const uint8* yplane, 47 MEDIA_EXPORT void ConvertYUVAToARGBRow_C(const uint8* yplane,
47 const uint8* uplane, 48 const uint8* uplane,
48 const uint8* vplane, 49 const uint8* vplane,
49 const uint8* aplane, 50 const uint8* aplane,
50 uint8* rgbframe, 51 uint8* rgbframe,
51 ptrdiff_t width); 52 ptrdiff_t width,
53 const int16 convert_table[1024][4]);
52 54
53 MEDIA_EXPORT void ConvertYUVToRGB32_SSE(const uint8* yplane, 55 MEDIA_EXPORT void ConvertYUVToRGB32_SSE(const uint8* yplane,
54 const uint8* uplane, 56 const uint8* uplane,
55 const uint8* vplane, 57 const uint8* vplane,
56 uint8* rgbframe, 58 uint8* rgbframe,
57 int width, 59 int width,
58 int height, 60 int height,
59 int ystride, 61 int ystride,
60 int uvstride, 62 int uvstride,
61 int rgbstride, 63 int rgbstride,
(...skipping 21 matching lines...) Expand all
83 int uvstride, 85 int uvstride,
84 int avstride, 86 int avstride,
85 int rgbstride, 87 int rgbstride,
86 YUVType yuv_type); 88 YUVType yuv_type);
87 89
88 MEDIA_EXPORT void ScaleYUVToRGB32Row_C(const uint8* y_buf, 90 MEDIA_EXPORT void ScaleYUVToRGB32Row_C(const uint8* y_buf,
89 const uint8* u_buf, 91 const uint8* u_buf,
90 const uint8* v_buf, 92 const uint8* v_buf,
91 uint8* rgb_buf, 93 uint8* rgb_buf,
92 ptrdiff_t width, 94 ptrdiff_t width,
93 ptrdiff_t source_dx); 95 ptrdiff_t source_dx,
96 const int16 convert_table[1024][4]);
94 97
95 MEDIA_EXPORT void LinearScaleYUVToRGB32Row_C(const uint8* y_buf, 98 MEDIA_EXPORT void LinearScaleYUVToRGB32Row_C(
96 const uint8* u_buf, 99 const uint8* y_buf,
97 const uint8* v_buf, 100 const uint8* u_buf,
98 uint8* rgb_buf, 101 const uint8* v_buf,
99 ptrdiff_t width, 102 uint8* rgb_buf,
100 ptrdiff_t source_dx); 103 ptrdiff_t width,
104 ptrdiff_t source_dx,
105 const int16 convert_table[1024][4]);
101 106
102 MEDIA_EXPORT void LinearScaleYUVToRGB32RowWithRange_C(const uint8* y_buf, 107 MEDIA_EXPORT void LinearScaleYUVToRGB32RowWithRange_C(
103 const uint8* u_buf, 108 const uint8* y_buf,
104 const uint8* v_buf, 109 const uint8* u_buf,
105 uint8* rgb_buf, 110 const uint8* v_buf,
106 int dest_width, 111 uint8* rgb_buf,
107 int source_x, 112 int dest_width,
108 int source_dx); 113 int source_x,
114 int source_dx,
115 const int16 convert_table[1024][4]);
109 116
110 } // namespace media 117 } // namespace media
111 118
112 // Assembly functions are declared without namespace. 119 // Assembly functions are declared without namespace.
113 extern "C" { 120 extern "C" {
114 121
115 // We use ptrdiff_t instead of int for yasm routine parameters to portably 122 // We use ptrdiff_t instead of int for yasm routine parameters to portably
116 // sign-extend int. On Win64, MSVC does not sign-extend the value in the stack 123 // sign-extend int. On Win64, MSVC does not sign-extend the value in the stack
117 // home of int function parameters, and yasm routines are unaware of this lack 124 // home of int function parameters, and yasm routines are unaware of this lack
118 // of extension and fault. ptrdiff_t is portably sign-extended and fixes this 125 // of extension and fault. ptrdiff_t is portably sign-extended and fixes this
119 // issue on at least Win64. The C-equivalent RowProc versions' prototypes 126 // issue on at least Win64. The C-equivalent RowProc versions' prototypes
120 // include the same change to ptrdiff_t to reuse the typedefs. 127 // include the same change to ptrdiff_t to reuse the typedefs.
121 128
122 MEDIA_EXPORT void ConvertYUVToRGB32Row_MMX(const uint8* yplane, 129 MEDIA_EXPORT void ConvertYUVToRGB32Row_MMX(const uint8* yplane,
123 const uint8* uplane, 130 const uint8* uplane,
124 const uint8* vplane, 131 const uint8* vplane,
125 uint8* rgbframe, 132 uint8* rgbframe,
126 ptrdiff_t width); 133 ptrdiff_t width,
134 const int16 convert_table[1024][4]);
127 135
128 MEDIA_EXPORT void ConvertYUVAToARGBRow_MMX(const uint8* yplane, 136 MEDIA_EXPORT void ConvertYUVAToARGBRow_MMX(const uint8* yplane,
129 const uint8* uplane, 137 const uint8* uplane,
130 const uint8* vplane, 138 const uint8* vplane,
131 const uint8* aplane, 139 const uint8* aplane,
132 uint8* rgbframe, 140 uint8* rgbframe,
133 ptrdiff_t width); 141 ptrdiff_t width,
142 const int16 convert_table[1024][4]);
134 143
135 MEDIA_EXPORT void ConvertYUVToRGB32Row_SSE(const uint8* yplane, 144 MEDIA_EXPORT void ConvertYUVToRGB32Row_SSE(const uint8* yplane,
136 const uint8* uplane, 145 const uint8* uplane,
137 const uint8* vplane, 146 const uint8* vplane,
138 uint8* rgbframe, 147 uint8* rgbframe,
139 ptrdiff_t width); 148 ptrdiff_t width,
149 const int16 convert_table[1024][4]);
140 150
141 MEDIA_EXPORT void ScaleYUVToRGB32Row_MMX(const uint8* y_buf, 151 MEDIA_EXPORT void ScaleYUVToRGB32Row_MMX(const uint8* y_buf,
142 const uint8* u_buf, 152 const uint8* u_buf,
143 const uint8* v_buf, 153 const uint8* v_buf,
144 uint8* rgb_buf, 154 uint8* rgb_buf,
145 ptrdiff_t width, 155 ptrdiff_t width,
146 ptrdiff_t source_dx); 156 ptrdiff_t source_dx,
157 const int16 convert_table[1024][4]);
147 158
148 MEDIA_EXPORT void ScaleYUVToRGB32Row_SSE(const uint8* y_buf, 159 MEDIA_EXPORT void ScaleYUVToRGB32Row_SSE(const uint8* y_buf,
149 const uint8* u_buf, 160 const uint8* u_buf,
150 const uint8* v_buf, 161 const uint8* v_buf,
151 uint8* rgb_buf, 162 uint8* rgb_buf,
152 ptrdiff_t width, 163 ptrdiff_t width,
153 ptrdiff_t source_dx); 164 ptrdiff_t source_dx,
165 const int16 convert_table[1024][4]);
154 166
155 MEDIA_EXPORT void ScaleYUVToRGB32Row_SSE2_X64(const uint8* y_buf, 167 MEDIA_EXPORT void ScaleYUVToRGB32Row_SSE2_X64(
156 const uint8* u_buf, 168 const uint8* y_buf,
157 const uint8* v_buf, 169 const uint8* u_buf,
158 uint8* rgb_buf, 170 const uint8* v_buf,
159 ptrdiff_t width, 171 uint8* rgb_buf,
160 ptrdiff_t source_dx); 172 ptrdiff_t width,
173 ptrdiff_t source_dx,
174 const int16 convert_table[1024][4]);
161 175
162 MEDIA_EXPORT void LinearScaleYUVToRGB32Row_MMX(const uint8* y_buf, 176 MEDIA_EXPORT void LinearScaleYUVToRGB32Row_MMX(
163 const uint8* u_buf, 177 const uint8* y_buf,
164 const uint8* v_buf, 178 const uint8* u_buf,
165 uint8* rgb_buf, 179 const uint8* v_buf,
166 ptrdiff_t width, 180 uint8* rgb_buf,
167 ptrdiff_t source_dx); 181 ptrdiff_t width,
182 ptrdiff_t source_dx,
183 const int16 convert_table[1024][4]);
168 184
169 MEDIA_EXPORT void LinearScaleYUVToRGB32Row_SSE(const uint8* y_buf, 185 MEDIA_EXPORT void LinearScaleYUVToRGB32Row_SSE(
170 const uint8* u_buf, 186 const uint8* y_buf,
171 const uint8* v_buf, 187 const uint8* u_buf,
172 uint8* rgb_buf, 188 const uint8* v_buf,
173 ptrdiff_t width, 189 uint8* rgb_buf,
174 ptrdiff_t source_dx); 190 ptrdiff_t width,
191 ptrdiff_t source_dx,
192 const int16 convert_table[1024][4]);
175 193
176 MEDIA_EXPORT void LinearScaleYUVToRGB32Row_MMX_X64(const uint8* y_buf, 194 MEDIA_EXPORT void LinearScaleYUVToRGB32Row_MMX_X64(
177 const uint8* u_buf, 195 const uint8* y_buf,
178 const uint8* v_buf, 196 const uint8* u_buf,
179 uint8* rgb_buf, 197 const uint8* v_buf,
180 ptrdiff_t width, 198 uint8* rgb_buf,
181 ptrdiff_t source_dx); 199 ptrdiff_t width,
200 ptrdiff_t source_dx,
201 const int16 convert_table[1024][4]);
182 202
183 } // extern "C" 203 } // extern "C"
184 204
185 #endif // MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_ 205 #endif // MEDIA_BASE_SIMD_CONVERT_YUV_TO_RGB_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/simd/convert_yuv_to_rgb_c.cc » ('j') | media/base/simd/scale_yuv_to_rgb_sse2_x64.asm » ('J')

Powered by Google App Engine
This is Rietveld 408576698