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_
12 #define INCLUDE_LIBYUV_ROW_H_
13 
14 #include <stdlib.h>  // For malloc.
15 
16 #include "libyuv/basic_types.h"
17 
18 #ifdef __cplusplus
19 namespace libyuv {
20 extern "C" {
21 #endif
22 
23 #define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a)-1)))
24 
25 #define align_buffer_64(var, size)                                       \
26   uint8* var##_mem = (uint8*)(malloc((size) + 63));         /* NOLINT */ \
27   uint8* var = (uint8*)(((intptr_t)(var##_mem) + 63) & ~63) /* NOLINT */
28 
29 #define free_aligned_buffer_64(var) \
30   free(var##_mem);                  \
31   var = 0
32 
33 #if defined(__pnacl__) || defined(__CLR_VER) || \
34     (defined(__i386__) && !defined(__SSE__) && !defined(__clang__))
35 #define LIBYUV_DISABLE_X86
36 #endif
37 // MemorySanitizer does not support assembly code yet. http://crbug.com/344505
38 #if defined(__has_feature)
39 #if __has_feature(memory_sanitizer)
40 #define LIBYUV_DISABLE_X86
41 #endif
42 #endif
43 // True if compiling for SSSE3 as a requirement.
44 #if defined(__SSSE3__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 3))
45 #define LIBYUV_SSSE3_ONLY
46 #endif
47 
48 #if defined(__native_client__)
49 #define LIBYUV_DISABLE_NEON
50 #endif
51 // clang >= 3.5.0 required for Arm64.
52 #if defined(__clang__) && defined(__aarch64__) && !defined(LIBYUV_DISABLE_NEON)
53 #if (__clang_major__ < 3) || (__clang_major__ == 3 && (__clang_minor__ < 5))
54 #define LIBYUV_DISABLE_NEON
55 #endif  // clang >= 3.5
56 #endif  // __clang__
57 
58 // GCC >= 4.7.0 required for AVX2.
59 #if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))
60 #if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 7))
61 #define GCC_HAS_AVX2 1
62 #endif  // GNUC >= 4.7
63 #endif  // __GNUC__
64 
65 // clang >= 3.4.0 required for AVX2.
66 #if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
67 #if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4))
68 #define CLANG_HAS_AVX2 1
69 #endif  // clang >= 3.4
70 #endif  // __clang__
71 
72 // Visual C 2012 required for AVX2.
73 #if defined(_M_IX86) && !defined(__clang__) && defined(_MSC_VER) && \
74     _MSC_VER >= 1700
75 #define VISUALC_HAS_AVX2 1
76 #endif  // VisualStudio >= 2012
77 
78 // The following are available on all x86 platforms:
79 #if !defined(LIBYUV_DISABLE_X86) && \
80     (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__))
81 // Conversions:
82 #define HAS_ABGRTOUVROW_SSSE3
83 #define HAS_ABGRTOYROW_SSSE3
84 #define HAS_ARGB1555TOARGBROW_SSE2
85 #define HAS_ARGB4444TOARGBROW_SSE2
86 #define HAS_ARGBEXTRACTALPHAROW_SSE2
87 #define HAS_ARGBSETROW_X86
88 #define HAS_ARGBSHUFFLEROW_SSE2
89 #define HAS_ARGBSHUFFLEROW_SSSE3
90 #define HAS_ARGBTOARGB1555ROW_SSE2
91 #define HAS_ARGBTOARGB4444ROW_SSE2
92 #define HAS_ARGBTORAWROW_SSSE3
93 #define HAS_ARGBTORGB24ROW_SSSE3
94 #define HAS_ARGBTORGB565DITHERROW_SSE2
95 #define HAS_ARGBTORGB565ROW_SSE2
96 #define HAS_ARGBTOUV444ROW_SSSE3
97 #define HAS_ARGBTOUVJROW_SSSE3
98 #define HAS_ARGBTOUVROW_SSSE3
99 #define HAS_ARGBTOYJROW_SSSE3
100 #define HAS_ARGBTOYROW_SSSE3
101 #define HAS_BGRATOUVROW_SSSE3
102 #define HAS_BGRATOYROW_SSSE3
103 #define HAS_COPYROW_ERMS
104 #define HAS_COPYROW_SSE2
105 #define HAS_H422TOARGBROW_SSSE3
106 #define HAS_HALFFLOATROW_SSE2
107 #define HAS_I400TOARGBROW_SSE2
108 #define HAS_I422TOARGB1555ROW_SSSE3
109 #define HAS_I422TOARGB4444ROW_SSSE3
110 #define HAS_I422TOARGBROW_SSSE3
111 #define HAS_I422TORGB24ROW_SSSE3
112 #define HAS_I422TORGB565ROW_SSSE3
113 #define HAS_I422TORGBAROW_SSSE3
114 #define HAS_I422TOUYVYROW_SSE2
115 #define HAS_I422TOYUY2ROW_SSE2
116 #define HAS_I444TOARGBROW_SSSE3
117 #define HAS_J400TOARGBROW_SSE2
118 #define HAS_J422TOARGBROW_SSSE3
119 #define HAS_MERGEUVROW_SSE2
120 #define HAS_MIRRORROW_SSSE3
121 #define HAS_MIRRORUVROW_SSSE3
122 #define HAS_NV12TOARGBROW_SSSE3
123 #define HAS_NV12TORGB565ROW_SSSE3
124 #define HAS_NV21TOARGBROW_SSSE3
125 #define HAS_RAWTOARGBROW_SSSE3
126 #define HAS_RAWTORGB24ROW_SSSE3
127 #define HAS_RAWTOYROW_SSSE3
128 #define HAS_RGB24TOARGBROW_SSSE3
129 #define HAS_RGB24TOYROW_SSSE3
130 #define HAS_RGB565TOARGBROW_SSE2
131 #define HAS_RGBATOUVROW_SSSE3
132 #define HAS_RGBATOYROW_SSSE3
133 #define HAS_SETROW_ERMS
134 #define HAS_SETROW_X86
135 #define HAS_SPLITUVROW_SSE2
136 #define HAS_UYVYTOARGBROW_SSSE3
137 #define HAS_UYVYTOUV422ROW_SSE2
138 #define HAS_UYVYTOUVROW_SSE2
139 #define HAS_UYVYTOYROW_SSE2
140 #define HAS_YUY2TOARGBROW_SSSE3
141 #define HAS_YUY2TOUV422ROW_SSE2
142 #define HAS_YUY2TOUVROW_SSE2
143 #define HAS_YUY2TOYROW_SSE2
144 
145 // Effects:
146 #define HAS_ARGBADDROW_SSE2
147 #define HAS_ARGBAFFINEROW_SSE2
148 #define HAS_ARGBATTENUATEROW_SSSE3
149 #define HAS_ARGBBLENDROW_SSSE3
150 #define HAS_ARGBCOLORMATRIXROW_SSSE3
151 #define HAS_ARGBCOLORTABLEROW_X86
152 #define HAS_ARGBCOPYALPHAROW_SSE2
153 #define HAS_ARGBCOPYYTOALPHAROW_SSE2
154 #define HAS_ARGBGRAYROW_SSSE3
155 #define HAS_ARGBLUMACOLORTABLEROW_SSSE3
156 #define HAS_ARGBMIRRORROW_SSE2
157 #define HAS_ARGBMULTIPLYROW_SSE2
158 #define HAS_ARGBPOLYNOMIALROW_SSE2
159 #define HAS_ARGBQUANTIZEROW_SSE2
160 #define HAS_ARGBSEPIAROW_SSSE3
161 #define HAS_ARGBSHADEROW_SSE2
162 #define HAS_ARGBSUBTRACTROW_SSE2
163 #define HAS_ARGBUNATTENUATEROW_SSE2
164 #define HAS_BLENDPLANEROW_SSSE3
165 #define HAS_COMPUTECUMULATIVESUMROW_SSE2
166 #define HAS_CUMULATIVESUMTOAVERAGEROW_SSE2
167 #define HAS_INTERPOLATEROW_SSSE3
168 #define HAS_RGBCOLORTABLEROW_X86
169 #define HAS_SOBELROW_SSE2
170 #define HAS_SOBELTOPLANEROW_SSE2
171 #define HAS_SOBELXROW_SSE2
172 #define HAS_SOBELXYROW_SSE2
173 #define HAS_SOBELYROW_SSE2
174 
175 // The following functions fail on gcc/clang 32 bit with fpic and framepointer.
176 // caveat: clangcl uses row_win.cc which works.
177 #if defined(__x86_64__) || !defined(__pic__) || defined(__clang__) || \
178     defined(_MSC_VER)
179 // TODO(fbarchard): fix build error on android_full_debug=1
180 // https://code.google.com/p/libyuv/issues/detail?id=517
181 #define HAS_I422ALPHATOARGBROW_SSSE3
182 #endif
183 #endif
184 
185 // The following are available on all x86 platforms, but
186 // require VS2012, clang 3.4 or gcc 4.7.
187 // The code supports NaCL but requires a new compiler and validator.
188 #if !defined(LIBYUV_DISABLE_X86) &&                          \
189     (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2) || \
190      defined(GCC_HAS_AVX2))
191 #define HAS_ARGBCOPYALPHAROW_AVX2
192 #define HAS_ARGBCOPYYTOALPHAROW_AVX2
193 #define HAS_ARGBEXTRACTALPHAROW_AVX2
194 #define HAS_ARGBMIRRORROW_AVX2
195 #define HAS_ARGBPOLYNOMIALROW_AVX2
196 #define HAS_ARGBSHUFFLEROW_AVX2
197 #define HAS_ARGBTORGB565DITHERROW_AVX2
198 #define HAS_ARGBTOUVJROW_AVX2
199 #define HAS_ARGBTOUVROW_AVX2
200 #define HAS_ARGBTOYJROW_AVX2
201 #define HAS_ARGBTOYROW_AVX2
202 #define HAS_COPYROW_AVX
203 #define HAS_H422TOARGBROW_AVX2
204 #define HAS_HALFFLOATROW_AVX2
205 //  #define HAS_HALFFLOATROW_F16C  // Enable to test halffloat cast
206 #define HAS_I400TOARGBROW_AVX2
207 #define HAS_I422TOARGB1555ROW_AVX2
208 #define HAS_I422TOARGB4444ROW_AVX2
209 #define HAS_I422TOARGBROW_AVX2
210 #define HAS_I422TORGB24ROW_AVX2
211 #define HAS_I422TORGB565ROW_AVX2
212 #define HAS_I422TORGBAROW_AVX2
213 #define HAS_I444TOARGBROW_AVX2
214 #define HAS_INTERPOLATEROW_AVX2
215 #define HAS_J422TOARGBROW_AVX2
216 #define HAS_MERGEUVROW_AVX2
217 #define HAS_MIRRORROW_AVX2
218 #define HAS_NV12TOARGBROW_AVX2
219 #define HAS_NV12TORGB565ROW_AVX2
220 #define HAS_NV21TOARGBROW_AVX2
221 #define HAS_SPLITUVROW_AVX2
222 #define HAS_UYVYTOARGBROW_AVX2
223 #define HAS_UYVYTOUV422ROW_AVX2
224 #define HAS_UYVYTOUVROW_AVX2
225 #define HAS_UYVYTOYROW_AVX2
226 #define HAS_YUY2TOARGBROW_AVX2
227 #define HAS_YUY2TOUV422ROW_AVX2
228 #define HAS_YUY2TOUVROW_AVX2
229 #define HAS_YUY2TOYROW_AVX2
230 
231 // Effects:
232 #define HAS_ARGBADDROW_AVX2
233 #define HAS_ARGBATTENUATEROW_AVX2
234 #define HAS_ARGBMULTIPLYROW_AVX2
235 #define HAS_ARGBSUBTRACTROW_AVX2
236 #define HAS_ARGBUNATTENUATEROW_AVX2
237 #define HAS_BLENDPLANEROW_AVX2
238 
239 #if defined(__x86_64__) || !defined(__pic__) || defined(__clang__) || \
240     defined(_MSC_VER)
241 // TODO(fbarchard): fix build error on android_full_debug=1
242 // https://code.google.com/p/libyuv/issues/detail?id=517
243 #define HAS_I422ALPHATOARGBROW_AVX2
244 #endif
245 #endif
246 
247 // The following are available for AVX2 Visual C and clangcl 32 bit:
248 // TODO(fbarchard): Port to gcc.
249 #if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \
250     (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2))
251 #define HAS_ARGB1555TOARGBROW_AVX2
252 #define HAS_ARGB4444TOARGBROW_AVX2
253 #define HAS_ARGBTOARGB1555ROW_AVX2
254 #define HAS_ARGBTOARGB4444ROW_AVX2
255 #define HAS_ARGBTORGB565ROW_AVX2
256 #define HAS_J400TOARGBROW_AVX2
257 #define HAS_RGB565TOARGBROW_AVX2
258 #endif
259 
260 // The following are also available on x64 Visual C.
261 #if !defined(LIBYUV_DISABLE_X86) && defined(_MSC_VER) && defined(_M_X64) && \
262     (!defined(__clang__) || defined(__SSSE3__))
263 #define HAS_I422ALPHATOARGBROW_SSSE3
264 #define HAS_I422TOARGBROW_SSSE3
265 #endif
266 
267 // The following are available for gcc/clang x86 platforms:
268 // TODO(fbarchard): Port to Visual C
269 #if !defined(LIBYUV_DISABLE_X86) && \
270     (defined(__x86_64__) || (defined(__i386__) && !defined(_MSC_VER)))
271 #define HAS_MERGERGBROW_SSSE3
272 #define HAS_SPLITRGBROW_SSSE3
273 #endif
274 
275 // The following are available for AVX2 gcc/clang x86 platforms:
276 // TODO(fbarchard): Port to Visual C
277 #if !defined(LIBYUV_DISABLE_X86) &&                                       \
278     (defined(__x86_64__) || (defined(__i386__) && !defined(_MSC_VER))) && \
279     (defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2))
280 #define HAS_MERGEUVROW_16_AVX2
281 #define HAS_MULTIPLYROW_16_AVX2
282 #endif
283 
284 // The following are available on Neon platforms:
285 #if !defined(LIBYUV_DISABLE_NEON) && \
286     (defined(__aarch64__) || defined(__ARM_NEON__) || defined(LIBYUV_NEON))
287 #define HAS_ABGRTOUVROW_NEON
288 #define HAS_ABGRTOYROW_NEON
289 #define HAS_ARGB1555TOARGBROW_NEON
290 #define HAS_ARGB1555TOUVROW_NEON
291 #define HAS_ARGB1555TOYROW_NEON
292 #define HAS_ARGB4444TOARGBROW_NEON
293 #define HAS_ARGB4444TOUVROW_NEON
294 #define HAS_ARGB4444TOYROW_NEON
295 #define HAS_ARGBEXTRACTALPHAROW_NEON
296 #define HAS_ARGBSETROW_NEON
297 #define HAS_ARGBTOARGB1555ROW_NEON
298 #define HAS_ARGBTOARGB4444ROW_NEON
299 #define HAS_ARGBTORAWROW_NEON
300 #define HAS_ARGBTORGB24ROW_NEON
301 #define HAS_ARGBTORGB565DITHERROW_NEON
302 #define HAS_ARGBTORGB565ROW_NEON
303 #define HAS_ARGBTOUV444ROW_NEON
304 #define HAS_ARGBTOUVJROW_NEON
305 #define HAS_ARGBTOUVROW_NEON
306 #define HAS_ARGBTOYJROW_NEON
307 #define HAS_ARGBTOYROW_NEON
308 #define HAS_BGRATOUVROW_NEON
309 #define HAS_BGRATOYROW_NEON
310 #define HAS_COPYROW_NEON
311 #define HAS_HALFFLOATROW_NEON
312 #define HAS_I400TOARGBROW_NEON
313 #define HAS_I422ALPHATOARGBROW_NEON
314 #define HAS_I422TOARGB1555ROW_NEON
315 #define HAS_I422TOARGB4444ROW_NEON
316 #define HAS_I422TOARGBROW_NEON
317 #define HAS_I422TORGB24ROW_NEON
318 #define HAS_I422TORGB565ROW_NEON
319 #define HAS_I422TORGBAROW_NEON
320 #define HAS_I422TOUYVYROW_NEON
321 #define HAS_I422TOYUY2ROW_NEON
322 #define HAS_I444TOARGBROW_NEON
323 #define HAS_J400TOARGBROW_NEON
324 #define HAS_MERGEUVROW_NEON
325 #define HAS_MIRRORROW_NEON
326 #define HAS_MIRRORUVROW_NEON
327 #define HAS_NV12TOARGBROW_NEON
328 #define HAS_NV12TORGB565ROW_NEON
329 #define HAS_NV21TOARGBROW_NEON
330 #define HAS_RAWTOARGBROW_NEON
331 #define HAS_RAWTORGB24ROW_NEON
332 #define HAS_RAWTOUVROW_NEON
333 #define HAS_RAWTOYROW_NEON
334 #define HAS_RGB24TOARGBROW_NEON
335 #define HAS_RGB24TOUVROW_NEON
336 #define HAS_RGB24TOYROW_NEON
337 #define HAS_RGB565TOARGBROW_NEON
338 #define HAS_RGB565TOUVROW_NEON
339 #define HAS_RGB565TOYROW_NEON
340 #define HAS_RGBATOUVROW_NEON
341 #define HAS_RGBATOYROW_NEON
342 #define HAS_SETROW_NEON
343 #define HAS_SPLITRGBROW_NEON
344 #define HAS_SPLITUVROW_NEON
345 #define HAS_UYVYTOARGBROW_NEON
346 #define HAS_UYVYTOUV422ROW_NEON
347 #define HAS_UYVYTOUVROW_NEON
348 #define HAS_UYVYTOYROW_NEON
349 #define HAS_YUY2TOARGBROW_NEON
350 #define HAS_YUY2TOUV422ROW_NEON
351 #define HAS_YUY2TOUVROW_NEON
352 #define HAS_YUY2TOYROW_NEON
353 
354 // Effects:
355 #define HAS_ARGBADDROW_NEON
356 #define HAS_ARGBATTENUATEROW_NEON
357 #define HAS_ARGBBLENDROW_NEON
358 #define HAS_ARGBCOLORMATRIXROW_NEON
359 #define HAS_ARGBGRAYROW_NEON
360 #define HAS_ARGBMIRRORROW_NEON
361 #define HAS_ARGBMULTIPLYROW_NEON
362 #define HAS_ARGBQUANTIZEROW_NEON
363 #define HAS_ARGBSEPIAROW_NEON
364 #define HAS_ARGBSHADEROW_NEON
365 #define HAS_ARGBSHUFFLEROW_NEON
366 #define HAS_ARGBSUBTRACTROW_NEON
367 #define HAS_INTERPOLATEROW_NEON
368 #define HAS_SOBELROW_NEON
369 #define HAS_SOBELTOPLANEROW_NEON
370 #define HAS_SOBELXROW_NEON
371 #define HAS_SOBELXYROW_NEON
372 #define HAS_SOBELYROW_NEON
373 #endif
374 
375 // The following are available on AArch64 platforms:
376 #if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__)
377 #define HAS_SCALESUMSAMPLES_NEON
378 #endif
379 
380 // The following are available on Mips platforms:
381 #if !defined(LIBYUV_DISABLE_DSPR2) && defined(__mips__) && \
382     (_MIPS_SIM == _MIPS_SIM_ABI32) && (__mips_isa_rev < 6)
383 #define HAS_COPYROW_MIPS
384 #if defined(__mips_dsp) && (__mips_dsp_rev >= 2)
385 #define HAS_I422TOARGBROW_DSPR2
386 #define HAS_INTERPOLATEROW_DSPR2
387 #define HAS_MIRRORROW_DSPR2
388 #define HAS_MIRRORUVROW_DSPR2
389 #define HAS_SPLITUVROW_DSPR2
390 #define HAS_RGB24TOARGBROW_DSPR2
391 #define HAS_RAWTOARGBROW_DSPR2
392 #define HAS_RGB565TOARGBROW_DSPR2
393 #define HAS_ARGB1555TOARGBROW_DSPR2
394 #define HAS_ARGB4444TOARGBROW_DSPR2
395 #define HAS_I444TOARGBROW_DSPR2
396 #define HAS_I422TOARGB4444ROW_DSPR2
397 #define HAS_I422TOARGB1555ROW_DSPR2
398 #define HAS_NV12TOARGBROW_DSPR2
399 #define HAS_BGRATOUVROW_DSPR2
400 #define HAS_BGRATOYROW_DSPR2
401 #define HAS_ABGRTOUVROW_DSPR2
402 #define HAS_ARGBTOYROW_DSPR2
403 #define HAS_ABGRTOYROW_DSPR2
404 #define HAS_RGBATOUVROW_DSPR2
405 #define HAS_RGBATOYROW_DSPR2
406 #define HAS_ARGBTOUVROW_DSPR2
407 #endif
408 #endif
409 
410 #if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa)
411 #define HAS_ABGRTOUVROW_MSA
412 #define HAS_ABGRTOYROW_MSA
413 #define HAS_ARGB1555TOARGBROW_MSA
414 #define HAS_ARGB1555TOUVROW_MSA
415 #define HAS_ARGB1555TOYROW_MSA
416 #define HAS_ARGB4444TOARGBROW_MSA
417 #define HAS_ARGBADDROW_MSA
418 #define HAS_ARGBATTENUATEROW_MSA
419 #define HAS_ARGBBLENDROW_MSA
420 #define HAS_ARGBCOLORMATRIXROW_MSA
421 #define HAS_ARGBEXTRACTALPHAROW_MSA
422 #define HAS_ARGBGRAYROW_MSA
423 #define HAS_ARGBMIRRORROW_MSA
424 #define HAS_ARGBMULTIPLYROW_MSA
425 #define HAS_ARGBQUANTIZEROW_MSA
426 #define HAS_ARGBSEPIAROW_MSA
427 #define HAS_ARGBSETROW_MSA
428 #define HAS_ARGBSHADEROW_MSA
429 #define HAS_ARGBSHUFFLEROW_MSA
430 #define HAS_ARGBSUBTRACTROW_MSA
431 #define HAS_ARGBTOARGB1555ROW_MSA
432 #define HAS_ARGBTOARGB4444ROW_MSA
433 #define HAS_ARGBTORAWROW_MSA
434 #define HAS_ARGBTORGB24ROW_MSA
435 #define HAS_ARGBTORGB565DITHERROW_MSA
436 #define HAS_ARGBTORGB565ROW_MSA
437 #define HAS_ARGBTOUV444ROW_MSA
438 #define HAS_ARGBTOUVJROW_MSA
439 #define HAS_ARGBTOUVROW_MSA
440 #define HAS_ARGBTOYJROW_MSA
441 #define HAS_ARGBTOYROW_MSA
442 #define HAS_BGRATOUVROW_MSA
443 #define HAS_BGRATOYROW_MSA
444 #define HAS_HALFFLOATROW_MSA
445 #define HAS_I400TOARGBROW_MSA
446 #define HAS_I422ALPHATOARGBROW_MSA
447 #define HAS_I422TOARGBROW_MSA
448 #define HAS_I422TORGB24ROW_MSA
449 #define HAS_I422TORGBAROW_MSA
450 #define HAS_I422TOUYVYROW_MSA
451 #define HAS_I422TOYUY2ROW_MSA
452 #define HAS_I444TOARGBROW_MSA
453 #define HAS_INTERPOLATEROW_MSA
454 #define HAS_J400TOARGBROW_MSA
455 #define HAS_MERGEUVROW_MSA
456 #define HAS_MIRRORROW_MSA
457 #define HAS_MIRRORUVROW_MSA
458 #define HAS_NV12TOARGBROW_MSA
459 #define HAS_NV12TORGB565ROW_MSA
460 #define HAS_NV21TOARGBROW_MSA
461 #define HAS_RAWTOARGBROW_MSA
462 #define HAS_RAWTORGB24ROW_MSA
463 #define HAS_RAWTOUVROW_MSA
464 #define HAS_RAWTOYROW_MSA
465 #define HAS_RGB24TOARGBROW_MSA
466 #define HAS_RGB24TOUVROW_MSA
467 #define HAS_RGB24TOYROW_MSA
468 #define HAS_RGB565TOARGBROW_MSA
469 #define HAS_RGB565TOUVROW_MSA
470 #define HAS_RGB565TOYROW_MSA
471 #define HAS_RGBATOUVROW_MSA
472 #define HAS_RGBATOYROW_MSA
473 #define HAS_SETROW_MSA
474 #define HAS_SOBELROW_MSA
475 #define HAS_SOBELTOPLANEROW_MSA
476 #define HAS_SOBELXROW_MSA
477 #define HAS_SOBELXYROW_MSA
478 #define HAS_SOBELYROW_MSA
479 #define HAS_SPLITUVROW_MSA
480 #define HAS_UYVYTOARGBROW_MSA
481 #define HAS_UYVYTOUVROW_MSA
482 #define HAS_UYVYTOYROW_MSA
483 #define HAS_YUY2TOARGBROW_MSA
484 #define HAS_YUY2TOUV422ROW_MSA
485 #define HAS_YUY2TOUVROW_MSA
486 #define HAS_YUY2TOYROW_MSA
487 #endif
488 
489 #if defined(_MSC_VER) && !defined(__CLR_VER) && !defined(__clang__)
490 #if defined(VISUALC_HAS_AVX2)
491 #define SIMD_ALIGNED(var) __declspec(align(32)) var
492 #else
493 #define SIMD_ALIGNED(var) __declspec(align(16)) var
494 #endif
495 typedef __declspec(align(16)) int16 vec16[8];
496 typedef __declspec(align(16)) int32 vec32[4];
497 typedef __declspec(align(16)) int8 vec8[16];
498 typedef __declspec(align(16)) uint16 uvec16[8];
499 typedef __declspec(align(16)) uint32 uvec32[4];
500 typedef __declspec(align(16)) uint8 uvec8[16];
501 typedef __declspec(align(32)) int16 lvec16[16];
502 typedef __declspec(align(32)) int32 lvec32[8];
503 typedef __declspec(align(32)) int8 lvec8[32];
504 typedef __declspec(align(32)) uint16 ulvec16[16];
505 typedef __declspec(align(32)) uint32 ulvec32[8];
506 typedef __declspec(align(32)) uint8 ulvec8[32];
507 #elif !defined(__pnacl__) && (defined(__GNUC__) || defined(__clang__))
508 // Caveat GCC 4.2 to 4.7 have a known issue using vectors with const.
509 #if defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2)
510 #define SIMD_ALIGNED(var) var __attribute__((aligned(32)))
511 #else
512 #define SIMD_ALIGNED(var) var __attribute__((aligned(16)))
513 #endif
514 typedef int16 __attribute__((vector_size(16))) vec16;
515 typedef int32 __attribute__((vector_size(16))) vec32;
516 typedef int8 __attribute__((vector_size(16))) vec8;
517 typedef uint16 __attribute__((vector_size(16))) uvec16;
518 typedef uint32 __attribute__((vector_size(16))) uvec32;
519 typedef uint8 __attribute__((vector_size(16))) uvec8;
520 typedef int16 __attribute__((vector_size(32))) lvec16;
521 typedef int32 __attribute__((vector_size(32))) lvec32;
522 typedef int8 __attribute__((vector_size(32))) lvec8;
523 typedef uint16 __attribute__((vector_size(32))) ulvec16;
524 typedef uint32 __attribute__((vector_size(32))) ulvec32;
525 typedef uint8 __attribute__((vector_size(32))) ulvec8;
526 #else
527 #define SIMD_ALIGNED(var) var
528 typedef int16 vec16[8];
529 typedef int32 vec32[4];
530 typedef int8 vec8[16];
531 typedef uint16 uvec16[8];
532 typedef uint32 uvec32[4];
533 typedef uint8 uvec8[16];
534 typedef int16 lvec16[16];
535 typedef int32 lvec32[8];
536 typedef int8 lvec8[32];
537 typedef uint16 ulvec16[16];
538 typedef uint32 ulvec32[8];
539 typedef uint8 ulvec8[32];
540 #endif
541 
542 #if defined(__aarch64__)
543 // This struct is for Arm64 color conversion.
544 struct YuvConstants {
545   uvec16 kUVToRB;
546   uvec16 kUVToRB2;
547   uvec16 kUVToG;
548   uvec16 kUVToG2;
549   vec16 kUVBiasBGR;
550   vec32 kYToRgb;
551 };
552 #elif defined(__arm__)
553 // This struct is for ArmV7 color conversion.
554 struct YuvConstants {
555   uvec8 kUVToRB;
556   uvec8 kUVToG;
557   vec16 kUVBiasBGR;
558   vec32 kYToRgb;
559 };
560 #else
561 // This struct is for Intel color conversion.
562 struct YuvConstants {
563   int8 kUVToB[32];
564   int8 kUVToG[32];
565   int8 kUVToR[32];
566   int16 kUVBiasB[16];
567   int16 kUVBiasG[16];
568   int16 kUVBiasR[16];
569   int16 kYToRgb[16];
570 };
571 
572 // Offsets into YuvConstants structure
573 #define KUVTOB 0
574 #define KUVTOG 32
575 #define KUVTOR 64
576 #define KUVBIASB 96
577 #define KUVBIASG 128
578 #define KUVBIASR 160
579 #define KYTORGB 192
580 #endif
581 
582 // Conversion matrix for YUV to RGB
583 extern const struct YuvConstants SIMD_ALIGNED(kYuvI601Constants);  // BT.601
584 extern const struct YuvConstants SIMD_ALIGNED(kYuvJPEGConstants);  // JPeg
585 extern const struct YuvConstants SIMD_ALIGNED(kYuvH709Constants);  // BT.709
586 
587 // Conversion matrix for YVU to BGR
588 extern const struct YuvConstants SIMD_ALIGNED(kYvuI601Constants);  // BT.601
589 extern const struct YuvConstants SIMD_ALIGNED(kYvuJPEGConstants);  // JPeg
590 extern const struct YuvConstants SIMD_ALIGNED(kYvuH709Constants);  // BT.709
591 
592 #if defined(__APPLE__) || defined(__x86_64__) || defined(__llvm__)
593 #define OMITFP
594 #else
595 #define OMITFP __attribute__((optimize("omit-frame-pointer")))
596 #endif
597 
598 // NaCL macros for GCC x86 and x64.
599 #if defined(__native_client__)
600 #define LABELALIGN ".p2align 5\n"
601 #else
602 #define LABELALIGN
603 #endif
604 #if defined(__native_client__) && defined(__x86_64__)
605 // r14 is used for MEMOP macros.
606 #define NACL_R14 "r14",
607 #define BUNDLELOCK ".bundle_lock\n"
608 #define BUNDLEUNLOCK ".bundle_unlock\n"
609 #define MEMACCESS(base) "%%nacl:(%%r15,%q" #base ")"
610 #define MEMACCESS2(offset, base) "%%nacl:" #offset "(%%r15,%q" #base ")"
611 #define MEMLEA(offset, base) #offset "(%q" #base ")"
612 #define MEMLEA3(offset, index, scale) #offset "(,%q" #index "," #scale ")"
613 #define MEMLEA4(offset, base, index, scale) \
614   #offset "(%q" #base ",%q" #index "," #scale ")"
615 #define MEMMOVESTRING(s, d) "%%nacl:(%q" #s "),%%nacl:(%q" #d "), %%r15"
616 #define MEMSTORESTRING(reg, d) "%%" #reg ",%%nacl:(%q" #d "), %%r15"
617 #define MEMOPREG(opcode, offset, base, index, scale, reg)                 \
618   BUNDLELOCK                                                              \
619   "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" #opcode \
620   " (%%r15,%%r14),%%" #reg "\n" BUNDLEUNLOCK
621 #define MEMOPMEM(opcode, reg, offset, base, index, scale)                 \
622   BUNDLELOCK                                                              \
623   "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" #opcode \
624   " %%" #reg ",(%%r15,%%r14)\n" BUNDLEUNLOCK
625 #define MEMOPARG(opcode, offset, base, index, scale, arg)                 \
626   BUNDLELOCK                                                              \
627   "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" #opcode \
628   " (%%r15,%%r14),%" #arg "\n" BUNDLEUNLOCK
629 #define VMEMOPREG(opcode, offset, base, index, scale, reg1, reg2)         \
630   BUNDLELOCK                                                              \
631   "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" #opcode \
632   " (%%r15,%%r14),%%" #reg1 ",%%" #reg2 "\n" BUNDLEUNLOCK
633 #define VEXTOPMEM(op, sel, reg, offset, base, index, scale)           \
634   BUNDLELOCK                                                          \
635   "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" #op \
636   " $" #sel ",%%" #reg ",(%%r15,%%r14)\n" BUNDLEUNLOCK
637 #else  // defined(__native_client__) && defined(__x86_64__)
638 #define NACL_R14
639 #define BUNDLEALIGN
640 #define MEMACCESS(base) "(%" #base ")"
641 #define MEMACCESS2(offset, base) #offset "(%" #base ")"
642 #define MEMLEA(offset, base) #offset "(%" #base ")"
643 #define MEMLEA3(offset, index, scale) #offset "(,%" #index "," #scale ")"
644 #define MEMLEA4(offset, base, index, scale) \
645   #offset "(%" #base ",%" #index "," #scale ")"
646 #define MEMMOVESTRING(s, d)
647 #define MEMSTORESTRING(reg, d)
648 #define MEMOPREG(opcode, offset, base, index, scale, reg) \
649   #opcode " " #offset "(%" #base ",%" #index "," #scale "),%%" #reg "\n"
650 #define MEMOPMEM(opcode, reg, offset, base, index, scale) \
651   #opcode " %%" #reg "," #offset "(%" #base ",%" #index "," #scale ")\n"
652 #define MEMOPARG(opcode, offset, base, index, scale, arg) \
653   #opcode " " #offset "(%" #base ",%" #index "," #scale "),%" #arg "\n"
654 #define VMEMOPREG(opcode, offset, base, index, scale, reg1, reg2)    \
655   #opcode " " #offset "(%" #base ",%" #index "," #scale "),%%" #reg1 \
656           ",%%" #reg2 "\n"
657 #define VEXTOPMEM(op, sel, reg, offset, base, index, scale) \
658   #op " $" #sel ",%%" #reg "," #offset "(%" #base ",%" #index "," #scale ")\n"
659 #endif  // defined(__native_client__) && defined(__x86_64__)
660 
661 // Intel Code Analizer markers.  Insert IACA_START IACA_END around code to be
662 // measured and then run with iaca -64 libyuv_unittest.
663 // IACA_ASM_START amd IACA_ASM_END are equivalents that can be used within
664 // inline assembly blocks.
665 // example of iaca:
666 // ~/iaca-lin64/bin/iaca.sh -64 -analysis LATENCY out/Release/libyuv_unittest
667 
668 #if defined(__x86_64__) || defined(__i386__)
669 
670 #define IACA_ASM_START  \
671   ".byte 0x0F, 0x0B\n"  \
672   " movl $111, %%ebx\n" \
673   ".byte 0x64, 0x67, 0x90\n"
674 
675 #define IACA_ASM_END         \
676   " movl $222, %%ebx\n"      \
677   ".byte 0x64, 0x67, 0x90\n" \
678   ".byte 0x0F, 0x0B\n"
679 
680 #define IACA_SSC_MARK(MARK_ID)                        \
681   __asm__ __volatile__("\n\t  movl $" #MARK_ID        \
682                        ", %%ebx"                      \
683                        "\n\t  .byte 0x64, 0x67, 0x90" \
684                        :                              \
685                        :                              \
686                        : "memory");
687 
688 #define IACA_UD_BYTES __asm__ __volatile__("\n\t .byte 0x0F, 0x0B");
689 
690 #else /* Visual C */
691 #define IACA_UD_BYTES \
692   { __asm _emit 0x0F __asm _emit 0x0B }
693 
694 #define IACA_SSC_MARK(x) \
695   { __asm mov ebx, x __asm _emit 0x64 __asm _emit 0x67 __asm _emit 0x90 }
696 
697 #define IACA_VC64_START __writegsbyte(111, 111);
698 #define IACA_VC64_END __writegsbyte(222, 222);
699 #endif
700 
701 #define IACA_START     \
702   {                    \
703     IACA_UD_BYTES      \
704     IACA_SSC_MARK(111) \
705   }
706 #define IACA_END       \
707   {                    \
708     IACA_SSC_MARK(222) \
709     IACA_UD_BYTES      \
710   }
711 
712 void I444ToARGBRow_NEON(const uint8* src_y,
713                         const uint8* src_u,
714                         const uint8* src_v,
715                         uint8* dst_argb,
716                         const struct YuvConstants* yuvconstants,
717                         int width);
718 void I422ToARGBRow_NEON(const uint8* src_y,
719                         const uint8* src_u,
720                         const uint8* src_v,
721                         uint8* dst_argb,
722                         const struct YuvConstants* yuvconstants,
723                         int width);
724 void I422AlphaToARGBRow_NEON(const uint8* y_buf,
725                              const uint8* u_buf,
726                              const uint8* v_buf,
727                              const uint8* a_buf,
728                              uint8* dst_argb,
729                              const struct YuvConstants* yuvconstants,
730                              int width);
731 void I422ToARGBRow_NEON(const uint8* src_y,
732                         const uint8* src_u,
733                         const uint8* src_v,
734                         uint8* dst_argb,
735                         const struct YuvConstants* yuvconstants,
736                         int width);
737 void I422ToRGBARow_NEON(const uint8* src_y,
738                         const uint8* src_u,
739                         const uint8* src_v,
740                         uint8* dst_rgba,
741                         const struct YuvConstants* yuvconstants,
742                         int width);
743 void I422ToRGB24Row_NEON(const uint8* src_y,
744                          const uint8* src_u,
745                          const uint8* src_v,
746                          uint8* dst_rgb24,
747                          const struct YuvConstants* yuvconstants,
748                          int width);
749 void I422ToRGB565Row_NEON(const uint8* src_y,
750                           const uint8* src_u,
751                           const uint8* src_v,
752                           uint8* dst_rgb565,
753                           const struct YuvConstants* yuvconstants,
754                           int width);
755 void I422ToARGB1555Row_NEON(const uint8* src_y,
756                             const uint8* src_u,
757                             const uint8* src_v,
758                             uint8* dst_argb1555,
759                             const struct YuvConstants* yuvconstants,
760                             int width);
761 void I422ToARGB4444Row_NEON(const uint8* src_y,
762                             const uint8* src_u,
763                             const uint8* src_v,
764                             uint8* dst_argb4444,
765                             const struct YuvConstants* yuvconstants,
766                             int width);
767 void NV12ToARGBRow_NEON(const uint8* src_y,
768                         const uint8* src_uv,
769                         uint8* dst_argb,
770                         const struct YuvConstants* yuvconstants,
771                         int width);
772 void NV12ToRGB565Row_NEON(const uint8* src_y,
773                           const uint8* src_uv,
774                           uint8* dst_rgb565,
775                           const struct YuvConstants* yuvconstants,
776                           int width);
777 void NV21ToARGBRow_NEON(const uint8* src_y,
778                         const uint8* src_vu,
779                         uint8* dst_argb,
780                         const struct YuvConstants* yuvconstants,
781                         int width);
782 void YUY2ToARGBRow_NEON(const uint8* src_yuy2,
783                         uint8* dst_argb,
784                         const struct YuvConstants* yuvconstants,
785                         int width);
786 void UYVYToARGBRow_NEON(const uint8* src_uyvy,
787                         uint8* dst_argb,
788                         const struct YuvConstants* yuvconstants,
789                         int width);
790 void I444ToARGBRow_MSA(const uint8* src_y,
791                        const uint8* src_u,
792                        const uint8* src_v,
793                        uint8* dst_argb,
794                        const struct YuvConstants* yuvconstants,
795                        int width);
796 void I444ToARGBRow_DSPR2(const uint8* src_y,
797                          const uint8* src_u,
798                          const uint8* src_v,
799                          uint8* dst_argb,
800                          const struct YuvConstants* yuvconstants,
801                          int width);
802 void I422ToARGB4444Row_DSPR2(const uint8* src_y,
803                              const uint8* src_u,
804                              const uint8* src_v,
805                              uint8* dst_argb4444,
806                              const struct YuvConstants* yuvconstants,
807                              int width);
808 void I422ToARGB1555Row_DSPR2(const uint8* src_y,
809                              const uint8* src_u,
810                              const uint8* src_v,
811                              uint8* dst_argb1555,
812                              const struct YuvConstants* yuvconstants,
813                              int width);
814 void NV12ToARGBRow_DSPR2(const uint8* src_y,
815                          const uint8* src_uv,
816                          uint8* dst_argb,
817                          const struct YuvConstants* yuvconstants,
818                          int width);
819 
820 void I422ToARGBRow_MSA(const uint8* src_y,
821                        const uint8* src_u,
822                        const uint8* src_v,
823                        uint8* dst_argb,
824                        const struct YuvConstants* yuvconstants,
825                        int width);
826 void I422ToRGBARow_MSA(const uint8* src_y,
827                        const uint8* src_u,
828                        const uint8* src_v,
829                        uint8* dst_rgba,
830                        const struct YuvConstants* yuvconstants,
831                        int width);
832 void I422AlphaToARGBRow_MSA(const uint8* y_buf,
833                             const uint8* u_buf,
834                             const uint8* v_buf,
835                             const uint8* a_buf,
836                             uint8* dst_argb,
837                             const struct YuvConstants* yuvconstants,
838                             int width);
839 void I422ToRGB24Row_MSA(const uint8* src_y,
840                         const uint8* src_u,
841                         const uint8* src_v,
842                         uint8* dst_rgb24,
843                         const struct YuvConstants* yuvconstants,
844                         int width);
845 void I422ToRGB565Row_MSA(const uint8* src_y,
846                          const uint8* src_u,
847                          const uint8* src_v,
848                          uint8* dst_rgb565,
849                          const struct YuvConstants* yuvconstants,
850                          int width);
851 void I422ToARGB4444Row_MSA(const uint8* src_y,
852                            const uint8* src_u,
853                            const uint8* src_v,
854                            uint8* dst_argb4444,
855                            const struct YuvConstants* yuvconstants,
856                            int width);
857 void I422ToARGB1555Row_MSA(const uint8* src_y,
858                            const uint8* src_u,
859                            const uint8* src_v,
860                            uint8* dst_argb1555,
861                            const struct YuvConstants* yuvconstants,
862                            int width);
863 void NV12ToARGBRow_MSA(const uint8* src_y,
864                        const uint8* src_uv,
865                        uint8* dst_argb,
866                        const struct YuvConstants* yuvconstants,
867                        int width);
868 void NV12ToRGB565Row_MSA(const uint8* src_y,
869                          const uint8* src_uv,
870                          uint8* dst_rgb565,
871                          const struct YuvConstants* yuvconstants,
872                          int width);
873 void NV21ToARGBRow_MSA(const uint8* src_y,
874                        const uint8* src_vu,
875                        uint8* dst_argb,
876                        const struct YuvConstants* yuvconstants,
877                        int width);
878 void YUY2ToARGBRow_MSA(const uint8* src_yuy2,
879                        uint8* dst_argb,
880                        const struct YuvConstants* yuvconstants,
881                        int width);
882 void UYVYToARGBRow_MSA(const uint8* src_uyvy,
883                        uint8* dst_argb,
884                        const struct YuvConstants* yuvconstants,
885                        int width);
886 
887 void ARGBToYRow_AVX2(const uint8* src_argb, uint8* dst_y, int width);
888 void ARGBToYRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int width);
889 void ARGBToYRow_SSSE3(const uint8* src_argb, uint8* dst_y, int width);
890 void ARGBToYJRow_AVX2(const uint8* src_argb, uint8* dst_y, int width);
891 void ARGBToYJRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int width);
892 void ARGBToYJRow_SSSE3(const uint8* src_argb, uint8* dst_y, int width);
893 void BGRAToYRow_SSSE3(const uint8* src_bgra, uint8* dst_y, int width);
894 void ABGRToYRow_SSSE3(const uint8* src_abgr, uint8* dst_y, int width);
895 void RGBAToYRow_SSSE3(const uint8* src_rgba, uint8* dst_y, int width);
896 void RGB24ToYRow_SSSE3(const uint8* src_rgb24, uint8* dst_y, int width);
897 void RAWToYRow_SSSE3(const uint8* src_raw, uint8* dst_y, int width);
898 void ARGBToYRow_NEON(const uint8* src_argb, uint8* dst_y, int width);
899 void ARGBToYJRow_NEON(const uint8* src_argb, uint8* dst_y, int width);
900 void ARGBToYRow_MSA(const uint8* src_argb, uint8* dst_y, int width);
901 void ARGBToYJRow_MSA(const uint8* src_argb, uint8* dst_y, int width);
902 void ARGBToUV444Row_NEON(const uint8* src_argb,
903                          uint8* dst_u,
904                          uint8* dst_v,
905                          int width);
906 void ARGBToUVRow_NEON(const uint8* src_argb,
907                       int src_stride_argb,
908                       uint8* dst_u,
909                       uint8* dst_v,
910                       int width);
911 void ARGBToUV444Row_MSA(const uint8* src_argb,
912                         uint8* dst_u,
913                         uint8* dst_v,
914                         int width);
915 void ARGBToUVRow_MSA(const uint8* src_argb,
916                      int src_stride_argb,
917                      uint8* dst_u,
918                      uint8* dst_v,
919                      int width);
920 void ARGBToUVJRow_NEON(const uint8* src_argb,
921                        int src_stride_argb,
922                        uint8* dst_u,
923                        uint8* dst_v,
924                        int width);
925 void BGRAToUVRow_NEON(const uint8* src_bgra,
926                       int src_stride_bgra,
927                       uint8* dst_u,
928                       uint8* dst_v,
929                       int width);
930 void ABGRToUVRow_NEON(const uint8* src_abgr,
931                       int src_stride_abgr,
932                       uint8* dst_u,
933                       uint8* dst_v,
934                       int width);
935 void RGBAToUVRow_NEON(const uint8* src_rgba,
936                       int src_stride_rgba,
937                       uint8* dst_u,
938                       uint8* dst_v,
939                       int width);
940 void RGB24ToUVRow_NEON(const uint8* src_rgb24,
941                        int src_stride_rgb24,
942                        uint8* dst_u,
943                        uint8* dst_v,
944                        int width);
945 void RAWToUVRow_NEON(const uint8* src_raw,
946                      int src_stride_raw,
947                      uint8* dst_u,
948                      uint8* dst_v,
949                      int width);
950 void RGB565ToUVRow_NEON(const uint8* src_rgb565,
951                         int src_stride_rgb565,
952                         uint8* dst_u,
953                         uint8* dst_v,
954                         int width);
955 void ARGB1555ToUVRow_NEON(const uint8* src_argb1555,
956                           int src_stride_argb1555,
957                           uint8* dst_u,
958                           uint8* dst_v,
959                           int width);
960 void ARGB4444ToUVRow_NEON(const uint8* src_argb4444,
961                           int src_stride_argb4444,
962                           uint8* dst_u,
963                           uint8* dst_v,
964                           int width);
965 void ARGBToUVJRow_MSA(const uint8* src_argb,
966                       int src_stride_argb,
967                       uint8* dst_u,
968                       uint8* dst_v,
969                       int width);
970 void BGRAToUVRow_MSA(const uint8* src_bgra,
971                      int src_stride_bgra,
972                      uint8* dst_u,
973                      uint8* dst_v,
974                      int width);
975 void ABGRToUVRow_MSA(const uint8* src_abgr,
976                      int src_stride_abgr,
977                      uint8* dst_u,
978                      uint8* dst_v,
979                      int width);
980 void RGBAToUVRow_MSA(const uint8* src_rgba,
981                      int src_stride_rgba,
982                      uint8* dst_u,
983                      uint8* dst_v,
984                      int width);
985 void RGB24ToUVRow_MSA(const uint8* src_rgb24,
986                       int src_stride_rgb24,
987                       uint8* dst_u,
988                       uint8* dst_v,
989                       int width);
990 void RAWToUVRow_MSA(const uint8* src_raw,
991                     int src_stride_raw,
992                     uint8* dst_u,
993                     uint8* dst_v,
994                     int width);
995 void RGB565ToUVRow_MSA(const uint8* src_rgb565,
996                        int src_stride_rgb565,
997                        uint8* dst_u,
998                        uint8* dst_v,
999                        int width);
1000 void ARGB1555ToUVRow_MSA(const uint8* src_argb1555,
1001                          int src_stride_argb1555,
1002                          uint8* dst_u,
1003                          uint8* dst_v,
1004                          int width);
1005 void BGRAToYRow_NEON(const uint8* src_bgra, uint8* dst_y, int width);
1006 void ABGRToYRow_NEON(const uint8* src_abgr, uint8* dst_y, int width);
1007 void RGBAToYRow_NEON(const uint8* src_rgba, uint8* dst_y, int width);
1008 void RGB24ToYRow_NEON(const uint8* src_rgb24, uint8* dst_y, int width);
1009 void RAWToYRow_NEON(const uint8* src_raw, uint8* dst_y, int width);
1010 void RGB565ToYRow_NEON(const uint8* src_rgb565, uint8* dst_y, int width);
1011 void ARGB1555ToYRow_NEON(const uint8* src_argb1555, uint8* dst_y, int width);
1012 void ARGB4444ToYRow_NEON(const uint8* src_argb4444, uint8* dst_y, int width);
1013 void BGRAToYRow_MSA(const uint8* src_bgra, uint8* dst_y, int width);
1014 void ABGRToYRow_MSA(const uint8* src_abgr, uint8* dst_y, int width);
1015 void RGBAToYRow_MSA(const uint8* src_rgba, uint8* dst_y, int width);
1016 void RGB24ToYRow_MSA(const uint8* src_rgb24, uint8* dst_y, int width);
1017 void RAWToYRow_MSA(const uint8* src_raw, uint8* dst_y, int width);
1018 void RGB565ToYRow_MSA(const uint8* src_rgb565, uint8* dst_y, int width);
1019 void ARGB1555ToYRow_MSA(const uint8* src_argb1555, uint8* dst_y, int width);
1020 void BGRAToUVRow_DSPR2(const uint8* src_bgra,
1021                        int src_stride_bgra,
1022                        uint8* dst_u,
1023                        uint8* dst_v,
1024                        int width);
1025 void BGRAToYRow_DSPR2(const uint8* src_bgra, uint8* dst_y, int width);
1026 void ABGRToUVRow_DSPR2(const uint8* src_abgr,
1027                        int src_stride_abgr,
1028                        uint8* dst_u,
1029                        uint8* dst_v,
1030                        int width);
1031 void ARGBToYRow_DSPR2(const uint8* src_argb, uint8* dst_y, int width);
1032 void ABGRToYRow_DSPR2(const uint8* src_abgr, uint8* dst_y, int width);
1033 void RGBAToUVRow_DSPR2(const uint8* src_rgba,
1034                        int src_stride_rgba,
1035                        uint8* dst_u,
1036                        uint8* dst_v,
1037                        int width);
1038 void RGBAToYRow_DSPR2(const uint8* src_rgba, uint8* dst_y, int width);
1039 void ARGBToUVRow_DSPR2(const uint8* src_argb,
1040                        int src_stride_argb,
1041                        uint8* dst_u,
1042                        uint8* dst_v,
1043                        int width);
1044 void ARGBToYRow_C(const uint8* src_argb, uint8* dst_y, int width);
1045 void ARGBToYJRow_C(const uint8* src_argb, uint8* dst_y, int width);
1046 void BGRAToYRow_C(const uint8* src_bgra, uint8* dst_y, int width);
1047 void ABGRToYRow_C(const uint8* src_abgr, uint8* dst_y, int width);
1048 void RGBAToYRow_C(const uint8* src_rgba, uint8* dst_y, int width);
1049 void RGB24ToYRow_C(const uint8* src_rgb24, uint8* dst_y, int width);
1050 void RAWToYRow_C(const uint8* src_raw, uint8* dst_y, int width);
1051 void RGB565ToYRow_C(const uint8* src_rgb565, uint8* dst_y, int width);
1052 void ARGB1555ToYRow_C(const uint8* src_argb1555, uint8* dst_y, int width);
1053 void ARGB4444ToYRow_C(const uint8* src_argb4444, uint8* dst_y, int width);
1054 void ARGBToYRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int width);
1055 void ARGBToYJRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int width);
1056 void BGRAToYRow_Any_SSSE3(const uint8* src_bgra, uint8* dst_y, int width);
1057 void ABGRToYRow_Any_SSSE3(const uint8* src_abgr, uint8* dst_y, int width);
1058 void RGBAToYRow_Any_SSSE3(const uint8* src_rgba, uint8* dst_y, int width);
1059 void RGB24ToYRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_y, int width);
1060 void RAWToYRow_Any_SSSE3(const uint8* src_raw, uint8* dst_y, int width);
1061 void ARGBToYRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int width);
1062 void ARGBToYJRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int width);
1063 void BGRAToYRow_Any_NEON(const uint8* src_bgra, uint8* dst_y, int width);
1064 void ABGRToYRow_Any_NEON(const uint8* src_abgr, uint8* dst_y, int width);
1065 void RGBAToYRow_Any_NEON(const uint8* src_rgba, uint8* dst_y, int width);
1066 void RGB24ToYRow_Any_NEON(const uint8* src_rgb24, uint8* dst_y, int width);
1067 void RAWToYRow_Any_NEON(const uint8* src_raw, uint8* dst_y, int width);
1068 void RGB565ToYRow_Any_NEON(const uint8* src_rgb565, uint8* dst_y, int width);
1069 void ARGB1555ToYRow_Any_NEON(const uint8* src_argb1555,
1070                              uint8* dst_y,
1071                              int width);
1072 void BGRAToYRow_Any_DSPR2(const uint8* src_bgra, uint8* dst_y, int width);
1073 void ARGBToYRow_Any_DSPR2(const uint8* src_argb, uint8* dst_y, int width);
1074 void ABGRToYRow_Any_DSPR2(const uint8* src_abgr, uint8* dst_y, int width);
1075 void RGBAToYRow_Any_DSPR2(const uint8* src_rgba, uint8* dst_y, int width);
1076 void ARGB4444ToYRow_Any_NEON(const uint8* src_argb4444,
1077                              uint8* dst_y,
1078                              int width);
1079 void BGRAToYRow_Any_MSA(const uint8* src_bgra, uint8* dst_y, int width);
1080 void ABGRToYRow_Any_MSA(const uint8* src_abgr, uint8* dst_y, int width);
1081 void RGBAToYRow_Any_MSA(const uint8* src_rgba, uint8* dst_y, int width);
1082 void ARGBToYJRow_Any_MSA(const uint8* src_argb, uint8* dst_y, int width);
1083 void ARGBToYRow_Any_MSA(const uint8* src_argb, uint8* dst_y, int width);
1084 void RGB24ToYRow_Any_MSA(const uint8* src_rgb24, uint8* dst_y, int width);
1085 void RAWToYRow_Any_MSA(const uint8* src_raw, uint8* dst_y, int width);
1086 void RGB565ToYRow_Any_MSA(const uint8* src_rgb565, uint8* dst_y, int width);
1087 void ARGB1555ToYRow_Any_MSA(const uint8* src_argb1555, uint8* dst_y, int width);
1088 
1089 void ARGBToUVRow_AVX2(const uint8* src_argb,
1090                       int src_stride_argb,
1091                       uint8* dst_u,
1092                       uint8* dst_v,
1093                       int width);
1094 void ARGBToUVJRow_AVX2(const uint8* src_argb,
1095                        int src_stride_argb,
1096                        uint8* dst_u,
1097                        uint8* dst_v,
1098                        int width);
1099 void ARGBToUVRow_SSSE3(const uint8* src_argb,
1100                        int src_stride_argb,
1101                        uint8* dst_u,
1102                        uint8* dst_v,
1103                        int width);
1104 void ARGBToUVJRow_SSSE3(const uint8* src_argb,
1105                         int src_stride_argb,
1106                         uint8* dst_u,
1107                         uint8* dst_v,
1108                         int width);
1109 void BGRAToUVRow_SSSE3(const uint8* src_bgra,
1110                        int src_stride_bgra,
1111                        uint8* dst_u,
1112                        uint8* dst_v,
1113                        int width);
1114 void ABGRToUVRow_SSSE3(const uint8* src_abgr,
1115                        int src_stride_abgr,
1116                        uint8* dst_u,
1117                        uint8* dst_v,
1118                        int width);
1119 void RGBAToUVRow_SSSE3(const uint8* src_rgba,
1120                        int src_stride_rgba,
1121                        uint8* dst_u,
1122                        uint8* dst_v,
1123                        int width);
1124 void ARGBToUVRow_Any_AVX2(const uint8* src_argb,
1125                           int src_stride_argb,
1126                           uint8* dst_u,
1127                           uint8* dst_v,
1128                           int width);
1129 void ARGBToUVJRow_Any_AVX2(const uint8* src_argb,
1130                            int src_stride_argb,
1131                            uint8* dst_u,
1132                            uint8* dst_v,
1133                            int width);
1134 void ARGBToUVRow_Any_SSSE3(const uint8* src_argb,
1135                            int src_stride_argb,
1136                            uint8* dst_u,
1137                            uint8* dst_v,
1138                            int width);
1139 void ARGBToUVJRow_Any_SSSE3(const uint8* src_argb,
1140                             int src_stride_argb,
1141                             uint8* dst_u,
1142                             uint8* dst_v,
1143                             int width);
1144 void BGRAToUVRow_Any_SSSE3(const uint8* src_bgra,
1145                            int src_stride_bgra,
1146                            uint8* dst_u,
1147                            uint8* dst_v,
1148                            int width);
1149 void ABGRToUVRow_Any_SSSE3(const uint8* src_abgr,
1150                            int src_stride_abgr,
1151                            uint8* dst_u,
1152                            uint8* dst_v,
1153                            int width);
1154 void RGBAToUVRow_Any_SSSE3(const uint8* src_rgba,
1155                            int src_stride_rgba,
1156                            uint8* dst_u,
1157                            uint8* dst_v,
1158                            int width);
1159 void ARGBToUV444Row_Any_NEON(const uint8* src_argb,
1160                              uint8* dst_u,
1161                              uint8* dst_v,
1162                              int width);
1163 void ARGBToUVRow_Any_NEON(const uint8* src_argb,
1164                           int src_stride_argb,
1165                           uint8* dst_u,
1166                           uint8* dst_v,
1167                           int width);
1168 void ARGBToUV444Row_Any_MSA(const uint8* src_argb,
1169                             uint8* dst_u,
1170                             uint8* dst_v,
1171                             int width);
1172 void ARGBToUVRow_Any_MSA(const uint8* src_argb,
1173                          int src_stride_argb,
1174                          uint8* dst_u,
1175                          uint8* dst_v,
1176                          int width);
1177 void ARGBToUVJRow_Any_NEON(const uint8* src_argb,
1178                            int src_stride_argb,
1179                            uint8* dst_u,
1180                            uint8* dst_v,
1181                            int width);
1182 void BGRAToUVRow_Any_NEON(const uint8* src_bgra,
1183                           int src_stride_bgra,
1184                           uint8* dst_u,
1185                           uint8* dst_v,
1186                           int width);
1187 void ABGRToUVRow_Any_NEON(const uint8* src_abgr,
1188                           int src_stride_abgr,
1189                           uint8* dst_u,
1190                           uint8* dst_v,
1191                           int width);
1192 void RGBAToUVRow_Any_NEON(const uint8* src_rgba,
1193                           int src_stride_rgba,
1194                           uint8* dst_u,
1195                           uint8* dst_v,
1196                           int width);
1197 void RGB24ToUVRow_Any_NEON(const uint8* src_rgb24,
1198                            int src_stride_rgb24,
1199                            uint8* dst_u,
1200                            uint8* dst_v,
1201                            int width);
1202 void RAWToUVRow_Any_NEON(const uint8* src_raw,
1203                          int src_stride_raw,
1204                          uint8* dst_u,
1205                          uint8* dst_v,
1206                          int width);
1207 void RGB565ToUVRow_Any_NEON(const uint8* src_rgb565,
1208                             int src_stride_rgb565,
1209                             uint8* dst_u,
1210                             uint8* dst_v,
1211                             int width);
1212 void ARGB1555ToUVRow_Any_NEON(const uint8* src_argb1555,
1213                               int src_stride_argb1555,
1214                               uint8* dst_u,
1215                               uint8* dst_v,
1216                               int width);
1217 void ARGB4444ToUVRow_Any_NEON(const uint8* src_argb4444,
1218                               int src_stride_argb4444,
1219                               uint8* dst_u,
1220                               uint8* dst_v,
1221                               int width);
1222 void ARGBToUVJRow_Any_MSA(const uint8* src_argb,
1223                           int src_stride_argb,
1224                           uint8* dst_u,
1225                           uint8* dst_v,
1226                           int width);
1227 void BGRAToUVRow_Any_MSA(const uint8* src_bgra,
1228                          int src_stride_bgra,
1229                          uint8* dst_u,
1230                          uint8* dst_v,
1231                          int width);
1232 void ABGRToUVRow_Any_MSA(const uint8* src_abgr,
1233                          int src_stride_abgr,
1234                          uint8* dst_u,
1235                          uint8* dst_v,
1236                          int width);
1237 void RGBAToUVRow_Any_MSA(const uint8* src_rgba,
1238                          int src_stride_rgba,
1239                          uint8* dst_u,
1240                          uint8* dst_v,
1241                          int width);
1242 void RGB24ToUVRow_Any_MSA(const uint8* src_rgb24,
1243                           int src_stride_rgb24,
1244                           uint8* dst_u,
1245                           uint8* dst_v,
1246                           int width);
1247 void RAWToUVRow_Any_MSA(const uint8* src_raw,
1248                         int src_stride_raw,
1249                         uint8* dst_u,
1250                         uint8* dst_v,
1251                         int width);
1252 void RGB565ToUVRow_Any_MSA(const uint8* src_rgb565,
1253                            int src_stride_rgb565,
1254                            uint8* dst_u,
1255                            uint8* dst_v,
1256                            int width);
1257 void ARGB1555ToUVRow_Any_MSA(const uint8* src_argb1555,
1258                              int src_stride_argb1555,
1259                              uint8* dst_u,
1260                              uint8* dst_v,
1261                              int width);
1262 void BGRAToUVRow_Any_DSPR2(const uint8* src_bgra,
1263                            int src_stride_bgra,
1264                            uint8* dst_u,
1265                            uint8* dst_v,
1266                            int width);
1267 void ABGRToUVRow_Any_DSPR2(const uint8* src_abgr,
1268                            int src_stride_abgr,
1269                            uint8* dst_u,
1270                            uint8* dst_v,
1271                            int width);
1272 void RGBAToUVRow_Any_DSPR2(const uint8* src_rgba,
1273                            int src_stride_rgba,
1274                            uint8* dst_u,
1275                            uint8* dst_v,
1276                            int width);
1277 void ARGBToUVRow_Any_DSPR2(const uint8* src_argb,
1278                            int src_stride_argb,
1279                            uint8* dst_u,
1280                            uint8* dst_v,
1281                            int width);
1282 void ARGBToUVRow_C(const uint8* src_argb,
1283                    int src_stride_argb,
1284                    uint8* dst_u,
1285                    uint8* dst_v,
1286                    int width);
1287 void ARGBToUVJRow_C(const uint8* src_argb,
1288                     int src_stride_argb,
1289                     uint8* dst_u,
1290                     uint8* dst_v,
1291                     int width);
1292 void ARGBToUVRow_C(const uint8* src_argb,
1293                    int src_stride_argb,
1294                    uint8* dst_u,
1295                    uint8* dst_v,
1296                    int width);
1297 void ARGBToUVJRow_C(const uint8* src_argb,
1298                     int src_stride_argb,
1299                     uint8* dst_u,
1300                     uint8* dst_v,
1301                     int width);
1302 void BGRAToUVRow_C(const uint8* src_bgra,
1303                    int src_stride_bgra,
1304                    uint8* dst_u,
1305                    uint8* dst_v,
1306                    int width);
1307 void ABGRToUVRow_C(const uint8* src_abgr,
1308                    int src_stride_abgr,
1309                    uint8* dst_u,
1310                    uint8* dst_v,
1311                    int width);
1312 void RGBAToUVRow_C(const uint8* src_rgba,
1313                    int src_stride_rgba,
1314                    uint8* dst_u,
1315                    uint8* dst_v,
1316                    int width);
1317 void RGB24ToUVRow_C(const uint8* src_rgb24,
1318                     int src_stride_rgb24,
1319                     uint8* dst_u,
1320                     uint8* dst_v,
1321                     int width);
1322 void RAWToUVRow_C(const uint8* src_raw,
1323                   int src_stride_raw,
1324                   uint8* dst_u,
1325                   uint8* dst_v,
1326                   int width);
1327 void RGB565ToUVRow_C(const uint8* src_rgb565,
1328                      int src_stride_rgb565,
1329                      uint8* dst_u,
1330                      uint8* dst_v,
1331                      int width);
1332 void ARGB1555ToUVRow_C(const uint8* src_argb1555,
1333                        int src_stride_argb1555,
1334                        uint8* dst_u,
1335                        uint8* dst_v,
1336                        int width);
1337 void ARGB4444ToUVRow_C(const uint8* src_argb4444,
1338                        int src_stride_argb4444,
1339                        uint8* dst_u,
1340                        uint8* dst_v,
1341                        int width);
1342 
1343 void ARGBToUV444Row_SSSE3(const uint8* src_argb,
1344                           uint8* dst_u,
1345                           uint8* dst_v,
1346                           int width);
1347 void ARGBToUV444Row_Any_SSSE3(const uint8* src_argb,
1348                               uint8* dst_u,
1349                               uint8* dst_v,
1350                               int width);
1351 
1352 void ARGBToUV444Row_C(const uint8* src_argb,
1353                       uint8* dst_u,
1354                       uint8* dst_v,
1355                       int width);
1356 
1357 void MirrorRow_AVX2(const uint8* src, uint8* dst, int width);
1358 void MirrorRow_SSSE3(const uint8* src, uint8* dst, int width);
1359 void MirrorRow_NEON(const uint8* src, uint8* dst, int width);
1360 void MirrorRow_DSPR2(const uint8* src, uint8* dst, int width);
1361 void MirrorRow_MSA(const uint8* src, uint8* dst, int width);
1362 void MirrorRow_C(const uint8* src, uint8* dst, int width);
1363 void MirrorRow_Any_AVX2(const uint8* src, uint8* dst, int width);
1364 void MirrorRow_Any_SSSE3(const uint8* src, uint8* dst, int width);
1365 void MirrorRow_Any_SSE2(const uint8* src, uint8* dst, int width);
1366 void MirrorRow_Any_NEON(const uint8* src, uint8* dst, int width);
1367 void MirrorRow_Any_MSA(const uint8* src, uint8* dst, int width);
1368 
1369 void MirrorUVRow_SSSE3(const uint8* src_uv,
1370                        uint8* dst_u,
1371                        uint8* dst_v,
1372                        int width);
1373 void MirrorUVRow_NEON(const uint8* src_uv,
1374                       uint8* dst_u,
1375                       uint8* dst_v,
1376                       int width);
1377 void MirrorUVRow_DSPR2(const uint8* src_uv,
1378                        uint8* dst_u,
1379                        uint8* dst_v,
1380                        int width);
1381 void MirrorUVRow_MSA(const uint8* src_uv,
1382                      uint8* dst_u,
1383                      uint8* dst_v,
1384                      int width);
1385 void MirrorUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int width);
1386 
1387 void ARGBMirrorRow_AVX2(const uint8* src, uint8* dst, int width);
1388 void ARGBMirrorRow_SSE2(const uint8* src, uint8* dst, int width);
1389 void ARGBMirrorRow_NEON(const uint8* src, uint8* dst, int width);
1390 void ARGBMirrorRow_MSA(const uint8* src, uint8* dst, int width);
1391 void ARGBMirrorRow_C(const uint8* src, uint8* dst, int width);
1392 void ARGBMirrorRow_Any_AVX2(const uint8* src, uint8* dst, int width);
1393 void ARGBMirrorRow_Any_SSE2(const uint8* src, uint8* dst, int width);
1394 void ARGBMirrorRow_Any_NEON(const uint8* src, uint8* dst, int width);
1395 void ARGBMirrorRow_Any_MSA(const uint8* src, uint8* dst, int width);
1396 
1397 void SplitUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int width);
1398 void SplitUVRow_SSE2(const uint8* src_uv,
1399                      uint8* dst_u,
1400                      uint8* dst_v,
1401                      int width);
1402 void SplitUVRow_AVX2(const uint8* src_uv,
1403                      uint8* dst_u,
1404                      uint8* dst_v,
1405                      int width);
1406 void SplitUVRow_NEON(const uint8* src_uv,
1407                      uint8* dst_u,
1408                      uint8* dst_v,
1409                      int width);
1410 void SplitUVRow_DSPR2(const uint8* src_uv,
1411                       uint8* dst_u,
1412                       uint8* dst_v,
1413                       int width);
1414 void SplitUVRow_MSA(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int width);
1415 void SplitUVRow_Any_SSE2(const uint8* src_uv,
1416                          uint8* dst_u,
1417                          uint8* dst_v,
1418                          int width);
1419 void SplitUVRow_Any_AVX2(const uint8* src_uv,
1420                          uint8* dst_u,
1421                          uint8* dst_v,
1422                          int width);
1423 void SplitUVRow_Any_NEON(const uint8* src_uv,
1424                          uint8* dst_u,
1425                          uint8* dst_v,
1426                          int width);
1427 void SplitUVRow_Any_DSPR2(const uint8* src_uv,
1428                           uint8* dst_u,
1429                           uint8* dst_v,
1430                           int width);
1431 void SplitUVRow_Any_MSA(const uint8* src_uv,
1432                         uint8* dst_u,
1433                         uint8* dst_v,
1434                         int width);
1435 
1436 void MergeUVRow_C(const uint8* src_u,
1437                   const uint8* src_v,
1438                   uint8* dst_uv,
1439                   int width);
1440 void MergeUVRow_SSE2(const uint8* src_u,
1441                      const uint8* src_v,
1442                      uint8* dst_uv,
1443                      int width);
1444 void MergeUVRow_AVX2(const uint8* src_u,
1445                      const uint8* src_v,
1446                      uint8* dst_uv,
1447                      int width);
1448 void MergeUVRow_NEON(const uint8* src_u,
1449                      const uint8* src_v,
1450                      uint8* dst_uv,
1451                      int width);
1452 void MergeUVRow_MSA(const uint8* src_u,
1453                     const uint8* src_v,
1454                     uint8* dst_uv,
1455                     int width);
1456 void MergeUVRow_Any_SSE2(const uint8* src_u,
1457                          const uint8* src_v,
1458                          uint8* dst_uv,
1459                          int width);
1460 void MergeUVRow_Any_AVX2(const uint8* src_u,
1461                          const uint8* src_v,
1462                          uint8* dst_uv,
1463                          int width);
1464 void MergeUVRow_Any_NEON(const uint8* src_u,
1465                          const uint8* src_v,
1466                          uint8* dst_uv,
1467                          int width);
1468 void MergeUVRow_Any_MSA(const uint8* src_u,
1469                         const uint8* src_v,
1470                         uint8* dst_uv,
1471                         int width);
1472 
1473 void SplitRGBRow_C(const uint8* src_rgb,
1474                    uint8* dst_r,
1475                    uint8* dst_g,
1476                    uint8* dst_b,
1477                    int width);
1478 void SplitRGBRow_SSSE3(const uint8* src_rgb,
1479                        uint8* dst_r,
1480                        uint8* dst_g,
1481                        uint8* dst_b,
1482                        int width);
1483 void SplitRGBRow_NEON(const uint8* src_rgb,
1484                       uint8* dst_r,
1485                       uint8* dst_g,
1486                       uint8* dst_b,
1487                       int width);
1488 void SplitRGBRow_Any_SSSE3(const uint8* src_rgb,
1489                            uint8* dst_r,
1490                            uint8* dst_g,
1491                            uint8* dst_b,
1492                            int width);
1493 void SplitRGBRow_Any_NEON(const uint8* src_rgb,
1494                           uint8* dst_r,
1495                           uint8* dst_g,
1496                           uint8* dst_b,
1497                           int width);
1498 
1499 void MergeRGBRow_C(const uint8* src_r,
1500                    const uint8* src_g,
1501                    const uint8* src_b,
1502                    uint8* dst_rgb,
1503                    int width);
1504 void MergeRGBRow_SSSE3(const uint8* src_r,
1505                        const uint8* src_g,
1506                        const uint8* src_b,
1507                        uint8* dst_rgb,
1508                        int width);
1509 void MergeRGBRow_NEON(const uint8* src_r,
1510                       const uint8* src_g,
1511                       const uint8* src_b,
1512                       uint8* dst_rgb,
1513                       int width);
1514 void MergeRGBRow_Any_SSSE3(const uint8* src_r,
1515                            const uint8* src_g,
1516                            const uint8* src_b,
1517                            uint8* dst_rgb,
1518                            int width);
1519 void MergeRGBRow_Any_NEON(const uint8* src_r,
1520                           const uint8* src_g,
1521                           const uint8* src_b,
1522                           uint8* dst_rgb,
1523                           int width);
1524 
1525 void MergeUVRow_16_C(const uint16* src_u,
1526                      const uint16* src_v,
1527                      uint16* dst_uv,
1528                      int scale, /* 64 for 10 bit */
1529                      int width);
1530 void MergeUVRow_16_AVX2(const uint16* src_u,
1531                         const uint16* src_v,
1532                         uint16* dst_uv,
1533                         int scale,
1534                         int width);
1535 
1536 void MultiplyRow_16_AVX2(const uint16* src_y,
1537                          uint16* dst_y,
1538                          int scale,
1539                          int width);
1540 void MultiplyRow_16_C(const uint16* src_y, uint16* dst_y, int scale, int width);
1541 
1542 void CopyRow_SSE2(const uint8* src, uint8* dst, int count);
1543 void CopyRow_AVX(const uint8* src, uint8* dst, int count);
1544 void CopyRow_ERMS(const uint8* src, uint8* dst, int count);
1545 void CopyRow_NEON(const uint8* src, uint8* dst, int count);
1546 void CopyRow_MIPS(const uint8* src, uint8* dst, int count);
1547 void CopyRow_C(const uint8* src, uint8* dst, int count);
1548 void CopyRow_Any_SSE2(const uint8* src, uint8* dst, int count);
1549 void CopyRow_Any_AVX(const uint8* src, uint8* dst, int count);
1550 void CopyRow_Any_NEON(const uint8* src, uint8* dst, int count);
1551 
1552 void CopyRow_16_C(const uint16* src, uint16* dst, int count);
1553 
1554 void ARGBCopyAlphaRow_C(const uint8* src_argb, uint8* dst_argb, int width);
1555 void ARGBCopyAlphaRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
1556 void ARGBCopyAlphaRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
1557 void ARGBCopyAlphaRow_Any_SSE2(const uint8* src_argb,
1558                                uint8* dst_argb,
1559                                int width);
1560 void ARGBCopyAlphaRow_Any_AVX2(const uint8* src_argb,
1561                                uint8* dst_argb,
1562                                int width);
1563 
1564 void ARGBExtractAlphaRow_C(const uint8* src_argb, uint8* dst_a, int width);
1565 void ARGBExtractAlphaRow_SSE2(const uint8* src_argb, uint8* dst_a, int width);
1566 void ARGBExtractAlphaRow_AVX2(const uint8* src_argb, uint8* dst_a, int width);
1567 void ARGBExtractAlphaRow_NEON(const uint8* src_argb, uint8* dst_a, int width);
1568 void ARGBExtractAlphaRow_MSA(const uint8* src_argb, uint8* dst_a, int width);
1569 void ARGBExtractAlphaRow_Any_SSE2(const uint8* src_argb,
1570                                   uint8* dst_a,
1571                                   int width);
1572 void ARGBExtractAlphaRow_Any_AVX2(const uint8* src_argb,
1573                                   uint8* dst_a,
1574                                   int width);
1575 void ARGBExtractAlphaRow_Any_NEON(const uint8* src_argb,
1576                                   uint8* dst_a,
1577                                   int width);
1578 void ARGBExtractAlphaRow_Any_MSA(const uint8* src_argb,
1579                                  uint8* dst_a,
1580                                  int width);
1581 
1582 void ARGBCopyYToAlphaRow_C(const uint8* src_y, uint8* dst_argb, int width);
1583 void ARGBCopyYToAlphaRow_SSE2(const uint8* src_y, uint8* dst_argb, int width);
1584 void ARGBCopyYToAlphaRow_AVX2(const uint8* src_y, uint8* dst_argb, int width);
1585 void ARGBCopyYToAlphaRow_Any_SSE2(const uint8* src_y,
1586                                   uint8* dst_argb,
1587                                   int width);
1588 void ARGBCopyYToAlphaRow_Any_AVX2(const uint8* src_y,
1589                                   uint8* dst_argb,
1590                                   int width);
1591 
1592 void SetRow_C(uint8* dst, uint8 v8, int count);
1593 void SetRow_MSA(uint8* dst, uint8 v8, int count);
1594 void SetRow_X86(uint8* dst, uint8 v8, int count);
1595 void SetRow_ERMS(uint8* dst, uint8 v8, int count);
1596 void SetRow_NEON(uint8* dst, uint8 v8, int count);
1597 void SetRow_Any_X86(uint8* dst, uint8 v8, int count);
1598 void SetRow_Any_NEON(uint8* dst, uint8 v8, int count);
1599 
1600 void ARGBSetRow_C(uint8* dst_argb, uint32 v32, int count);
1601 void ARGBSetRow_X86(uint8* dst_argb, uint32 v32, int count);
1602 void ARGBSetRow_NEON(uint8* dst_argb, uint32 v32, int count);
1603 void ARGBSetRow_Any_NEON(uint8* dst_argb, uint32 v32, int count);
1604 void ARGBSetRow_MSA(uint8* dst_argb, uint32 v32, int count);
1605 void ARGBSetRow_Any_MSA(uint8* dst_argb, uint32 v32, int count);
1606 
1607 // ARGBShufflers for BGRAToARGB etc.
1608 void ARGBShuffleRow_C(const uint8* src_argb,
1609                       uint8* dst_argb,
1610                       const uint8* shuffler,
1611                       int width);
1612 void ARGBShuffleRow_SSE2(const uint8* src_argb,
1613                          uint8* dst_argb,
1614                          const uint8* shuffler,
1615                          int width);
1616 void ARGBShuffleRow_SSSE3(const uint8* src_argb,
1617                           uint8* dst_argb,
1618                           const uint8* shuffler,
1619                           int width);
1620 void ARGBShuffleRow_AVX2(const uint8* src_argb,
1621                          uint8* dst_argb,
1622                          const uint8* shuffler,
1623                          int width);
1624 void ARGBShuffleRow_NEON(const uint8* src_argb,
1625                          uint8* dst_argb,
1626                          const uint8* shuffler,
1627                          int width);
1628 void ARGBShuffleRow_MSA(const uint8* src_argb,
1629                         uint8* dst_argb,
1630                         const uint8* shuffler,
1631                         int width);
1632 void ARGBShuffleRow_Any_SSE2(const uint8* src_argb,
1633                              uint8* dst_argb,
1634                              const uint8* shuffler,
1635                              int width);
1636 void ARGBShuffleRow_Any_SSSE3(const uint8* src_argb,
1637                               uint8* dst_argb,
1638                               const uint8* shuffler,
1639                               int width);
1640 void ARGBShuffleRow_Any_AVX2(const uint8* src_argb,
1641                              uint8* dst_argb,
1642                              const uint8* shuffler,
1643                              int width);
1644 void ARGBShuffleRow_Any_NEON(const uint8* src_argb,
1645                              uint8* dst_argb,
1646                              const uint8* shuffler,
1647                              int width);
1648 void ARGBShuffleRow_Any_MSA(const uint8* src_argb,
1649                             uint8* dst_argb,
1650                             const uint8* shuffler,
1651                             int width);
1652 
1653 void RGB24ToARGBRow_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int width);
1654 void RAWToARGBRow_SSSE3(const uint8* src_raw, uint8* dst_argb, int width);
1655 void RAWToRGB24Row_SSSE3(const uint8* src_raw, uint8* dst_rgb24, int width);
1656 void RGB565ToARGBRow_SSE2(const uint8* src_rgb565, uint8* dst_argb, int width);
1657 void ARGB1555ToARGBRow_SSE2(const uint8* src_argb1555,
1658                             uint8* dst_argb,
1659                             int width);
1660 void ARGB4444ToARGBRow_SSE2(const uint8* src_argb4444,
1661                             uint8* dst_argb,
1662                             int width);
1663 void RGB565ToARGBRow_AVX2(const uint8* src_rgb565, uint8* dst_argb, int width);
1664 void ARGB1555ToARGBRow_AVX2(const uint8* src_argb1555,
1665                             uint8* dst_argb,
1666                             int width);
1667 void ARGB4444ToARGBRow_AVX2(const uint8* src_argb4444,
1668                             uint8* dst_argb,
1669                             int width);
1670 
1671 void RGB24ToARGBRow_NEON(const uint8* src_rgb24, uint8* dst_argb, int width);
1672 void RGB24ToARGBRow_MSA(const uint8* src_rgb24, uint8* dst_argb, int width);
1673 void RAWToARGBRow_NEON(const uint8* src_raw, uint8* dst_argb, int width);
1674 void RAWToARGBRow_MSA(const uint8* src_raw, uint8* dst_argb, int width);
1675 void RAWToRGB24Row_NEON(const uint8* src_raw, uint8* dst_rgb24, int width);
1676 void RAWToRGB24Row_MSA(const uint8* src_raw, uint8* dst_rgb24, int width);
1677 void RGB565ToARGBRow_NEON(const uint8* src_rgb565, uint8* dst_argb, int width);
1678 void RGB565ToARGBRow_MSA(const uint8* src_rgb565, uint8* dst_argb, int width);
1679 void ARGB1555ToARGBRow_NEON(const uint8* src_argb1555,
1680                             uint8* dst_argb,
1681                             int width);
1682 void ARGB1555ToARGBRow_MSA(const uint8* src_argb1555,
1683                            uint8* dst_argb,
1684                            int width);
1685 void ARGB4444ToARGBRow_NEON(const uint8* src_argb4444,
1686                             uint8* dst_argb,
1687                             int width);
1688 void RGB24ToARGBRow_DSPR2(const uint8* src_rgb24, uint8* dst_argb, int width);
1689 void RAWToARGBRow_DSPR2(const uint8* src_raw, uint8* dst_argb, int width);
1690 void RGB565ToARGBRow_DSPR2(const uint8* src_rgb565, uint8* dst_argb, int width);
1691 void ARGB1555ToARGBRow_DSPR2(const uint8* src_argb1555,
1692                              uint8* dst_argb,
1693                              int width);
1694 void ARGB4444ToARGBRow_DSPR2(const uint8* src_argb4444,
1695                              uint8* dst_argb,
1696                              int width);
1697 void ARGB4444ToARGBRow_MSA(const uint8* src_argb4444,
1698                            uint8* dst_argb,
1699                            int width);
1700 void RGB24ToARGBRow_C(const uint8* src_rgb24, uint8* dst_argb, int width);
1701 void RAWToARGBRow_C(const uint8* src_raw, uint8* dst_argb, int width);
1702 void RAWToRGB24Row_C(const uint8* src_raw, uint8* dst_rgb24, int width);
1703 void RGB565ToARGBRow_C(const uint8* src_rgb, uint8* dst_argb, int width);
1704 void ARGB1555ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int width);
1705 void ARGB4444ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int width);
1706 void RGB24ToARGBRow_Any_SSSE3(const uint8* src_rgb24,
1707                               uint8* dst_argb,
1708                               int width);
1709 void RAWToARGBRow_Any_SSSE3(const uint8* src_raw, uint8* dst_argb, int width);
1710 void RAWToRGB24Row_Any_SSSE3(const uint8* src_raw, uint8* dst_rgb24, int width);
1711 
1712 void RGB565ToARGBRow_Any_SSE2(const uint8* src_rgb565,
1713                               uint8* dst_argb,
1714                               int width);
1715 void ARGB1555ToARGBRow_Any_SSE2(const uint8* src_argb1555,
1716                                 uint8* dst_argb,
1717                                 int width);
1718 void ARGB4444ToARGBRow_Any_SSE2(const uint8* src_argb4444,
1719                                 uint8* dst_argb,
1720                                 int width);
1721 void RGB565ToARGBRow_Any_AVX2(const uint8* src_rgb565,
1722                               uint8* dst_argb,
1723                               int width);
1724 void ARGB1555ToARGBRow_Any_AVX2(const uint8* src_argb1555,
1725                                 uint8* dst_argb,
1726                                 int width);
1727 void ARGB4444ToARGBRow_Any_AVX2(const uint8* src_argb4444,
1728                                 uint8* dst_argb,
1729                                 int width);
1730 
1731 void RGB24ToARGBRow_Any_NEON(const uint8* src_rgb24,
1732                              uint8* dst_argb,
1733                              int width);
1734 void RGB24ToARGBRow_Any_MSA(const uint8* src_rgb24, uint8* dst_argb, int width);
1735 void RAWToARGBRow_Any_NEON(const uint8* src_raw, uint8* dst_argb, int width);
1736 void RAWToARGBRow_Any_MSA(const uint8* src_raw, uint8* dst_argb, int width);
1737 void RAWToRGB24Row_Any_NEON(const uint8* src_raw, uint8* dst_rgb24, int width);
1738 void RAWToRGB24Row_Any_MSA(const uint8* src_raw, uint8* dst_rgb24, int width);
1739 void RGB565ToARGBRow_Any_NEON(const uint8* src_rgb565,
1740                               uint8* dst_argb,
1741                               int width);
1742 void RGB565ToARGBRow_Any_MSA(const uint8* src_rgb565,
1743                              uint8* dst_argb,
1744                              int width);
1745 void ARGB1555ToARGBRow_Any_NEON(const uint8* src_argb1555,
1746                                 uint8* dst_argb,
1747                                 int width);
1748 void ARGB1555ToARGBRow_Any_MSA(const uint8* src_argb1555,
1749                                uint8* dst_argb,
1750                                int width);
1751 void ARGB4444ToARGBRow_Any_NEON(const uint8* src_argb4444,
1752                                 uint8* dst_argb,
1753                                 int width);
1754 void RGB24ToARGBRow_Any_DSPR2(const uint8* src_rgb24,
1755                               uint8* dst_argb,
1756                               int width);
1757 void RAWToARGBRow_Any_DSPR2(const uint8* src_raw, uint8* dst_argb, int width);
1758 void RGB565ToARGBRow_Any_DSPR2(const uint8* src_rgb565,
1759                                uint8* dst_argb,
1760                                int width);
1761 void ARGB1555ToARGBRow_Any_DSPR2(const uint8* src_argb1555,
1762                                  uint8* dst_argb,
1763                                  int width);
1764 void ARGB4444ToARGBRow_Any_DSPR2(const uint8* src_argb4444,
1765                                  uint8* dst_argb,
1766                                  int width);
1767 
1768 void ARGB4444ToARGBRow_Any_MSA(const uint8* src_argb4444,
1769                                uint8* dst_argb,
1770                                int width);
1771 
1772 void ARGBToRGB24Row_SSSE3(const uint8* src_argb, uint8* dst_rgb, int width);
1773 void ARGBToRAWRow_SSSE3(const uint8* src_argb, uint8* dst_rgb, int width);
1774 void ARGBToRGB565Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int width);
1775 void ARGBToARGB1555Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int width);
1776 void ARGBToARGB4444Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int width);
1777 
1778 void ARGBToRGB565DitherRow_C(const uint8* src_argb,
1779                              uint8* dst_rgb,
1780                              const uint32 dither4,
1781                              int width);
1782 void ARGBToRGB565DitherRow_SSE2(const uint8* src_argb,
1783                                 uint8* dst_rgb,
1784                                 const uint32 dither4,
1785                                 int width);
1786 void ARGBToRGB565DitherRow_AVX2(const uint8* src_argb,
1787                                 uint8* dst_rgb,
1788                                 const uint32 dither4,
1789                                 int width);
1790 
1791 void ARGBToRGB565Row_AVX2(const uint8* src_argb, uint8* dst_rgb, int width);
1792 void ARGBToARGB1555Row_AVX2(const uint8* src_argb, uint8* dst_rgb, int width);
1793 void ARGBToARGB4444Row_AVX2(const uint8* src_argb, uint8* dst_rgb, int width);
1794 
1795 void ARGBToRGB24Row_NEON(const uint8* src_argb, uint8* dst_rgb, int width);
1796 void ARGBToRAWRow_NEON(const uint8* src_argb, uint8* dst_rgb, int width);
1797 void ARGBToRGB565Row_NEON(const uint8* src_argb, uint8* dst_rgb, int width);
1798 void ARGBToARGB1555Row_NEON(const uint8* src_argb, uint8* dst_rgb, int width);
1799 void ARGBToARGB4444Row_NEON(const uint8* src_argb, uint8* dst_rgb, int width);
1800 void ARGBToRGB565DitherRow_NEON(const uint8* src_argb,
1801                                 uint8* dst_rgb,
1802                                 const uint32 dither4,
1803                                 int width);
1804 void ARGBToRGB24Row_MSA(const uint8* src_argb, uint8* dst_rgb, int width);
1805 void ARGBToRAWRow_MSA(const uint8* src_argb, uint8* dst_rgb, int width);
1806 void ARGBToRGB565Row_MSA(const uint8* src_argb, uint8* dst_rgb, int width);
1807 void ARGBToARGB1555Row_MSA(const uint8* src_argb, uint8* dst_rgb, int width);
1808 void ARGBToARGB4444Row_MSA(const uint8* src_argb, uint8* dst_rgb, int width);
1809 void ARGBToRGB565DitherRow_MSA(const uint8* src_argb,
1810                                uint8* dst_rgb,
1811                                const uint32 dither4,
1812                                int width);
1813 
1814 void ARGBToRGBARow_C(const uint8* src_argb, uint8* dst_rgb, int width);
1815 void ARGBToRGB24Row_C(const uint8* src_argb, uint8* dst_rgb, int width);
1816 void ARGBToRAWRow_C(const uint8* src_argb, uint8* dst_rgb, int width);
1817 void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int width);
1818 void ARGBToARGB1555Row_C(const uint8* src_argb, uint8* dst_rgb, int width);
1819 void ARGBToARGB4444Row_C(const uint8* src_argb, uint8* dst_rgb, int width);
1820 
1821 void J400ToARGBRow_SSE2(const uint8* src_y, uint8* dst_argb, int width);
1822 void J400ToARGBRow_AVX2(const uint8* src_y, uint8* dst_argb, int width);
1823 void J400ToARGBRow_NEON(const uint8* src_y, uint8* dst_argb, int width);
1824 void J400ToARGBRow_MSA(const uint8* src_y, uint8* dst_argb, int width);
1825 void J400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int width);
1826 void J400ToARGBRow_Any_SSE2(const uint8* src_y, uint8* dst_argb, int width);
1827 void J400ToARGBRow_Any_AVX2(const uint8* src_y, uint8* dst_argb, int width);
1828 void J400ToARGBRow_Any_NEON(const uint8* src_y, uint8* dst_argb, int width);
1829 void J400ToARGBRow_Any_MSA(const uint8* src_y, uint8* dst_argb, int width);
1830 
1831 void I444ToARGBRow_C(const uint8* src_y,
1832                      const uint8* src_u,
1833                      const uint8* src_v,
1834                      uint8* dst_argb,
1835                      const struct YuvConstants* yuvconstants,
1836                      int width);
1837 void I422ToARGBRow_C(const uint8* src_y,
1838                      const uint8* src_u,
1839                      const uint8* src_v,
1840                      uint8* dst_argb,
1841                      const struct YuvConstants* yuvconstants,
1842                      int width);
1843 void I422ToARGBRow_C(const uint8* src_y,
1844                      const uint8* src_u,
1845                      const uint8* src_v,
1846                      uint8* dst_argb,
1847                      const struct YuvConstants* yuvconstants,
1848                      int width);
1849 void I422AlphaToARGBRow_C(const uint8* y_buf,
1850                           const uint8* u_buf,
1851                           const uint8* v_buf,
1852                           const uint8* a_buf,
1853                           uint8* dst_argb,
1854                           const struct YuvConstants* yuvconstants,
1855                           int width);
1856 void NV12ToARGBRow_C(const uint8* src_y,
1857                      const uint8* src_uv,
1858                      uint8* dst_argb,
1859                      const struct YuvConstants* yuvconstants,
1860                      int width);
1861 void NV12ToRGB565Row_C(const uint8* src_y,
1862                        const uint8* src_uv,
1863                        uint8* dst_argb,
1864                        const struct YuvConstants* yuvconstants,
1865                        int width);
1866 void NV21ToARGBRow_C(const uint8* src_y,
1867                      const uint8* src_uv,
1868                      uint8* dst_argb,
1869                      const struct YuvConstants* yuvconstants,
1870                      int width);
1871 void YUY2ToARGBRow_C(const uint8* src_yuy2,
1872                      uint8* dst_argb,
1873                      const struct YuvConstants* yuvconstants,
1874                      int width);
1875 void UYVYToARGBRow_C(const uint8* src_uyvy,
1876                      uint8* dst_argb,
1877                      const struct YuvConstants* yuvconstants,
1878                      int width);
1879 void I422ToRGBARow_C(const uint8* src_y,
1880                      const uint8* src_u,
1881                      const uint8* src_v,
1882                      uint8* dst_rgba,
1883                      const struct YuvConstants* yuvconstants,
1884                      int width);
1885 void I422ToRGB24Row_C(const uint8* src_y,
1886                       const uint8* src_u,
1887                       const uint8* src_v,
1888                       uint8* dst_rgb24,
1889                       const struct YuvConstants* yuvconstants,
1890                       int width);
1891 void I422ToARGB4444Row_C(const uint8* src_y,
1892                          const uint8* src_u,
1893                          const uint8* src_v,
1894                          uint8* dst_argb4444,
1895                          const struct YuvConstants* yuvconstants,
1896                          int width);
1897 void I422ToARGB1555Row_C(const uint8* src_y,
1898                          const uint8* src_u,
1899                          const uint8* src_v,
1900                          uint8* dst_argb4444,
1901                          const struct YuvConstants* yuvconstants,
1902                          int width);
1903 void I422ToRGB565Row_C(const uint8* src_y,
1904                        const uint8* src_u,
1905                        const uint8* src_v,
1906                        uint8* dst_rgb565,
1907                        const struct YuvConstants* yuvconstants,
1908                        int width);
1909 void I422ToARGBRow_AVX2(const uint8* src_y,
1910                         const uint8* src_u,
1911                         const uint8* src_v,
1912                         uint8* dst_argb,
1913                         const struct YuvConstants* yuvconstants,
1914                         int width);
1915 void I422ToARGBRow_AVX2(const uint8* src_y,
1916                         const uint8* src_u,
1917                         const uint8* src_v,
1918                         uint8* dst_argb,
1919                         const struct YuvConstants* yuvconstants,
1920                         int width);
1921 void I422ToRGBARow_AVX2(const uint8* src_y,
1922                         const uint8* src_u,
1923                         const uint8* src_v,
1924                         uint8* dst_argb,
1925                         const struct YuvConstants* yuvconstants,
1926                         int width);
1927 void I444ToARGBRow_SSSE3(const uint8* src_y,
1928                          const uint8* src_u,
1929                          const uint8* src_v,
1930                          uint8* dst_argb,
1931                          const struct YuvConstants* yuvconstants,
1932                          int width);
1933 void I444ToARGBRow_AVX2(const uint8* src_y,
1934                         const uint8* src_u,
1935                         const uint8* src_v,
1936                         uint8* dst_argb,
1937                         const struct YuvConstants* yuvconstants,
1938                         int width);
1939 void I444ToARGBRow_SSSE3(const uint8* src_y,
1940                          const uint8* src_u,
1941                          const uint8* src_v,
1942                          uint8* dst_argb,
1943                          const struct YuvConstants* yuvconstants,
1944                          int width);
1945 void I444ToARGBRow_AVX2(const uint8* src_y,
1946                         const uint8* src_u,
1947                         const uint8* src_v,
1948                         uint8* dst_argb,
1949                         const struct YuvConstants* yuvconstants,
1950                         int width);
1951 void I422ToARGBRow_SSSE3(const uint8* src_y,
1952                          const uint8* src_u,
1953                          const uint8* src_v,
1954                          uint8* dst_argb,
1955                          const struct YuvConstants* yuvconstants,
1956                          int width);
1957 void I422AlphaToARGBRow_SSSE3(const uint8* y_buf,
1958                               const uint8* u_buf,
1959                               const uint8* v_buf,
1960                               const uint8* a_buf,
1961                               uint8* dst_argb,
1962                               const struct YuvConstants* yuvconstants,
1963                               int width);
1964 void I422AlphaToARGBRow_AVX2(const uint8* y_buf,
1965                              const uint8* u_buf,
1966                              const uint8* v_buf,
1967                              const uint8* a_buf,
1968                              uint8* dst_argb,
1969                              const struct YuvConstants* yuvconstants,
1970                              int width);
1971 void I422ToARGBRow_SSSE3(const uint8* src_y,
1972                          const uint8* src_u,
1973                          const uint8* src_v,
1974                          uint8* dst_argb,
1975                          const struct YuvConstants* yuvconstants,
1976                          int width);
1977 void NV12ToARGBRow_SSSE3(const uint8* src_y,
1978                          const uint8* src_uv,
1979                          uint8* dst_argb,
1980                          const struct YuvConstants* yuvconstants,
1981                          int width);
1982 void NV12ToARGBRow_AVX2(const uint8* src_y,
1983                         const uint8* src_uv,
1984                         uint8* dst_argb,
1985                         const struct YuvConstants* yuvconstants,
1986                         int width);
1987 void NV12ToRGB565Row_SSSE3(const uint8* src_y,
1988                            const uint8* src_uv,
1989                            uint8* dst_argb,
1990                            const struct YuvConstants* yuvconstants,
1991                            int width);
1992 void NV12ToRGB565Row_AVX2(const uint8* src_y,
1993                           const uint8* src_uv,
1994                           uint8* dst_argb,
1995                           const struct YuvConstants* yuvconstants,
1996                           int width);
1997 void NV21ToARGBRow_SSSE3(const uint8* src_y,
1998                          const uint8* src_uv,
1999                          uint8* dst_argb,
2000                          const struct YuvConstants* yuvconstants,
2001                          int width);
2002 void NV21ToARGBRow_AVX2(const uint8* src_y,
2003                         const uint8* src_uv,
2004                         uint8* dst_argb,
2005                         const struct YuvConstants* yuvconstants,
2006                         int width);
2007 void YUY2ToARGBRow_SSSE3(const uint8* src_yuy2,
2008                          uint8* dst_argb,
2009                          const struct YuvConstants* yuvconstants,
2010                          int width);
2011 void UYVYToARGBRow_SSSE3(const uint8* src_uyvy,
2012                          uint8* dst_argb,
2013                          const struct YuvConstants* yuvconstants,
2014                          int width);
2015 void YUY2ToARGBRow_AVX2(const uint8* src_yuy2,
2016                         uint8* dst_argb,
2017                         const struct YuvConstants* yuvconstants,
2018                         int width);
2019 void UYVYToARGBRow_AVX2(const uint8* src_uyvy,
2020                         uint8* dst_argb,
2021                         const struct YuvConstants* yuvconstants,
2022                         int width);
2023 void I422ToRGBARow_SSSE3(const uint8* src_y,
2024                          const uint8* src_u,
2025                          const uint8* src_v,
2026                          uint8* dst_rgba,
2027                          const struct YuvConstants* yuvconstants,
2028                          int width);
2029 void I422ToARGB4444Row_SSSE3(const uint8* src_y,
2030                              const uint8* src_u,
2031                              const uint8* src_v,
2032                              uint8* dst_argb,
2033                              const struct YuvConstants* yuvconstants,
2034                              int width);
2035 void I422ToARGB4444Row_AVX2(const uint8* src_y,
2036                             const uint8* src_u,
2037                             const uint8* src_v,
2038                             uint8* dst_argb,
2039                             const struct YuvConstants* yuvconstants,
2040                             int width);
2041 void I422ToARGB1555Row_SSSE3(const uint8* src_y,
2042                              const uint8* src_u,
2043                              const uint8* src_v,
2044                              uint8* dst_argb,
2045                              const struct YuvConstants* yuvconstants,
2046                              int width);
2047 void I422ToARGB1555Row_AVX2(const uint8* src_y,
2048                             const uint8* src_u,
2049                             const uint8* src_v,
2050                             uint8* dst_argb,
2051                             const struct YuvConstants* yuvconstants,
2052                             int width);
2053 void I422ToRGB565Row_SSSE3(const uint8* src_y,
2054                            const uint8* src_u,
2055                            const uint8* src_v,
2056                            uint8* dst_argb,
2057                            const struct YuvConstants* yuvconstants,
2058                            int width);
2059 void I422ToRGB565Row_AVX2(const uint8* src_y,
2060                           const uint8* src_u,
2061                           const uint8* src_v,
2062                           uint8* dst_argb,
2063                           const struct YuvConstants* yuvconstants,
2064                           int width);
2065 void I422ToRGB24Row_SSSE3(const uint8* src_y,
2066                           const uint8* src_u,
2067                           const uint8* src_v,
2068                           uint8* dst_rgb24,
2069                           const struct YuvConstants* yuvconstants,
2070                           int width);
2071 void I422ToRGB24Row_AVX2(const uint8* src_y,
2072                          const uint8* src_u,
2073                          const uint8* src_v,
2074                          uint8* dst_rgb24,
2075                          const struct YuvConstants* yuvconstants,
2076                          int width);
2077 void I422ToARGBRow_Any_AVX2(const uint8* src_y,
2078                             const uint8* src_u,
2079                             const uint8* src_v,
2080                             uint8* dst_argb,
2081                             const struct YuvConstants* yuvconstants,
2082                             int width);
2083 void I422ToRGBARow_Any_AVX2(const uint8* src_y,
2084                             const uint8* src_u,
2085                             const uint8* src_v,
2086                             uint8* dst_argb,
2087                             const struct YuvConstants* yuvconstants,
2088                             int width);
2089 void I444ToARGBRow_Any_SSSE3(const uint8* src_y,
2090                              const uint8* src_u,
2091                              const uint8* src_v,
2092                              uint8* dst_argb,
2093                              const struct YuvConstants* yuvconstants,
2094                              int width);
2095 void I444ToARGBRow_Any_AVX2(const uint8* src_y,
2096                             const uint8* src_u,
2097                             const uint8* src_v,
2098                             uint8* dst_argb,
2099                             const struct YuvConstants* yuvconstants,
2100                             int width);
2101 void I422ToARGBRow_Any_SSSE3(const uint8* src_y,
2102                              const uint8* src_u,
2103                              const uint8* src_v,
2104                              uint8* dst_argb,
2105                              const struct YuvConstants* yuvconstants,
2106                              int width);
2107 void I422AlphaToARGBRow_Any_SSSE3(const uint8* y_buf,
2108                                   const uint8* u_buf,
2109                                   const uint8* v_buf,
2110                                   const uint8* a_buf,
2111                                   uint8* dst_argb,
2112                                   const struct YuvConstants* yuvconstants,
2113                                   int width);
2114 void I422AlphaToARGBRow_Any_AVX2(const uint8* y_buf,
2115                                  const uint8* u_buf,
2116                                  const uint8* v_buf,
2117                                  const uint8* a_buf,
2118                                  uint8* dst_argb,
2119                                  const struct YuvConstants* yuvconstants,
2120                                  int width);
2121 void NV12ToARGBRow_Any_SSSE3(const uint8* src_y,
2122                              const uint8* src_uv,
2123                              uint8* dst_argb,
2124                              const struct YuvConstants* yuvconstants,
2125                              int width);
2126 void NV12ToARGBRow_Any_AVX2(const uint8* src_y,
2127                             const uint8* src_uv,
2128                             uint8* dst_argb,
2129                             const struct YuvConstants* yuvconstants,
2130                             int width);
2131 void NV21ToARGBRow_Any_SSSE3(const uint8* src_y,
2132                              const uint8* src_vu,
2133                              uint8* dst_argb,
2134                              const struct YuvConstants* yuvconstants,
2135                              int width);
2136 void NV21ToARGBRow_Any_AVX2(const uint8* src_y,
2137                             const uint8* src_vu,
2138                             uint8* dst_argb,
2139                             const struct YuvConstants* yuvconstants,
2140                             int width);
2141 void NV12ToRGB565Row_Any_SSSE3(const uint8* src_y,
2142                                const uint8* src_uv,
2143                                uint8* dst_argb,
2144                                const struct YuvConstants* yuvconstants,
2145                                int width);
2146 void NV12ToRGB565Row_Any_AVX2(const uint8* src_y,
2147                               const uint8* src_uv,
2148                               uint8* dst_argb,
2149                               const struct YuvConstants* yuvconstants,
2150                               int width);
2151 void YUY2ToARGBRow_Any_SSSE3(const uint8* src_yuy2,
2152                              uint8* dst_argb,
2153                              const struct YuvConstants* yuvconstants,
2154                              int width);
2155 void UYVYToARGBRow_Any_SSSE3(const uint8* src_uyvy,
2156                              uint8* dst_argb,
2157                              const struct YuvConstants* yuvconstants,
2158                              int width);
2159 void YUY2ToARGBRow_Any_AVX2(const uint8* src_yuy2,
2160                             uint8* dst_argb,
2161                             const struct YuvConstants* yuvconstants,
2162                             int width);
2163 void UYVYToARGBRow_Any_AVX2(const uint8* src_uyvy,
2164                             uint8* dst_argb,
2165                             const struct YuvConstants* yuvconstants,
2166                             int width);
2167 void I422ToRGBARow_Any_SSSE3(const uint8* src_y,
2168                              const uint8* src_u,
2169                              const uint8* src_v,
2170                              uint8* dst_rgba,
2171                              const struct YuvConstants* yuvconstants,
2172                              int width);
2173 void I422ToARGB4444Row_Any_SSSE3(const uint8* src_y,
2174                                  const uint8* src_u,
2175                                  const uint8* src_v,
2176                                  uint8* dst_rgba,
2177                                  const struct YuvConstants* yuvconstants,
2178                                  int width);
2179 void I422ToARGB4444Row_Any_AVX2(const uint8* src_y,
2180                                 const uint8* src_u,
2181                                 const uint8* src_v,
2182                                 uint8* dst_rgba,
2183                                 const struct YuvConstants* yuvconstants,
2184                                 int width);
2185 void I422ToARGB1555Row_Any_SSSE3(const uint8* src_y,
2186                                  const uint8* src_u,
2187                                  const uint8* src_v,
2188                                  uint8* dst_rgba,
2189                                  const struct YuvConstants* yuvconstants,
2190                                  int width);
2191 void I422ToARGB1555Row_Any_AVX2(const uint8* src_y,
2192                                 const uint8* src_u,
2193                                 const uint8* src_v,
2194                                 uint8* dst_rgba,
2195                                 const struct YuvConstants* yuvconstants,
2196                                 int width);
2197 void I422ToRGB565Row_Any_SSSE3(const uint8* src_y,
2198                                const uint8* src_u,
2199                                const uint8* src_v,
2200                                uint8* dst_rgba,
2201                                const struct YuvConstants* yuvconstants,
2202                                int width);
2203 void I422ToRGB565Row_Any_AVX2(const uint8* src_y,
2204                               const uint8* src_u,
2205                               const uint8* src_v,
2206                               uint8* dst_rgba,
2207                               const struct YuvConstants* yuvconstants,
2208                               int width);
2209 void I422ToRGB24Row_Any_SSSE3(const uint8* src_y,
2210                               const uint8* src_u,
2211                               const uint8* src_v,
2212                               uint8* dst_argb,
2213                               const struct YuvConstants* yuvconstants,
2214                               int width);
2215 void I422ToRGB24Row_Any_AVX2(const uint8* src_y,
2216                              const uint8* src_u,
2217                              const uint8* src_v,
2218                              uint8* dst_argb,
2219                              const struct YuvConstants* yuvconstants,
2220                              int width);
2221 
2222 void I400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int width);
2223 void I400ToARGBRow_SSE2(const uint8* src_y, uint8* dst_argb, int width);
2224 void I400ToARGBRow_AVX2(const uint8* src_y, uint8* dst_argb, int width);
2225 void I400ToARGBRow_NEON(const uint8* src_y, uint8* dst_argb, int width);
2226 void I400ToARGBRow_MSA(const uint8* src_y, uint8* dst_argb, int width);
2227 void I400ToARGBRow_Any_SSE2(const uint8* src_y, uint8* dst_argb, int width);
2228 void I400ToARGBRow_Any_AVX2(const uint8* src_y, uint8* dst_argb, int width);
2229 void I400ToARGBRow_Any_NEON(const uint8* src_y, uint8* dst_argb, int width);
2230 void I400ToARGBRow_Any_MSA(const uint8* src_y, uint8* dst_argb, int width);
2231 
2232 // ARGB preattenuated alpha blend.
2233 void ARGBBlendRow_SSSE3(const uint8* src_argb,
2234                         const uint8* src_argb1,
2235                         uint8* dst_argb,
2236                         int width);
2237 void ARGBBlendRow_NEON(const uint8* src_argb,
2238                        const uint8* src_argb1,
2239                        uint8* dst_argb,
2240                        int width);
2241 void ARGBBlendRow_MSA(const uint8* src_argb,
2242                       const uint8* src_argb1,
2243                       uint8* dst_argb,
2244                       int width);
2245 void ARGBBlendRow_C(const uint8* src_argb,
2246                     const uint8* src_argb1,
2247                     uint8* dst_argb,
2248                     int width);
2249 
2250 // Unattenuated planar alpha blend.
2251 void BlendPlaneRow_SSSE3(const uint8* src0,
2252                          const uint8* src1,
2253                          const uint8* alpha,
2254                          uint8* dst,
2255                          int width);
2256 void BlendPlaneRow_Any_SSSE3(const uint8* src0,
2257                              const uint8* src1,
2258                              const uint8* alpha,
2259                              uint8* dst,
2260                              int width);
2261 void BlendPlaneRow_AVX2(const uint8* src0,
2262                         const uint8* src1,
2263                         const uint8* alpha,
2264                         uint8* dst,
2265                         int width);
2266 void BlendPlaneRow_Any_AVX2(const uint8* src0,
2267                             const uint8* src1,
2268                             const uint8* alpha,
2269                             uint8* dst,
2270                             int width);
2271 void BlendPlaneRow_C(const uint8* src0,
2272                      const uint8* src1,
2273                      const uint8* alpha,
2274                      uint8* dst,
2275                      int width);
2276 
2277 // ARGB multiply images. Same API as Blend, but these require
2278 // pointer and width alignment for SSE2.
2279 void ARGBMultiplyRow_C(const uint8* src_argb,
2280                        const uint8* src_argb1,
2281                        uint8* dst_argb,
2282                        int width);
2283 void ARGBMultiplyRow_SSE2(const uint8* src_argb,
2284                           const uint8* src_argb1,
2285                           uint8* dst_argb,
2286                           int width);
2287 void ARGBMultiplyRow_Any_SSE2(const uint8* src_argb,
2288                               const uint8* src_argb1,
2289                               uint8* dst_argb,
2290                               int width);
2291 void ARGBMultiplyRow_AVX2(const uint8* src_argb,
2292                           const uint8* src_argb1,
2293                           uint8* dst_argb,
2294                           int width);
2295 void ARGBMultiplyRow_Any_AVX2(const uint8* src_argb,
2296                               const uint8* src_argb1,
2297                               uint8* dst_argb,
2298                               int width);
2299 void ARGBMultiplyRow_NEON(const uint8* src_argb,
2300                           const uint8* src_argb1,
2301                           uint8* dst_argb,
2302                           int width);
2303 void ARGBMultiplyRow_Any_NEON(const uint8* src_argb,
2304                               const uint8* src_argb1,
2305                               uint8* dst_argb,
2306                               int width);
2307 void ARGBMultiplyRow_MSA(const uint8* src_argb,
2308                          const uint8* src_argb1,
2309                          uint8* dst_argb,
2310                          int width);
2311 void ARGBMultiplyRow_Any_MSA(const uint8* src_argb,
2312                              const uint8* src_argb1,
2313                              uint8* dst_argb,
2314                              int width);
2315 
2316 // ARGB add images.
2317 void ARGBAddRow_C(const uint8* src_argb,
2318                   const uint8* src_argb1,
2319                   uint8* dst_argb,
2320                   int width);
2321 void ARGBAddRow_SSE2(const uint8* src_argb,
2322                      const uint8* src_argb1,
2323                      uint8* dst_argb,
2324                      int width);
2325 void ARGBAddRow_Any_SSE2(const uint8* src_argb,
2326                          const uint8* src_argb1,
2327                          uint8* dst_argb,
2328                          int width);
2329 void ARGBAddRow_AVX2(const uint8* src_argb,
2330                      const uint8* src_argb1,
2331                      uint8* dst_argb,
2332                      int width);
2333 void ARGBAddRow_Any_AVX2(const uint8* src_argb,
2334                          const uint8* src_argb1,
2335                          uint8* dst_argb,
2336                          int width);
2337 void ARGBAddRow_NEON(const uint8* src_argb,
2338                      const uint8* src_argb1,
2339                      uint8* dst_argb,
2340                      int width);
2341 void ARGBAddRow_Any_NEON(const uint8* src_argb,
2342                          const uint8* src_argb1,
2343                          uint8* dst_argb,
2344                          int width);
2345 void ARGBAddRow_MSA(const uint8* src_argb,
2346                     const uint8* src_argb1,
2347                     uint8* dst_argb,
2348                     int width);
2349 void ARGBAddRow_Any_MSA(const uint8* src_argb,
2350                         const uint8* src_argb1,
2351                         uint8* dst_argb,
2352                         int width);
2353 
2354 // ARGB subtract images. Same API as Blend, but these require
2355 // pointer and width alignment for SSE2.
2356 void ARGBSubtractRow_C(const uint8* src_argb,
2357                        const uint8* src_argb1,
2358                        uint8* dst_argb,
2359                        int width);
2360 void ARGBSubtractRow_SSE2(const uint8* src_argb,
2361                           const uint8* src_argb1,
2362                           uint8* dst_argb,
2363                           int width);
2364 void ARGBSubtractRow_Any_SSE2(const uint8* src_argb,
2365                               const uint8* src_argb1,
2366                               uint8* dst_argb,
2367                               int width);
2368 void ARGBSubtractRow_AVX2(const uint8* src_argb,
2369                           const uint8* src_argb1,
2370                           uint8* dst_argb,
2371                           int width);
2372 void ARGBSubtractRow_Any_AVX2(const uint8* src_argb,
2373                               const uint8* src_argb1,
2374                               uint8* dst_argb,
2375                               int width);
2376 void ARGBSubtractRow_NEON(const uint8* src_argb,
2377                           const uint8* src_argb1,
2378                           uint8* dst_argb,
2379                           int width);
2380 void ARGBSubtractRow_Any_NEON(const uint8* src_argb,
2381                               const uint8* src_argb1,
2382                               uint8* dst_argb,
2383                               int width);
2384 void ARGBSubtractRow_MSA(const uint8* src_argb,
2385                          const uint8* src_argb1,
2386                          uint8* dst_argb,
2387                          int width);
2388 void ARGBSubtractRow_Any_MSA(const uint8* src_argb,
2389                              const uint8* src_argb1,
2390                              uint8* dst_argb,
2391                              int width);
2392 
2393 void ARGBToRGB24Row_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int width);
2394 void ARGBToRAWRow_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int width);
2395 void ARGBToRGB565Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int width);
2396 void ARGBToARGB1555Row_Any_SSE2(const uint8* src_argb,
2397                                 uint8* dst_rgb,
2398                                 int width);
2399 void ARGBToARGB4444Row_Any_SSE2(const uint8* src_argb,
2400                                 uint8* dst_rgb,
2401                                 int width);
2402 
2403 void ARGBToRGB565DitherRow_Any_SSE2(const uint8* src_argb,
2404                                     uint8* dst_rgb,
2405                                     const uint32 dither4,
2406                                     int width);
2407 void ARGBToRGB565DitherRow_Any_AVX2(const uint8* src_argb,
2408                                     uint8* dst_rgb,
2409                                     const uint32 dither4,
2410                                     int width);
2411 
2412 void ARGBToRGB565Row_Any_AVX2(const uint8* src_argb, uint8* dst_rgb, int width);
2413 void ARGBToARGB1555Row_Any_AVX2(const uint8* src_argb,
2414                                 uint8* dst_rgb,
2415                                 int width);
2416 void ARGBToARGB4444Row_Any_AVX2(const uint8* src_argb,
2417                                 uint8* dst_rgb,
2418                                 int width);
2419 
2420 void ARGBToRGB24Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int width);
2421 void ARGBToRAWRow_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int width);
2422 void ARGBToRGB565Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int width);
2423 void ARGBToARGB1555Row_Any_NEON(const uint8* src_argb,
2424                                 uint8* dst_rgb,
2425                                 int width);
2426 void ARGBToARGB4444Row_Any_NEON(const uint8* src_argb,
2427                                 uint8* dst_rgb,
2428                                 int width);
2429 void ARGBToRGB565DitherRow_Any_NEON(const uint8* src_argb,
2430                                     uint8* dst_rgb,
2431                                     const uint32 dither4,
2432                                     int width);
2433 void ARGBToRGB24Row_Any_MSA(const uint8* src_argb, uint8* dst_rgb, int width);
2434 void ARGBToRAWRow_Any_MSA(const uint8* src_argb, uint8* dst_rgb, int width);
2435 void ARGBToRGB565Row_Any_MSA(const uint8* src_argb, uint8* dst_rgb, int width);
2436 void ARGBToARGB1555Row_Any_MSA(const uint8* src_argb,
2437                                uint8* dst_rgb,
2438                                int width);
2439 void ARGBToARGB4444Row_Any_MSA(const uint8* src_argb,
2440                                uint8* dst_rgb,
2441                                int width);
2442 void ARGBToRGB565DitherRow_Any_MSA(const uint8* src_argb,
2443                                    uint8* dst_rgb,
2444                                    const uint32 dither4,
2445                                    int width);
2446 
2447 void I444ToARGBRow_Any_NEON(const uint8* src_y,
2448                             const uint8* src_u,
2449                             const uint8* src_v,
2450                             uint8* dst_argb,
2451                             const struct YuvConstants* yuvconstants,
2452                             int width);
2453 void I422ToARGBRow_Any_NEON(const uint8* src_y,
2454                             const uint8* src_u,
2455                             const uint8* src_v,
2456                             uint8* dst_argb,
2457                             const struct YuvConstants* yuvconstants,
2458                             int width);
2459 void I422AlphaToARGBRow_Any_NEON(const uint8* src_y,
2460                                  const uint8* src_u,
2461                                  const uint8* src_v,
2462                                  const uint8* src_a,
2463                                  uint8* dst_argb,
2464                                  const struct YuvConstants* yuvconstants,
2465                                  int width);
2466 void I422ToRGBARow_Any_NEON(const uint8* src_y,
2467                             const uint8* src_u,
2468                             const uint8* src_v,
2469                             uint8* dst_argb,
2470                             const struct YuvConstants* yuvconstants,
2471                             int width);
2472 void I422ToRGB24Row_Any_NEON(const uint8* src_y,
2473                              const uint8* src_u,
2474                              const uint8* src_v,
2475                              uint8* dst_argb,
2476                              const struct YuvConstants* yuvconstants,
2477                              int width);
2478 void I422ToARGB4444Row_Any_NEON(const uint8* src_y,
2479                                 const uint8* src_u,
2480                                 const uint8* src_v,
2481                                 uint8* dst_argb,
2482                                 const struct YuvConstants* yuvconstants,
2483                                 int width);
2484 void I422ToARGB1555Row_Any_NEON(const uint8* src_y,
2485                                 const uint8* src_u,
2486                                 const uint8* src_v,
2487                                 uint8* dst_argb,
2488                                 const struct YuvConstants* yuvconstants,
2489                                 int width);
2490 void I422ToRGB565Row_Any_NEON(const uint8* src_y,
2491                               const uint8* src_u,
2492                               const uint8* src_v,
2493                               uint8* dst_argb,
2494                               const struct YuvConstants* yuvconstants,
2495                               int width);
2496 void NV12ToARGBRow_Any_NEON(const uint8* src_y,
2497                             const uint8* src_uv,
2498                             uint8* dst_argb,
2499                             const struct YuvConstants* yuvconstants,
2500                             int width);
2501 void NV21ToARGBRow_Any_NEON(const uint8* src_y,
2502                             const uint8* src_vu,
2503                             uint8* dst_argb,
2504                             const struct YuvConstants* yuvconstants,
2505                             int width);
2506 void NV12ToRGB565Row_Any_NEON(const uint8* src_y,
2507                               const uint8* src_uv,
2508                               uint8* dst_argb,
2509                               const struct YuvConstants* yuvconstants,
2510                               int width);
2511 void YUY2ToARGBRow_Any_NEON(const uint8* src_yuy2,
2512                             uint8* dst_argb,
2513                             const struct YuvConstants* yuvconstants,
2514                             int width);
2515 void UYVYToARGBRow_Any_NEON(const uint8* src_uyvy,
2516                             uint8* dst_argb,
2517                             const struct YuvConstants* yuvconstants,
2518                             int width);
2519 void I444ToARGBRow_Any_DSPR2(const uint8* src_y,
2520                              const uint8* src_u,
2521                              const uint8* src_v,
2522                              uint8* dst_argb,
2523                              const struct YuvConstants* yuvconstants,
2524                              int width);
2525 void I422ToARGB4444Row_Any_DSPR2(const uint8* src_y,
2526                                  const uint8* src_u,
2527                                  const uint8* src_v,
2528                                  uint8* dst_argb,
2529                                  const struct YuvConstants* yuvconstants,
2530                                  int width);
2531 void I422ToARGBRow_Any_DSPR2(const uint8* src_y,
2532                              const uint8* src_u,
2533                              const uint8* src_v,
2534                              uint8* dst_argb,
2535                              const struct YuvConstants* yuvconstants,
2536                              int width);
2537 void I422ToARGBRow_DSPR2(const uint8* src_y,
2538                          const uint8* src_u,
2539                          const uint8* src_v,
2540                          uint8* dst_argb,
2541                          const struct YuvConstants* yuvconstants,
2542                          int width);
2543 void I422ToARGB1555Row_Any_DSPR2(const uint8* src_y,
2544                                  const uint8* src_u,
2545                                  const uint8* src_v,
2546                                  uint8* dst_argb,
2547                                  const struct YuvConstants* yuvconstants,
2548                                  int width);
2549 void I411ToARGBRow_Any_DSPR2(const uint8* src_y,
2550                              const uint8* src_u,
2551                              const uint8* src_v,
2552                              uint8* dst_argb,
2553                              const struct YuvConstants* yuvconstants,
2554                              int width);
2555 void NV12ToARGBRow_Any_DSPR2(const uint8* src_y,
2556                              const uint8* src_uv,
2557                              uint8* dst_argb,
2558                              const struct YuvConstants* yuvconstants,
2559                              int width);
2560 void I422ToARGBRow_DSPR2(const uint8* src_y,
2561                          const uint8* src_u,
2562                          const uint8* src_v,
2563                          uint8* dst_argb,
2564                          const struct YuvConstants* yuvconstants,
2565                          int width);
2566 void I444ToARGBRow_Any_MSA(const uint8* src_y,
2567                            const uint8* src_u,
2568                            const uint8* src_v,
2569                            uint8* dst_argb,
2570                            const struct YuvConstants* yuvconstants,
2571                            int width);
2572 void I422ToARGBRow_Any_MSA(const uint8* src_y,
2573                            const uint8* src_u,
2574                            const uint8* src_v,
2575                            uint8* dst_argb,
2576                            const struct YuvConstants* yuvconstants,
2577                            int width);
2578 void I422ToRGBARow_Any_MSA(const uint8* src_y,
2579                            const uint8* src_u,
2580                            const uint8* src_v,
2581                            uint8* dst_argb,
2582                            const struct YuvConstants* yuvconstants,
2583                            int width);
2584 void I422AlphaToARGBRow_Any_MSA(const uint8* src_y,
2585                                 const uint8* src_u,
2586                                 const uint8* src_v,
2587                                 const uint8* src_a,
2588                                 uint8* dst_argb,
2589                                 const struct YuvConstants* yuvconstants,
2590                                 int width);
2591 void I422ToRGB24Row_Any_MSA(const uint8* src_y,
2592                             const uint8* src_u,
2593                             const uint8* src_v,
2594                             uint8* dst_rgb24,
2595                             const struct YuvConstants* yuvconstants,
2596                             int width);
2597 void I422ToRGB565Row_Any_MSA(const uint8* src_y,
2598                              const uint8* src_u,
2599                              const uint8* src_v,
2600                              uint8* dst_rgb565,
2601                              const struct YuvConstants* yuvconstants,
2602                              int width);
2603 void I422ToARGB4444Row_Any_MSA(const uint8* src_y,
2604                                const uint8* src_u,
2605                                const uint8* src_v,
2606                                uint8* dst_argb4444,
2607                                const struct YuvConstants* yuvconstants,
2608                                int width);
2609 void I422ToARGB1555Row_Any_MSA(const uint8* src_y,
2610                                const uint8* src_u,
2611                                const uint8* src_v,
2612                                uint8* dst_argb1555,
2613                                const struct YuvConstants* yuvconstants,
2614                                int width);
2615 void NV12ToARGBRow_Any_MSA(const uint8* src_y,
2616                            const uint8* src_uv,
2617                            uint8* dst_argb,
2618                            const struct YuvConstants* yuvconstants,
2619                            int width);
2620 void NV12ToRGB565Row_Any_MSA(const uint8* src_y,
2621                              const uint8* src_uv,
2622                              uint8* dst_argb,
2623                              const struct YuvConstants* yuvconstants,
2624                              int width);
2625 void NV21ToARGBRow_Any_MSA(const uint8* src_y,
2626                            const uint8* src_vu,
2627                            uint8* dst_argb,
2628                            const struct YuvConstants* yuvconstants,
2629                            int width);
2630 void YUY2ToARGBRow_Any_MSA(const uint8* src_yuy2,
2631                            uint8* dst_argb,
2632                            const struct YuvConstants* yuvconstants,
2633                            int width);
2634 void UYVYToARGBRow_Any_MSA(const uint8* src_uyvy,
2635                            uint8* dst_argb,
2636                            const struct YuvConstants* yuvconstants,
2637                            int width);
2638 
2639 void YUY2ToYRow_AVX2(const uint8* src_yuy2, uint8* dst_y, int width);
2640 void YUY2ToUVRow_AVX2(const uint8* src_yuy2,
2641                       int stride_yuy2,
2642                       uint8* dst_u,
2643                       uint8* dst_v,
2644                       int width);
2645 void YUY2ToUV422Row_AVX2(const uint8* src_yuy2,
2646                          uint8* dst_u,
2647                          uint8* dst_v,
2648                          int width);
2649 void YUY2ToYRow_SSE2(const uint8* src_yuy2, uint8* dst_y, int width);
2650 void YUY2ToUVRow_SSE2(const uint8* src_yuy2,
2651                       int stride_yuy2,
2652                       uint8* dst_u,
2653                       uint8* dst_v,
2654                       int width);
2655 void YUY2ToUV422Row_SSE2(const uint8* src_yuy2,
2656                          uint8* dst_u,
2657                          uint8* dst_v,
2658                          int width);
2659 void YUY2ToYRow_NEON(const uint8* src_yuy2, uint8* dst_y, int width);
2660 void YUY2ToUVRow_NEON(const uint8* src_yuy2,
2661                       int stride_yuy2,
2662                       uint8* dst_u,
2663                       uint8* dst_v,
2664                       int width);
2665 void YUY2ToUV422Row_NEON(const uint8* src_yuy2,
2666                          uint8* dst_u,
2667                          uint8* dst_v,
2668                          int width);
2669 void YUY2ToYRow_MSA(const uint8* src_yuy2, uint8* dst_y, int width);
2670 void YUY2ToUVRow_MSA(const uint8* src_yuy2,
2671                      int stride_yuy2,
2672                      uint8* dst_u,
2673                      uint8* dst_v,
2674                      int width);
2675 void YUY2ToUV422Row_MSA(const uint8* src_yuy2,
2676                         uint8* dst_u,
2677                         uint8* dst_v,
2678                         int width);
2679 void YUY2ToYRow_C(const uint8* src_yuy2, uint8* dst_y, int width);
2680 void YUY2ToUVRow_C(const uint8* src_yuy2,
2681                    int stride_yuy2,
2682                    uint8* dst_u,
2683                    uint8* dst_v,
2684                    int width);
2685 void YUY2ToUV422Row_C(const uint8* src_yuy2,
2686                       uint8* dst_u,
2687                       uint8* dst_v,
2688                       int width);
2689 void YUY2ToYRow_Any_AVX2(const uint8* src_yuy2, uint8* dst_y, int width);
2690 void YUY2ToUVRow_Any_AVX2(const uint8* src_yuy2,
2691                           int stride_yuy2,
2692                           uint8* dst_u,
2693                           uint8* dst_v,
2694                           int width);
2695 void YUY2ToUV422Row_Any_AVX2(const uint8* src_yuy2,
2696                              uint8* dst_u,
2697                              uint8* dst_v,
2698                              int width);
2699 void YUY2ToYRow_Any_SSE2(const uint8* src_yuy2, uint8* dst_y, int width);
2700 void YUY2ToUVRow_Any_SSE2(const uint8* src_yuy2,
2701                           int stride_yuy2,
2702                           uint8* dst_u,
2703                           uint8* dst_v,
2704                           int width);
2705 void YUY2ToUV422Row_Any_SSE2(const uint8* src_yuy2,
2706                              uint8* dst_u,
2707                              uint8* dst_v,
2708                              int width);
2709 void YUY2ToYRow_Any_NEON(const uint8* src_yuy2, uint8* dst_y, int width);
2710 void YUY2ToUVRow_Any_NEON(const uint8* src_yuy2,
2711                           int stride_yuy2,
2712                           uint8* dst_u,
2713                           uint8* dst_v,
2714                           int width);
2715 void YUY2ToUV422Row_Any_NEON(const uint8* src_yuy2,
2716                              uint8* dst_u,
2717                              uint8* dst_v,
2718                              int width);
2719 void YUY2ToYRow_Any_MSA(const uint8* src_yuy2, uint8* dst_y, int width);
2720 void YUY2ToUVRow_Any_MSA(const uint8* src_yuy2,
2721                          int stride_yuy2,
2722                          uint8* dst_u,
2723                          uint8* dst_v,
2724                          int width);
2725 void YUY2ToUV422Row_Any_MSA(const uint8* src_yuy2,
2726                             uint8* dst_u,
2727                             uint8* dst_v,
2728                             int width);
2729 void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int width);
2730 void UYVYToUVRow_AVX2(const uint8* src_uyvy,
2731                       int stride_uyvy,
2732                       uint8* dst_u,
2733                       uint8* dst_v,
2734                       int width);
2735 void UYVYToUV422Row_AVX2(const uint8* src_uyvy,
2736                          uint8* dst_u,
2737                          uint8* dst_v,
2738                          int width);
2739 void UYVYToYRow_SSE2(const uint8* src_uyvy, uint8* dst_y, int width);
2740 void UYVYToUVRow_SSE2(const uint8* src_uyvy,
2741                       int stride_uyvy,
2742                       uint8* dst_u,
2743                       uint8* dst_v,
2744                       int width);
2745 void UYVYToUV422Row_SSE2(const uint8* src_uyvy,
2746                          uint8* dst_u,
2747                          uint8* dst_v,
2748                          int width);
2749 void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int width);
2750 void UYVYToUVRow_AVX2(const uint8* src_uyvy,
2751                       int stride_uyvy,
2752                       uint8* dst_u,
2753                       uint8* dst_v,
2754                       int width);
2755 void UYVYToUV422Row_AVX2(const uint8* src_uyvy,
2756                          uint8* dst_u,
2757                          uint8* dst_v,
2758                          int width);
2759 void UYVYToYRow_NEON(const uint8* src_uyvy, uint8* dst_y, int width);
2760 void UYVYToUVRow_NEON(const uint8* src_uyvy,
2761                       int stride_uyvy,
2762                       uint8* dst_u,
2763                       uint8* dst_v,
2764                       int width);
2765 void UYVYToUV422Row_NEON(const uint8* src_uyvy,
2766                          uint8* dst_u,
2767                          uint8* dst_v,
2768                          int width);
2769 void UYVYToYRow_MSA(const uint8* src_uyvy, uint8* dst_y, int width);
2770 void UYVYToUVRow_MSA(const uint8* src_uyvy,
2771                      int stride_uyvy,
2772                      uint8* dst_u,
2773                      uint8* dst_v,
2774                      int width);
2775 void UYVYToUV422Row_MSA(const uint8* src_uyvy,
2776                         uint8* dst_u,
2777                         uint8* dst_v,
2778                         int width);
2779 
2780 void UYVYToYRow_C(const uint8* src_uyvy, uint8* dst_y, int width);
2781 void UYVYToUVRow_C(const uint8* src_uyvy,
2782                    int stride_uyvy,
2783                    uint8* dst_u,
2784                    uint8* dst_v,
2785                    int width);
2786 void UYVYToUV422Row_C(const uint8* src_uyvy,
2787                       uint8* dst_u,
2788                       uint8* dst_v,
2789                       int width);
2790 void UYVYToYRow_Any_AVX2(const uint8* src_uyvy, uint8* dst_y, int width);
2791 void UYVYToUVRow_Any_AVX2(const uint8* src_uyvy,
2792                           int stride_uyvy,
2793                           uint8* dst_u,
2794                           uint8* dst_v,
2795                           int width);
2796 void UYVYToUV422Row_Any_AVX2(const uint8* src_uyvy,
2797                              uint8* dst_u,
2798                              uint8* dst_v,
2799                              int width);
2800 void UYVYToYRow_Any_SSE2(const uint8* src_uyvy, uint8* dst_y, int width);
2801 void UYVYToUVRow_Any_SSE2(const uint8* src_uyvy,
2802                           int stride_uyvy,
2803                           uint8* dst_u,
2804                           uint8* dst_v,
2805                           int width);
2806 void UYVYToUV422Row_Any_SSE2(const uint8* src_uyvy,
2807                              uint8* dst_u,
2808                              uint8* dst_v,
2809                              int width);
2810 void UYVYToYRow_Any_NEON(const uint8* src_uyvy, uint8* dst_y, int width);
2811 void UYVYToUVRow_Any_NEON(const uint8* src_uyvy,
2812                           int stride_uyvy,
2813                           uint8* dst_u,
2814                           uint8* dst_v,
2815                           int width);
2816 void UYVYToUV422Row_Any_NEON(const uint8* src_uyvy,
2817                              uint8* dst_u,
2818                              uint8* dst_v,
2819                              int width);
2820 void UYVYToYRow_Any_MSA(const uint8* src_uyvy, uint8* dst_y, int width);
2821 void UYVYToUVRow_Any_MSA(const uint8* src_uyvy,
2822                          int stride_uyvy,
2823                          uint8* dst_u,
2824                          uint8* dst_v,
2825                          int width);
2826 void UYVYToUV422Row_Any_MSA(const uint8* src_uyvy,
2827                             uint8* dst_u,
2828                             uint8* dst_v,
2829                             int width);
2830 
2831 void I422ToYUY2Row_C(const uint8* src_y,
2832                      const uint8* src_u,
2833                      const uint8* src_v,
2834                      uint8* dst_yuy2,
2835                      int width);
2836 void I422ToUYVYRow_C(const uint8* src_y,
2837                      const uint8* src_u,
2838                      const uint8* src_v,
2839                      uint8* dst_uyvy,
2840                      int width);
2841 void I422ToYUY2Row_SSE2(const uint8* src_y,
2842                         const uint8* src_u,
2843                         const uint8* src_v,
2844                         uint8* dst_yuy2,
2845                         int width);
2846 void I422ToUYVYRow_SSE2(const uint8* src_y,
2847                         const uint8* src_u,
2848                         const uint8* src_v,
2849                         uint8* dst_uyvy,
2850                         int width);
2851 void I422ToYUY2Row_Any_SSE2(const uint8* src_y,
2852                             const uint8* src_u,
2853                             const uint8* src_v,
2854                             uint8* dst_yuy2,
2855                             int width);
2856 void I422ToUYVYRow_Any_SSE2(const uint8* src_y,
2857                             const uint8* src_u,
2858                             const uint8* src_v,
2859                             uint8* dst_uyvy,
2860                             int width);
2861 void I422ToYUY2Row_NEON(const uint8* src_y,
2862                         const uint8* src_u,
2863                         const uint8* src_v,
2864                         uint8* dst_yuy2,
2865                         int width);
2866 void I422ToUYVYRow_NEON(const uint8* src_y,
2867                         const uint8* src_u,
2868                         const uint8* src_v,
2869                         uint8* dst_uyvy,
2870                         int width);
2871 void I422ToYUY2Row_Any_NEON(const uint8* src_y,
2872                             const uint8* src_u,
2873                             const uint8* src_v,
2874                             uint8* dst_yuy2,
2875                             int width);
2876 void I422ToUYVYRow_Any_NEON(const uint8* src_y,
2877                             const uint8* src_u,
2878                             const uint8* src_v,
2879                             uint8* dst_uyvy,
2880                             int width);
2881 void I422ToYUY2Row_MSA(const uint8* src_y,
2882                        const uint8* src_u,
2883                        const uint8* src_v,
2884                        uint8* dst_yuy2,
2885                        int width);
2886 void I422ToUYVYRow_MSA(const uint8* src_y,
2887                        const uint8* src_u,
2888                        const uint8* src_v,
2889                        uint8* dst_uyvy,
2890                        int width);
2891 void I422ToYUY2Row_Any_MSA(const uint8* src_y,
2892                            const uint8* src_u,
2893                            const uint8* src_v,
2894                            uint8* dst_yuy2,
2895                            int width);
2896 void I422ToUYVYRow_Any_MSA(const uint8* src_y,
2897                            const uint8* src_u,
2898                            const uint8* src_v,
2899                            uint8* dst_uyvy,
2900                            int width);
2901 
2902 // Effects related row functions.
2903 void ARGBAttenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width);
2904 void ARGBAttenuateRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width);
2905 void ARGBAttenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
2906 void ARGBAttenuateRow_NEON(const uint8* src_argb, uint8* dst_argb, int width);
2907 void ARGBAttenuateRow_MSA(const uint8* src_argb, uint8* dst_argb, int width);
2908 void ARGBAttenuateRow_Any_SSE2(const uint8* src_argb,
2909                                uint8* dst_argb,
2910                                int width);
2911 void ARGBAttenuateRow_Any_SSSE3(const uint8* src_argb,
2912                                 uint8* dst_argb,
2913                                 int width);
2914 void ARGBAttenuateRow_Any_AVX2(const uint8* src_argb,
2915                                uint8* dst_argb,
2916                                int width);
2917 void ARGBAttenuateRow_Any_NEON(const uint8* src_argb,
2918                                uint8* dst_argb,
2919                                int width);
2920 void ARGBAttenuateRow_Any_MSA(const uint8* src_argb,
2921                               uint8* dst_argb,
2922                               int width);
2923 
2924 // Inverse table for unattenuate, shared by C and SSE2.
2925 extern const uint32 fixed_invtbl8[256];
2926 void ARGBUnattenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width);
2927 void ARGBUnattenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
2928 void ARGBUnattenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width);
2929 void ARGBUnattenuateRow_Any_SSE2(const uint8* src_argb,
2930                                  uint8* dst_argb,
2931                                  int width);
2932 void ARGBUnattenuateRow_Any_AVX2(const uint8* src_argb,
2933                                  uint8* dst_argb,
2934                                  int width);
2935 
2936 void ARGBGrayRow_C(const uint8* src_argb, uint8* dst_argb, int width);
2937 void ARGBGrayRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width);
2938 void ARGBGrayRow_NEON(const uint8* src_argb, uint8* dst_argb, int width);
2939 void ARGBGrayRow_MSA(const uint8* src_argb, uint8* dst_argb, int width);
2940 
2941 void ARGBSepiaRow_C(uint8* dst_argb, int width);
2942 void ARGBSepiaRow_SSSE3(uint8* dst_argb, int width);
2943 void ARGBSepiaRow_NEON(uint8* dst_argb, int width);
2944 void ARGBSepiaRow_MSA(uint8* dst_argb, int width);
2945 
2946 void ARGBColorMatrixRow_C(const uint8* src_argb,
2947                           uint8* dst_argb,
2948                           const int8* matrix_argb,
2949                           int width);
2950 void ARGBColorMatrixRow_SSSE3(const uint8* src_argb,
2951                               uint8* dst_argb,
2952                               const int8* matrix_argb,
2953                               int width);
2954 void ARGBColorMatrixRow_NEON(const uint8* src_argb,
2955                              uint8* dst_argb,
2956                              const int8* matrix_argb,
2957                              int width);
2958 void ARGBColorMatrixRow_MSA(const uint8* src_argb,
2959                             uint8* dst_argb,
2960                             const int8* matrix_argb,
2961                             int width);
2962 
2963 void ARGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width);
2964 void ARGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width);
2965 
2966 void RGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width);
2967 void RGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width);
2968 
2969 void ARGBQuantizeRow_C(uint8* dst_argb,
2970                        int scale,
2971                        int interval_size,
2972                        int interval_offset,
2973                        int width);
2974 void ARGBQuantizeRow_SSE2(uint8* dst_argb,
2975                           int scale,
2976                           int interval_size,
2977                           int interval_offset,
2978                           int width);
2979 void ARGBQuantizeRow_NEON(uint8* dst_argb,
2980                           int scale,
2981                           int interval_size,
2982                           int interval_offset,
2983                           int width);
2984 void ARGBQuantizeRow_MSA(uint8* dst_argb,
2985                          int scale,
2986                          int interval_size,
2987                          int interval_offset,
2988                          int width);
2989 
2990 void ARGBShadeRow_C(const uint8* src_argb,
2991                     uint8* dst_argb,
2992                     int width,
2993                     uint32 value);
2994 void ARGBShadeRow_SSE2(const uint8* src_argb,
2995                        uint8* dst_argb,
2996                        int width,
2997                        uint32 value);
2998 void ARGBShadeRow_NEON(const uint8* src_argb,
2999                        uint8* dst_argb,
3000                        int width,
3001                        uint32 value);
3002 void ARGBShadeRow_MSA(const uint8* src_argb,
3003                       uint8* dst_argb,
3004                       int width,
3005                       uint32 value);
3006 
3007 // Used for blur.
3008 void CumulativeSumToAverageRow_SSE2(const int32* topleft,
3009                                     const int32* botleft,
3010                                     int width,
3011                                     int area,
3012                                     uint8* dst,
3013                                     int count);
3014 void ComputeCumulativeSumRow_SSE2(const uint8* row,
3015                                   int32* cumsum,
3016                                   const int32* previous_cumsum,
3017                                   int width);
3018 
3019 void CumulativeSumToAverageRow_C(const int32* topleft,
3020                                  const int32* botleft,
3021                                  int width,
3022                                  int area,
3023                                  uint8* dst,
3024                                  int count);
3025 void ComputeCumulativeSumRow_C(const uint8* row,
3026                                int32* cumsum,
3027                                const int32* previous_cumsum,
3028                                int width);
3029 
3030 LIBYUV_API
3031 void ARGBAffineRow_C(const uint8* src_argb,
3032                      int src_argb_stride,
3033                      uint8* dst_argb,
3034                      const float* uv_dudv,
3035                      int width);
3036 LIBYUV_API
3037 void ARGBAffineRow_SSE2(const uint8* src_argb,
3038                         int src_argb_stride,
3039                         uint8* dst_argb,
3040                         const float* uv_dudv,
3041                         int width);
3042 
3043 // Used for I420Scale, ARGBScale, and ARGBInterpolate.
3044 void InterpolateRow_C(uint8* dst_ptr,
3045                       const uint8* src_ptr,
3046                       ptrdiff_t src_stride_ptr,
3047                       int width,
3048                       int source_y_fraction);
3049 void InterpolateRow_SSSE3(uint8* dst_ptr,
3050                           const uint8* src_ptr,
3051                           ptrdiff_t src_stride_ptr,
3052                           int width,
3053                           int source_y_fraction);
3054 void InterpolateRow_AVX2(uint8* dst_ptr,
3055                          const uint8* src_ptr,
3056                          ptrdiff_t src_stride_ptr,
3057                          int width,
3058                          int source_y_fraction);
3059 void InterpolateRow_NEON(uint8* dst_ptr,
3060                          const uint8* src_ptr,
3061                          ptrdiff_t src_stride_ptr,
3062                          int width,
3063                          int source_y_fraction);
3064 void InterpolateRow_DSPR2(uint8* dst_ptr,
3065                           const uint8* src_ptr,
3066                           ptrdiff_t src_stride_ptr,
3067                           int width,
3068                           int source_y_fraction);
3069 void InterpolateRow_MSA(uint8* dst_ptr,
3070                         const uint8* src_ptr,
3071                         ptrdiff_t src_stride_ptr,
3072                         int width,
3073                         int source_y_fraction);
3074 void InterpolateRow_Any_NEON(uint8* dst_ptr,
3075                              const uint8* src_ptr,
3076                              ptrdiff_t src_stride_ptr,
3077                              int width,
3078                              int source_y_fraction);
3079 void InterpolateRow_Any_SSSE3(uint8* dst_ptr,
3080                               const uint8* src_ptr,
3081                               ptrdiff_t src_stride_ptr,
3082                               int width,
3083                               int source_y_fraction);
3084 void InterpolateRow_Any_AVX2(uint8* dst_ptr,
3085                              const uint8* src_ptr,
3086                              ptrdiff_t src_stride_ptr,
3087                              int width,
3088                              int source_y_fraction);
3089 void InterpolateRow_Any_DSPR2(uint8* dst_ptr,
3090                               const uint8* src_ptr,
3091                               ptrdiff_t src_stride_ptr,
3092                               int width,
3093                               int source_y_fraction);
3094 void InterpolateRow_Any_MSA(uint8* dst_ptr,
3095                             const uint8* src_ptr,
3096                             ptrdiff_t src_stride_ptr,
3097                             int width,
3098                             int source_y_fraction);
3099 
3100 void InterpolateRow_16_C(uint16* dst_ptr,
3101                          const uint16* src_ptr,
3102                          ptrdiff_t src_stride_ptr,
3103                          int width,
3104                          int source_y_fraction);
3105 
3106 // Sobel images.
3107 void SobelXRow_C(const uint8* src_y0,
3108                  const uint8* src_y1,
3109                  const uint8* src_y2,
3110                  uint8* dst_sobelx,
3111                  int width);
3112 void SobelXRow_SSE2(const uint8* src_y0,
3113                     const uint8* src_y1,
3114                     const uint8* src_y2,
3115                     uint8* dst_sobelx,
3116                     int width);
3117 void SobelXRow_NEON(const uint8* src_y0,
3118                     const uint8* src_y1,
3119                     const uint8* src_y2,
3120                     uint8* dst_sobelx,
3121                     int width);
3122 void SobelXRow_MSA(const uint8* src_y0,
3123                    const uint8* src_y1,
3124                    const uint8* src_y2,
3125                    uint8* dst_sobelx,
3126                    int width);
3127 void SobelYRow_C(const uint8* src_y0,
3128                  const uint8* src_y1,
3129                  uint8* dst_sobely,
3130                  int width);
3131 void SobelYRow_SSE2(const uint8* src_y0,
3132                     const uint8* src_y1,
3133                     uint8* dst_sobely,
3134                     int width);
3135 void SobelYRow_NEON(const uint8* src_y0,
3136                     const uint8* src_y1,
3137                     uint8* dst_sobely,
3138                     int width);
3139 void SobelYRow_MSA(const uint8* src_y0,
3140                    const uint8* src_y1,
3141                    uint8* dst_sobely,
3142                    int width);
3143 void SobelRow_C(const uint8* src_sobelx,
3144                 const uint8* src_sobely,
3145                 uint8* dst_argb,
3146                 int width);
3147 void SobelRow_SSE2(const uint8* src_sobelx,
3148                    const uint8* src_sobely,
3149                    uint8* dst_argb,
3150                    int width);
3151 void SobelRow_NEON(const uint8* src_sobelx,
3152                    const uint8* src_sobely,
3153                    uint8* dst_argb,
3154                    int width);
3155 void SobelRow_MSA(const uint8* src_sobelx,
3156                   const uint8* src_sobely,
3157                   uint8* dst_argb,
3158                   int width);
3159 void SobelToPlaneRow_C(const uint8* src_sobelx,
3160                        const uint8* src_sobely,
3161                        uint8* dst_y,
3162                        int width);
3163 void SobelToPlaneRow_SSE2(const uint8* src_sobelx,
3164                           const uint8* src_sobely,
3165                           uint8* dst_y,
3166                           int width);
3167 void SobelToPlaneRow_NEON(const uint8* src_sobelx,
3168                           const uint8* src_sobely,
3169                           uint8* dst_y,
3170                           int width);
3171 void SobelToPlaneRow_MSA(const uint8* src_sobelx,
3172                          const uint8* src_sobely,
3173                          uint8* dst_y,
3174                          int width);
3175 void SobelXYRow_C(const uint8* src_sobelx,
3176                   const uint8* src_sobely,
3177                   uint8* dst_argb,
3178                   int width);
3179 void SobelXYRow_SSE2(const uint8* src_sobelx,
3180                      const uint8* src_sobely,
3181                      uint8* dst_argb,
3182                      int width);
3183 void SobelXYRow_NEON(const uint8* src_sobelx,
3184                      const uint8* src_sobely,
3185                      uint8* dst_argb,
3186                      int width);
3187 void SobelXYRow_MSA(const uint8* src_sobelx,
3188                     const uint8* src_sobely,
3189                     uint8* dst_argb,
3190                     int width);
3191 void SobelRow_Any_SSE2(const uint8* src_sobelx,
3192                        const uint8* src_sobely,
3193                        uint8* dst_argb,
3194                        int width);
3195 void SobelRow_Any_NEON(const uint8* src_sobelx,
3196                        const uint8* src_sobely,
3197                        uint8* dst_argb,
3198                        int width);
3199 void SobelRow_Any_MSA(const uint8* src_sobelx,
3200                       const uint8* src_sobely,
3201                       uint8* dst_argb,
3202                       int width);
3203 void SobelToPlaneRow_Any_SSE2(const uint8* src_sobelx,
3204                               const uint8* src_sobely,
3205                               uint8* dst_y,
3206                               int width);
3207 void SobelToPlaneRow_Any_NEON(const uint8* src_sobelx,
3208                               const uint8* src_sobely,
3209                               uint8* dst_y,
3210                               int width);
3211 void SobelToPlaneRow_Any_MSA(const uint8* src_sobelx,
3212                              const uint8* src_sobely,
3213                              uint8* dst_y,
3214                              int width);
3215 void SobelXYRow_Any_SSE2(const uint8* src_sobelx,
3216                          const uint8* src_sobely,
3217                          uint8* dst_argb,
3218                          int width);
3219 void SobelXYRow_Any_NEON(const uint8* src_sobelx,
3220                          const uint8* src_sobely,
3221                          uint8* dst_argb,
3222                          int width);
3223 void SobelXYRow_Any_MSA(const uint8* src_sobelx,
3224                         const uint8* src_sobely,
3225                         uint8* dst_argb,
3226                         int width);
3227 
3228 void ARGBPolynomialRow_C(const uint8* src_argb,
3229                          uint8* dst_argb,
3230                          const float* poly,
3231                          int width);
3232 void ARGBPolynomialRow_SSE2(const uint8* src_argb,
3233                             uint8* dst_argb,
3234                             const float* poly,
3235                             int width);
3236 void ARGBPolynomialRow_AVX2(const uint8* src_argb,
3237                             uint8* dst_argb,
3238                             const float* poly,
3239                             int width);
3240 
3241 // Scale and convert to half float.
3242 void HalfFloatRow_C(const uint16* src, uint16* dst, float scale, int width);
3243 void HalfFloatRow_SSE2(const uint16* src, uint16* dst, float scale, int width);
3244 void HalfFloatRow_Any_SSE2(const uint16* src,
3245                            uint16* dst,
3246                            float scale,
3247                            int width);
3248 void HalfFloatRow_AVX2(const uint16* src, uint16* dst, float scale, int width);
3249 void HalfFloatRow_Any_AVX2(const uint16* src,
3250                            uint16* dst,
3251                            float scale,
3252                            int width);
3253 void HalfFloatRow_F16C(const uint16* src, uint16* dst, float scale, int width);
3254 void HalfFloatRow_Any_F16C(const uint16* src,
3255                            uint16* dst,
3256                            float scale,
3257                            int width);
3258 void HalfFloat1Row_F16C(const uint16* src, uint16* dst, float scale, int width);
3259 void HalfFloat1Row_Any_F16C(const uint16* src,
3260                             uint16* dst,
3261                             float scale,
3262                             int width);
3263 void HalfFloatRow_NEON(const uint16* src, uint16* dst, float scale, int width);
3264 void HalfFloatRow_Any_NEON(const uint16* src,
3265                            uint16* dst,
3266                            float scale,
3267                            int width);
3268 void HalfFloat1Row_NEON(const uint16* src, uint16* dst, float scale, int width);
3269 void HalfFloat1Row_Any_NEON(const uint16* src,
3270                             uint16* dst,
3271                             float scale,
3272                             int width);
3273 void HalfFloatRow_MSA(const uint16* src, uint16* dst, float scale, int width);
3274 void HalfFloatRow_Any_MSA(const uint16* src,
3275                           uint16* dst,
3276                           float scale,
3277                           int width);
3278 
3279 void ARGBLumaColorTableRow_C(const uint8* src_argb,
3280                              uint8* dst_argb,
3281                              int width,
3282                              const uint8* luma,
3283                              uint32 lumacoeff);
3284 void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb,
3285                                  uint8* dst_argb,
3286                                  int width,
3287                                  const uint8* luma,
3288                                  uint32 lumacoeff);
3289 
3290 float ScaleMaxSamples_C(const float* src, float* dst, float scale, int width);
3291 float ScaleMaxSamples_NEON(const float* src,
3292                            float* dst,
3293                            float scale,
3294                            int width);
3295 float ScaleSumSamples_C(const float* src, float* dst, float scale, int width);
3296 float ScaleSumSamples_NEON(const float* src,
3297                            float* dst,
3298                            float scale,
3299                            int width);
3300 void ScaleSamples_C(const float* src, float* dst, float scale, int width);
3301 void ScaleSamples_NEON(const float* src, float* dst, float scale, int width);
3302 
3303 #ifdef __cplusplus
3304 }  // extern "C"
3305 }  // namespace libyuv
3306 #endif
3307 
3308 #endif  // INCLUDE_LIBYUV_ROW_H_
3309