Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / libvpx / source / libvpx / third_party / libyuv / include / libyuv / row.h
1 /*
2  *  Copyright 2011 The LibYuv Project Authors. All rights reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS. All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10
11 #ifndef INCLUDE_LIBYUV_ROW_H_  // NOLINT
12 #define INCLUDE_LIBYUV_ROW_H_
13
14 #include <stdlib.h>  // For malloc.
15
16 #include "libyuv/basic_types.h"
17
18 #if defined(__native_client__)
19 #include "ppapi/c/pp_macros.h"  // For PPAPI_RELEASE
20 #endif
21
22 #ifdef __cplusplus
23 namespace libyuv {
24 extern "C" {
25 #endif
26
27 #define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1)))
28
29 #ifdef __cplusplus
30 #define align_buffer_64(var, size)                                             \
31   uint8* var##_mem = reinterpret_cast<uint8*>(malloc((size) + 63));            \
32   uint8* var = reinterpret_cast<uint8*>                                        \
33       ((reinterpret_cast<intptr_t>(var##_mem) + 63) & ~63)
34 #else
35 #define align_buffer_64(var, size)                                             \
36   uint8* var##_mem = (uint8*)(malloc((size) + 63));               /* NOLINT */ \
37   uint8* var = (uint8*)(((intptr_t)(var##_mem) + 63) & ~63)       /* NOLINT */
38 #endif
39
40 #define free_aligned_buffer_64(var) \
41   free(var##_mem);  \
42   var = 0
43
44 #if defined(__pnacl__) || defined(__CLR_VER) || defined(COVERAGE_ENABLED) || \
45     defined(TARGET_IPHONE_SIMULATOR) || \
46     (defined(_MSC_VER) && defined(__clang__))
47 #define LIBYUV_DISABLE_X86
48 #endif
49 // True if compiling for SSSE3 as a requirement.
50 #if defined(__SSSE3__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 3))
51 #define LIBYUV_SSSE3_ONLY
52 #endif
53
54 // Enable for NaCL pepper 33 for bundle and AVX2 support.
55 #if defined(__native_client__) && PPAPI_RELEASE >= 33
56 #define NEW_BINUTILS
57 #endif
58 #if defined(__native_client__) && defined(__arm__) && PPAPI_RELEASE < 37
59 #define LIBYUV_DISABLE_NEON
60 #endif
61
62 // The following are available on all x86 platforms:
63 #if !defined(LIBYUV_DISABLE_X86) && \
64     (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__))
65 // Effects:
66 #define HAS_ARGBADDROW_SSE2
67 #define HAS_ARGBAFFINEROW_SSE2
68 #define HAS_ARGBATTENUATEROW_SSSE3
69 #define HAS_ARGBBLENDROW_SSSE3
70 #define HAS_ARGBCOLORMATRIXROW_SSSE3
71 #define HAS_ARGBCOLORTABLEROW_X86
72 #define HAS_ARGBCOPYALPHAROW_SSE2
73 #define HAS_ARGBCOPYYTOALPHAROW_SSE2
74 #define HAS_ARGBGRAYROW_SSSE3
75 #define HAS_ARGBLUMACOLORTABLEROW_SSSE3
76 #define HAS_ARGBMIRRORROW_SSSE3
77 #define HAS_ARGBMULTIPLYROW_SSE2
78 #define HAS_ARGBPOLYNOMIALROW_SSE2
79 #define HAS_ARGBQUANTIZEROW_SSE2
80 #define HAS_ARGBSEPIAROW_SSSE3
81 #define HAS_ARGBSHADEROW_SSE2
82 #define HAS_ARGBSUBTRACTROW_SSE2
83 #define HAS_ARGBTOUVROW_SSSE3
84 #define HAS_ARGBUNATTENUATEROW_SSE2
85 #define HAS_COMPUTECUMULATIVESUMROW_SSE2
86 #define HAS_CUMULATIVESUMTOAVERAGEROW_SSE2
87 #define HAS_INTERPOLATEROW_SSE2
88 #define HAS_INTERPOLATEROW_SSSE3
89 #define HAS_RGBCOLORTABLEROW_X86
90 #define HAS_SOBELROW_SSE2
91 #define HAS_SOBELTOPLANEROW_SSE2
92 #define HAS_SOBELXROW_SSE2
93 #define HAS_SOBELXYROW_SSE2
94 #define HAS_SOBELYROW_SSE2
95
96 // Conversions:
97 #define HAS_ABGRTOUVROW_SSSE3
98 #define HAS_ABGRTOYROW_SSSE3
99 #define HAS_ARGB1555TOARGBROW_SSE2
100 #define HAS_ARGB4444TOARGBROW_SSE2
101 #define HAS_ARGBSHUFFLEROW_SSE2
102 #define HAS_ARGBSHUFFLEROW_SSSE3
103 #define HAS_ARGBTOARGB1555ROW_SSE2
104 #define HAS_ARGBTOARGB4444ROW_SSE2
105 #define HAS_ARGBTOBAYERGGROW_SSE2
106 #define HAS_ARGBTOBAYERROW_SSSE3
107 #define HAS_ARGBTORAWROW_SSSE3
108 #define HAS_ARGBTORGB24ROW_SSSE3
109 #define HAS_ARGBTORGB565ROW_SSE2
110 #define HAS_ARGBTOUV422ROW_SSSE3
111 #define HAS_ARGBTOUV444ROW_SSSE3
112 #define HAS_ARGBTOUVJROW_SSSE3
113 #define HAS_ARGBTOYJROW_SSSE3
114 #define HAS_ARGBTOYROW_SSSE3
115 #define HAS_BGRATOUVROW_SSSE3
116 #define HAS_BGRATOYROW_SSSE3
117 #define HAS_COPYROW_ERMS
118 #define HAS_COPYROW_SSE2
119 #define HAS_COPYROW_X86
120 #define HAS_HALFROW_SSE2
121 #define HAS_I400TOARGBROW_SSE2
122 #define HAS_I411TOARGBROW_SSSE3
123 #define HAS_I422TOARGB1555ROW_SSSE3
124 #define HAS_I422TOABGRROW_SSSE3
125 #define HAS_I422TOARGB1555ROW_SSSE3
126 #define HAS_I422TOARGB4444ROW_SSSE3
127 #define HAS_I422TOARGBROW_SSSE3
128 #define HAS_I422TOBGRAROW_SSSE3
129 #define HAS_I422TORAWROW_SSSE3
130 #define HAS_I422TORGB24ROW_SSSE3
131 #define HAS_I422TORGB565ROW_SSSE3
132 #define HAS_I422TORGBAROW_SSSE3
133 #define HAS_I422TOUYVYROW_SSE2
134 #define HAS_I422TOYUY2ROW_SSE2
135 #define HAS_I444TOARGBROW_SSSE3
136 #define HAS_MERGEUVROW_SSE2
137 #define HAS_MIRRORROW_SSE2
138 #define HAS_MIRRORROW_SSSE3
139 #define HAS_MIRRORROW_UV_SSSE3
140 #define HAS_MIRRORUVROW_SSSE3
141 #define HAS_NV12TOARGBROW_SSSE3
142 #define HAS_NV12TORGB565ROW_SSSE3
143 #define HAS_NV21TOARGBROW_SSSE3
144 #define HAS_NV21TORGB565ROW_SSSE3
145 #define HAS_RAWTOARGBROW_SSSE3
146 #define HAS_RAWTOYROW_SSSE3
147 #define HAS_RGB24TOARGBROW_SSSE3
148 #define HAS_RGB24TOYROW_SSSE3
149 #define HAS_RGB565TOARGBROW_SSE2
150 #define HAS_RGBATOUVROW_SSSE3
151 #define HAS_RGBATOYROW_SSSE3
152 #define HAS_SETROW_X86
153 #define HAS_SPLITUVROW_SSE2
154 #define HAS_UYVYTOARGBROW_SSSE3
155 #define HAS_UYVYTOUV422ROW_SSE2
156 #define HAS_UYVYTOUVROW_SSE2
157 #define HAS_UYVYTOYROW_SSE2
158 #define HAS_YTOARGBROW_SSE2
159 #define HAS_YUY2TOARGBROW_SSSE3
160 #define HAS_YUY2TOUV422ROW_SSE2
161 #define HAS_YUY2TOUVROW_SSE2
162 #define HAS_YUY2TOYROW_SSE2
163 #endif
164
165 // The following are available on x64 Visual C:
166 #if !defined(LIBYUV_DISABLE_X86) && defined (_M_X64)
167 #define HAS_I422TOARGBROW_SSSE3
168 #endif
169
170 // GCC >= 4.7.0 required for AVX2.
171 #if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))
172 #if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 7))
173 #define GCC_HAS_AVX2 1
174 #endif  // GNUC >= 4.7
175 #endif  // __GNUC__
176
177 // clang >= 3.4.0 required for AVX2.
178 #if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
179 #if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4))
180 #define CLANG_HAS_AVX2 1
181 #endif  // clang >= 3.4
182 #endif  // __clang__
183
184 // Visual C 2012 required for AVX2.
185 #if defined(_M_IX86) && defined(_MSC_VER) && _MSC_VER >= 1700
186 #define VISUALC_HAS_AVX2 1
187 #endif  // VisualStudio >= 2012
188
189 // The following are available on all x86 platforms, but
190 // require VS2012, clang 3.4 or gcc 4.7.
191 // The code supports NaCL but requires a new compiler and validator.
192 #if !defined(LIBYUV_DISABLE_X86) && (defined(VISUALC_HAS_AVX2) || \
193     defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2))
194 // Effects:
195 #define HAS_ARGBPOLYNOMIALROW_AVX2
196 #define HAS_ARGBSHUFFLEROW_AVX2
197 #define HAS_ARGBCOPYALPHAROW_AVX2
198 #define HAS_ARGBCOPYYTOALPHAROW_AVX2
199 #endif
200
201 // The following are require VS2012.
202 // TODO(fbarchard): Port to gcc.
203 #if !defined(LIBYUV_DISABLE_X86) && defined(VISUALC_HAS_AVX2)
204 #define HAS_ARGBTOUVROW_AVX2
205 #define HAS_ARGBTOYJROW_AVX2
206 #define HAS_ARGBTOYROW_AVX2
207 #define HAS_HALFROW_AVX2
208 #define HAS_I422TOARGBROW_AVX2
209 #define HAS_INTERPOLATEROW_AVX2
210 #define HAS_MERGEUVROW_AVX2
211 #define HAS_MIRRORROW_AVX2
212 #define HAS_SPLITUVROW_AVX2
213 #define HAS_UYVYTOUV422ROW_AVX2
214 #define HAS_UYVYTOUVROW_AVX2
215 #define HAS_UYVYTOYROW_AVX2
216 #define HAS_YUY2TOUV422ROW_AVX2
217 #define HAS_YUY2TOUVROW_AVX2
218 #define HAS_YUY2TOYROW_AVX2
219
220 // Effects:
221 #define HAS_ARGBADDROW_AVX2
222 #define HAS_ARGBATTENUATEROW_AVX2
223 #define HAS_ARGBMIRRORROW_AVX2
224 #define HAS_ARGBMULTIPLYROW_AVX2
225 #define HAS_ARGBSUBTRACTROW_AVX2
226 #define HAS_ARGBUNATTENUATEROW_AVX2
227 #endif  // defined(VISUALC_HAS_AVX2)
228
229 // The following are Yasm x86 only:
230 // TODO(fbarchard): Port AVX2 to inline.
231 #if !defined(LIBYUV_DISABLE_X86) && defined(HAVE_YASM)
232     (defined(_M_IX86) || defined(_M_X64) || \
233     defined(__x86_64__) || defined(__i386__))
234 #define HAS_MERGEUVROW_AVX2
235 #define HAS_MERGEUVROW_MMX
236 #define HAS_SPLITUVROW_AVX2
237 #define HAS_SPLITUVROW_MMX
238 #define HAS_UYVYTOYROW_AVX2
239 #define HAS_UYVYTOYROW_MMX
240 #define HAS_YUY2TOYROW_AVX2
241 #define HAS_YUY2TOYROW_MMX
242 #endif
243
244 // The following are disabled when SSSE3 is available:
245 #if !defined(LIBYUV_DISABLE_X86) && \
246     (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) && \
247     !defined(LIBYUV_SSSE3_ONLY)
248 #define HAS_ARGBBLENDROW_SSE2
249 #define HAS_ARGBATTENUATEROW_SSE2
250 #define HAS_MIRRORROW_SSE2
251 #endif
252
253 // The following are available on arm64 platforms:
254 #if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__)
255 // #define HAS_I444TOARGBROW_NEON
256 // #define HAS_I422TOARGBROW_NEON
257 // #define HAS_I411TOARGBROW_NEON
258 // #define HAS_I422TOBGRAROW_NEON
259 // #define HAS_I422TOABGRROW_NEON
260 // #define HAS_I422TORGBAROW_NEON
261 // #define HAS_I422TORGB24ROW_NEON
262 // #define HAS_I422TORAWROW_NEON
263 // #define HAS_I422TORGB565ROW_NEON
264 // #define HAS_I422TOARGB1555ROW_NEON
265 // #define HAS_I422TOARGB4444ROW_NEON
266 // #define HAS_YTOARGBROW_NEON
267 // #define HAS_I400TOARGBROW_NEON
268 // #define HAS_NV12TOARGBROW_NEON
269 // #define HAS_NV21TOARGBROW_NEON
270 // #define HAS_NV12TORGB565ROW_NEON
271 // #define HAS_NV21TORGB565ROW_NEON
272 // #define HAS_YUY2TOARGBROW_NEON
273 // #define HAS_UYVYTOARGBROW_NEON
274 #define HAS_SPLITUVROW_NEON
275 #define HAS_MERGEUVROW_NEON
276 #define HAS_COPYROW_NEON
277 #define HAS_SETROW_NEON
278 #define HAS_ARGBSETROWS_NEON
279 #define HAS_MIRRORROW_NEON
280 #define HAS_MIRRORUVROW_NEON
281 #define HAS_ARGBMIRRORROW_NEON
282 #define HAS_RGB24TOARGBROW_NEON
283 #define HAS_RAWTOARGBROW_NEON
284 // #define HAS_RGB565TOARGBROW_NEON
285 // #define HAS_ARGB1555TOARGBROW_NEON
286 // #define HAS_ARGB4444TOARGBROW_NEON
287 #define HAS_ARGBTORGB24ROW_NEON
288 #define HAS_ARGBTORAWROW_NEON
289 #define HAS_YUY2TOYROW_NEON
290 #define HAS_UYVYTOYROW_NEON
291 #define HAS_YUY2TOUV422ROW_NEON
292 #define HAS_UYVYTOUV422ROW_NEON
293 #define HAS_YUY2TOUVROW_NEON
294 #define HAS_UYVYTOUVROW_NEON
295 #define HAS_HALFROW_NEON
296 #define HAS_ARGBTOBAYERROW_NEON
297 #define HAS_ARGBTOBAYERGGROW_NEON
298 #define HAS_ARGBSHUFFLEROW_NEON
299 #define HAS_I422TOYUY2ROW_NEON
300 #define HAS_I422TOUYVYROW_NEON
301 // #define HAS_ARGBTORGB565ROW_NEON
302 // #define HAS_ARGBTOARGB1555ROW_NEON
303 // #define HAS_ARGBTOARGB4444ROW_NEON
304 #define HAS_ARGBTOYROW_NEON
305 #define HAS_ARGBTOYJROW_NEON
306 // #define HAS_ARGBTOUV444ROW_NEON
307 // #define HAS_ARGBTOUV422ROW_NEON
308 // #define HAS_ARGBTOUV411ROW_NEON
309 // #define HAS_ARGBTOUVROW_NEON
310 // #define HAS_ARGBTOUVJROW_NEON
311 // #define HAS_BGRATOUVROW_NEON
312 // #define HAS_ABGRTOUVROW_NEON
313 // #define HAS_RGBATOUVROW_NEON
314 // #define HAS_RGB24TOUVROW_NEON
315 // #define HAS_RAWTOUVROW_NEON
316 // #define HAS_RGB565TOUVROW_NEON
317 // #define HAS_ARGB1555TOUVROW_NEON
318 // #define HAS_ARGB4444TOUVROW_NEON
319 // #define HAS_RGB565TOYROW_NEON
320 // #define HAS_ARGB1555TOYROW_NEON
321 // #define HAS_ARGB4444TOYROW_NEON
322 // #define HAS_BGRATOYROW_NEON
323 // #define HAS_ABGRTOYROW_NEON
324 // #define HAS_RGBATOYROW_NEON
325 // #define HAS_RGB24TOYROW_NEON
326 // #define HAS_RAWTOYROW_NEON
327 // #define HAS_INTERPOLATEROW_NEON
328 // #define HAS_ARGBBLENDROW_NEON
329 // #define HAS_ARGBATTENUATEROW_NEON
330 // #define HAS_ARGBQUANTIZEROW_NEON
331 // #define HAS_ARGBSHADEROW_NEON
332 // #define HAS_ARGBGRAYROW_NEON
333 // #define HAS_ARGBSEPIAROW_NEON
334 // #define HAS_ARGBCOLORMATRIXROW_NEON
335 #define HAS_ARGBMULTIPLYROW_NEON
336 #define HAS_ARGBADDROW_NEON
337 #define HAS_ARGBSUBTRACTROW_NEON
338 #define HAS_SOBELROW_NEON
339 #define HAS_SOBELTOPLANEROW_NEON
340 #define HAS_SOBELXYROW_NEON
341 #define HAS_SOBELXROW_NEON
342 #define HAS_SOBELYROW_NEON
343 #endif
344
345 // The following are available on Neon platforms:
346 #if !defined(LIBYUV_DISABLE_NEON) && \
347     (defined(__ARM_NEON__) || defined(LIBYUV_NEON))
348 #define HAS_ABGRTOUVROW_NEON
349 #define HAS_ABGRTOYROW_NEON
350 #define HAS_ARGB1555TOARGBROW_NEON
351 #define HAS_ARGB1555TOUVROW_NEON
352 #define HAS_ARGB1555TOYROW_NEON
353 #define HAS_ARGB4444TOARGBROW_NEON
354 #define HAS_ARGB4444TOUVROW_NEON
355 #define HAS_ARGB4444TOYROW_NEON
356 #define HAS_ARGBTOARGB1555ROW_NEON
357 #define HAS_ARGBTOARGB4444ROW_NEON
358 #define HAS_ARGBTOBAYERROW_NEON
359 #define HAS_ARGBTOBAYERGGROW_NEON
360 #define HAS_ARGBTORAWROW_NEON
361 #define HAS_ARGBTORGB24ROW_NEON
362 #define HAS_ARGBTORGB565ROW_NEON
363 #define HAS_ARGBTOUV411ROW_NEON
364 #define HAS_ARGBTOUV422ROW_NEON
365 #define HAS_ARGBTOUV444ROW_NEON
366 #define HAS_ARGBTOUVROW_NEON
367 #define HAS_ARGBTOUVJROW_NEON
368 #define HAS_ARGBTOYROW_NEON
369 #define HAS_ARGBTOYJROW_NEON
370 #define HAS_BGRATOUVROW_NEON
371 #define HAS_BGRATOYROW_NEON
372 #define HAS_COPYROW_NEON
373 #define HAS_HALFROW_NEON
374 #define HAS_I400TOARGBROW_NEON
375 #define HAS_I411TOARGBROW_NEON
376 #define HAS_I422TOABGRROW_NEON
377 #define HAS_I422TOARGB1555ROW_NEON
378 #define HAS_I422TOARGB4444ROW_NEON
379 #define HAS_I422TOARGBROW_NEON
380 #define HAS_I422TOBGRAROW_NEON
381 #define HAS_I422TORAWROW_NEON
382 #define HAS_I422TORGB24ROW_NEON
383 #define HAS_I422TORGB565ROW_NEON
384 #define HAS_I422TORGBAROW_NEON
385 #define HAS_I422TOUYVYROW_NEON
386 #define HAS_I422TOYUY2ROW_NEON
387 #define HAS_I444TOARGBROW_NEON
388 #define HAS_MERGEUVROW_NEON
389 #define HAS_MIRRORROW_NEON
390 #define HAS_MIRRORUVROW_NEON
391 #define HAS_NV12TOARGBROW_NEON
392 #define HAS_NV12TORGB565ROW_NEON
393 #define HAS_NV21TOARGBROW_NEON
394 #define HAS_NV21TORGB565ROW_NEON
395 #define HAS_RAWTOARGBROW_NEON
396 #define HAS_RAWTOUVROW_NEON
397 #define HAS_RAWTOYROW_NEON
398 #define HAS_RGB24TOARGBROW_NEON
399 #define HAS_RGB24TOUVROW_NEON
400 #define HAS_RGB24TOYROW_NEON
401 #define HAS_RGB565TOARGBROW_NEON
402 #define HAS_RGB565TOUVROW_NEON
403 #define HAS_RGB565TOYROW_NEON
404 #define HAS_RGBATOUVROW_NEON
405 #define HAS_RGBATOYROW_NEON
406 #define HAS_SETROW_NEON
407 #define HAS_SPLITUVROW_NEON
408 #define HAS_UYVYTOARGBROW_NEON
409 #define HAS_UYVYTOUV422ROW_NEON
410 #define HAS_UYVYTOUVROW_NEON
411 #define HAS_UYVYTOYROW_NEON
412 #define HAS_YTOARGBROW_NEON
413 #define HAS_YUY2TOARGBROW_NEON
414 #define HAS_YUY2TOUV422ROW_NEON
415 #define HAS_YUY2TOUVROW_NEON
416 #define HAS_YUY2TOYROW_NEON
417
418 // Effects:
419 #define HAS_ARGBADDROW_NEON
420 #define HAS_ARGBATTENUATEROW_NEON
421 #define HAS_ARGBBLENDROW_NEON
422 #define HAS_ARGBGRAYROW_NEON
423 #define HAS_ARGBMIRRORROW_NEON
424 #define HAS_ARGBMULTIPLYROW_NEON
425 #define HAS_ARGBQUANTIZEROW_NEON
426 #define HAS_ARGBSEPIAROW_NEON
427 #define HAS_ARGBSHADEROW_NEON
428 #define HAS_ARGBSUBTRACTROW_NEON
429 #define HAS_SOBELROW_NEON
430 #define HAS_SOBELTOPLANEROW_NEON
431 #define HAS_SOBELXYROW_NEON
432 #define HAS_SOBELXROW_NEON
433 #define HAS_SOBELYROW_NEON
434 #define HAS_INTERPOLATEROW_NEON
435 // TODO(fbarchard): Investigate neon unittest failure.
436 // #define HAS_ARGBCOLORMATRIXROW_NEON
437 #endif
438
439 // The following are available on Mips platforms:
440 #if !defined(LIBYUV_DISABLE_MIPS) && defined(__mips__) && \
441     (_MIPS_SIM == _MIPS_SIM_ABI32)
442 #define HAS_COPYROW_MIPS
443 #if defined(__mips_dsp) && (__mips_dsp_rev >= 2)
444 #define HAS_I422TOABGRROW_MIPS_DSPR2
445 #define HAS_I422TOARGBROW_MIPS_DSPR2
446 #define HAS_I422TOBGRAROW_MIPS_DSPR2
447 #define HAS_INTERPOLATEROWS_MIPS_DSPR2
448 #define HAS_MIRRORROW_MIPS_DSPR2
449 #define HAS_MIRRORUVROW_MIPS_DSPR2
450 #define HAS_SPLITUVROW_MIPS_DSPR2
451 #endif
452 #endif
453
454 #if defined(_MSC_VER) && !defined(__CLR_VER)
455 #define SIMD_ALIGNED(var) __declspec(align(16)) var
456 typedef __declspec(align(16)) int16 vec16[8];
457 typedef __declspec(align(16)) int32 vec32[4];
458 typedef __declspec(align(16)) int8 vec8[16];
459 typedef __declspec(align(16)) uint16 uvec16[8];
460 typedef __declspec(align(16)) uint32 uvec32[4];
461 typedef __declspec(align(16)) uint8 uvec8[16];
462 typedef __declspec(align(32)) int16 lvec16[16];
463 typedef __declspec(align(32)) int32 lvec32[8];
464 typedef __declspec(align(32)) int8 lvec8[32];
465 typedef __declspec(align(32)) uint16 ulvec16[16];
466 typedef __declspec(align(32)) uint32 ulvec32[8];
467 typedef __declspec(align(32)) uint8 ulvec8[32];
468
469 #elif defined(__GNUC__)
470 // Caveat GCC 4.2 to 4.7 have a known issue using vectors with const.
471 #define SIMD_ALIGNED(var) var __attribute__((aligned(16)))
472 typedef int16 __attribute__((vector_size(16))) vec16;
473 typedef int32 __attribute__((vector_size(16))) vec32;
474 typedef int8 __attribute__((vector_size(16))) vec8;
475 typedef uint16 __attribute__((vector_size(16))) uvec16;
476 typedef uint32 __attribute__((vector_size(16))) uvec32;
477 typedef uint8 __attribute__((vector_size(16))) uvec8;
478 #else
479 #define SIMD_ALIGNED(var) var
480 typedef int16 vec16[8];
481 typedef int32 vec32[4];
482 typedef int8 vec8[16];
483 typedef uint16 uvec16[8];
484 typedef uint32 uvec32[4];
485 typedef uint8 uvec8[16];
486 #endif
487
488 #if defined(__APPLE__) || defined(__x86_64__) || defined(__llvm__)
489 #define OMITFP
490 #else
491 #define OMITFP __attribute__((optimize("omit-frame-pointer")))
492 #endif
493
494 // NaCL macros for GCC x86 and x64.
495
496 // TODO(nfullagar): When pepper_33 toolchain is distributed, default to
497 // NEW_BINUTILS and remove all BUNDLEALIGN occurances.
498 #if defined(__native_client__)
499 #define LABELALIGN ".p2align 5\n"
500 #else
501 #define LABELALIGN ".p2align 2\n"
502 #endif
503 #if defined(__native_client__) && defined(__x86_64__)
504 #if defined(NEW_BINUTILS)
505 #define BUNDLELOCK ".bundle_lock\n"
506 #define BUNDLEUNLOCK ".bundle_unlock\n"
507 #define BUNDLEALIGN "\n"
508 #else
509 #define BUNDLELOCK "\n"
510 #define BUNDLEUNLOCK "\n"
511 #define BUNDLEALIGN ".p2align 5\n"
512 #endif
513 #define MEMACCESS(base) "%%nacl:(%%r15,%q" #base ")"
514 #define MEMACCESS2(offset, base) "%%nacl:" #offset "(%%r15,%q" #base ")"
515 #define MEMLEA(offset, base) #offset "(%q" #base ")"
516 #define MEMLEA3(offset, index, scale) \
517     #offset "(,%q" #index "," #scale ")"
518 #define MEMLEA4(offset, base, index, scale) \
519     #offset "(%q" #base ",%q" #index "," #scale ")"
520 #define MEMMOVESTRING(s, d) "%%nacl:(%q" #s "),%%nacl:(%q" #d "), %%r15"
521 #define MEMSTORESTRING(reg, d) "%%" #reg ",%%nacl:(%q" #d "), %%r15"
522 #define MEMOPREG(opcode, offset, base, index, scale, reg) \
523     BUNDLELOCK \
524     "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \
525     #opcode " (%%r15,%%r14),%%" #reg "\n" \
526     BUNDLEUNLOCK
527 #define MEMOPMEM(opcode, reg, offset, base, index, scale) \
528     BUNDLELOCK \
529     "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \
530     #opcode " %%" #reg ",(%%r15,%%r14)\n" \
531     BUNDLEUNLOCK
532 #define MEMOPARG(opcode, offset, base, index, scale, arg) \
533     BUNDLELOCK \
534     "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \
535     #opcode " (%%r15,%%r14),%" #arg "\n" \
536     BUNDLEUNLOCK
537 #else  // defined(__native_client__) && defined(__x86_64__)
538 #define BUNDLEALIGN "\n"
539 #define MEMACCESS(base) "(%" #base ")"
540 #define MEMACCESS2(offset, base) #offset "(%" #base ")"
541 #define MEMLEA(offset, base) #offset "(%" #base ")"
542 #define MEMLEA3(offset, index, scale) \
543     #offset "(,%" #index "," #scale ")"
544 #define MEMLEA4(offset, base, index, scale) \
545     #offset "(%" #base ",%" #index "," #scale ")"
546 #define MEMMOVESTRING(s, d)
547 #define MEMSTORESTRING(reg, d)
548 #define MEMOPREG(opcode, offset, base, index, scale, reg) \
549     #opcode " " #offset "(%" #base ",%" #index "," #scale "),%%" #reg "\n"
550 #define MEMOPMEM(opcode, reg, offset, base, index, scale) \
551     #opcode " %%" #reg ","#offset "(%" #base ",%" #index "," #scale ")\n"
552 #define MEMOPARG(opcode, offset, base, index, scale, arg) \
553     #opcode " " #offset "(%" #base ",%" #index "," #scale "),%" #arg "\n"
554 #endif  // defined(__native_client__) && defined(__x86_64__)
555
556 #if defined(__arm__) || defined(__aarch64__)
557 #undef MEMACCESS
558 #if defined(__native_client__)
559 #define MEMACCESS(base) ".p2align   3\nbic %" #base ", #0xc0000000\n"
560 #else
561 #define MEMACCESS(base) "\n"
562 #endif
563 #endif
564
565 void I444ToARGBRow_NEON(const uint8* src_y,
566                         const uint8* src_u,
567                         const uint8* src_v,
568                         uint8* dst_argb,
569                         int width);
570 void I422ToARGBRow_NEON(const uint8* src_y,
571                         const uint8* src_u,
572                         const uint8* src_v,
573                         uint8* dst_argb,
574                         int width);
575 void I411ToARGBRow_NEON(const uint8* src_y,
576                         const uint8* src_u,
577                         const uint8* src_v,
578                         uint8* dst_argb,
579                         int width);
580 void I422ToBGRARow_NEON(const uint8* src_y,
581                         const uint8* src_u,
582                         const uint8* src_v,
583                         uint8* dst_bgra,
584                         int width);
585 void I422ToABGRRow_NEON(const uint8* src_y,
586                         const uint8* src_u,
587                         const uint8* src_v,
588                         uint8* dst_abgr,
589                         int width);
590 void I422ToRGBARow_NEON(const uint8* src_y,
591                         const uint8* src_u,
592                         const uint8* src_v,
593                         uint8* dst_rgba,
594                         int width);
595 void I422ToRGB24Row_NEON(const uint8* src_y,
596                          const uint8* src_u,
597                          const uint8* src_v,
598                          uint8* dst_rgb24,
599                          int width);
600 void I422ToRAWRow_NEON(const uint8* src_y,
601                        const uint8* src_u,
602                        const uint8* src_v,
603                        uint8* dst_raw,
604                        int width);
605 void I422ToRGB565Row_NEON(const uint8* src_y,
606                           const uint8* src_u,
607                           const uint8* src_v,
608                           uint8* dst_rgb565,
609                           int width);
610 void I422ToARGB1555Row_NEON(const uint8* src_y,
611                             const uint8* src_u,
612                             const uint8* src_v,
613                             uint8* dst_argb1555,
614                             int width);
615 void I422ToARGB4444Row_NEON(const uint8* src_y,
616                             const uint8* src_u,
617                             const uint8* src_v,
618                             uint8* dst_argb4444,
619                             int width);
620 void NV12ToARGBRow_NEON(const uint8* src_y,
621                         const uint8* src_uv,
622                         uint8* dst_argb,
623                         int width);
624 void NV21ToARGBRow_NEON(const uint8* src_y,
625                         const uint8* src_vu,
626                         uint8* dst_argb,
627                         int width);
628 void NV12ToRGB565Row_NEON(const uint8* src_y,
629                           const uint8* src_uv,
630                           uint8* dst_rgb565,
631                           int width);
632 void NV21ToRGB565Row_NEON(const uint8* src_y,
633                           const uint8* src_vu,
634                           uint8* dst_rgb565,
635                           int width);
636 void YUY2ToARGBRow_NEON(const uint8* src_yuy2,
637                         uint8* dst_argb,
638                         int width);
639 void UYVYToARGBRow_NEON(const uint8* src_uyvy,
640                         uint8* dst_argb,
641                         int width);
642
643 void ARGBToYRow_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
644 void ARGBToYRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
645 void ARGBToYRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
646 void ARGBToYJRow_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
647 void ARGBToYJRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int pix);
648 void ARGBToYJRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
649 void BGRAToYRow_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix);
650 void ABGRToYRow_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix);
651 void RGBAToYRow_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix);
652 void RGB24ToYRow_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix);
653 void RAWToYRow_SSSE3(const uint8* src_raw, uint8* dst_y, int pix);
654 void ARGBToYRow_Unaligned_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
655 void ARGBToYJRow_Unaligned_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
656 void BGRAToYRow_Unaligned_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix);
657 void ABGRToYRow_Unaligned_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix);
658 void RGBAToYRow_Unaligned_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix);
659 void RGB24ToYRow_Unaligned_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix);
660 void RAWToYRow_Unaligned_SSSE3(const uint8* src_raw, uint8* dst_y, int pix);
661 void ARGBToYRow_NEON(const uint8* src_argb, uint8* dst_y, int pix);
662 void ARGBToYJRow_NEON(const uint8* src_argb, uint8* dst_y, int pix);
663 void ARGBToUV444Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
664                          int pix);
665 void ARGBToUV422Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
666                          int pix);
667 void ARGBToUV411Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
668                          int pix);
669 void ARGBToUVRow_NEON(const uint8* src_argb, int src_stride_argb,
670                       uint8* dst_u, uint8* dst_v, int pix);
671 void ARGBToUVJRow_NEON(const uint8* src_argb, int src_stride_argb,
672                        uint8* dst_u, uint8* dst_v, int pix);
673 void BGRAToUVRow_NEON(const uint8* src_bgra, int src_stride_bgra,
674                       uint8* dst_u, uint8* dst_v, int pix);
675 void ABGRToUVRow_NEON(const uint8* src_abgr, int src_stride_abgr,
676                       uint8* dst_u, uint8* dst_v, int pix);
677 void RGBAToUVRow_NEON(const uint8* src_rgba, int src_stride_rgba,
678                       uint8* dst_u, uint8* dst_v, int pix);
679 void RGB24ToUVRow_NEON(const uint8* src_rgb24, int src_stride_rgb24,
680                        uint8* dst_u, uint8* dst_v, int pix);
681 void RAWToUVRow_NEON(const uint8* src_raw, int src_stride_raw,
682                      uint8* dst_u, uint8* dst_v, int pix);
683 void RGB565ToUVRow_NEON(const uint8* src_rgb565, int src_stride_rgb565,
684                         uint8* dst_u, uint8* dst_v, int pix);
685 void ARGB1555ToUVRow_NEON(const uint8* src_argb1555, int src_stride_argb1555,
686                           uint8* dst_u, uint8* dst_v, int pix);
687 void ARGB4444ToUVRow_NEON(const uint8* src_argb4444, int src_stride_argb4444,
688                           uint8* dst_u, uint8* dst_v, int pix);
689 void BGRAToYRow_NEON(const uint8* src_bgra, uint8* dst_y, int pix);
690 void ABGRToYRow_NEON(const uint8* src_abgr, uint8* dst_y, int pix);
691 void RGBAToYRow_NEON(const uint8* src_rgba, uint8* dst_y, int pix);
692 void RGB24ToYRow_NEON(const uint8* src_rgb24, uint8* dst_y, int pix);
693 void RAWToYRow_NEON(const uint8* src_raw, uint8* dst_y, int pix);
694 void RGB565ToYRow_NEON(const uint8* src_rgb565, uint8* dst_y, int pix);
695 void ARGB1555ToYRow_NEON(const uint8* src_argb1555, uint8* dst_y, int pix);
696 void ARGB4444ToYRow_NEON(const uint8* src_argb4444, uint8* dst_y, int pix);
697 void ARGBToYRow_C(const uint8* src_argb, uint8* dst_y, int pix);
698 void ARGBToYJRow_C(const uint8* src_argb, uint8* dst_y, int pix);
699 void BGRAToYRow_C(const uint8* src_bgra, uint8* dst_y, int pix);
700 void ABGRToYRow_C(const uint8* src_abgr, uint8* dst_y, int pix);
701 void RGBAToYRow_C(const uint8* src_rgba, uint8* dst_y, int pix);
702 void RGB24ToYRow_C(const uint8* src_rgb24, uint8* dst_y, int pix);
703 void RAWToYRow_C(const uint8* src_raw, uint8* dst_y, int pix);
704 void RGB565ToYRow_C(const uint8* src_rgb565, uint8* dst_y, int pix);
705 void ARGB1555ToYRow_C(const uint8* src_argb1555, uint8* dst_y, int pix);
706 void ARGB4444ToYRow_C(const uint8* src_argb4444, uint8* dst_y, int pix);
707 void ARGBToYRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
708 void ARGBToYJRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
709 void BGRAToYRow_Any_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix);
710 void ABGRToYRow_Any_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix);
711 void RGBAToYRow_Any_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix);
712 void RGB24ToYRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix);
713 void RAWToYRow_Any_SSSE3(const uint8* src_raw, uint8* dst_y, int pix);
714 void ARGBToYRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int pix);
715 void ARGBToYJRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int pix);
716 void BGRAToYRow_Any_NEON(const uint8* src_bgra, uint8* dst_y, int pix);
717 void ABGRToYRow_Any_NEON(const uint8* src_abgr, uint8* dst_y, int pix);
718 void RGBAToYRow_Any_NEON(const uint8* src_rgba, uint8* dst_y, int pix);
719 void RGB24ToYRow_Any_NEON(const uint8* src_rgb24, uint8* dst_y, int pix);
720 void RAWToYRow_Any_NEON(const uint8* src_raw, uint8* dst_y, int pix);
721 void RGB565ToYRow_Any_NEON(const uint8* src_rgb565, uint8* dst_y, int pix);
722 void ARGB1555ToYRow_Any_NEON(const uint8* src_argb1555, uint8* dst_y, int pix);
723 void ARGB4444ToYRow_Any_NEON(const uint8* src_argb4444, uint8* dst_y, int pix);
724
725 void ARGBToUVRow_AVX2(const uint8* src_argb, int src_stride_argb,
726                       uint8* dst_u, uint8* dst_v, int width);
727 void ARGBToUVRow_Any_AVX2(const uint8* src_argb, int src_stride_argb,
728                           uint8* dst_u, uint8* dst_v, int width);
729 void ARGBToUVRow_SSSE3(const uint8* src_argb, int src_stride_argb,
730                        uint8* dst_u, uint8* dst_v, int width);
731 void ARGBToUVJRow_SSSE3(const uint8* src_argb, int src_stride_argb,
732                         uint8* dst_u, uint8* dst_v, int width);
733 void BGRAToUVRow_SSSE3(const uint8* src_bgra, int src_stride_bgra,
734                        uint8* dst_u, uint8* dst_v, int width);
735 void ABGRToUVRow_SSSE3(const uint8* src_abgr, int src_stride_abgr,
736                        uint8* dst_u, uint8* dst_v, int width);
737 void RGBAToUVRow_SSSE3(const uint8* src_rgba, int src_stride_rgba,
738                        uint8* dst_u, uint8* dst_v, int width);
739 void ARGBToUVRow_Unaligned_SSSE3(const uint8* src_argb, int src_stride_argb,
740                                  uint8* dst_u, uint8* dst_v, int width);
741 void ARGBToUVJRow_Unaligned_SSSE3(const uint8* src_argb, int src_stride_argb,
742                                   uint8* dst_u, uint8* dst_v, int width);
743 void BGRAToUVRow_Unaligned_SSSE3(const uint8* src_bgra, int src_stride_bgra,
744                                  uint8* dst_u, uint8* dst_v, int width);
745 void ABGRToUVRow_Unaligned_SSSE3(const uint8* src_abgr, int src_stride_abgr,
746                                  uint8* dst_u, uint8* dst_v, int width);
747 void RGBAToUVRow_Unaligned_SSSE3(const uint8* src_rgba, int src_stride_rgba,
748                                  uint8* dst_u, uint8* dst_v, int width);
749 void ARGBToUVRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb,
750                            uint8* dst_u, uint8* dst_v, int width);
751 void ARGBToUVJRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb,
752                             uint8* dst_u, uint8* dst_v, int width);
753 void BGRAToUVRow_Any_SSSE3(const uint8* src_bgra, int src_stride_bgra,
754                            uint8* dst_u, uint8* dst_v, int width);
755 void ABGRToUVRow_Any_SSSE3(const uint8* src_abgr, int src_stride_abgr,
756                            uint8* dst_u, uint8* dst_v, int width);
757 void RGBAToUVRow_Any_SSSE3(const uint8* src_rgba, int src_stride_rgba,
758                            uint8* dst_u, uint8* dst_v, int width);
759 void ARGBToUV444Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
760                              int pix);
761 void ARGBToUV422Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
762                              int pix);
763 void ARGBToUV411Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
764                              int pix);
765 void ARGBToUVRow_Any_NEON(const uint8* src_argb, int src_stride_argb,
766                           uint8* dst_u, uint8* dst_v, int pix);
767 void ARGBToUVJRow_Any_NEON(const uint8* src_argb, int src_stride_argb,
768                            uint8* dst_u, uint8* dst_v, int pix);
769 void BGRAToUVRow_Any_NEON(const uint8* src_bgra, int src_stride_bgra,
770                           uint8* dst_u, uint8* dst_v, int pix);
771 void ABGRToUVRow_Any_NEON(const uint8* src_abgr, int src_stride_abgr,
772                           uint8* dst_u, uint8* dst_v, int pix);
773 void RGBAToUVRow_Any_NEON(const uint8* src_rgba, int src_stride_rgba,
774                           uint8* dst_u, uint8* dst_v, int pix);
775 void RGB24ToUVRow_Any_NEON(const uint8* src_rgb24, int src_stride_rgb24,
776                            uint8* dst_u, uint8* dst_v, int pix);
777 void RAWToUVRow_Any_NEON(const uint8* src_raw, int src_stride_raw,
778                          uint8* dst_u, uint8* dst_v, int pix);
779 void RGB565ToUVRow_Any_NEON(const uint8* src_rgb565, int src_stride_rgb565,
780                             uint8* dst_u, uint8* dst_v, int pix);
781 void ARGB1555ToUVRow_Any_NEON(const uint8* src_argb1555,
782                               int src_stride_argb1555,
783                               uint8* dst_u, uint8* dst_v, int pix);
784 void ARGB4444ToUVRow_Any_NEON(const uint8* src_argb4444,
785                               int src_stride_argb4444,
786                               uint8* dst_u, uint8* dst_v, int pix);
787 void ARGBToUVRow_C(const uint8* src_argb, int src_stride_argb,
788                    uint8* dst_u, uint8* dst_v, int width);
789 void ARGBToUVJRow_C(const uint8* src_argb, int src_stride_argb,
790                     uint8* dst_u, uint8* dst_v, int width);
791 void BGRAToUVRow_C(const uint8* src_bgra, int src_stride_bgra,
792                    uint8* dst_u, uint8* dst_v, int width);
793 void ABGRToUVRow_C(const uint8* src_abgr, int src_stride_abgr,
794                    uint8* dst_u, uint8* dst_v, int width);
795 void RGBAToUVRow_C(const uint8* src_rgba, int src_stride_rgba,
796                    uint8* dst_u, uint8* dst_v, int width);
797 void RGB24ToUVRow_C(const uint8* src_rgb24, int src_stride_rgb24,
798                     uint8* dst_u, uint8* dst_v, int width);
799 void RAWToUVRow_C(const uint8* src_raw, int src_stride_raw,
800                   uint8* dst_u, uint8* dst_v, int width);
801 void RGB565ToUVRow_C(const uint8* src_rgb565, int src_stride_rgb565,
802                      uint8* dst_u, uint8* dst_v, int width);
803 void ARGB1555ToUVRow_C(const uint8* src_argb1555, int src_stride_argb1555,
804                        uint8* dst_u, uint8* dst_v, int width);
805 void ARGB4444ToUVRow_C(const uint8* src_argb4444, int src_stride_argb4444,
806                        uint8* dst_u, uint8* dst_v, int width);
807
808 void ARGBToUV444Row_SSSE3(const uint8* src_argb,
809                           uint8* dst_u, uint8* dst_v, int width);
810 void ARGBToUV444Row_Unaligned_SSSE3(const uint8* src_argb,
811                                     uint8* dst_u, uint8* dst_v, int width);
812 void ARGBToUV444Row_Any_SSSE3(const uint8* src_argb,
813                               uint8* dst_u, uint8* dst_v, int width);
814
815 void ARGBToUV422Row_SSSE3(const uint8* src_argb,
816                           uint8* dst_u, uint8* dst_v, int width);
817 void ARGBToUV422Row_Unaligned_SSSE3(const uint8* src_argb,
818                                     uint8* dst_u, uint8* dst_v, int width);
819 void ARGBToUV422Row_Any_SSSE3(const uint8* src_argb,
820                               uint8* dst_u, uint8* dst_v, int width);
821
822 void ARGBToUV444Row_C(const uint8* src_argb,
823                       uint8* dst_u, uint8* dst_v, int width);
824 void ARGBToUV422Row_C(const uint8* src_argb,
825                       uint8* dst_u, uint8* dst_v, int width);
826 void ARGBToUV411Row_C(const uint8* src_argb,
827                       uint8* dst_u, uint8* dst_v, int width);
828
829 void MirrorRow_AVX2(const uint8* src, uint8* dst, int width);
830 void MirrorRow_SSSE3(const uint8* src, uint8* dst, int width);
831 void MirrorRow_SSE2(const uint8* src, uint8* dst, int width);
832 void MirrorRow_NEON(const uint8* src, uint8* dst, int width);
833 void MirrorRow_MIPS_DSPR2(const uint8* src, uint8* dst, int width);
834 void MirrorRow_C(const uint8* src, uint8* dst, int width);
835
836 void MirrorUVRow_SSSE3(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
837                        int width);
838 void MirrorUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
839                       int width);
840 void MirrorUVRow_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
841                             int width);
842 void MirrorUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
843                    int width);
844
845 void ARGBMirrorRow_AVX2(const uint8* src, uint8* dst, int width);
846 void ARGBMirrorRow_SSSE3(const uint8* src, uint8* dst, int width);
847 void ARGBMirrorRow_NEON(const uint8* src, uint8* dst, int width);
848 void ARGBMirrorRow_C(const uint8* src, uint8* dst, int width);
849
850 void SplitUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
851 void SplitUVRow_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
852 void SplitUVRow_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
853 void SplitUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
854 void SplitUVRow_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
855                            int pix);
856 void SplitUVRow_Unaligned_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
857                                int pix);
858 void SplitUVRow_Unaligned_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u,
859                                      uint8* dst_v, int pix);
860 void SplitUVRow_Any_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
861                          int pix);
862 void SplitUVRow_Any_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
863                          int pix);
864 void SplitUVRow_Any_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
865                          int pix);
866 void SplitUVRow_Any_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
867                                int pix);
868
869 void MergeUVRow_C(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
870                   int width);
871 void MergeUVRow_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
872                      int width);
873 void MergeUVRow_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
874                      int width);
875 void MergeUVRow_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
876                      int width);
877 void MergeUVRow_Unaligned_SSE2(const uint8* src_u, const uint8* src_v,
878                                uint8* dst_uv, int width);
879 void MergeUVRow_Any_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
880                          int width);
881 void MergeUVRow_Any_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
882                          int width);
883 void MergeUVRow_Any_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
884                          int width);
885
886 void CopyRow_SSE2(const uint8* src, uint8* dst, int count);
887 void CopyRow_ERMS(const uint8* src, uint8* dst, int count);
888 void CopyRow_X86(const uint8* src, uint8* dst, int count);
889 void CopyRow_NEON(const uint8* src, uint8* dst, int count);
890 void CopyRow_MIPS(const uint8* src, uint8* dst, int count);
891 void CopyRow_C(const uint8* src, uint8* dst, int count);
892
893 void CopyRow_16_C(const uint16* src, uint16* dst, int count);
894
895 void ARGBCopyAlphaRow_C(const uint8* src_argb, uint8* dst_argb, int width);
896 void ARGBCopyAlphaRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
897 void ARGBCopyAlphaRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
898
899 void ARGBCopyYToAlphaRow_C(const uint8* src_y, uint8* dst_argb, int width);
900 void ARGBCopyYToAlphaRow_SSE2(const uint8* src_y, uint8* dst_argb, int width);
901 void ARGBCopyYToAlphaRow_AVX2(const uint8* src_y, uint8* dst_argb, int width);
902
903 void SetRow_X86(uint8* dst, uint32 v32, int count);
904 void ARGBSetRows_X86(uint8* dst, uint32 v32, int width,
905                      int dst_stride, int height);
906 void SetRow_NEON(uint8* dst, uint32 v32, int count);
907 void ARGBSetRows_NEON(uint8* dst, uint32 v32, int width,
908                       int dst_stride, int height);
909 void SetRow_C(uint8* dst, uint32 v32, int count);
910 void ARGBSetRows_C(uint8* dst, uint32 v32, int width, int dst_stride,
911                    int height);
912
913 // ARGBShufflers for BGRAToARGB etc.
914 void ARGBShuffleRow_C(const uint8* src_argb, uint8* dst_argb,
915                       const uint8* shuffler, int pix);
916 void ARGBShuffleRow_SSE2(const uint8* src_argb, uint8* dst_argb,
917                          const uint8* shuffler, int pix);
918 void ARGBShuffleRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
919                           const uint8* shuffler, int pix);
920 void ARGBShuffleRow_AVX2(const uint8* src_argb, uint8* dst_argb,
921                          const uint8* shuffler, int pix);
922 void ARGBShuffleRow_NEON(const uint8* src_argb, uint8* dst_argb,
923                          const uint8* shuffler, int pix);
924 void ARGBShuffleRow_Unaligned_SSSE3(const uint8* src_argb, uint8* dst_argb,
925                                     const uint8* shuffler, int pix);
926 void ARGBShuffleRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
927                              const uint8* shuffler, int pix);
928 void ARGBShuffleRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb,
929                               const uint8* shuffler, int pix);
930 void ARGBShuffleRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
931                              const uint8* shuffler, int pix);
932 void ARGBShuffleRow_Any_NEON(const uint8* src_argb, uint8* dst_argb,
933                              const uint8* shuffler, int pix);
934
935 void RGB24ToARGBRow_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int pix);
936 void RAWToARGBRow_SSSE3(const uint8* src_raw, uint8* dst_argb, int pix);
937 void RGB565ToARGBRow_SSE2(const uint8* src_rgb565, uint8* dst_argb, int pix);
938 void ARGB1555ToARGBRow_SSE2(const uint8* src_argb1555, uint8* dst_argb,
939                             int pix);
940 void ARGB4444ToARGBRow_SSE2(const uint8* src_argb4444, uint8* dst_argb,
941                             int pix);
942
943 void RGB24ToARGBRow_NEON(const uint8* src_rgb24, uint8* dst_argb, int pix);
944 void RAWToARGBRow_NEON(const uint8* src_raw, uint8* dst_argb, int pix);
945 void RGB565ToARGBRow_NEON(const uint8* src_rgb565, uint8* dst_argb, int pix);
946 void ARGB1555ToARGBRow_NEON(const uint8* src_argb1555, uint8* dst_argb,
947                             int pix);
948 void ARGB4444ToARGBRow_NEON(const uint8* src_argb4444, uint8* dst_argb,
949                             int pix);
950 void RGB24ToARGBRow_C(const uint8* src_rgb24, uint8* dst_argb, int pix);
951 void RAWToARGBRow_C(const uint8* src_raw, uint8* dst_argb, int pix);
952 void RGB565ToARGBRow_C(const uint8* src_rgb, uint8* dst_argb, int pix);
953 void ARGB1555ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int pix);
954 void ARGB4444ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int pix);
955 void RGB24ToARGBRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int pix);
956 void RAWToARGBRow_Any_SSSE3(const uint8* src_raw, uint8* dst_argb, int pix);
957 void RGB565ToARGBRow_Any_SSE2(const uint8* src_rgb565, uint8* dst_argb,
958                               int pix);
959 void ARGB1555ToARGBRow_Any_SSE2(const uint8* src_argb1555, uint8* dst_argb,
960                                 int pix);
961 void ARGB4444ToARGBRow_Any_SSE2(const uint8* src_argb4444, uint8* dst_argb,
962                                 int pix);
963 void RGB24ToARGBRow_Any_NEON(const uint8* src_rgb24, uint8* dst_argb, int pix);
964 void RAWToARGBRow_Any_NEON(const uint8* src_raw, uint8* dst_argb, int pix);
965 void RGB565ToARGBRow_Any_NEON(const uint8* src_rgb565, uint8* dst_argb,
966                               int pix);
967 void ARGB1555ToARGBRow_Any_NEON(const uint8* src_argb1555, uint8* dst_argb,
968                                 int pix);
969 void ARGB4444ToARGBRow_Any_NEON(const uint8* src_argb4444, uint8* dst_argb,
970                                 int pix);
971
972 void ARGBToRGB24Row_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
973 void ARGBToRAWRow_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
974 void ARGBToRGB565Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
975 void ARGBToARGB1555Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
976 void ARGBToARGB4444Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
977
978 void ARGBToRGB24Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
979 void ARGBToRAWRow_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
980 void ARGBToRGB565Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
981 void ARGBToARGB1555Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
982 void ARGBToARGB4444Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
983
984 void ARGBToRGBARow_C(const uint8* src_argb, uint8* dst_rgb, int pix);
985 void ARGBToRGB24Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
986 void ARGBToRAWRow_C(const uint8* src_argb, uint8* dst_rgb, int pix);
987 void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
988 void ARGBToARGB1555Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
989 void ARGBToARGB4444Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
990
991 void I400ToARGBRow_SSE2(const uint8* src_y, uint8* dst_argb, int pix);
992 void I400ToARGBRow_Unaligned_SSE2(const uint8* src_y, uint8* dst_argb, int pix);
993 void I400ToARGBRow_NEON(const uint8* src_y, uint8* dst_argb, int pix);
994 void I400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int pix);
995 void I400ToARGBRow_Any_SSE2(const uint8* src_y, uint8* dst_argb, int pix);
996 void I400ToARGBRow_Any_NEON(const uint8* src_y, uint8* dst_argb, int pix);
997
998 void I444ToARGBRow_C(const uint8* src_y,
999                      const uint8* src_u,
1000                      const uint8* src_v,
1001                      uint8* dst_argb,
1002                      int width);
1003 void I422ToARGBRow_C(const uint8* src_y,
1004                      const uint8* src_u,
1005                      const uint8* src_v,
1006                      uint8* dst_argb,
1007                      int width);
1008 void I411ToARGBRow_C(const uint8* src_y,
1009                      const uint8* src_u,
1010                      const uint8* src_v,
1011                      uint8* dst_argb,
1012                      int width);
1013 void NV12ToARGBRow_C(const uint8* src_y,
1014                      const uint8* src_uv,
1015                      uint8* dst_argb,
1016                      int width);
1017 void NV21ToRGB565Row_C(const uint8* src_y,
1018                        const uint8* src_vu,
1019                        uint8* dst_argb,
1020                        int width);
1021 void NV12ToRGB565Row_C(const uint8* src_y,
1022                        const uint8* src_uv,
1023                        uint8* dst_argb,
1024                        int width);
1025 void NV21ToARGBRow_C(const uint8* src_y,
1026                      const uint8* src_vu,
1027                      uint8* dst_argb,
1028                      int width);
1029 void YUY2ToARGBRow_C(const uint8* src_yuy2,
1030                      uint8* dst_argb,
1031                      int width);
1032 void UYVYToARGBRow_C(const uint8* src_uyvy,
1033                      uint8* dst_argb,
1034                      int width);
1035 void I422ToBGRARow_C(const uint8* src_y,
1036                      const uint8* src_u,
1037                      const uint8* src_v,
1038                      uint8* dst_bgra,
1039                      int width);
1040 void I422ToABGRRow_C(const uint8* src_y,
1041                      const uint8* src_u,
1042                      const uint8* src_v,
1043                      uint8* dst_abgr,
1044                      int width);
1045 void I422ToRGBARow_C(const uint8* src_y,
1046                      const uint8* src_u,
1047                      const uint8* src_v,
1048                      uint8* dst_rgba,
1049                      int width);
1050 void I422ToRGB24Row_C(const uint8* src_y,
1051                       const uint8* src_u,
1052                       const uint8* src_v,
1053                       uint8* dst_rgb24,
1054                       int width);
1055 void I422ToRAWRow_C(const uint8* src_y,
1056                     const uint8* src_u,
1057                     const uint8* src_v,
1058                     uint8* dst_raw,
1059                     int width);
1060 void I422ToARGB4444Row_C(const uint8* src_y,
1061                          const uint8* src_u,
1062                          const uint8* src_v,
1063                          uint8* dst_argb4444,
1064                          int width);
1065 void I422ToARGB1555Row_C(const uint8* src_y,
1066                          const uint8* src_u,
1067                          const uint8* src_v,
1068                          uint8* dst_argb4444,
1069                          int width);
1070 void I422ToRGB565Row_C(const uint8* src_y,
1071                        const uint8* src_u,
1072                        const uint8* src_v,
1073                        uint8* dst_rgb565,
1074                        int width);
1075 void YToARGBRow_C(const uint8* src_y,
1076                   uint8* dst_argb,
1077                   int width);
1078 void I422ToARGBRow_AVX2(const uint8* src_y,
1079                         const uint8* src_u,
1080                         const uint8* src_v,
1081                         uint8* dst_argb,
1082                         int width);
1083 void I444ToARGBRow_SSSE3(const uint8* src_y,
1084                          const uint8* src_u,
1085                          const uint8* src_v,
1086                          uint8* dst_argb,
1087                          int width);
1088 void I422ToARGBRow_SSSE3(const uint8* src_y,
1089                          const uint8* src_u,
1090                          const uint8* src_v,
1091                          uint8* dst_argb,
1092                          int width);
1093 void I411ToARGBRow_SSSE3(const uint8* src_y,
1094                          const uint8* src_u,
1095                          const uint8* src_v,
1096                          uint8* dst_argb,
1097                          int width);
1098 void NV12ToARGBRow_SSSE3(const uint8* src_y,
1099                          const uint8* src_uv,
1100                          uint8* dst_argb,
1101                          int width);
1102 void NV21ToARGBRow_SSSE3(const uint8* src_y,
1103                          const uint8* src_vu,
1104                          uint8* dst_argb,
1105                          int width);
1106 void NV12ToRGB565Row_SSSE3(const uint8* src_y,
1107                            const uint8* src_uv,
1108                            uint8* dst_argb,
1109                            int width);
1110 void NV21ToRGB565Row_SSSE3(const uint8* src_y,
1111                            const uint8* src_vu,
1112                            uint8* dst_argb,
1113                            int width);
1114 void YUY2ToARGBRow_SSSE3(const uint8* src_yuy2,
1115                          uint8* dst_argb,
1116                          int width);
1117 void UYVYToARGBRow_SSSE3(const uint8* src_uyvy,
1118                          uint8* dst_argb,
1119                          int width);
1120 void I422ToBGRARow_SSSE3(const uint8* src_y,
1121                          const uint8* src_u,
1122                          const uint8* src_v,
1123                          uint8* dst_bgra,
1124                          int width);
1125 void I422ToABGRRow_SSSE3(const uint8* src_y,
1126                          const uint8* src_u,
1127                          const uint8* src_v,
1128                          uint8* dst_abgr,
1129                          int width);
1130 void I422ToRGBARow_SSSE3(const uint8* src_y,
1131                          const uint8* src_u,
1132                          const uint8* src_v,
1133                          uint8* dst_rgba,
1134                          int width);
1135 void I422ToARGB4444Row_SSSE3(const uint8* src_y,
1136                              const uint8* src_u,
1137                              const uint8* src_v,
1138                              uint8* dst_argb,
1139                              int width);
1140 void I422ToARGB1555Row_SSSE3(const uint8* src_y,
1141                              const uint8* src_u,
1142                              const uint8* src_v,
1143                              uint8* dst_argb,
1144                              int width);
1145 void I422ToRGB565Row_SSSE3(const uint8* src_y,
1146                            const uint8* src_u,
1147                            const uint8* src_v,
1148                            uint8* dst_argb,
1149                            int width);
1150 // RGB24/RAW are unaligned.
1151 void I422ToRGB24Row_SSSE3(const uint8* src_y,
1152                           const uint8* src_u,
1153                           const uint8* src_v,
1154                           uint8* dst_rgb24,
1155                           int width);
1156 void I422ToRAWRow_SSSE3(const uint8* src_y,
1157                         const uint8* src_u,
1158                         const uint8* src_v,
1159                         uint8* dst_raw,
1160                         int width);
1161
1162 void I444ToARGBRow_Unaligned_SSSE3(const uint8* src_y,
1163                                    const uint8* src_u,
1164                                    const uint8* src_v,
1165                                    uint8* dst_argb,
1166                                    int width);
1167 void I422ToARGBRow_Unaligned_SSSE3(const uint8* src_y,
1168                                    const uint8* src_u,
1169                                    const uint8* src_v,
1170                                    uint8* dst_argb,
1171                                    int width);
1172 void I411ToARGBRow_Unaligned_SSSE3(const uint8* src_y,
1173                                    const uint8* src_u,
1174                                    const uint8* src_v,
1175                                    uint8* dst_argb,
1176                                    int width);
1177 void NV12ToARGBRow_Unaligned_SSSE3(const uint8* src_y,
1178                                    const uint8* src_uv,
1179                                    uint8* dst_argb,
1180                                    int width);
1181 void NV21ToARGBRow_Unaligned_SSSE3(const uint8* src_y,
1182                                    const uint8* src_vu,
1183                                    uint8* dst_argb,
1184                                    int width);
1185 void YUY2ToARGBRow_Unaligned_SSSE3(const uint8* src_yuy2,
1186                                    uint8* dst_argb,
1187                                    int width);
1188 void UYVYToARGBRow_Unaligned_SSSE3(const uint8* src_uyvy,
1189                                    uint8* dst_argb,
1190                                    int width);
1191 void I422ToBGRARow_Unaligned_SSSE3(const uint8* src_y,
1192                                    const uint8* src_u,
1193                                    const uint8* src_v,
1194                                    uint8* dst_bgra,
1195                                    int width);
1196 void I422ToABGRRow_Unaligned_SSSE3(const uint8* src_y,
1197                                    const uint8* src_u,
1198                                    const uint8* src_v,
1199                                    uint8* dst_abgr,
1200                                    int width);
1201 void I422ToRGBARow_Unaligned_SSSE3(const uint8* src_y,
1202                                    const uint8* src_u,
1203                                    const uint8* src_v,
1204                                    uint8* dst_rgba,
1205                                    int width);
1206 void I422ToARGBRow_Any_AVX2(const uint8* src_y,
1207                             const uint8* src_u,
1208                             const uint8* src_v,
1209                             uint8* dst_argb,
1210                             int width);
1211 void I444ToARGBRow_Any_SSSE3(const uint8* src_y,
1212                              const uint8* src_u,
1213                              const uint8* src_v,
1214                              uint8* dst_argb,
1215                              int width);
1216 void I422ToARGBRow_Any_SSSE3(const uint8* src_y,
1217                              const uint8* src_u,
1218                              const uint8* src_v,
1219                              uint8* dst_argb,
1220                              int width);
1221 void I411ToARGBRow_Any_SSSE3(const uint8* src_y,
1222                              const uint8* src_u,
1223                              const uint8* src_v,
1224                              uint8* dst_argb,
1225                              int width);
1226 void NV12ToARGBRow_Any_SSSE3(const uint8* src_y,
1227                              const uint8* src_uv,
1228                              uint8* dst_argb,
1229                              int width);
1230 void NV21ToARGBRow_Any_SSSE3(const uint8* src_y,
1231                              const uint8* src_vu,
1232                              uint8* dst_argb,
1233                              int width);
1234 void NV12ToRGB565Row_Any_SSSE3(const uint8* src_y,
1235                                const uint8* src_uv,
1236                                uint8* dst_argb,
1237                                int width);
1238 void NV21ToRGB565Row_Any_SSSE3(const uint8* src_y,
1239                                const uint8* src_vu,
1240                                uint8* dst_argb,
1241                                int width);
1242 void YUY2ToARGBRow_Any_SSSE3(const uint8* src_yuy2,
1243                              uint8* dst_argb,
1244                              int width);
1245 void UYVYToARGBRow_Any_SSSE3(const uint8* src_uyvy,
1246                              uint8* dst_argb,
1247                              int width);
1248 void I422ToBGRARow_Any_SSSE3(const uint8* src_y,
1249                              const uint8* src_u,
1250                              const uint8* src_v,
1251                              uint8* dst_bgra,
1252                              int width);
1253 void I422ToABGRRow_Any_SSSE3(const uint8* src_y,
1254                              const uint8* src_u,
1255                              const uint8* src_v,
1256                              uint8* dst_abgr,
1257                              int width);
1258 void I422ToRGBARow_Any_SSSE3(const uint8* src_y,
1259                              const uint8* src_u,
1260                              const uint8* src_v,
1261                              uint8* dst_rgba,
1262                              int width);
1263 void I422ToARGB4444Row_Any_SSSE3(const uint8* src_y,
1264                                  const uint8* src_u,
1265                                  const uint8* src_v,
1266                                  uint8* dst_rgba,
1267                                  int width);
1268 void I422ToARGB1555Row_Any_SSSE3(const uint8* src_y,
1269                                  const uint8* src_u,
1270                                  const uint8* src_v,
1271                                  uint8* dst_rgba,
1272                                  int width);
1273 void I422ToRGB565Row_Any_SSSE3(const uint8* src_y,
1274                                const uint8* src_u,
1275                                const uint8* src_v,
1276                                uint8* dst_rgba,
1277                                int width);
1278 // RGB24/RAW are unaligned.
1279 void I422ToRGB24Row_Any_SSSE3(const uint8* src_y,
1280                               const uint8* src_u,
1281                               const uint8* src_v,
1282                               uint8* dst_argb,
1283                               int width);
1284 void I422ToRAWRow_Any_SSSE3(const uint8* src_y,
1285                             const uint8* src_u,
1286                             const uint8* src_v,
1287                             uint8* dst_argb,
1288                             int width);
1289 void YToARGBRow_SSE2(const uint8* src_y,
1290                      uint8* dst_argb,
1291                      int width);
1292 void YToARGBRow_NEON(const uint8* src_y,
1293                      uint8* dst_argb,
1294                      int width);
1295 void YToARGBRow_Any_SSE2(const uint8* src_y,
1296                          uint8* dst_argb,
1297                          int width);
1298 void YToARGBRow_Any_NEON(const uint8* src_y,
1299                          uint8* dst_argb,
1300                          int width);
1301
1302 // ARGB preattenuated alpha blend.
1303 void ARGBBlendRow_SSSE3(const uint8* src_argb, const uint8* src_argb1,
1304                         uint8* dst_argb, int width);
1305 void ARGBBlendRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
1306                        uint8* dst_argb, int width);
1307 void ARGBBlendRow_NEON(const uint8* src_argb, const uint8* src_argb1,
1308                        uint8* dst_argb, int width);
1309 void ARGBBlendRow_C(const uint8* src_argb, const uint8* src_argb1,
1310                     uint8* dst_argb, int width);
1311
1312 // ARGB multiply images. Same API as Blend, but these require
1313 // pointer and width alignment for SSE2.
1314 void ARGBMultiplyRow_C(const uint8* src_argb, const uint8* src_argb1,
1315                        uint8* dst_argb, int width);
1316 void ARGBMultiplyRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
1317                           uint8* dst_argb, int width);
1318 void ARGBMultiplyRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1,
1319                               uint8* dst_argb, int width);
1320 void ARGBMultiplyRow_AVX2(const uint8* src_argb, const uint8* src_argb1,
1321                           uint8* dst_argb, int width);
1322 void ARGBMultiplyRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1,
1323                               uint8* dst_argb, int width);
1324 void ARGBMultiplyRow_NEON(const uint8* src_argb, const uint8* src_argb1,
1325                           uint8* dst_argb, int width);
1326 void ARGBMultiplyRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1,
1327                               uint8* dst_argb, int width);
1328
1329 // ARGB add images.
1330 void ARGBAddRow_C(const uint8* src_argb, const uint8* src_argb1,
1331                   uint8* dst_argb, int width);
1332 void ARGBAddRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
1333                      uint8* dst_argb, int width);
1334 void ARGBAddRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1,
1335                          uint8* dst_argb, int width);
1336 void ARGBAddRow_AVX2(const uint8* src_argb, const uint8* src_argb1,
1337                      uint8* dst_argb, int width);
1338 void ARGBAddRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1,
1339                          uint8* dst_argb, int width);
1340 void ARGBAddRow_NEON(const uint8* src_argb, const uint8* src_argb1,
1341                      uint8* dst_argb, int width);
1342 void ARGBAddRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1,
1343                          uint8* dst_argb, int width);
1344
1345 // ARGB subtract images. Same API as Blend, but these require
1346 // pointer and width alignment for SSE2.
1347 void ARGBSubtractRow_C(const uint8* src_argb, const uint8* src_argb1,
1348                        uint8* dst_argb, int width);
1349 void ARGBSubtractRow_SSE2(const uint8* src_argb, const uint8* src_argb1,
1350                           uint8* dst_argb, int width);
1351 void ARGBSubtractRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1,
1352                               uint8* dst_argb, int width);
1353 void ARGBSubtractRow_AVX2(const uint8* src_argb, const uint8* src_argb1,
1354                           uint8* dst_argb, int width);
1355 void ARGBSubtractRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1,
1356                               uint8* dst_argb, int width);
1357 void ARGBSubtractRow_NEON(const uint8* src_argb, const uint8* src_argb1,
1358                           uint8* dst_argb, int width);
1359 void ARGBSubtractRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1,
1360                               uint8* dst_argb, int width);
1361
1362 void ARGBToRGB24Row_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
1363 void ARGBToRAWRow_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix);
1364 void ARGBToRGB565Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
1365 void ARGBToARGB1555Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
1366 void ARGBToARGB4444Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
1367
1368 void ARGBToRGB24Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
1369 void ARGBToRAWRow_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
1370 void ARGBToRGB565Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
1371 void ARGBToARGB1555Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
1372 void ARGBToARGB4444Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix);
1373
1374 void I444ToARGBRow_Any_NEON(const uint8* src_y,
1375                             const uint8* src_u,
1376                             const uint8* src_v,
1377                             uint8* dst_argb,
1378                             int width);
1379 void I422ToARGBRow_Any_NEON(const uint8* src_y,
1380                             const uint8* src_u,
1381                             const uint8* src_v,
1382                             uint8* dst_argb,
1383                             int width);
1384 void I411ToARGBRow_Any_NEON(const uint8* src_y,
1385                             const uint8* src_u,
1386                             const uint8* src_v,
1387                             uint8* dst_argb,
1388                             int width);
1389 void I422ToBGRARow_Any_NEON(const uint8* src_y,
1390                             const uint8* src_u,
1391                             const uint8* src_v,
1392                             uint8* dst_argb,
1393                             int width);
1394 void I422ToABGRRow_Any_NEON(const uint8* src_y,
1395                             const uint8* src_u,
1396                             const uint8* src_v,
1397                             uint8* dst_argb,
1398                             int width);
1399 void I422ToRGBARow_Any_NEON(const uint8* src_y,
1400                             const uint8* src_u,
1401                             const uint8* src_v,
1402                             uint8* dst_argb,
1403                             int width);
1404 void I422ToRGB24Row_Any_NEON(const uint8* src_y,
1405                              const uint8* src_u,
1406                              const uint8* src_v,
1407                              uint8* dst_argb,
1408                              int width);
1409 void I422ToRAWRow_Any_NEON(const uint8* src_y,
1410                            const uint8* src_u,
1411                            const uint8* src_v,
1412                            uint8* dst_argb,
1413                            int width);
1414 void I422ToARGB4444Row_Any_NEON(const uint8* src_y,
1415                                 const uint8* src_u,
1416                                 const uint8* src_v,
1417                                 uint8* dst_argb,
1418                                 int width);
1419 void I422ToARGB1555Row_Any_NEON(const uint8* src_y,
1420                                 const uint8* src_u,
1421                                 const uint8* src_v,
1422                                 uint8* dst_argb,
1423                                 int width);
1424 void I422ToRGB565Row_Any_NEON(const uint8* src_y,
1425                               const uint8* src_u,
1426                               const uint8* src_v,
1427                               uint8* dst_argb,
1428                               int width);
1429 void NV12ToARGBRow_Any_NEON(const uint8* src_y,
1430                             const uint8* src_uv,
1431                             uint8* dst_argb,
1432                             int width);
1433 void NV21ToARGBRow_Any_NEON(const uint8* src_y,
1434                             const uint8* src_uv,
1435                             uint8* dst_argb,
1436                             int width);
1437 void NV12ToRGB565Row_Any_NEON(const uint8* src_y,
1438                               const uint8* src_uv,
1439                               uint8* dst_argb,
1440                               int width);
1441 void NV21ToRGB565Row_Any_NEON(const uint8* src_y,
1442                               const uint8* src_uv,
1443                               uint8* dst_argb,
1444                               int width);
1445 void YUY2ToARGBRow_Any_NEON(const uint8* src_yuy2,
1446                             uint8* dst_argb,
1447                             int width);
1448 void UYVYToARGBRow_Any_NEON(const uint8* src_uyvy,
1449                             uint8* dst_argb,
1450                             int width);
1451 void I422ToARGBRow_MIPS_DSPR2(const uint8* src_y,
1452                               const uint8* src_u,
1453                               const uint8* src_v,
1454                               uint8* dst_argb,
1455                               int width);
1456 void I422ToBGRARow_MIPS_DSPR2(const uint8* src_y,
1457                               const uint8* src_u,
1458                               const uint8* src_v,
1459                               uint8* dst_argb,
1460                               int width);
1461 void I422ToABGRRow_MIPS_DSPR2(const uint8* src_y,
1462                               const uint8* src_u,
1463                               const uint8* src_v,
1464                               uint8* dst_argb,
1465                               int width);
1466 void I422ToARGBRow_MIPS_DSPR2(const uint8* src_y,
1467                               const uint8* src_u,
1468                               const uint8* src_v,
1469                               uint8* dst_argb,
1470                               int width);
1471 void I422ToBGRARow_MIPS_DSPR2(const uint8* src_y,
1472                               const uint8* src_u,
1473                               const uint8* src_v,
1474                               uint8* dst_argb,
1475                               int width);
1476 void I422ToABGRRow_MIPS_DSPR2(const uint8* src_y,
1477                               const uint8* src_u,
1478                               const uint8* src_v,
1479                               uint8* dst_argb,
1480                               int width);
1481
1482 void YUY2ToYRow_AVX2(const uint8* src_yuy2, uint8* dst_y, int pix);
1483 void YUY2ToUVRow_AVX2(const uint8* src_yuy2, int stride_yuy2,
1484                       uint8* dst_u, uint8* dst_v, int pix);
1485 void YUY2ToUV422Row_AVX2(const uint8* src_yuy2,
1486                          uint8* dst_u, uint8* dst_v, int pix);
1487 void YUY2ToYRow_SSE2(const uint8* src_yuy2, uint8* dst_y, int pix);
1488 void YUY2ToUVRow_SSE2(const uint8* src_yuy2, int stride_yuy2,
1489                       uint8* dst_u, uint8* dst_v, int pix);
1490 void YUY2ToUV422Row_SSE2(const uint8* src_yuy2,
1491                          uint8* dst_u, uint8* dst_v, int pix);
1492 void YUY2ToYRow_Unaligned_SSE2(const uint8* src_yuy2,
1493                                uint8* dst_y, int pix);
1494 void YUY2ToUVRow_Unaligned_SSE2(const uint8* src_yuy2, int stride_yuy2,
1495                                 uint8* dst_u, uint8* dst_v, int pix);
1496 void YUY2ToUV422Row_Unaligned_SSE2(const uint8* src_yuy2,
1497                                    uint8* dst_u, uint8* dst_v, int pix);
1498 void YUY2ToYRow_NEON(const uint8* src_yuy2, uint8* dst_y, int pix);
1499 void YUY2ToUVRow_NEON(const uint8* src_yuy2, int stride_yuy2,
1500                       uint8* dst_u, uint8* dst_v, int pix);
1501 void YUY2ToUV422Row_NEON(const uint8* src_yuy2,
1502                          uint8* dst_u, uint8* dst_v, int pix);
1503 void YUY2ToYRow_C(const uint8* src_yuy2, uint8* dst_y, int pix);
1504 void YUY2ToUVRow_C(const uint8* src_yuy2, int stride_yuy2,
1505                    uint8* dst_u, uint8* dst_v, int pix);
1506 void YUY2ToUV422Row_C(const uint8* src_yuy2,
1507                       uint8* dst_u, uint8* dst_v, int pix);
1508 void YUY2ToYRow_Any_AVX2(const uint8* src_yuy2, uint8* dst_y, int pix);
1509 void YUY2ToUVRow_Any_AVX2(const uint8* src_yuy2, int stride_yuy2,
1510                           uint8* dst_u, uint8* dst_v, int pix);
1511 void YUY2ToUV422Row_Any_AVX2(const uint8* src_yuy2,
1512                              uint8* dst_u, uint8* dst_v, int pix);
1513 void YUY2ToYRow_Any_SSE2(const uint8* src_yuy2, uint8* dst_y, int pix);
1514 void YUY2ToUVRow_Any_SSE2(const uint8* src_yuy2, int stride_yuy2,
1515                           uint8* dst_u, uint8* dst_v, int pix);
1516 void YUY2ToUV422Row_Any_SSE2(const uint8* src_yuy2,
1517                              uint8* dst_u, uint8* dst_v, int pix);
1518 void YUY2ToYRow_Any_NEON(const uint8* src_yuy2, uint8* dst_y, int pix);
1519 void YUY2ToUVRow_Any_NEON(const uint8* src_yuy2, int stride_yuy2,
1520                           uint8* dst_u, uint8* dst_v, int pix);
1521 void YUY2ToUV422Row_Any_NEON(const uint8* src_yuy2,
1522                              uint8* dst_u, uint8* dst_v, int pix);
1523 void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix);
1524 void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy,
1525                       uint8* dst_u, uint8* dst_v, int pix);
1526 void UYVYToUV422Row_AVX2(const uint8* src_uyvy,
1527                          uint8* dst_u, uint8* dst_v, int pix);
1528 void UYVYToYRow_SSE2(const uint8* src_uyvy, uint8* dst_y, int pix);
1529 void UYVYToUVRow_SSE2(const uint8* src_uyvy, int stride_uyvy,
1530                       uint8* dst_u, uint8* dst_v, int pix);
1531 void UYVYToUV422Row_SSE2(const uint8* src_uyvy,
1532                          uint8* dst_u, uint8* dst_v, int pix);
1533 void UYVYToYRow_Unaligned_SSE2(const uint8* src_uyvy,
1534                                uint8* dst_y, int pix);
1535 void UYVYToUVRow_Unaligned_SSE2(const uint8* src_uyvy, int stride_uyvy,
1536                                 uint8* dst_u, uint8* dst_v, int pix);
1537 void UYVYToUV422Row_Unaligned_SSE2(const uint8* src_uyvy,
1538                                    uint8* dst_u, uint8* dst_v, int pix);
1539 void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix);
1540 void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy,
1541                       uint8* dst_u, uint8* dst_v, int pix);
1542 void UYVYToUV422Row_AVX2(const uint8* src_uyvy,
1543                          uint8* dst_u, uint8* dst_v, int pix);
1544 void UYVYToYRow_NEON(const uint8* src_uyvy, uint8* dst_y, int pix);
1545 void UYVYToUVRow_NEON(const uint8* src_uyvy, int stride_uyvy,
1546                       uint8* dst_u, uint8* dst_v, int pix);
1547 void UYVYToUV422Row_NEON(const uint8* src_uyvy,
1548                          uint8* dst_u, uint8* dst_v, int pix);
1549
1550 void UYVYToYRow_C(const uint8* src_uyvy, uint8* dst_y, int pix);
1551 void UYVYToUVRow_C(const uint8* src_uyvy, int stride_uyvy,
1552                    uint8* dst_u, uint8* dst_v, int pix);
1553 void UYVYToUV422Row_C(const uint8* src_uyvy,
1554                       uint8* dst_u, uint8* dst_v, int pix);
1555 void UYVYToYRow_Any_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix);
1556 void UYVYToUVRow_Any_AVX2(const uint8* src_uyvy, int stride_uyvy,
1557                           uint8* dst_u, uint8* dst_v, int pix);
1558 void UYVYToUV422Row_Any_AVX2(const uint8* src_uyvy,
1559                              uint8* dst_u, uint8* dst_v, int pix);
1560 void UYVYToYRow_Any_SSE2(const uint8* src_uyvy, uint8* dst_y, int pix);
1561 void UYVYToUVRow_Any_SSE2(const uint8* src_uyvy, int stride_uyvy,
1562                           uint8* dst_u, uint8* dst_v, int pix);
1563 void UYVYToUV422Row_Any_SSE2(const uint8* src_uyvy,
1564                              uint8* dst_u, uint8* dst_v, int pix);
1565 void UYVYToYRow_Any_NEON(const uint8* src_uyvy, uint8* dst_y, int pix);
1566 void UYVYToUVRow_Any_NEON(const uint8* src_uyvy, int stride_uyvy,
1567                           uint8* dst_u, uint8* dst_v, int pix);
1568 void UYVYToUV422Row_Any_NEON(const uint8* src_uyvy,
1569                              uint8* dst_u, uint8* dst_v, int pix);
1570
1571 void HalfRow_C(const uint8* src_uv, int src_uv_stride,
1572                uint8* dst_uv, int pix);
1573 void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride,
1574                   uint8* dst_uv, int pix);
1575 void HalfRow_AVX2(const uint8* src_uv, int src_uv_stride,
1576                   uint8* dst_uv, int pix);
1577 void HalfRow_NEON(const uint8* src_uv, int src_uv_stride,
1578                   uint8* dst_uv, int pix);
1579
1580 void HalfRow_16_C(const uint16* src_uv, int src_uv_stride,
1581                   uint16* dst_uv, int pix);
1582
1583 void ARGBToBayerRow_C(const uint8* src_argb, uint8* dst_bayer,
1584                       uint32 selector, int pix);
1585 void ARGBToBayerRow_SSSE3(const uint8* src_argb, uint8* dst_bayer,
1586                           uint32 selector, int pix);
1587 void ARGBToBayerRow_NEON(const uint8* src_argb, uint8* dst_bayer,
1588                          uint32 selector, int pix);
1589 void ARGBToBayerRow_Any_SSSE3(const uint8* src_argb, uint8* dst_bayer,
1590                               uint32 selector, int pix);
1591 void ARGBToBayerRow_Any_NEON(const uint8* src_argb, uint8* dst_bayer,
1592                              uint32 selector, int pix);
1593 void ARGBToBayerGGRow_C(const uint8* src_argb, uint8* dst_bayer,
1594                         uint32 /* selector */, int pix);
1595 void ARGBToBayerGGRow_SSE2(const uint8* src_argb, uint8* dst_bayer,
1596                            uint32 /* selector */, int pix);
1597 void ARGBToBayerGGRow_NEON(const uint8* src_argb, uint8* dst_bayer,
1598                            uint32 /* selector */, int pix);
1599 void ARGBToBayerGGRow_Any_SSE2(const uint8* src_argb, uint8* dst_bayer,
1600                                uint32 /* selector */, int pix);
1601 void ARGBToBayerGGRow_Any_NEON(const uint8* src_argb, uint8* dst_bayer,
1602                                uint32 /* selector */, int pix);
1603
1604 void I422ToYUY2Row_C(const uint8* src_y,
1605                      const uint8* src_u,
1606                      const uint8* src_v,
1607                      uint8* dst_yuy2, int width);
1608 void I422ToUYVYRow_C(const uint8* src_y,
1609                      const uint8* src_u,
1610                      const uint8* src_v,
1611                      uint8* dst_uyvy, int width);
1612 void I422ToYUY2Row_SSE2(const uint8* src_y,
1613                         const uint8* src_u,
1614                         const uint8* src_v,
1615                         uint8* dst_yuy2, int width);
1616 void I422ToUYVYRow_SSE2(const uint8* src_y,
1617                         const uint8* src_u,
1618                         const uint8* src_v,
1619                         uint8* dst_uyvy, int width);
1620 void I422ToYUY2Row_Any_SSE2(const uint8* src_y,
1621                             const uint8* src_u,
1622                             const uint8* src_v,
1623                             uint8* dst_yuy2, int width);
1624 void I422ToUYVYRow_Any_SSE2(const uint8* src_y,
1625                             const uint8* src_u,
1626                             const uint8* src_v,
1627                             uint8* dst_uyvy, int width);
1628 void I422ToYUY2Row_NEON(const uint8* src_y,
1629                         const uint8* src_u,
1630                         const uint8* src_v,
1631                         uint8* dst_yuy2, int width);
1632 void I422ToUYVYRow_NEON(const uint8* src_y,
1633                         const uint8* src_u,
1634                         const uint8* src_v,
1635                         uint8* dst_uyvy, int width);
1636 void I422ToYUY2Row_Any_NEON(const uint8* src_y,
1637                             const uint8* src_u,
1638                             const uint8* src_v,
1639                             uint8* dst_yuy2, int width);
1640 void I422ToUYVYRow_Any_NEON(const uint8* src_y,
1641                             const uint8* src_u,
1642                             const uint8* src_v,
1643                             uint8* dst_uyvy, int width);
1644
1645 // Effects related row functions.
1646 void ARGBAttenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width);
1647 void ARGBAttenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
1648 void ARGBAttenuateRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width);
1649 void ARGBAttenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
1650 void ARGBAttenuateRow_NEON(const uint8* src_argb, uint8* dst_argb, int width);
1651 void ARGBAttenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
1652                                int width);
1653 void ARGBAttenuateRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb,
1654                                 int width);
1655 void ARGBAttenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
1656                                int width);
1657 void ARGBAttenuateRow_Any_NEON(const uint8* src_argb, uint8* dst_argb,
1658                                int width);
1659
1660 // Inverse table for unattenuate, shared by C and SSE2.
1661 extern const uint32 fixed_invtbl8[256];
1662 void ARGBUnattenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width);
1663 void ARGBUnattenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
1664 void ARGBUnattenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
1665 void ARGBUnattenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
1666                                  int width);
1667 void ARGBUnattenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
1668                                  int width);
1669
1670 void ARGBGrayRow_C(const uint8* src_argb, uint8* dst_argb, int width);
1671 void ARGBGrayRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width);
1672 void ARGBGrayRow_NEON(const uint8* src_argb, uint8* dst_argb, int width);
1673
1674 void ARGBSepiaRow_C(uint8* dst_argb, int width);
1675 void ARGBSepiaRow_SSSE3(uint8* dst_argb, int width);
1676 void ARGBSepiaRow_NEON(uint8* dst_argb, int width);
1677
1678 void ARGBColorMatrixRow_C(const uint8* src_argb, uint8* dst_argb,
1679                           const int8* matrix_argb, int width);
1680 void ARGBColorMatrixRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
1681                               const int8* matrix_argb, int width);
1682 void ARGBColorMatrixRow_NEON(const uint8* src_argb, uint8* dst_argb,
1683                              const int8* matrix_argb, int width);
1684
1685 void ARGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width);
1686 void ARGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width);
1687
1688 void RGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width);
1689 void RGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width);
1690
1691 void ARGBQuantizeRow_C(uint8* dst_argb, int scale, int interval_size,
1692                        int interval_offset, int width);
1693 void ARGBQuantizeRow_SSE2(uint8* dst_argb, int scale, int interval_size,
1694                           int interval_offset, int width);
1695 void ARGBQuantizeRow_NEON(uint8* dst_argb, int scale, int interval_size,
1696                           int interval_offset, int width);
1697
1698 void ARGBShadeRow_C(const uint8* src_argb, uint8* dst_argb, int width,
1699                     uint32 value);
1700 void ARGBShadeRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width,
1701                        uint32 value);
1702 void ARGBShadeRow_NEON(const uint8* src_argb, uint8* dst_argb, int width,
1703                        uint32 value);
1704
1705 // Used for blur.
1706 void CumulativeSumToAverageRow_SSE2(const int32* topleft, const int32* botleft,
1707                                     int width, int area, uint8* dst, int count);
1708 void ComputeCumulativeSumRow_SSE2(const uint8* row, int32* cumsum,
1709                                   const int32* previous_cumsum, int width);
1710
1711 void CumulativeSumToAverageRow_C(const int32* topleft, const int32* botleft,
1712                                  int width, int area, uint8* dst, int count);
1713 void ComputeCumulativeSumRow_C(const uint8* row, int32* cumsum,
1714                                const int32* previous_cumsum, int width);
1715
1716 LIBYUV_API
1717 void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride,
1718                      uint8* dst_argb, const float* uv_dudv, int width);
1719 LIBYUV_API
1720 void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride,
1721                         uint8* dst_argb, const float* uv_dudv, int width);
1722
1723 // Used for I420Scale, ARGBScale, and ARGBInterpolate.
1724 void InterpolateRow_C(uint8* dst_ptr, const uint8* src_ptr,
1725                       ptrdiff_t src_stride_ptr,
1726                       int width, int source_y_fraction);
1727 void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr,
1728                          ptrdiff_t src_stride_ptr, int width,
1729                          int source_y_fraction);
1730 void InterpolateRow_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
1731                           ptrdiff_t src_stride_ptr, int width,
1732                           int source_y_fraction);
1733 void InterpolateRow_AVX2(uint8* dst_ptr, const uint8* src_ptr,
1734                          ptrdiff_t src_stride_ptr, int width,
1735                          int source_y_fraction);
1736 void InterpolateRow_NEON(uint8* dst_ptr, const uint8* src_ptr,
1737                          ptrdiff_t src_stride_ptr, int width,
1738                          int source_y_fraction);
1739 void InterpolateRows_MIPS_DSPR2(uint8* dst_ptr, const uint8* src_ptr,
1740                                 ptrdiff_t src_stride_ptr, int width,
1741                                 int source_y_fraction);
1742 void InterpolateRow_Unaligned_SSE2(uint8* dst_ptr, const uint8* src_ptr,
1743                                    ptrdiff_t src_stride_ptr, int width,
1744                                    int source_y_fraction);
1745 void InterpolateRow_Unaligned_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
1746                                     ptrdiff_t src_stride_ptr, int width,
1747                                     int source_y_fraction);
1748 void InterpolateRow_Any_NEON(uint8* dst_ptr, const uint8* src_ptr,
1749                              ptrdiff_t src_stride_ptr, int width,
1750                              int source_y_fraction);
1751 void InterpolateRow_Any_SSE2(uint8* dst_ptr, const uint8* src_ptr,
1752                              ptrdiff_t src_stride_ptr, int width,
1753                              int source_y_fraction);
1754 void InterpolateRow_Any_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
1755                               ptrdiff_t src_stride_ptr, int width,
1756                               int source_y_fraction);
1757 void InterpolateRow_Any_AVX2(uint8* dst_ptr, const uint8* src_ptr,
1758                              ptrdiff_t src_stride_ptr, int width,
1759                              int source_y_fraction);
1760 void InterpolateRows_Any_MIPS_DSPR2(uint8* dst_ptr, const uint8* src_ptr,
1761                                     ptrdiff_t src_stride_ptr, int width,
1762                                     int source_y_fraction);
1763
1764 void InterpolateRow_16_C(uint16* dst_ptr, const uint16* src_ptr,
1765                          ptrdiff_t src_stride_ptr,
1766                          int width, int source_y_fraction);
1767
1768 // Sobel images.
1769 void SobelXRow_C(const uint8* src_y0, const uint8* src_y1, const uint8* src_y2,
1770                  uint8* dst_sobelx, int width);
1771 void SobelXRow_SSE2(const uint8* src_y0, const uint8* src_y1,
1772                     const uint8* src_y2, uint8* dst_sobelx, int width);
1773 void SobelXRow_NEON(const uint8* src_y0, const uint8* src_y1,
1774                     const uint8* src_y2, uint8* dst_sobelx, int width);
1775 void SobelYRow_C(const uint8* src_y0, const uint8* src_y1,
1776                  uint8* dst_sobely, int width);
1777 void SobelYRow_SSE2(const uint8* src_y0, const uint8* src_y1,
1778                     uint8* dst_sobely, int width);
1779 void SobelYRow_NEON(const uint8* src_y0, const uint8* src_y1,
1780                     uint8* dst_sobely, int width);
1781 void SobelRow_C(const uint8* src_sobelx, const uint8* src_sobely,
1782                 uint8* dst_argb, int width);
1783 void SobelRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely,
1784                    uint8* dst_argb, int width);
1785 void SobelRow_NEON(const uint8* src_sobelx, const uint8* src_sobely,
1786                    uint8* dst_argb, int width);
1787 void SobelToPlaneRow_C(const uint8* src_sobelx, const uint8* src_sobely,
1788                        uint8* dst_y, int width);
1789 void SobelToPlaneRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely,
1790                           uint8* dst_y, int width);
1791 void SobelToPlaneRow_NEON(const uint8* src_sobelx, const uint8* src_sobely,
1792                           uint8* dst_y, int width);
1793 void SobelXYRow_C(const uint8* src_sobelx, const uint8* src_sobely,
1794                   uint8* dst_argb, int width);
1795 void SobelXYRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely,
1796                      uint8* dst_argb, int width);
1797 void SobelXYRow_NEON(const uint8* src_sobelx, const uint8* src_sobely,
1798                      uint8* dst_argb, int width);
1799
1800 void ARGBPolynomialRow_C(const uint8* src_argb,
1801                          uint8* dst_argb, const float* poly,
1802                          int width);
1803 void ARGBPolynomialRow_SSE2(const uint8* src_argb,
1804                             uint8* dst_argb, const float* poly,
1805                             int width);
1806 void ARGBPolynomialRow_AVX2(const uint8* src_argb,
1807                             uint8* dst_argb, const float* poly,
1808                             int width);
1809
1810 void ARGBLumaColorTableRow_C(const uint8* src_argb, uint8* dst_argb, int width,
1811                              const uint8* luma, uint32 lumacoeff);
1812 void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
1813                                  int width,
1814                                  const uint8* luma, uint32 lumacoeff);
1815
1816 #ifdef __cplusplus
1817 }  // extern "C"
1818 }  // namespace libyuv
1819 #endif
1820
1821 #endif  // INCLUDE_LIBYUV_ROW_H_  NOLINT