1 /*
2  *  Copyright 2013 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_SCALE_ROW_H_
12 #define INCLUDE_LIBYUV_SCALE_ROW_H_
13 
14 #include "libyuv/basic_types.h"
15 #include "libyuv/scale.h"
16 
17 #ifdef __cplusplus
18 namespace libyuv {
19 extern "C" {
20 #endif
21 
22 #if defined(__pnacl__) || defined(__CLR_VER) ||            \
23     (defined(__native_client__) && defined(__x86_64__)) || \
24     (defined(__i386__) && !defined(__SSE__) && !defined(__clang__))
25 #define LIBYUV_DISABLE_X86
26 #endif
27 #if defined(__native_client__)
28 #define LIBYUV_DISABLE_NEON
29 #endif
30 // MemorySanitizer does not support assembly code yet. http://crbug.com/344505
31 #if defined(__has_feature)
32 #if __has_feature(memory_sanitizer)
33 #define LIBYUV_DISABLE_X86
34 #endif
35 #endif
36 // GCC >= 4.7.0 required for AVX2.
37 #if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))
38 #if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 7))
39 #define GCC_HAS_AVX2 1
40 #endif  // GNUC >= 4.7
41 #endif  // __GNUC__
42 
43 // clang >= 3.4.0 required for AVX2.
44 #if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
45 #if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4))
46 #define CLANG_HAS_AVX2 1
47 #endif  // clang >= 3.4
48 #endif  // __clang__
49 
50 // Visual C 2012 required for AVX2.
51 #if defined(_M_IX86) && !defined(__clang__) && defined(_MSC_VER) && \
52     _MSC_VER >= 1700
53 #define VISUALC_HAS_AVX2 1
54 #endif  // VisualStudio >= 2012
55 
56 // The following are available on all x86 platforms:
57 #if !defined(LIBYUV_DISABLE_X86) && \
58     (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__))
59 #define HAS_FIXEDDIV1_X86
60 #define HAS_FIXEDDIV_X86
61 #define HAS_SCALEADDROW_SSE2
62 #define HAS_SCALEARGBCOLS_SSE2
63 #define HAS_SCALEARGBCOLSUP2_SSE2
64 #define HAS_SCALEARGBFILTERCOLS_SSSE3
65 #define HAS_SCALEARGBROWDOWN2_SSE2
66 #define HAS_SCALEARGBROWDOWNEVEN_SSE2
67 #define HAS_SCALECOLSUP2_SSE2
68 #define HAS_SCALEFILTERCOLS_SSSE3
69 #define HAS_SCALEROWDOWN2_SSSE3
70 #define HAS_SCALEROWDOWN34_SSSE3
71 #define HAS_SCALEROWDOWN38_SSSE3
72 #define HAS_SCALEROWDOWN4_SSSE3
73 #endif
74 
75 // The following are available for gcc/clang x86 platforms:
76 // TODO(fbarchard): Port to Visual C
77 #if !defined(LIBYUV_DISABLE_X86) && \
78     (defined(__x86_64__) || (defined(__i386__) && !defined(_MSC_VER)))
79 #define HAS_SCALEUVROWDOWN2BOX_SSSE3
80 #endif
81 
82 // The following are available for gcc/clang x86 platforms, but
83 // require clang 3.4 or gcc 4.7.
84 // TODO(fbarchard): Port to Visual C
85 #if !defined(LIBYUV_DISABLE_X86) &&                                     \
86     (defined(__x86_64__) || defined(__i386__)) && !defined(_MSC_VER) && \
87     (defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2))
88 #define HAS_SCALEUVROWDOWN2BOX_AVX2
89 #endif
90 
91 // The following are available on all x86 platforms, but
92 // require VS2012, clang 3.4 or gcc 4.7.
93 // The code supports NaCL but requires a new compiler and validator.
94 #if !defined(LIBYUV_DISABLE_X86) &&                          \
95     (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2) || \
96      defined(GCC_HAS_AVX2))
97 #define HAS_SCALEADDROW_AVX2
98 #define HAS_SCALEROWDOWN2_AVX2
99 #define HAS_SCALEROWDOWN4_AVX2
100 #endif
101 
102 // The following are available on Neon platforms:
103 #if !defined(LIBYUV_DISABLE_NEON) && \
104     (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__))
105 #define HAS_SCALEADDROW_NEON
106 #define HAS_SCALEARGBCOLS_NEON
107 #define HAS_SCALEARGBFILTERCOLS_NEON
108 #define HAS_SCALEARGBROWDOWN2_NEON
109 #define HAS_SCALEARGBROWDOWNEVEN_NEON
110 #define HAS_SCALEFILTERCOLS_NEON
111 #define HAS_SCALEROWDOWN2_NEON
112 #define HAS_SCALEROWDOWN34_NEON
113 #define HAS_SCALEROWDOWN38_NEON
114 #define HAS_SCALEROWDOWN4_NEON
115 #define HAS_SCALEUVROWDOWN2BOX_NEON
116 #define HAS_SCALEUVROWDOWNEVEN_NEON
117 #endif
118 
119 #if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa)
120 #define HAS_SCALEADDROW_MSA
121 #define HAS_SCALEARGBCOLS_MSA
122 #define HAS_SCALEARGBFILTERCOLS_MSA
123 #define HAS_SCALEARGBROWDOWN2_MSA
124 #define HAS_SCALEARGBROWDOWNEVEN_MSA
125 #define HAS_SCALEFILTERCOLS_MSA
126 #define HAS_SCALEROWDOWN2_MSA
127 #define HAS_SCALEROWDOWN34_MSA
128 #define HAS_SCALEROWDOWN38_MSA
129 #define HAS_SCALEROWDOWN4_MSA
130 #endif
131 
132 #if !defined(LIBYUV_DISABLE_MMI) && defined(_MIPS_ARCH_LOONGSON3A)
133 #define HAS_FIXEDDIV1_MIPS
134 #define HAS_FIXEDDIV_MIPS
135 #define HAS_SCALEADDROW_16_MMI
136 #define HAS_SCALEADDROW_MMI
137 #define HAS_SCALEARGBCOLS_MMI
138 #define HAS_SCALEARGBCOLSUP2_MMI
139 #define HAS_SCALEARGBROWDOWN2_MMI
140 #define HAS_SCALEARGBROWDOWNEVEN_MMI
141 #define HAS_SCALECOLS_16_MMI
142 #define HAS_SCALECOLS_MMI
143 #define HAS_SCALEROWDOWN2_16_MMI
144 #define HAS_SCALEROWDOWN2_MMI
145 #define HAS_SCALEROWDOWN4_16_MMI
146 #define HAS_SCALEROWDOWN4_MMI
147 #define HAS_SCALEROWDOWN34_MMI
148 #endif
149 
150 // Scale ARGB vertically with bilinear interpolation.
151 void ScalePlaneVertical(int src_height,
152                         int dst_width,
153                         int dst_height,
154                         int src_stride,
155                         int dst_stride,
156                         const uint8_t* src_argb,
157                         uint8_t* dst_argb,
158                         int x,
159                         int y,
160                         int dy,
161                         int bpp,
162                         enum FilterMode filtering);
163 
164 void ScalePlaneVertical_16(int src_height,
165                            int dst_width,
166                            int dst_height,
167                            int src_stride,
168                            int dst_stride,
169                            const uint16_t* src_argb,
170                            uint16_t* dst_argb,
171                            int x,
172                            int y,
173                            int dy,
174                            int wpp,
175                            enum FilterMode filtering);
176 
177 // Simplify the filtering based on scale factors.
178 enum FilterMode ScaleFilterReduce(int src_width,
179                                   int src_height,
180                                   int dst_width,
181                                   int dst_height,
182                                   enum FilterMode filtering);
183 
184 // Divide num by div and return as 16.16 fixed point result.
185 int FixedDiv_C(int num, int div);
186 int FixedDiv_X86(int num, int div);
187 int FixedDiv_MIPS(int num, int div);
188 // Divide num - 1 by div - 1 and return as 16.16 fixed point result.
189 int FixedDiv1_C(int num, int div);
190 int FixedDiv1_X86(int num, int div);
191 int FixedDiv1_MIPS(int num, int div);
192 #ifdef HAS_FIXEDDIV_X86
193 #define FixedDiv FixedDiv_X86
194 #define FixedDiv1 FixedDiv1_X86
195 #elif defined HAS_FIXEDDIV_MIPS
196 #define FixedDiv FixedDiv_MIPS
197 #define FixedDiv1 FixedDiv1_MIPS
198 #else
199 #define FixedDiv FixedDiv_C
200 #define FixedDiv1 FixedDiv1_C
201 #endif
202 
203 // Compute slope values for stepping.
204 void ScaleSlope(int src_width,
205                 int src_height,
206                 int dst_width,
207                 int dst_height,
208                 enum FilterMode filtering,
209                 int* x,
210                 int* y,
211                 int* dx,
212                 int* dy);
213 
214 void ScaleRowDown2_C(const uint8_t* src_ptr,
215                      ptrdiff_t src_stride,
216                      uint8_t* dst,
217                      int dst_width);
218 void ScaleRowDown2_16_C(const uint16_t* src_ptr,
219                         ptrdiff_t src_stride,
220                         uint16_t* dst,
221                         int dst_width);
222 void ScaleRowDown2Linear_C(const uint8_t* src_ptr,
223                            ptrdiff_t src_stride,
224                            uint8_t* dst,
225                            int dst_width);
226 void ScaleRowDown2Linear_16_C(const uint16_t* src_ptr,
227                               ptrdiff_t src_stride,
228                               uint16_t* dst,
229                               int dst_width);
230 void ScaleRowDown2Box_C(const uint8_t* src_ptr,
231                         ptrdiff_t src_stride,
232                         uint8_t* dst,
233                         int dst_width);
234 void ScaleRowDown2Box_Odd_C(const uint8_t* src_ptr,
235                             ptrdiff_t src_stride,
236                             uint8_t* dst,
237                             int dst_width);
238 void ScaleRowDown2Box_16_C(const uint16_t* src_ptr,
239                            ptrdiff_t src_stride,
240                            uint16_t* dst,
241                            int dst_width);
242 void ScaleRowDown4_C(const uint8_t* src_ptr,
243                      ptrdiff_t src_stride,
244                      uint8_t* dst,
245                      int dst_width);
246 void ScaleRowDown4_16_C(const uint16_t* src_ptr,
247                         ptrdiff_t src_stride,
248                         uint16_t* dst,
249                         int dst_width);
250 void ScaleRowDown4Box_C(const uint8_t* src_ptr,
251                         ptrdiff_t src_stride,
252                         uint8_t* dst,
253                         int dst_width);
254 void ScaleRowDown4Box_16_C(const uint16_t* src_ptr,
255                            ptrdiff_t src_stride,
256                            uint16_t* dst,
257                            int dst_width);
258 void ScaleRowDown34_C(const uint8_t* src_ptr,
259                       ptrdiff_t src_stride,
260                       uint8_t* dst,
261                       int dst_width);
262 void ScaleRowDown34_16_C(const uint16_t* src_ptr,
263                          ptrdiff_t src_stride,
264                          uint16_t* dst,
265                          int dst_width);
266 void ScaleRowDown34_0_Box_C(const uint8_t* src_ptr,
267                             ptrdiff_t src_stride,
268                             uint8_t* d,
269                             int dst_width);
270 void ScaleRowDown34_0_Box_16_C(const uint16_t* src_ptr,
271                                ptrdiff_t src_stride,
272                                uint16_t* d,
273                                int dst_width);
274 void ScaleRowDown34_1_Box_C(const uint8_t* src_ptr,
275                             ptrdiff_t src_stride,
276                             uint8_t* d,
277                             int dst_width);
278 void ScaleRowDown34_1_Box_16_C(const uint16_t* src_ptr,
279                                ptrdiff_t src_stride,
280                                uint16_t* d,
281                                int dst_width);
282 void ScaleCols_C(uint8_t* dst_ptr,
283                  const uint8_t* src_ptr,
284                  int dst_width,
285                  int x,
286                  int dx);
287 void ScaleCols_16_C(uint16_t* dst_ptr,
288                     const uint16_t* src_ptr,
289                     int dst_width,
290                     int x,
291                     int dx);
292 void ScaleColsUp2_C(uint8_t* dst_ptr,
293                     const uint8_t* src_ptr,
294                     int dst_width,
295                     int,
296                     int);
297 void ScaleColsUp2_16_C(uint16_t* dst_ptr,
298                        const uint16_t* src_ptr,
299                        int dst_width,
300                        int,
301                        int);
302 void ScaleFilterCols_C(uint8_t* dst_ptr,
303                        const uint8_t* src_ptr,
304                        int dst_width,
305                        int x,
306                        int dx);
307 void ScaleFilterCols_16_C(uint16_t* dst_ptr,
308                           const uint16_t* src_ptr,
309                           int dst_width,
310                           int x,
311                           int dx);
312 void ScaleFilterCols64_C(uint8_t* dst_ptr,
313                          const uint8_t* src_ptr,
314                          int dst_width,
315                          int x32,
316                          int dx);
317 void ScaleFilterCols64_16_C(uint16_t* dst_ptr,
318                             const uint16_t* src_ptr,
319                             int dst_width,
320                             int x32,
321                             int dx);
322 void ScaleRowDown38_C(const uint8_t* src_ptr,
323                       ptrdiff_t src_stride,
324                       uint8_t* dst,
325                       int dst_width);
326 void ScaleRowDown38_16_C(const uint16_t* src_ptr,
327                          ptrdiff_t src_stride,
328                          uint16_t* dst,
329                          int dst_width);
330 void ScaleRowDown38_3_Box_C(const uint8_t* src_ptr,
331                             ptrdiff_t src_stride,
332                             uint8_t* dst_ptr,
333                             int dst_width);
334 void ScaleRowDown38_3_Box_16_C(const uint16_t* src_ptr,
335                                ptrdiff_t src_stride,
336                                uint16_t* dst_ptr,
337                                int dst_width);
338 void ScaleRowDown38_2_Box_C(const uint8_t* src_ptr,
339                             ptrdiff_t src_stride,
340                             uint8_t* dst_ptr,
341                             int dst_width);
342 void ScaleRowDown38_2_Box_16_C(const uint16_t* src_ptr,
343                                ptrdiff_t src_stride,
344                                uint16_t* dst_ptr,
345                                int dst_width);
346 void ScaleAddRow_C(const uint8_t* src_ptr, uint16_t* dst_ptr, int src_width);
347 void ScaleAddRow_16_C(const uint16_t* src_ptr,
348                       uint32_t* dst_ptr,
349                       int src_width);
350 void ScaleARGBRowDown2_C(const uint8_t* src_argb,
351                          ptrdiff_t src_stride,
352                          uint8_t* dst_argb,
353                          int dst_width);
354 void ScaleARGBRowDown2Linear_C(const uint8_t* src_argb,
355                                ptrdiff_t src_stride,
356                                uint8_t* dst_argb,
357                                int dst_width);
358 void ScaleARGBRowDown2Box_C(const uint8_t* src_argb,
359                             ptrdiff_t src_stride,
360                             uint8_t* dst_argb,
361                             int dst_width);
362 void ScaleARGBRowDownEven_C(const uint8_t* src_argb,
363                             ptrdiff_t src_stride,
364                             int src_stepx,
365                             uint8_t* dst_argb,
366                             int dst_width);
367 void ScaleARGBRowDownEvenBox_C(const uint8_t* src_argb,
368                                ptrdiff_t src_stride,
369                                int src_stepx,
370                                uint8_t* dst_argb,
371                                int dst_width);
372 void ScaleARGBCols_C(uint8_t* dst_argb,
373                      const uint8_t* src_argb,
374                      int dst_width,
375                      int x,
376                      int dx);
377 void ScaleARGBCols64_C(uint8_t* dst_argb,
378                        const uint8_t* src_argb,
379                        int dst_width,
380                        int x32,
381                        int dx);
382 void ScaleARGBColsUp2_C(uint8_t* dst_argb,
383                         const uint8_t* src_argb,
384                         int dst_width,
385                         int,
386                         int);
387 void ScaleARGBFilterCols_C(uint8_t* dst_argb,
388                            const uint8_t* src_argb,
389                            int dst_width,
390                            int x,
391                            int dx);
392 void ScaleARGBFilterCols64_C(uint8_t* dst_argb,
393                              const uint8_t* src_argb,
394                              int dst_width,
395                              int x32,
396                              int dx);
397 void ScaleUVRowDown2_C(const uint8_t* src_uv,
398                        ptrdiff_t src_stride,
399                        uint8_t* dst_uv,
400                        int dst_width);
401 void ScaleUVRowDown2Linear_C(const uint8_t* src_uv,
402                              ptrdiff_t src_stride,
403                              uint8_t* dst_uv,
404                              int dst_width);
405 void ScaleUVRowDown2Box_C(const uint8_t* src_uv,
406                           ptrdiff_t src_stride,
407                           uint8_t* dst_uv,
408                           int dst_width);
409 void ScaleUVRowDownEven_C(const uint8_t* src_uv,
410                           ptrdiff_t src_stride,
411                           int src_stepx,
412                           uint8_t* dst_uv,
413                           int dst_width);
414 void ScaleUVRowDownEvenBox_C(const uint8_t* src_uv,
415                              ptrdiff_t src_stride,
416                              int src_stepx,
417                              uint8_t* dst_uv,
418                              int dst_width);
419 void ScaleUVCols_C(uint8_t* dst_uv,
420                    const uint8_t* src_uv,
421                    int dst_width,
422                    int x,
423                    int dx);
424 void ScaleUVCols64_C(uint8_t* dst_uv,
425                      const uint8_t* src_uv,
426                      int dst_width,
427                      int x32,
428                      int dx);
429 void ScaleUVColsUp2_C(uint8_t* dst_uv,
430                       const uint8_t* src_uv,
431                       int dst_width,
432                       int,
433                       int);
434 void ScaleUVFilterCols_C(uint8_t* dst_uv,
435                          const uint8_t* src_uv,
436                          int dst_width,
437                          int x,
438                          int dx);
439 void ScaleUVFilterCols64_C(uint8_t* dst_uv,
440                            const uint8_t* src_uv,
441                            int dst_width,
442                            int x32,
443                            int dx);
444 
445 // Specialized scalers for x86.
446 void ScaleRowDown2_SSSE3(const uint8_t* src_ptr,
447                          ptrdiff_t src_stride,
448                          uint8_t* dst_ptr,
449                          int dst_width);
450 void ScaleRowDown2Linear_SSSE3(const uint8_t* src_ptr,
451                                ptrdiff_t src_stride,
452                                uint8_t* dst_ptr,
453                                int dst_width);
454 void ScaleRowDown2Box_SSSE3(const uint8_t* src_ptr,
455                             ptrdiff_t src_stride,
456                             uint8_t* dst_ptr,
457                             int dst_width);
458 void ScaleRowDown2_AVX2(const uint8_t* src_ptr,
459                         ptrdiff_t src_stride,
460                         uint8_t* dst_ptr,
461                         int dst_width);
462 void ScaleRowDown2Linear_AVX2(const uint8_t* src_ptr,
463                               ptrdiff_t src_stride,
464                               uint8_t* dst_ptr,
465                               int dst_width);
466 void ScaleRowDown2Box_AVX2(const uint8_t* src_ptr,
467                            ptrdiff_t src_stride,
468                            uint8_t* dst_ptr,
469                            int dst_width);
470 void ScaleRowDown4_SSSE3(const uint8_t* src_ptr,
471                          ptrdiff_t src_stride,
472                          uint8_t* dst_ptr,
473                          int dst_width);
474 void ScaleRowDown4Box_SSSE3(const uint8_t* src_ptr,
475                             ptrdiff_t src_stride,
476                             uint8_t* dst_ptr,
477                             int dst_width);
478 void ScaleRowDown4_AVX2(const uint8_t* src_ptr,
479                         ptrdiff_t src_stride,
480                         uint8_t* dst_ptr,
481                         int dst_width);
482 void ScaleRowDown4Box_AVX2(const uint8_t* src_ptr,
483                            ptrdiff_t src_stride,
484                            uint8_t* dst_ptr,
485                            int dst_width);
486 
487 void ScaleRowDown34_SSSE3(const uint8_t* src_ptr,
488                           ptrdiff_t src_stride,
489                           uint8_t* dst_ptr,
490                           int dst_width);
491 void ScaleRowDown34_1_Box_SSSE3(const uint8_t* src_ptr,
492                                 ptrdiff_t src_stride,
493                                 uint8_t* dst_ptr,
494                                 int dst_width);
495 void ScaleRowDown34_0_Box_SSSE3(const uint8_t* src_ptr,
496                                 ptrdiff_t src_stride,
497                                 uint8_t* dst_ptr,
498                                 int dst_width);
499 void ScaleRowDown38_SSSE3(const uint8_t* src_ptr,
500                           ptrdiff_t src_stride,
501                           uint8_t* dst_ptr,
502                           int dst_width);
503 void ScaleRowDown38_3_Box_SSSE3(const uint8_t* src_ptr,
504                                 ptrdiff_t src_stride,
505                                 uint8_t* dst_ptr,
506                                 int dst_width);
507 void ScaleRowDown38_2_Box_SSSE3(const uint8_t* src_ptr,
508                                 ptrdiff_t src_stride,
509                                 uint8_t* dst_ptr,
510                                 int dst_width);
511 void ScaleRowDown2_Any_SSSE3(const uint8_t* src_ptr,
512                              ptrdiff_t src_stride,
513                              uint8_t* dst_ptr,
514                              int dst_width);
515 void ScaleRowDown2Linear_Any_SSSE3(const uint8_t* src_ptr,
516                                    ptrdiff_t src_stride,
517                                    uint8_t* dst_ptr,
518                                    int dst_width);
519 void ScaleRowDown2Box_Any_SSSE3(const uint8_t* src_ptr,
520                                 ptrdiff_t src_stride,
521                                 uint8_t* dst_ptr,
522                                 int dst_width);
523 void ScaleRowDown2Box_Odd_SSSE3(const uint8_t* src_ptr,
524                                 ptrdiff_t src_stride,
525                                 uint8_t* dst_ptr,
526                                 int dst_width);
527 void ScaleRowDown2_Any_AVX2(const uint8_t* src_ptr,
528                             ptrdiff_t src_stride,
529                             uint8_t* dst_ptr,
530                             int dst_width);
531 void ScaleRowDown2Linear_Any_AVX2(const uint8_t* src_ptr,
532                                   ptrdiff_t src_stride,
533                                   uint8_t* dst_ptr,
534                                   int dst_width);
535 void ScaleRowDown2Box_Any_AVX2(const uint8_t* src_ptr,
536                                ptrdiff_t src_stride,
537                                uint8_t* dst_ptr,
538                                int dst_width);
539 void ScaleRowDown2Box_Odd_AVX2(const uint8_t* src_ptr,
540                                ptrdiff_t src_stride,
541                                uint8_t* dst_ptr,
542                                int dst_width);
543 void ScaleRowDown4_Any_SSSE3(const uint8_t* src_ptr,
544                              ptrdiff_t src_stride,
545                              uint8_t* dst_ptr,
546                              int dst_width);
547 void ScaleRowDown4Box_Any_SSSE3(const uint8_t* src_ptr,
548                                 ptrdiff_t src_stride,
549                                 uint8_t* dst_ptr,
550                                 int dst_width);
551 void ScaleRowDown4_Any_AVX2(const uint8_t* src_ptr,
552                             ptrdiff_t src_stride,
553                             uint8_t* dst_ptr,
554                             int dst_width);
555 void ScaleRowDown4Box_Any_AVX2(const uint8_t* src_ptr,
556                                ptrdiff_t src_stride,
557                                uint8_t* dst_ptr,
558                                int dst_width);
559 
560 void ScaleRowDown34_Any_SSSE3(const uint8_t* src_ptr,
561                               ptrdiff_t src_stride,
562                               uint8_t* dst_ptr,
563                               int dst_width);
564 void ScaleRowDown34_1_Box_Any_SSSE3(const uint8_t* src_ptr,
565                                     ptrdiff_t src_stride,
566                                     uint8_t* dst_ptr,
567                                     int dst_width);
568 void ScaleRowDown34_0_Box_Any_SSSE3(const uint8_t* src_ptr,
569                                     ptrdiff_t src_stride,
570                                     uint8_t* dst_ptr,
571                                     int dst_width);
572 void ScaleRowDown38_Any_SSSE3(const uint8_t* src_ptr,
573                               ptrdiff_t src_stride,
574                               uint8_t* dst_ptr,
575                               int dst_width);
576 void ScaleRowDown38_3_Box_Any_SSSE3(const uint8_t* src_ptr,
577                                     ptrdiff_t src_stride,
578                                     uint8_t* dst_ptr,
579                                     int dst_width);
580 void ScaleRowDown38_2_Box_Any_SSSE3(const uint8_t* src_ptr,
581                                     ptrdiff_t src_stride,
582                                     uint8_t* dst_ptr,
583                                     int dst_width);
584 
585 void ScaleAddRow_SSE2(const uint8_t* src_ptr, uint16_t* dst_ptr, int src_width);
586 void ScaleAddRow_AVX2(const uint8_t* src_ptr, uint16_t* dst_ptr, int src_width);
587 void ScaleAddRow_Any_SSE2(const uint8_t* src_ptr,
588                           uint16_t* dst_ptr,
589                           int src_width);
590 void ScaleAddRow_Any_AVX2(const uint8_t* src_ptr,
591                           uint16_t* dst_ptr,
592                           int src_width);
593 
594 void ScaleFilterCols_SSSE3(uint8_t* dst_ptr,
595                            const uint8_t* src_ptr,
596                            int dst_width,
597                            int x,
598                            int dx);
599 void ScaleColsUp2_SSE2(uint8_t* dst_ptr,
600                        const uint8_t* src_ptr,
601                        int dst_width,
602                        int x,
603                        int dx);
604 
605 // ARGB Column functions
606 void ScaleARGBCols_SSE2(uint8_t* dst_argb,
607                         const uint8_t* src_argb,
608                         int dst_width,
609                         int x,
610                         int dx);
611 void ScaleARGBFilterCols_SSSE3(uint8_t* dst_argb,
612                                const uint8_t* src_argb,
613                                int dst_width,
614                                int x,
615                                int dx);
616 void ScaleARGBColsUp2_SSE2(uint8_t* dst_argb,
617                            const uint8_t* src_argb,
618                            int dst_width,
619                            int x,
620                            int dx);
621 void ScaleARGBFilterCols_NEON(uint8_t* dst_argb,
622                               const uint8_t* src_argb,
623                               int dst_width,
624                               int x,
625                               int dx);
626 void ScaleARGBCols_NEON(uint8_t* dst_argb,
627                         const uint8_t* src_argb,
628                         int dst_width,
629                         int x,
630                         int dx);
631 void ScaleARGBFilterCols_Any_NEON(uint8_t* dst_ptr,
632                                   const uint8_t* src_ptr,
633                                   int dst_width,
634                                   int x,
635                                   int dx);
636 void ScaleARGBCols_Any_NEON(uint8_t* dst_ptr,
637                             const uint8_t* src_ptr,
638                             int dst_width,
639                             int x,
640                             int dx);
641 void ScaleARGBFilterCols_MSA(uint8_t* dst_argb,
642                              const uint8_t* src_argb,
643                              int dst_width,
644                              int x,
645                              int dx);
646 void ScaleARGBCols_MSA(uint8_t* dst_argb,
647                        const uint8_t* src_argb,
648                        int dst_width,
649                        int x,
650                        int dx);
651 void ScaleARGBFilterCols_Any_MSA(uint8_t* dst_ptr,
652                                  const uint8_t* src_ptr,
653                                  int dst_width,
654                                  int x,
655                                  int dx);
656 void ScaleARGBCols_Any_MSA(uint8_t* dst_ptr,
657                            const uint8_t* src_ptr,
658                            int dst_width,
659                            int x,
660                            int dx);
661 void ScaleARGBCols_MMI(uint8_t* dst_argb,
662                        const uint8_t* src_argb,
663                        int dst_width,
664                        int x,
665                        int dx);
666 void ScaleARGBCols_Any_MMI(uint8_t* dst_ptr,
667                            const uint8_t* src_ptr,
668                            int dst_width,
669                            int x,
670                            int dx);
671 
672 // ARGB Row functions
673 void ScaleARGBRowDown2_SSE2(const uint8_t* src_argb,
674                             ptrdiff_t src_stride,
675                             uint8_t* dst_argb,
676                             int dst_width);
677 void ScaleARGBRowDown2Linear_SSE2(const uint8_t* src_argb,
678                                   ptrdiff_t src_stride,
679                                   uint8_t* dst_argb,
680                                   int dst_width);
681 void ScaleARGBRowDown2Box_SSE2(const uint8_t* src_argb,
682                                ptrdiff_t src_stride,
683                                uint8_t* dst_argb,
684                                int dst_width);
685 void ScaleARGBRowDown2_NEON(const uint8_t* src_ptr,
686                             ptrdiff_t src_stride,
687                             uint8_t* dst,
688                             int dst_width);
689 void ScaleARGBRowDown2Linear_NEON(const uint8_t* src_argb,
690                                   ptrdiff_t src_stride,
691                                   uint8_t* dst_argb,
692                                   int dst_width);
693 void ScaleARGBRowDown2Box_NEON(const uint8_t* src_ptr,
694                                ptrdiff_t src_stride,
695                                uint8_t* dst,
696                                int dst_width);
697 void ScaleARGBRowDown2_MSA(const uint8_t* src_argb,
698                            ptrdiff_t src_stride,
699                            uint8_t* dst_argb,
700                            int dst_width);
701 void ScaleARGBRowDown2Linear_MSA(const uint8_t* src_argb,
702                                  ptrdiff_t src_stride,
703                                  uint8_t* dst_argb,
704                                  int dst_width);
705 void ScaleARGBRowDown2Box_MSA(const uint8_t* src_argb,
706                               ptrdiff_t src_stride,
707                               uint8_t* dst_argb,
708                               int dst_width);
709 void ScaleARGBRowDown2_MMI(const uint8_t* src_argb,
710                            ptrdiff_t src_stride,
711                            uint8_t* dst_argb,
712                            int dst_width);
713 void ScaleARGBRowDown2Linear_MMI(const uint8_t* src_argb,
714                                  ptrdiff_t src_stride,
715                                  uint8_t* dst_argb,
716                                  int dst_width);
717 void ScaleARGBRowDown2Box_MMI(const uint8_t* src_argb,
718                               ptrdiff_t src_stride,
719                               uint8_t* dst_argb,
720                               int dst_width);
721 void ScaleARGBRowDown2_Any_SSE2(const uint8_t* src_ptr,
722                                 ptrdiff_t src_stride,
723                                 uint8_t* dst_ptr,
724                                 int dst_width);
725 void ScaleARGBRowDown2Linear_Any_SSE2(const uint8_t* src_ptr,
726                                       ptrdiff_t src_stride,
727                                       uint8_t* dst_ptr,
728                                       int dst_width);
729 void ScaleARGBRowDown2Box_Any_SSE2(const uint8_t* src_ptr,
730                                    ptrdiff_t src_stride,
731                                    uint8_t* dst_ptr,
732                                    int dst_width);
733 void ScaleARGBRowDown2_Any_NEON(const uint8_t* src_ptr,
734                                 ptrdiff_t src_stride,
735                                 uint8_t* dst_ptr,
736                                 int dst_width);
737 void ScaleARGBRowDown2Linear_Any_NEON(const uint8_t* src_ptr,
738                                       ptrdiff_t src_stride,
739                                       uint8_t* dst_ptr,
740                                       int dst_width);
741 void ScaleARGBRowDown2Box_Any_NEON(const uint8_t* src_ptr,
742                                    ptrdiff_t src_stride,
743                                    uint8_t* dst_ptr,
744                                    int dst_width);
745 void ScaleARGBRowDown2_Any_MSA(const uint8_t* src_ptr,
746                                ptrdiff_t src_stride,
747                                uint8_t* dst_ptr,
748                                int dst_width);
749 void ScaleARGBRowDown2Linear_Any_MSA(const uint8_t* src_ptr,
750                                      ptrdiff_t src_stride,
751                                      uint8_t* dst_ptr,
752                                      int dst_width);
753 void ScaleARGBRowDown2Box_Any_MSA(const uint8_t* src_ptr,
754                                   ptrdiff_t src_stride,
755                                   uint8_t* dst_ptr,
756                                   int dst_width);
757 void ScaleARGBRowDown2_Any_MMI(const uint8_t* src_ptr,
758                                ptrdiff_t src_stride,
759                                uint8_t* dst_ptr,
760                                int dst_width);
761 void ScaleARGBRowDown2Linear_Any_MMI(const uint8_t* src_ptr,
762                                      ptrdiff_t src_stride,
763                                      uint8_t* dst_ptr,
764                                      int dst_width);
765 void ScaleARGBRowDown2Box_Any_MMI(const uint8_t* src_ptr,
766                                   ptrdiff_t src_stride,
767                                   uint8_t* dst_ptr,
768                                   int dst_width);
769 void ScaleARGBRowDownEven_SSE2(const uint8_t* src_argb,
770                                ptrdiff_t src_stride,
771                                int src_stepx,
772                                uint8_t* dst_argb,
773                                int dst_width);
774 void ScaleARGBRowDownEvenBox_SSE2(const uint8_t* src_argb,
775                                   ptrdiff_t src_stride,
776                                   int src_stepx,
777                                   uint8_t* dst_argb,
778                                   int dst_width);
779 void ScaleARGBRowDownEven_NEON(const uint8_t* src_argb,
780                                ptrdiff_t src_stride,
781                                int src_stepx,
782                                uint8_t* dst_argb,
783                                int dst_width);
784 void ScaleARGBRowDownEvenBox_NEON(const uint8_t* src_argb,
785                                   ptrdiff_t src_stride,
786                                   int src_stepx,
787                                   uint8_t* dst_argb,
788                                   int dst_width);
789 void ScaleARGBRowDownEven_MSA(const uint8_t* src_argb,
790                               ptrdiff_t src_stride,
791                               int32_t src_stepx,
792                               uint8_t* dst_argb,
793                               int dst_width);
794 void ScaleARGBRowDownEvenBox_MSA(const uint8_t* src_argb,
795                                  ptrdiff_t src_stride,
796                                  int src_stepx,
797                                  uint8_t* dst_argb,
798                                  int dst_width);
799 void ScaleARGBRowDownEven_MMI(const uint8_t* src_argb,
800                               ptrdiff_t src_stride,
801                               int32_t src_stepx,
802                               uint8_t* dst_argb,
803                               int dst_width);
804 void ScaleARGBRowDownEvenBox_MMI(const uint8_t* src_argb,
805                                  ptrdiff_t src_stride,
806                                  int src_stepx,
807                                  uint8_t* dst_argb,
808                                  int dst_width);
809 void ScaleARGBRowDownEven_Any_SSE2(const uint8_t* src_ptr,
810                                    ptrdiff_t src_stride,
811                                    int src_stepx,
812                                    uint8_t* dst_ptr,
813                                    int dst_width);
814 void ScaleARGBRowDownEvenBox_Any_SSE2(const uint8_t* src_ptr,
815                                       ptrdiff_t src_stride,
816                                       int src_stepx,
817                                       uint8_t* dst_ptr,
818                                       int dst_width);
819 void ScaleARGBRowDownEven_Any_NEON(const uint8_t* src_ptr,
820                                    ptrdiff_t src_stride,
821                                    int src_stepx,
822                                    uint8_t* dst_ptr,
823                                    int dst_width);
824 void ScaleARGBRowDownEvenBox_Any_NEON(const uint8_t* src_ptr,
825                                       ptrdiff_t src_stride,
826                                       int src_stepx,
827                                       uint8_t* dst_ptr,
828                                       int dst_width);
829 void ScaleARGBRowDownEven_Any_MSA(const uint8_t* src_ptr,
830                                   ptrdiff_t src_stride,
831                                   int32_t src_stepx,
832                                   uint8_t* dst_ptr,
833                                   int dst_width);
834 void ScaleARGBRowDownEvenBox_Any_MSA(const uint8_t* src_ptr,
835                                      ptrdiff_t src_stride,
836                                      int src_stepx,
837                                      uint8_t* dst_ptr,
838                                      int dst_width);
839 void ScaleARGBRowDownEven_Any_MMI(const uint8_t* src_ptr,
840                                   ptrdiff_t src_stride,
841                                   int32_t src_stepx,
842                                   uint8_t* dst_ptr,
843                                   int dst_width);
844 void ScaleARGBRowDownEvenBox_Any_MMI(const uint8_t* src_ptr,
845                                      ptrdiff_t src_stride,
846                                      int src_stepx,
847                                      uint8_t* dst_ptr,
848                                      int dst_width);
849 
850 // UV Row functions
851 void ScaleUVRowDown2_SSSE3(const uint8_t* src_ptr,
852                            ptrdiff_t src_stride,
853                            uint8_t* dst_uv,
854                            int dst_width);
855 void ScaleUVRowDown2Linear_SSSE3(const uint8_t* src_ptr,
856                                  ptrdiff_t src_stride,
857                                  uint8_t* dst_uv,
858                                  int dst_width);
859 void ScaleUVRowDown2Box_SSSE3(const uint8_t* src_ptr,
860                               ptrdiff_t src_stride,
861                               uint8_t* dst_uv,
862                               int dst_width);
863 void ScaleUVRowDown2Box_AVX2(const uint8_t* src_ptr,
864                              ptrdiff_t src_stride,
865                              uint8_t* dst_uv,
866                              int dst_width);
867 void ScaleUVRowDown2_NEON(const uint8_t* src_ptr,
868                           ptrdiff_t src_stride,
869                           uint8_t* dst,
870                           int dst_width);
871 void ScaleUVRowDown2Linear_NEON(const uint8_t* src_ptr,
872                                 ptrdiff_t src_stride,
873                                 uint8_t* dst_uv,
874                                 int dst_width);
875 void ScaleUVRowDown2Box_NEON(const uint8_t* src_ptr,
876                              ptrdiff_t src_stride,
877                              uint8_t* dst,
878                              int dst_width);
879 void ScaleUVRowDown2_MSA(const uint8_t* src_ptr,
880                          ptrdiff_t src_stride,
881                          uint8_t* dst_uv,
882                          int dst_width);
883 void ScaleUVRowDown2Linear_MSA(const uint8_t* src_ptr,
884                                ptrdiff_t src_stride,
885                                uint8_t* dst_uv,
886                                int dst_width);
887 void ScaleUVRowDown2Box_MSA(const uint8_t* src_ptr,
888                             ptrdiff_t src_stride,
889                             uint8_t* dst_uv,
890                             int dst_width);
891 void ScaleUVRowDown2_MMI(const uint8_t* src_ptr,
892                          ptrdiff_t src_stride,
893                          uint8_t* dst_uv,
894                          int dst_width);
895 void ScaleUVRowDown2Linear_MMI(const uint8_t* src_ptr,
896                                ptrdiff_t src_stride,
897                                uint8_t* dst_uv,
898                                int dst_width);
899 void ScaleUVRowDown2Box_MMI(const uint8_t* src_ptr,
900                             ptrdiff_t src_stride,
901                             uint8_t* dst_uv,
902                             int dst_width);
903 void ScaleUVRowDown2_Any_SSSE3(const uint8_t* src_ptr,
904                                ptrdiff_t src_stride,
905                                uint8_t* dst_ptr,
906                                int dst_width);
907 void ScaleUVRowDown2Linear_Any_SSSE3(const uint8_t* src_ptr,
908                                      ptrdiff_t src_stride,
909                                      uint8_t* dst_ptr,
910                                      int dst_width);
911 void ScaleUVRowDown2Box_Any_SSSE3(const uint8_t* src_ptr,
912                                   ptrdiff_t src_stride,
913                                   uint8_t* dst_ptr,
914                                   int dst_width);
915 void ScaleUVRowDown2Box_Any_AVX2(const uint8_t* src_ptr,
916                                  ptrdiff_t src_stride,
917                                  uint8_t* dst_ptr,
918                                  int dst_width);
919 void ScaleUVRowDown2_Any_NEON(const uint8_t* src_ptr,
920                               ptrdiff_t src_stride,
921                               uint8_t* dst_ptr,
922                               int dst_width);
923 void ScaleUVRowDown2Linear_Any_NEON(const uint8_t* src_ptr,
924                                     ptrdiff_t src_stride,
925                                     uint8_t* dst_ptr,
926                                     int dst_width);
927 void ScaleUVRowDown2Box_Any_NEON(const uint8_t* src_ptr,
928                                  ptrdiff_t src_stride,
929                                  uint8_t* dst_ptr,
930                                  int dst_width);
931 void ScaleUVRowDown2_Any_MSA(const uint8_t* src_ptr,
932                              ptrdiff_t src_stride,
933                              uint8_t* dst_ptr,
934                              int dst_width);
935 void ScaleUVRowDown2Linear_Any_MSA(const uint8_t* src_ptr,
936                                    ptrdiff_t src_stride,
937                                    uint8_t* dst_ptr,
938                                    int dst_width);
939 void ScaleUVRowDown2Box_Any_MSA(const uint8_t* src_ptr,
940                                 ptrdiff_t src_stride,
941                                 uint8_t* dst_ptr,
942                                 int dst_width);
943 void ScaleUVRowDown2_Any_MMI(const uint8_t* src_ptr,
944                              ptrdiff_t src_stride,
945                              uint8_t* dst_ptr,
946                              int dst_width);
947 void ScaleUVRowDown2Linear_Any_MMI(const uint8_t* src_ptr,
948                                    ptrdiff_t src_stride,
949                                    uint8_t* dst_ptr,
950                                    int dst_width);
951 void ScaleUVRowDown2Box_Any_MMI(const uint8_t* src_ptr,
952                                 ptrdiff_t src_stride,
953                                 uint8_t* dst_ptr,
954                                 int dst_width);
955 void ScaleUVRowDownEven_SSSE3(const uint8_t* src_ptr,
956                               ptrdiff_t src_stride,
957                               int src_stepx,
958                               uint8_t* dst_uv,
959                               int dst_width);
960 void ScaleUVRowDownEvenBox_SSSE3(const uint8_t* src_ptr,
961                                  ptrdiff_t src_stride,
962                                  int src_stepx,
963                                  uint8_t* dst_uv,
964                                  int dst_width);
965 void ScaleUVRowDownEven_NEON(const uint8_t* src_ptr,
966                              ptrdiff_t src_stride,
967                              int src_stepx,
968                              uint8_t* dst_uv,
969                              int dst_width);
970 void ScaleUVRowDownEvenBox_NEON(const uint8_t* src_ptr,
971                                 ptrdiff_t src_stride,
972                                 int src_stepx,
973                                 uint8_t* dst_uv,
974                                 int dst_width);
975 void ScaleUVRowDownEven_MSA(const uint8_t* src_ptr,
976                             ptrdiff_t src_stride,
977                             int32_t src_stepx,
978                             uint8_t* dst_uv,
979                             int dst_width);
980 void ScaleUVRowDownEvenBox_MSA(const uint8_t* src_ptr,
981                                ptrdiff_t src_stride,
982                                int src_stepx,
983                                uint8_t* dst_uv,
984                                int dst_width);
985 void ScaleUVRowDownEven_MMI(const uint8_t* src_ptr,
986                             ptrdiff_t src_stride,
987                             int32_t src_stepx,
988                             uint8_t* dst_uv,
989                             int dst_width);
990 void ScaleUVRowDownEvenBox_MMI(const uint8_t* src_ptr,
991                                ptrdiff_t src_stride,
992                                int src_stepx,
993                                uint8_t* dst_uv,
994                                int dst_width);
995 void ScaleUVRowDownEven_Any_SSSE3(const uint8_t* src_ptr,
996                                   ptrdiff_t src_stride,
997                                   int src_stepx,
998                                   uint8_t* dst_ptr,
999                                   int dst_width);
1000 void ScaleUVRowDownEvenBox_Any_SSSE3(const uint8_t* src_ptr,
1001                                      ptrdiff_t src_stride,
1002                                      int src_stepx,
1003                                      uint8_t* dst_ptr,
1004                                      int dst_width);
1005 void ScaleUVRowDownEven_Any_NEON(const uint8_t* src_ptr,
1006                                  ptrdiff_t src_stride,
1007                                  int src_stepx,
1008                                  uint8_t* dst_ptr,
1009                                  int dst_width);
1010 void ScaleUVRowDownEvenBox_Any_NEON(const uint8_t* src_ptr,
1011                                     ptrdiff_t src_stride,
1012                                     int src_stepx,
1013                                     uint8_t* dst_ptr,
1014                                     int dst_width);
1015 void ScaleUVRowDownEven_Any_MSA(const uint8_t* src_ptr,
1016                                 ptrdiff_t src_stride,
1017                                 int32_t src_stepx,
1018                                 uint8_t* dst_ptr,
1019                                 int dst_width);
1020 void ScaleUVRowDownEvenBox_Any_MSA(const uint8_t* src_ptr,
1021                                    ptrdiff_t src_stride,
1022                                    int src_stepx,
1023                                    uint8_t* dst_ptr,
1024                                    int dst_width);
1025 void ScaleUVRowDownEven_Any_MMI(const uint8_t* src_ptr,
1026                                 ptrdiff_t src_stride,
1027                                 int32_t src_stepx,
1028                                 uint8_t* dst_ptr,
1029                                 int dst_width);
1030 void ScaleUVRowDownEvenBox_Any_MMI(const uint8_t* src_ptr,
1031                                    ptrdiff_t src_stride,
1032                                    int src_stepx,
1033                                    uint8_t* dst_ptr,
1034                                    int dst_width);
1035 
1036 // ScaleRowDown2Box also used by planar functions
1037 // NEON downscalers with interpolation.
1038 
1039 // Note - not static due to reuse in convert for 444 to 420.
1040 void ScaleRowDown2_NEON(const uint8_t* src_ptr,
1041                         ptrdiff_t src_stride,
1042                         uint8_t* dst,
1043                         int dst_width);
1044 void ScaleRowDown2Linear_NEON(const uint8_t* src_ptr,
1045                               ptrdiff_t src_stride,
1046                               uint8_t* dst,
1047                               int dst_width);
1048 void ScaleRowDown2Box_NEON(const uint8_t* src_ptr,
1049                            ptrdiff_t src_stride,
1050                            uint8_t* dst,
1051                            int dst_width);
1052 
1053 void ScaleRowDown4_NEON(const uint8_t* src_ptr,
1054                         ptrdiff_t src_stride,
1055                         uint8_t* dst_ptr,
1056                         int dst_width);
1057 void ScaleRowDown4Box_NEON(const uint8_t* src_ptr,
1058                            ptrdiff_t src_stride,
1059                            uint8_t* dst_ptr,
1060                            int dst_width);
1061 
1062 // Down scale from 4 to 3 pixels. Use the neon multilane read/write
1063 //  to load up the every 4th pixel into a 4 different registers.
1064 // Point samples 32 pixels to 24 pixels.
1065 void ScaleRowDown34_NEON(const uint8_t* src_ptr,
1066                          ptrdiff_t src_stride,
1067                          uint8_t* dst_ptr,
1068                          int dst_width);
1069 void ScaleRowDown34_0_Box_NEON(const uint8_t* src_ptr,
1070                                ptrdiff_t src_stride,
1071                                uint8_t* dst_ptr,
1072                                int dst_width);
1073 void ScaleRowDown34_1_Box_NEON(const uint8_t* src_ptr,
1074                                ptrdiff_t src_stride,
1075                                uint8_t* dst_ptr,
1076                                int dst_width);
1077 
1078 // 32 -> 12
1079 void ScaleRowDown38_NEON(const uint8_t* src_ptr,
1080                          ptrdiff_t src_stride,
1081                          uint8_t* dst_ptr,
1082                          int dst_width);
1083 // 32x3 -> 12x1
1084 void ScaleRowDown38_3_Box_NEON(const uint8_t* src_ptr,
1085                                ptrdiff_t src_stride,
1086                                uint8_t* dst_ptr,
1087                                int dst_width);
1088 // 32x2 -> 12x1
1089 void ScaleRowDown38_2_Box_NEON(const uint8_t* src_ptr,
1090                                ptrdiff_t src_stride,
1091                                uint8_t* dst_ptr,
1092                                int dst_width);
1093 
1094 void ScaleRowDown2_Any_NEON(const uint8_t* src_ptr,
1095                             ptrdiff_t src_stride,
1096                             uint8_t* dst_ptr,
1097                             int dst_width);
1098 void ScaleRowDown2Linear_Any_NEON(const uint8_t* src_ptr,
1099                                   ptrdiff_t src_stride,
1100                                   uint8_t* dst_ptr,
1101                                   int dst_width);
1102 void ScaleRowDown2Box_Any_NEON(const uint8_t* src_ptr,
1103                                ptrdiff_t src_stride,
1104                                uint8_t* dst_ptr,
1105                                int dst_width);
1106 void ScaleRowDown2Box_Odd_NEON(const uint8_t* src_ptr,
1107                                ptrdiff_t src_stride,
1108                                uint8_t* dst_ptr,
1109                                int dst_width);
1110 void ScaleRowDown4_Any_NEON(const uint8_t* src_ptr,
1111                             ptrdiff_t src_stride,
1112                             uint8_t* dst_ptr,
1113                             int dst_width);
1114 void ScaleRowDown4Box_Any_NEON(const uint8_t* src_ptr,
1115                                ptrdiff_t src_stride,
1116                                uint8_t* dst_ptr,
1117                                int dst_width);
1118 void ScaleRowDown34_Any_NEON(const uint8_t* src_ptr,
1119                              ptrdiff_t src_stride,
1120                              uint8_t* dst_ptr,
1121                              int dst_width);
1122 void ScaleRowDown34_0_Box_Any_NEON(const uint8_t* src_ptr,
1123                                    ptrdiff_t src_stride,
1124                                    uint8_t* dst_ptr,
1125                                    int dst_width);
1126 void ScaleRowDown34_1_Box_Any_NEON(const uint8_t* src_ptr,
1127                                    ptrdiff_t src_stride,
1128                                    uint8_t* dst_ptr,
1129                                    int dst_width);
1130 // 32 -> 12
1131 void ScaleRowDown38_Any_NEON(const uint8_t* src_ptr,
1132                              ptrdiff_t src_stride,
1133                              uint8_t* dst_ptr,
1134                              int dst_width);
1135 // 32x3 -> 12x1
1136 void ScaleRowDown38_3_Box_Any_NEON(const uint8_t* src_ptr,
1137                                    ptrdiff_t src_stride,
1138                                    uint8_t* dst_ptr,
1139                                    int dst_width);
1140 // 32x2 -> 12x1
1141 void ScaleRowDown38_2_Box_Any_NEON(const uint8_t* src_ptr,
1142                                    ptrdiff_t src_stride,
1143                                    uint8_t* dst_ptr,
1144                                    int dst_width);
1145 
1146 void ScaleAddRow_NEON(const uint8_t* src_ptr, uint16_t* dst_ptr, int src_width);
1147 void ScaleAddRow_Any_NEON(const uint8_t* src_ptr,
1148                           uint16_t* dst_ptr,
1149                           int src_width);
1150 
1151 void ScaleFilterCols_NEON(uint8_t* dst_ptr,
1152                           const uint8_t* src_ptr,
1153                           int dst_width,
1154                           int x,
1155                           int dx);
1156 
1157 void ScaleFilterCols_Any_NEON(uint8_t* dst_ptr,
1158                               const uint8_t* src_ptr,
1159                               int dst_width,
1160                               int x,
1161                               int dx);
1162 
1163 void ScaleRowDown2_MSA(const uint8_t* src_ptr,
1164                        ptrdiff_t src_stride,
1165                        uint8_t* dst,
1166                        int dst_width);
1167 void ScaleRowDown2Linear_MSA(const uint8_t* src_ptr,
1168                              ptrdiff_t src_stride,
1169                              uint8_t* dst,
1170                              int dst_width);
1171 void ScaleRowDown2Box_MSA(const uint8_t* src_ptr,
1172                           ptrdiff_t src_stride,
1173                           uint8_t* dst,
1174                           int dst_width);
1175 void ScaleRowDown4_MSA(const uint8_t* src_ptr,
1176                        ptrdiff_t src_stride,
1177                        uint8_t* dst,
1178                        int dst_width);
1179 void ScaleRowDown4Box_MSA(const uint8_t* src_ptr,
1180                           ptrdiff_t src_stride,
1181                           uint8_t* dst,
1182                           int dst_width);
1183 void ScaleRowDown38_MSA(const uint8_t* src_ptr,
1184                         ptrdiff_t src_stride,
1185                         uint8_t* dst,
1186                         int dst_width);
1187 void ScaleRowDown38_2_Box_MSA(const uint8_t* src_ptr,
1188                               ptrdiff_t src_stride,
1189                               uint8_t* dst_ptr,
1190                               int dst_width);
1191 void ScaleRowDown38_3_Box_MSA(const uint8_t* src_ptr,
1192                               ptrdiff_t src_stride,
1193                               uint8_t* dst_ptr,
1194                               int dst_width);
1195 void ScaleAddRow_MSA(const uint8_t* src_ptr, uint16_t* dst_ptr, int src_width);
1196 void ScaleFilterCols_MSA(uint8_t* dst_ptr,
1197                          const uint8_t* src_ptr,
1198                          int dst_width,
1199                          int x,
1200                          int dx);
1201 void ScaleRowDown34_MSA(const uint8_t* src_ptr,
1202                         ptrdiff_t src_stride,
1203                         uint8_t* dst,
1204                         int dst_width);
1205 void ScaleRowDown34_MMI(const uint8_t* src_ptr,
1206                         ptrdiff_t src_stride,
1207                         uint8_t* dst,
1208                         int dst_width);
1209 void ScaleRowDown34_0_Box_MSA(const uint8_t* src_ptr,
1210                               ptrdiff_t src_stride,
1211                               uint8_t* d,
1212                               int dst_width);
1213 void ScaleRowDown34_1_Box_MSA(const uint8_t* src_ptr,
1214                               ptrdiff_t src_stride,
1215                               uint8_t* d,
1216                               int dst_width);
1217 
1218 void ScaleRowDown2_Any_MSA(const uint8_t* src_ptr,
1219                            ptrdiff_t src_stride,
1220                            uint8_t* dst_ptr,
1221                            int dst_width);
1222 void ScaleRowDown2Linear_Any_MSA(const uint8_t* src_ptr,
1223                                  ptrdiff_t src_stride,
1224                                  uint8_t* dst_ptr,
1225                                  int dst_width);
1226 void ScaleRowDown2Box_Any_MSA(const uint8_t* src_ptr,
1227                               ptrdiff_t src_stride,
1228                               uint8_t* dst_ptr,
1229                               int dst_width);
1230 void ScaleRowDown4_Any_MSA(const uint8_t* src_ptr,
1231                            ptrdiff_t src_stride,
1232                            uint8_t* dst_ptr,
1233                            int dst_width);
1234 void ScaleRowDown4Box_Any_MSA(const uint8_t* src_ptr,
1235                               ptrdiff_t src_stride,
1236                               uint8_t* dst_ptr,
1237                               int dst_width);
1238 void ScaleRowDown38_Any_MSA(const uint8_t* src_ptr,
1239                             ptrdiff_t src_stride,
1240                             uint8_t* dst_ptr,
1241                             int dst_width);
1242 void ScaleRowDown38_2_Box_Any_MSA(const uint8_t* src_ptr,
1243                                   ptrdiff_t src_stride,
1244                                   uint8_t* dst_ptr,
1245                                   int dst_width);
1246 void ScaleRowDown38_3_Box_Any_MSA(const uint8_t* src_ptr,
1247                                   ptrdiff_t src_stride,
1248                                   uint8_t* dst_ptr,
1249                                   int dst_width);
1250 void ScaleAddRow_Any_MSA(const uint8_t* src_ptr,
1251                          uint16_t* dst_ptr,
1252                          int src_width);
1253 void ScaleFilterCols_Any_MSA(uint8_t* dst_ptr,
1254                              const uint8_t* src_ptr,
1255                              int dst_width,
1256                              int x,
1257                              int dx);
1258 void ScaleRowDown34_Any_MSA(const uint8_t* src_ptr,
1259                             ptrdiff_t src_stride,
1260                             uint8_t* dst_ptr,
1261                             int dst_width);
1262 void ScaleRowDown34_Any_MMI(const uint8_t* src_ptr,
1263                             ptrdiff_t src_stride,
1264                             uint8_t* dst_ptr,
1265                             int dst_width);
1266 void ScaleRowDown34_0_Box_Any_MSA(const uint8_t* src_ptr,
1267                                   ptrdiff_t src_stride,
1268                                   uint8_t* dst_ptr,
1269                                   int dst_width);
1270 void ScaleRowDown34_1_Box_Any_MSA(const uint8_t* src_ptr,
1271                                   ptrdiff_t src_stride,
1272                                   uint8_t* dst_ptr,
1273                                   int dst_width);
1274 
1275 void ScaleRowDown2_MMI(const uint8_t* src_ptr,
1276                        ptrdiff_t src_stride,
1277                        uint8_t* dst,
1278                        int dst_width);
1279 void ScaleRowDown2_16_MMI(const uint16_t* src_ptr,
1280                           ptrdiff_t src_stride,
1281                           uint16_t* dst,
1282                           int dst_width);
1283 void ScaleRowDown2Linear_MMI(const uint8_t* src_ptr,
1284                              ptrdiff_t src_stride,
1285                              uint8_t* dst,
1286                              int dst_width);
1287 void ScaleRowDown2Linear_16_MMI(const uint16_t* src_ptr,
1288                                 ptrdiff_t src_stride,
1289                                 uint16_t* dst,
1290                                 int dst_width);
1291 void ScaleRowDown2Box_MMI(const uint8_t* src_ptr,
1292                           ptrdiff_t src_stride,
1293                           uint8_t* dst,
1294                           int dst_width);
1295 void ScaleRowDown2Box_16_MMI(const uint16_t* src_ptr,
1296                              ptrdiff_t src_stride,
1297                              uint16_t* dst,
1298                              int dst_width);
1299 void ScaleRowDown2Box_Odd_MMI(const uint8_t* src_ptr,
1300                               ptrdiff_t src_stride,
1301                               uint8_t* dst,
1302                               int dst_width);
1303 void ScaleRowDown4_MMI(const uint8_t* src_ptr,
1304                        ptrdiff_t src_stride,
1305                        uint8_t* dst,
1306                        int dst_width);
1307 void ScaleRowDown4_16_MMI(const uint16_t* src_ptr,
1308                           ptrdiff_t src_stride,
1309                           uint16_t* dst,
1310                           int dst_width);
1311 void ScaleRowDown4Box_MMI(const uint8_t* src_ptr,
1312                           ptrdiff_t src_stride,
1313                           uint8_t* dst,
1314                           int dst_width);
1315 void ScaleRowDown4Box_16_MMI(const uint16_t* src_ptr,
1316                              ptrdiff_t src_stride,
1317                              uint16_t* dst,
1318                              int dst_width);
1319 void ScaleAddRow_MMI(const uint8_t* src_ptr, uint16_t* dst_ptr, int src_width);
1320 void ScaleAddRow_16_MMI(const uint16_t* src_ptr,
1321                         uint32_t* dst_ptr,
1322                         int src_width);
1323 void ScaleColsUp2_MMI(uint8_t* dst_ptr,
1324                       const uint8_t* src_ptr,
1325                       int dst_width,
1326                       int x,
1327                       int dx);
1328 void ScaleColsUp2_16_MMI(uint16_t* dst_ptr,
1329                          const uint16_t* src_ptr,
1330                          int dst_width,
1331                          int x,
1332                          int dx);
1333 void ScaleARGBColsUp2_MMI(uint8_t* dst_argb,
1334                           const uint8_t* src_argb,
1335                           int dst_width,
1336                           int x,
1337                           int dx);
1338 
1339 void ScaleRowDown2_Any_MMI(const uint8_t* src_ptr,
1340                            ptrdiff_t src_stride,
1341                            uint8_t* dst_ptr,
1342                            int dst_width);
1343 void ScaleRowDown2Linear_Any_MMI(const uint8_t* src_ptr,
1344                                  ptrdiff_t src_stride,
1345                                  uint8_t* dst_ptr,
1346                                  int dst_width);
1347 void ScaleRowDown2Box_Any_MMI(const uint8_t* src_ptr,
1348                               ptrdiff_t src_stride,
1349                               uint8_t* dst_ptr,
1350                               int dst_width);
1351 void ScaleRowDown4_Any_MMI(const uint8_t* src_ptr,
1352                            ptrdiff_t src_stride,
1353                            uint8_t* dst_ptr,
1354                            int dst_width);
1355 void ScaleRowDown4Box_Any_MMI(const uint8_t* src_ptr,
1356                               ptrdiff_t src_stride,
1357                               uint8_t* dst_ptr,
1358                               int dst_width);
1359 void ScaleAddRow_Any_MMI(const uint8_t* src_ptr,
1360                          uint16_t* dst_ptr,
1361                          int src_width);
1362 #ifdef __cplusplus
1363 }  // extern "C"
1364 }  // namespace libyuv
1365 #endif
1366 
1367 #endif  // INCLUDE_LIBYUV_SCALE_ROW_H_
1368