xref: /aosp_15_r20/external/libyuv/include/libyuv/convert_argb.h (revision 4e366538070a3a6c5c163c31b791eab742e1657a)
1 /*
2  *  Copyright 2012 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_CONVERT_ARGB_H_
12 #define INCLUDE_LIBYUV_CONVERT_ARGB_H_
13 
14 #include "libyuv/basic_types.h"
15 
16 #include "libyuv/rotate.h"  // For enum RotationMode.
17 #include "libyuv/scale.h"   // For enum FilterMode.
18 
19 #ifdef __cplusplus
20 namespace libyuv {
21 extern "C" {
22 #endif
23 
24 // Conversion matrix for YUV to RGB
25 LIBYUV_API extern const struct YuvConstants kYuvI601Constants;   // BT.601
26 LIBYUV_API extern const struct YuvConstants kYuvJPEGConstants;   // BT.601 full
27 LIBYUV_API extern const struct YuvConstants kYuvH709Constants;   // BT.709
28 LIBYUV_API extern const struct YuvConstants kYuvF709Constants;   // BT.709 full
29 LIBYUV_API extern const struct YuvConstants kYuv2020Constants;   // BT.2020
30 LIBYUV_API extern const struct YuvConstants kYuvV2020Constants;  // BT.2020 full
31 
32 // Conversion matrix for YVU to BGR
33 LIBYUV_API extern const struct YuvConstants kYvuI601Constants;   // BT.601
34 LIBYUV_API extern const struct YuvConstants kYvuJPEGConstants;   // BT.601 full
35 LIBYUV_API extern const struct YuvConstants kYvuH709Constants;   // BT.709
36 LIBYUV_API extern const struct YuvConstants kYvuF709Constants;   // BT.709 full
37 LIBYUV_API extern const struct YuvConstants kYvu2020Constants;   // BT.2020
38 LIBYUV_API extern const struct YuvConstants kYvuV2020Constants;  // BT.2020 full
39 
40 // Macros for end swapped destination Matrix conversions.
41 // Swap UV and pass mirrored kYvuJPEGConstants matrix.
42 // TODO(fbarchard): Add macro for each Matrix function.
43 #define kYuvI601ConstantsVU kYvuI601Constants
44 #define kYuvJPEGConstantsVU kYvuJPEGConstants
45 #define kYuvH709ConstantsVU kYvuH709Constants
46 #define kYuvF709ConstantsVU kYvuF709Constants
47 #define kYuv2020ConstantsVU kYvu2020Constants
48 #define kYuvV2020ConstantsVU kYvuV2020Constants
49 
50 #define NV12ToABGRMatrix(a, b, c, d, e, f, g, h, i) \
51   NV21ToARGBMatrix(a, b, c, d, e, f, g##VU, h, i)
52 #define NV21ToABGRMatrix(a, b, c, d, e, f, g, h, i) \
53   NV12ToARGBMatrix(a, b, c, d, e, f, g##VU, h, i)
54 #define NV12ToRAWMatrix(a, b, c, d, e, f, g, h, i) \
55   NV21ToRGB24Matrix(a, b, c, d, e, f, g##VU, h, i)
56 #define NV21ToRAWMatrix(a, b, c, d, e, f, g, h, i) \
57   NV12ToRGB24Matrix(a, b, c, d, e, f, g##VU, h, i)
58 #define I010ToABGRMatrix(a, b, c, d, e, f, g, h, i, j, k) \
59   I010ToARGBMatrix(a, b, e, f, c, d, g, h, i##VU, j, k)
60 #define I210ToABGRMatrix(a, b, c, d, e, f, g, h, i, j, k) \
61   I210ToARGBMatrix(a, b, e, f, c, d, g, h, i##VU, j, k)
62 #define I410ToABGRMatrix(a, b, c, d, e, f, g, h, i, j, k) \
63   I410ToARGBMatrix(a, b, e, f, c, d, g, h, i##VU, j, k)
64 #define I010ToAB30Matrix(a, b, c, d, e, f, g, h, i, j, k) \
65   I010ToAR30Matrix(a, b, e, f, c, d, g, h, i##VU, j, k)
66 #define I210ToAB30Matrix(a, b, c, d, e, f, g, h, i, j, k) \
67   I210ToAR30Matrix(a, b, e, f, c, d, g, h, i##VU, j, k)
68 #define I410ToAB30Matrix(a, b, c, d, e, f, g, h, i, j, k) \
69   I410ToAR30Matrix(a, b, e, f, c, d, g, h, i##VU, j, k)
70 #define I012ToAB30Matrix(a, b, c, d, e, f, g, h, i, j, k) \
71   I012ToAR30Matrix(a, b, e, f, c, d, g, h, i##VU, j, k)
72 #define I420AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, k, l, m, n) \
73   I420AlphaToARGBMatrix(a, b, e, f, c, d, g, h, i, j, k##VU, l, m, n)
74 #define I422AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, k, l, m, n) \
75   I422AlphaToARGBMatrix(a, b, e, f, c, d, g, h, i, j, k##VU, l, m, n)
76 #define I444AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, k, l, m, n) \
77   I444AlphaToARGBMatrix(a, b, e, f, c, d, g, h, i, j, k##VU, l, m, n)
78 #define I010AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, k, l, m, n) \
79   I010AlphaToARGBMatrix(a, b, e, f, c, d, g, h, i, j, k##VU, l, m, n)
80 #define I210AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, k, l, m, n) \
81   I210AlphaToARGBMatrix(a, b, e, f, c, d, g, h, i, j, k##VU, l, m, n)
82 #define I410AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, k, l, m, n) \
83   I410AlphaToARGBMatrix(a, b, e, f, c, d, g, h, i, j, k##VU, l, m, n)
84 
85 // Alias.
86 #define ARGBToARGB ARGBCopy
87 
88 // Copy ARGB to ARGB.
89 LIBYUV_API
90 int ARGBCopy(const uint8_t* src_argb,
91              int src_stride_argb,
92              uint8_t* dst_argb,
93              int dst_stride_argb,
94              int width,
95              int height);
96 
97 // Convert I420 to ARGB.
98 LIBYUV_API
99 int I420ToARGB(const uint8_t* src_y,
100                int src_stride_y,
101                const uint8_t* src_u,
102                int src_stride_u,
103                const uint8_t* src_v,
104                int src_stride_v,
105                uint8_t* dst_argb,
106                int dst_stride_argb,
107                int width,
108                int height);
109 
110 // Convert I420 to ABGR.
111 LIBYUV_API
112 int I420ToABGR(const uint8_t* src_y,
113                int src_stride_y,
114                const uint8_t* src_u,
115                int src_stride_u,
116                const uint8_t* src_v,
117                int src_stride_v,
118                uint8_t* dst_abgr,
119                int dst_stride_abgr,
120                int width,
121                int height);
122 
123 // Convert J420 to ARGB.
124 LIBYUV_API
125 int J420ToARGB(const uint8_t* src_y,
126                int src_stride_y,
127                const uint8_t* src_u,
128                int src_stride_u,
129                const uint8_t* src_v,
130                int src_stride_v,
131                uint8_t* dst_argb,
132                int dst_stride_argb,
133                int width,
134                int height);
135 
136 // Convert J420 to ABGR.
137 LIBYUV_API
138 int J420ToABGR(const uint8_t* src_y,
139                int src_stride_y,
140                const uint8_t* src_u,
141                int src_stride_u,
142                const uint8_t* src_v,
143                int src_stride_v,
144                uint8_t* dst_abgr,
145                int dst_stride_abgr,
146                int width,
147                int height);
148 
149 // Convert H420 to ARGB.
150 LIBYUV_API
151 int H420ToARGB(const uint8_t* src_y,
152                int src_stride_y,
153                const uint8_t* src_u,
154                int src_stride_u,
155                const uint8_t* src_v,
156                int src_stride_v,
157                uint8_t* dst_argb,
158                int dst_stride_argb,
159                int width,
160                int height);
161 
162 // Convert H420 to ABGR.
163 LIBYUV_API
164 int H420ToABGR(const uint8_t* src_y,
165                int src_stride_y,
166                const uint8_t* src_u,
167                int src_stride_u,
168                const uint8_t* src_v,
169                int src_stride_v,
170                uint8_t* dst_abgr,
171                int dst_stride_abgr,
172                int width,
173                int height);
174 
175 // Convert U420 to ARGB.
176 LIBYUV_API
177 int U420ToARGB(const uint8_t* src_y,
178                int src_stride_y,
179                const uint8_t* src_u,
180                int src_stride_u,
181                const uint8_t* src_v,
182                int src_stride_v,
183                uint8_t* dst_argb,
184                int dst_stride_argb,
185                int width,
186                int height);
187 
188 // Convert U420 to ABGR.
189 LIBYUV_API
190 int U420ToABGR(const uint8_t* src_y,
191                int src_stride_y,
192                const uint8_t* src_u,
193                int src_stride_u,
194                const uint8_t* src_v,
195                int src_stride_v,
196                uint8_t* dst_abgr,
197                int dst_stride_abgr,
198                int width,
199                int height);
200 
201 // Convert I422 to ARGB.
202 LIBYUV_API
203 int I422ToARGB(const uint8_t* src_y,
204                int src_stride_y,
205                const uint8_t* src_u,
206                int src_stride_u,
207                const uint8_t* src_v,
208                int src_stride_v,
209                uint8_t* dst_argb,
210                int dst_stride_argb,
211                int width,
212                int height);
213 
214 // Convert I422 to ABGR.
215 LIBYUV_API
216 int I422ToABGR(const uint8_t* src_y,
217                int src_stride_y,
218                const uint8_t* src_u,
219                int src_stride_u,
220                const uint8_t* src_v,
221                int src_stride_v,
222                uint8_t* dst_abgr,
223                int dst_stride_abgr,
224                int width,
225                int height);
226 
227 // Convert J422 to ARGB.
228 LIBYUV_API
229 int J422ToARGB(const uint8_t* src_y,
230                int src_stride_y,
231                const uint8_t* src_u,
232                int src_stride_u,
233                const uint8_t* src_v,
234                int src_stride_v,
235                uint8_t* dst_argb,
236                int dst_stride_argb,
237                int width,
238                int height);
239 
240 // Convert J422 to ABGR.
241 LIBYUV_API
242 int J422ToABGR(const uint8_t* src_y,
243                int src_stride_y,
244                const uint8_t* src_u,
245                int src_stride_u,
246                const uint8_t* src_v,
247                int src_stride_v,
248                uint8_t* dst_abgr,
249                int dst_stride_abgr,
250                int width,
251                int height);
252 
253 // Convert H422 to ARGB.
254 LIBYUV_API
255 int H422ToARGB(const uint8_t* src_y,
256                int src_stride_y,
257                const uint8_t* src_u,
258                int src_stride_u,
259                const uint8_t* src_v,
260                int src_stride_v,
261                uint8_t* dst_argb,
262                int dst_stride_argb,
263                int width,
264                int height);
265 
266 // Convert H422 to ABGR.
267 LIBYUV_API
268 int H422ToABGR(const uint8_t* src_y,
269                int src_stride_y,
270                const uint8_t* src_u,
271                int src_stride_u,
272                const uint8_t* src_v,
273                int src_stride_v,
274                uint8_t* dst_abgr,
275                int dst_stride_abgr,
276                int width,
277                int height);
278 
279 // Convert U422 to ARGB.
280 LIBYUV_API
281 int U422ToARGB(const uint8_t* src_y,
282                int src_stride_y,
283                const uint8_t* src_u,
284                int src_stride_u,
285                const uint8_t* src_v,
286                int src_stride_v,
287                uint8_t* dst_argb,
288                int dst_stride_argb,
289                int width,
290                int height);
291 
292 // Convert U422 to ABGR.
293 LIBYUV_API
294 int U422ToABGR(const uint8_t* src_y,
295                int src_stride_y,
296                const uint8_t* src_u,
297                int src_stride_u,
298                const uint8_t* src_v,
299                int src_stride_v,
300                uint8_t* dst_abgr,
301                int dst_stride_abgr,
302                int width,
303                int height);
304 
305 // Convert I444 to ARGB.
306 LIBYUV_API
307 int I444ToARGB(const uint8_t* src_y,
308                int src_stride_y,
309                const uint8_t* src_u,
310                int src_stride_u,
311                const uint8_t* src_v,
312                int src_stride_v,
313                uint8_t* dst_argb,
314                int dst_stride_argb,
315                int width,
316                int height);
317 
318 // Convert I444 to ABGR.
319 LIBYUV_API
320 int I444ToABGR(const uint8_t* src_y,
321                int src_stride_y,
322                const uint8_t* src_u,
323                int src_stride_u,
324                const uint8_t* src_v,
325                int src_stride_v,
326                uint8_t* dst_abgr,
327                int dst_stride_abgr,
328                int width,
329                int height);
330 
331 // Convert J444 to ARGB.
332 LIBYUV_API
333 int J444ToARGB(const uint8_t* src_y,
334                int src_stride_y,
335                const uint8_t* src_u,
336                int src_stride_u,
337                const uint8_t* src_v,
338                int src_stride_v,
339                uint8_t* dst_argb,
340                int dst_stride_argb,
341                int width,
342                int height);
343 
344 // Convert J444 to ABGR.
345 LIBYUV_API
346 int J444ToABGR(const uint8_t* src_y,
347                int src_stride_y,
348                const uint8_t* src_u,
349                int src_stride_u,
350                const uint8_t* src_v,
351                int src_stride_v,
352                uint8_t* dst_abgr,
353                int dst_stride_abgr,
354                int width,
355                int height);
356 
357 // Convert H444 to ARGB.
358 LIBYUV_API
359 int H444ToARGB(const uint8_t* src_y,
360                int src_stride_y,
361                const uint8_t* src_u,
362                int src_stride_u,
363                const uint8_t* src_v,
364                int src_stride_v,
365                uint8_t* dst_argb,
366                int dst_stride_argb,
367                int width,
368                int height);
369 
370 // Convert H444 to ABGR.
371 LIBYUV_API
372 int H444ToABGR(const uint8_t* src_y,
373                int src_stride_y,
374                const uint8_t* src_u,
375                int src_stride_u,
376                const uint8_t* src_v,
377                int src_stride_v,
378                uint8_t* dst_abgr,
379                int dst_stride_abgr,
380                int width,
381                int height);
382 
383 // Convert U444 to ARGB.
384 LIBYUV_API
385 int U444ToARGB(const uint8_t* src_y,
386                int src_stride_y,
387                const uint8_t* src_u,
388                int src_stride_u,
389                const uint8_t* src_v,
390                int src_stride_v,
391                uint8_t* dst_argb,
392                int dst_stride_argb,
393                int width,
394                int height);
395 
396 // Convert U444 to ABGR.
397 LIBYUV_API
398 int U444ToABGR(const uint8_t* src_y,
399                int src_stride_y,
400                const uint8_t* src_u,
401                int src_stride_u,
402                const uint8_t* src_v,
403                int src_stride_v,
404                uint8_t* dst_abgr,
405                int dst_stride_abgr,
406                int width,
407                int height);
408 
409 // Convert I444 to RGB24.
410 LIBYUV_API
411 int I444ToRGB24(const uint8_t* src_y,
412                 int src_stride_y,
413                 const uint8_t* src_u,
414                 int src_stride_u,
415                 const uint8_t* src_v,
416                 int src_stride_v,
417                 uint8_t* dst_rgb24,
418                 int dst_stride_rgb24,
419                 int width,
420                 int height);
421 
422 // Convert I444 to RAW.
423 LIBYUV_API
424 int I444ToRAW(const uint8_t* src_y,
425               int src_stride_y,
426               const uint8_t* src_u,
427               int src_stride_u,
428               const uint8_t* src_v,
429               int src_stride_v,
430               uint8_t* dst_raw,
431               int dst_stride_raw,
432               int width,
433               int height);
434 
435 // Convert I010 to ARGB.
436 LIBYUV_API
437 int I010ToARGB(const uint16_t* src_y,
438                int src_stride_y,
439                const uint16_t* src_u,
440                int src_stride_u,
441                const uint16_t* src_v,
442                int src_stride_v,
443                uint8_t* dst_argb,
444                int dst_stride_argb,
445                int width,
446                int height);
447 
448 // Convert I010 to ABGR.
449 LIBYUV_API
450 int I010ToABGR(const uint16_t* src_y,
451                int src_stride_y,
452                const uint16_t* src_u,
453                int src_stride_u,
454                const uint16_t* src_v,
455                int src_stride_v,
456                uint8_t* dst_abgr,
457                int dst_stride_abgr,
458                int width,
459                int height);
460 
461 // Convert H010 to ARGB.
462 LIBYUV_API
463 int H010ToARGB(const uint16_t* src_y,
464                int src_stride_y,
465                const uint16_t* src_u,
466                int src_stride_u,
467                const uint16_t* src_v,
468                int src_stride_v,
469                uint8_t* dst_argb,
470                int dst_stride_argb,
471                int width,
472                int height);
473 
474 // Convert H010 to ABGR.
475 LIBYUV_API
476 int H010ToABGR(const uint16_t* src_y,
477                int src_stride_y,
478                const uint16_t* src_u,
479                int src_stride_u,
480                const uint16_t* src_v,
481                int src_stride_v,
482                uint8_t* dst_abgr,
483                int dst_stride_abgr,
484                int width,
485                int height);
486 
487 // Convert U010 to ARGB.
488 LIBYUV_API
489 int U010ToARGB(const uint16_t* src_y,
490                int src_stride_y,
491                const uint16_t* src_u,
492                int src_stride_u,
493                const uint16_t* src_v,
494                int src_stride_v,
495                uint8_t* dst_argb,
496                int dst_stride_argb,
497                int width,
498                int height);
499 
500 // Convert U010 to ABGR.
501 LIBYUV_API
502 int U010ToABGR(const uint16_t* src_y,
503                int src_stride_y,
504                const uint16_t* src_u,
505                int src_stride_u,
506                const uint16_t* src_v,
507                int src_stride_v,
508                uint8_t* dst_abgr,
509                int dst_stride_abgr,
510                int width,
511                int height);
512 
513 // Convert I210 to ARGB.
514 LIBYUV_API
515 int I210ToARGB(const uint16_t* src_y,
516                int src_stride_y,
517                const uint16_t* src_u,
518                int src_stride_u,
519                const uint16_t* src_v,
520                int src_stride_v,
521                uint8_t* dst_argb,
522                int dst_stride_argb,
523                int width,
524                int height);
525 
526 // Convert I210 to ABGR.
527 LIBYUV_API
528 int I210ToABGR(const uint16_t* src_y,
529                int src_stride_y,
530                const uint16_t* src_u,
531                int src_stride_u,
532                const uint16_t* src_v,
533                int src_stride_v,
534                uint8_t* dst_abgr,
535                int dst_stride_abgr,
536                int width,
537                int height);
538 
539 // Convert H210 to ARGB.
540 LIBYUV_API
541 int H210ToARGB(const uint16_t* src_y,
542                int src_stride_y,
543                const uint16_t* src_u,
544                int src_stride_u,
545                const uint16_t* src_v,
546                int src_stride_v,
547                uint8_t* dst_argb,
548                int dst_stride_argb,
549                int width,
550                int height);
551 
552 // Convert H210 to ABGR.
553 LIBYUV_API
554 int H210ToABGR(const uint16_t* src_y,
555                int src_stride_y,
556                const uint16_t* src_u,
557                int src_stride_u,
558                const uint16_t* src_v,
559                int src_stride_v,
560                uint8_t* dst_abgr,
561                int dst_stride_abgr,
562                int width,
563                int height);
564 
565 // Convert U210 to ARGB.
566 LIBYUV_API
567 int U210ToARGB(const uint16_t* src_y,
568                int src_stride_y,
569                const uint16_t* src_u,
570                int src_stride_u,
571                const uint16_t* src_v,
572                int src_stride_v,
573                uint8_t* dst_argb,
574                int dst_stride_argb,
575                int width,
576                int height);
577 
578 // Convert U210 to ABGR.
579 LIBYUV_API
580 int U210ToABGR(const uint16_t* src_y,
581                int src_stride_y,
582                const uint16_t* src_u,
583                int src_stride_u,
584                const uint16_t* src_v,
585                int src_stride_v,
586                uint8_t* dst_abgr,
587                int dst_stride_abgr,
588                int width,
589                int height);
590 
591 // Convert I420 with Alpha to preattenuated ARGB.
592 LIBYUV_API
593 int I420AlphaToARGB(const uint8_t* src_y,
594                     int src_stride_y,
595                     const uint8_t* src_u,
596                     int src_stride_u,
597                     const uint8_t* src_v,
598                     int src_stride_v,
599                     const uint8_t* src_a,
600                     int src_stride_a,
601                     uint8_t* dst_argb,
602                     int dst_stride_argb,
603                     int width,
604                     int height,
605                     int attenuate);
606 
607 // Convert I420 with Alpha to preattenuated ABGR.
608 LIBYUV_API
609 int I420AlphaToABGR(const uint8_t* src_y,
610                     int src_stride_y,
611                     const uint8_t* src_u,
612                     int src_stride_u,
613                     const uint8_t* src_v,
614                     int src_stride_v,
615                     const uint8_t* src_a,
616                     int src_stride_a,
617                     uint8_t* dst_abgr,
618                     int dst_stride_abgr,
619                     int width,
620                     int height,
621                     int attenuate);
622 
623 // Convert I422 with Alpha to preattenuated ARGB.
624 LIBYUV_API
625 int I422AlphaToARGB(const uint8_t* src_y,
626                     int src_stride_y,
627                     const uint8_t* src_u,
628                     int src_stride_u,
629                     const uint8_t* src_v,
630                     int src_stride_v,
631                     const uint8_t* src_a,
632                     int src_stride_a,
633                     uint8_t* dst_argb,
634                     int dst_stride_argb,
635                     int width,
636                     int height,
637                     int attenuate);
638 
639 // Convert I422 with Alpha to preattenuated ABGR.
640 LIBYUV_API
641 int I422AlphaToABGR(const uint8_t* src_y,
642                     int src_stride_y,
643                     const uint8_t* src_u,
644                     int src_stride_u,
645                     const uint8_t* src_v,
646                     int src_stride_v,
647                     const uint8_t* src_a,
648                     int src_stride_a,
649                     uint8_t* dst_abgr,
650                     int dst_stride_abgr,
651                     int width,
652                     int height,
653                     int attenuate);
654 
655 // Convert I444 with Alpha to preattenuated ARGB.
656 LIBYUV_API
657 int I444AlphaToARGB(const uint8_t* src_y,
658                     int src_stride_y,
659                     const uint8_t* src_u,
660                     int src_stride_u,
661                     const uint8_t* src_v,
662                     int src_stride_v,
663                     const uint8_t* src_a,
664                     int src_stride_a,
665                     uint8_t* dst_argb,
666                     int dst_stride_argb,
667                     int width,
668                     int height,
669                     int attenuate);
670 
671 // Convert I444 with Alpha to preattenuated ABGR.
672 LIBYUV_API
673 int I444AlphaToABGR(const uint8_t* src_y,
674                     int src_stride_y,
675                     const uint8_t* src_u,
676                     int src_stride_u,
677                     const uint8_t* src_v,
678                     int src_stride_v,
679                     const uint8_t* src_a,
680                     int src_stride_a,
681                     uint8_t* dst_abgr,
682                     int dst_stride_abgr,
683                     int width,
684                     int height,
685                     int attenuate);
686 
687 // Convert I400 (grey) to ARGB.  Reverse of ARGBToI400.
688 LIBYUV_API
689 int I400ToARGB(const uint8_t* src_y,
690                int src_stride_y,
691                uint8_t* dst_argb,
692                int dst_stride_argb,
693                int width,
694                int height);
695 
696 // Convert J400 (jpeg grey) to ARGB.
697 LIBYUV_API
698 int J400ToARGB(const uint8_t* src_y,
699                int src_stride_y,
700                uint8_t* dst_argb,
701                int dst_stride_argb,
702                int width,
703                int height);
704 
705 // Alias.
706 #define YToARGB I400ToARGB
707 
708 // Convert NV12 to ARGB.
709 LIBYUV_API
710 int NV12ToARGB(const uint8_t* src_y,
711                int src_stride_y,
712                const uint8_t* src_uv,
713                int src_stride_uv,
714                uint8_t* dst_argb,
715                int dst_stride_argb,
716                int width,
717                int height);
718 
719 // Convert NV21 to ARGB.
720 LIBYUV_API
721 int NV21ToARGB(const uint8_t* src_y,
722                int src_stride_y,
723                const uint8_t* src_vu,
724                int src_stride_vu,
725                uint8_t* dst_argb,
726                int dst_stride_argb,
727                int width,
728                int height);
729 
730 // Convert NV12 to ABGR.
731 LIBYUV_API
732 int NV12ToABGR(const uint8_t* src_y,
733                int src_stride_y,
734                const uint8_t* src_uv,
735                int src_stride_uv,
736                uint8_t* dst_abgr,
737                int dst_stride_abgr,
738                int width,
739                int height);
740 
741 // Convert NV21 to ABGR.
742 LIBYUV_API
743 int NV21ToABGR(const uint8_t* src_y,
744                int src_stride_y,
745                const uint8_t* src_vu,
746                int src_stride_vu,
747                uint8_t* dst_abgr,
748                int dst_stride_abgr,
749                int width,
750                int height);
751 
752 // Convert NV12 to RGB24.
753 LIBYUV_API
754 int NV12ToRGB24(const uint8_t* src_y,
755                 int src_stride_y,
756                 const uint8_t* src_uv,
757                 int src_stride_uv,
758                 uint8_t* dst_rgb24,
759                 int dst_stride_rgb24,
760                 int width,
761                 int height);
762 
763 // Convert NV21 to RGB24.
764 LIBYUV_API
765 int NV21ToRGB24(const uint8_t* src_y,
766                 int src_stride_y,
767                 const uint8_t* src_vu,
768                 int src_stride_vu,
769                 uint8_t* dst_rgb24,
770                 int dst_stride_rgb24,
771                 int width,
772                 int height);
773 
774 // Convert NV21 to YUV24.
775 LIBYUV_API
776 int NV21ToYUV24(const uint8_t* src_y,
777                 int src_stride_y,
778                 const uint8_t* src_vu,
779                 int src_stride_vu,
780                 uint8_t* dst_yuv24,
781                 int dst_stride_yuv24,
782                 int width,
783                 int height);
784 
785 // Convert NV12 to RAW.
786 LIBYUV_API
787 int NV12ToRAW(const uint8_t* src_y,
788               int src_stride_y,
789               const uint8_t* src_uv,
790               int src_stride_uv,
791               uint8_t* dst_raw,
792               int dst_stride_raw,
793               int width,
794               int height);
795 
796 // Convert NV21 to RAW.
797 LIBYUV_API
798 int NV21ToRAW(const uint8_t* src_y,
799               int src_stride_y,
800               const uint8_t* src_vu,
801               int src_stride_vu,
802               uint8_t* dst_raw,
803               int dst_stride_raw,
804               int width,
805               int height);
806 
807 // Convert YUY2 to ARGB.
808 LIBYUV_API
809 int YUY2ToARGB(const uint8_t* src_yuy2,
810                int src_stride_yuy2,
811                uint8_t* dst_argb,
812                int dst_stride_argb,
813                int width,
814                int height);
815 
816 // Convert UYVY to ARGB.
817 LIBYUV_API
818 int UYVYToARGB(const uint8_t* src_uyvy,
819                int src_stride_uyvy,
820                uint8_t* dst_argb,
821                int dst_stride_argb,
822                int width,
823                int height);
824 
825 // Convert I010 to AR30.
826 LIBYUV_API
827 int I010ToAR30(const uint16_t* src_y,
828                int src_stride_y,
829                const uint16_t* src_u,
830                int src_stride_u,
831                const uint16_t* src_v,
832                int src_stride_v,
833                uint8_t* dst_ar30,
834                int dst_stride_ar30,
835                int width,
836                int height);
837 
838 // Convert H010 to AR30.
839 LIBYUV_API
840 int H010ToAR30(const uint16_t* src_y,
841                int src_stride_y,
842                const uint16_t* src_u,
843                int src_stride_u,
844                const uint16_t* src_v,
845                int src_stride_v,
846                uint8_t* dst_ar30,
847                int dst_stride_ar30,
848                int width,
849                int height);
850 
851 // Convert I010 to AB30.
852 LIBYUV_API
853 int I010ToAB30(const uint16_t* src_y,
854                int src_stride_y,
855                const uint16_t* src_u,
856                int src_stride_u,
857                const uint16_t* src_v,
858                int src_stride_v,
859                uint8_t* dst_ab30,
860                int dst_stride_ab30,
861                int width,
862                int height);
863 
864 // Convert H010 to AB30.
865 LIBYUV_API
866 int H010ToAB30(const uint16_t* src_y,
867                int src_stride_y,
868                const uint16_t* src_u,
869                int src_stride_u,
870                const uint16_t* src_v,
871                int src_stride_v,
872                uint8_t* dst_ab30,
873                int dst_stride_ab30,
874                int width,
875                int height);
876 
877 // Convert U010 to AR30.
878 LIBYUV_API
879 int U010ToAR30(const uint16_t* src_y,
880                int src_stride_y,
881                const uint16_t* src_u,
882                int src_stride_u,
883                const uint16_t* src_v,
884                int src_stride_v,
885                uint8_t* dst_ar30,
886                int dst_stride_ar30,
887                int width,
888                int height);
889 
890 // Convert U010 to AB30.
891 LIBYUV_API
892 int U010ToAB30(const uint16_t* src_y,
893                int src_stride_y,
894                const uint16_t* src_u,
895                int src_stride_u,
896                const uint16_t* src_v,
897                int src_stride_v,
898                uint8_t* dst_ab30,
899                int dst_stride_ab30,
900                int width,
901                int height);
902 
903 // Convert I210 to AR30.
904 LIBYUV_API
905 int I210ToAR30(const uint16_t* src_y,
906                int src_stride_y,
907                const uint16_t* src_u,
908                int src_stride_u,
909                const uint16_t* src_v,
910                int src_stride_v,
911                uint8_t* dst_ar30,
912                int dst_stride_ar30,
913                int width,
914                int height);
915 
916 // Convert I210 to AB30.
917 LIBYUV_API
918 int I210ToAB30(const uint16_t* src_y,
919                int src_stride_y,
920                const uint16_t* src_u,
921                int src_stride_u,
922                const uint16_t* src_v,
923                int src_stride_v,
924                uint8_t* dst_ab30,
925                int dst_stride_ab30,
926                int width,
927                int height);
928 
929 // Convert H210 to AR30.
930 LIBYUV_API
931 int H210ToAR30(const uint16_t* src_y,
932                int src_stride_y,
933                const uint16_t* src_u,
934                int src_stride_u,
935                const uint16_t* src_v,
936                int src_stride_v,
937                uint8_t* dst_ar30,
938                int dst_stride_ar30,
939                int width,
940                int height);
941 
942 // Convert H210 to AB30.
943 LIBYUV_API
944 int H210ToAB30(const uint16_t* src_y,
945                int src_stride_y,
946                const uint16_t* src_u,
947                int src_stride_u,
948                const uint16_t* src_v,
949                int src_stride_v,
950                uint8_t* dst_ab30,
951                int dst_stride_ab30,
952                int width,
953                int height);
954 
955 // Convert U210 to AR30.
956 LIBYUV_API
957 int U210ToAR30(const uint16_t* src_y,
958                int src_stride_y,
959                const uint16_t* src_u,
960                int src_stride_u,
961                const uint16_t* src_v,
962                int src_stride_v,
963                uint8_t* dst_ar30,
964                int dst_stride_ar30,
965                int width,
966                int height);
967 
968 // Convert U210 to AB30.
969 LIBYUV_API
970 int U210ToAB30(const uint16_t* src_y,
971                int src_stride_y,
972                const uint16_t* src_u,
973                int src_stride_u,
974                const uint16_t* src_v,
975                int src_stride_v,
976                uint8_t* dst_ab30,
977                int dst_stride_ab30,
978                int width,
979                int height);
980 
981 // BGRA little endian (argb in memory) to ARGB.
982 LIBYUV_API
983 int BGRAToARGB(const uint8_t* src_bgra,
984                int src_stride_bgra,
985                uint8_t* dst_argb,
986                int dst_stride_argb,
987                int width,
988                int height);
989 
990 // ABGR little endian (rgba in memory) to ARGB.
991 LIBYUV_API
992 int ABGRToARGB(const uint8_t* src_abgr,
993                int src_stride_abgr,
994                uint8_t* dst_argb,
995                int dst_stride_argb,
996                int width,
997                int height);
998 
999 // RGBA little endian (abgr in memory) to ARGB.
1000 LIBYUV_API
1001 int RGBAToARGB(const uint8_t* src_rgba,
1002                int src_stride_rgba,
1003                uint8_t* dst_argb,
1004                int dst_stride_argb,
1005                int width,
1006                int height);
1007 
1008 // Deprecated function name.
1009 #define BG24ToARGB RGB24ToARGB
1010 
1011 // RGB little endian (bgr in memory) to ARGB.
1012 LIBYUV_API
1013 int RGB24ToARGB(const uint8_t* src_rgb24,
1014                 int src_stride_rgb24,
1015                 uint8_t* dst_argb,
1016                 int dst_stride_argb,
1017                 int width,
1018                 int height);
1019 
1020 // RGB big endian (rgb in memory) to ARGB.
1021 LIBYUV_API
1022 int RAWToARGB(const uint8_t* src_raw,
1023               int src_stride_raw,
1024               uint8_t* dst_argb,
1025               int dst_stride_argb,
1026               int width,
1027               int height);
1028 
1029 // RGB big endian (rgb in memory) to RGBA.
1030 LIBYUV_API
1031 int RAWToRGBA(const uint8_t* src_raw,
1032               int src_stride_raw,
1033               uint8_t* dst_rgba,
1034               int dst_stride_rgba,
1035               int width,
1036               int height);
1037 
1038 // RGB16 (RGBP fourcc) little endian to ARGB.
1039 LIBYUV_API
1040 int RGB565ToARGB(const uint8_t* src_rgb565,
1041                  int src_stride_rgb565,
1042                  uint8_t* dst_argb,
1043                  int dst_stride_argb,
1044                  int width,
1045                  int height);
1046 
1047 // RGB15 (RGBO fourcc) little endian to ARGB.
1048 LIBYUV_API
1049 int ARGB1555ToARGB(const uint8_t* src_argb1555,
1050                    int src_stride_argb1555,
1051                    uint8_t* dst_argb,
1052                    int dst_stride_argb,
1053                    int width,
1054                    int height);
1055 
1056 // RGB12 (R444 fourcc) little endian to ARGB.
1057 LIBYUV_API
1058 int ARGB4444ToARGB(const uint8_t* src_argb4444,
1059                    int src_stride_argb4444,
1060                    uint8_t* dst_argb,
1061                    int dst_stride_argb,
1062                    int width,
1063                    int height);
1064 
1065 // Aliases
1066 #define AB30ToARGB AR30ToABGR
1067 #define AB30ToABGR AR30ToARGB
1068 #define AB30ToAR30 AR30ToAB30
1069 
1070 // Convert AR30 To ARGB.
1071 LIBYUV_API
1072 int AR30ToARGB(const uint8_t* src_ar30,
1073                int src_stride_ar30,
1074                uint8_t* dst_argb,
1075                int dst_stride_argb,
1076                int width,
1077                int height);
1078 
1079 // Convert AR30 To ABGR.
1080 LIBYUV_API
1081 int AR30ToABGR(const uint8_t* src_ar30,
1082                int src_stride_ar30,
1083                uint8_t* dst_abgr,
1084                int dst_stride_abgr,
1085                int width,
1086                int height);
1087 
1088 // Convert AR30 To AB30.
1089 LIBYUV_API
1090 int AR30ToAB30(const uint8_t* src_ar30,
1091                int src_stride_ar30,
1092                uint8_t* dst_ab30,
1093                int dst_stride_ab30,
1094                int width,
1095                int height);
1096 
1097 // Convert AR64 to ARGB.
1098 LIBYUV_API
1099 int AR64ToARGB(const uint16_t* src_ar64,
1100                int src_stride_ar64,
1101                uint8_t* dst_argb,
1102                int dst_stride_argb,
1103                int width,
1104                int height);
1105 
1106 // Convert AB64 to ABGR.
1107 #define AB64ToABGR AR64ToARGB
1108 
1109 // Convert AB64 to ARGB.
1110 LIBYUV_API
1111 int AB64ToARGB(const uint16_t* src_ab64,
1112                int src_stride_ab64,
1113                uint8_t* dst_argb,
1114                int dst_stride_argb,
1115                int width,
1116                int height);
1117 
1118 // Convert AR64 to ABGR.
1119 #define AR64ToABGR AB64ToARGB
1120 
1121 // Convert AR64 To AB64.
1122 LIBYUV_API
1123 int AR64ToAB64(const uint16_t* src_ar64,
1124                int src_stride_ar64,
1125                uint16_t* dst_ab64,
1126                int dst_stride_ab64,
1127                int width,
1128                int height);
1129 
1130 // Convert AB64 To AR64.
1131 #define AB64ToAR64 AR64ToAB64
1132 
1133 // src_width/height provided by capture
1134 // dst_width/height for clipping determine final size.
1135 LIBYUV_API
1136 int MJPGToARGB(const uint8_t* sample,
1137                size_t sample_size,
1138                uint8_t* dst_argb,
1139                int dst_stride_argb,
1140                int src_width,
1141                int src_height,
1142                int dst_width,
1143                int dst_height);
1144 
1145 // Convert Android420 to ARGB.
1146 LIBYUV_API
1147 int Android420ToARGB(const uint8_t* src_y,
1148                      int src_stride_y,
1149                      const uint8_t* src_u,
1150                      int src_stride_u,
1151                      const uint8_t* src_v,
1152                      int src_stride_v,
1153                      int src_pixel_stride_uv,
1154                      uint8_t* dst_argb,
1155                      int dst_stride_argb,
1156                      int width,
1157                      int height);
1158 
1159 // Convert Android420 to ABGR.
1160 LIBYUV_API
1161 int Android420ToABGR(const uint8_t* src_y,
1162                      int src_stride_y,
1163                      const uint8_t* src_u,
1164                      int src_stride_u,
1165                      const uint8_t* src_v,
1166                      int src_stride_v,
1167                      int src_pixel_stride_uv,
1168                      uint8_t* dst_abgr,
1169                      int dst_stride_abgr,
1170                      int width,
1171                      int height);
1172 
1173 // Convert NV12 to RGB565.
1174 LIBYUV_API
1175 int NV12ToRGB565(const uint8_t* src_y,
1176                  int src_stride_y,
1177                  const uint8_t* src_uv,
1178                  int src_stride_uv,
1179                  uint8_t* dst_rgb565,
1180                  int dst_stride_rgb565,
1181                  int width,
1182                  int height);
1183 
1184 // Convert I422 to BGRA.
1185 LIBYUV_API
1186 int I422ToBGRA(const uint8_t* src_y,
1187                int src_stride_y,
1188                const uint8_t* src_u,
1189                int src_stride_u,
1190                const uint8_t* src_v,
1191                int src_stride_v,
1192                uint8_t* dst_bgra,
1193                int dst_stride_bgra,
1194                int width,
1195                int height);
1196 
1197 // Convert I422 to ABGR.
1198 LIBYUV_API
1199 int I422ToABGR(const uint8_t* src_y,
1200                int src_stride_y,
1201                const uint8_t* src_u,
1202                int src_stride_u,
1203                const uint8_t* src_v,
1204                int src_stride_v,
1205                uint8_t* dst_abgr,
1206                int dst_stride_abgr,
1207                int width,
1208                int height);
1209 
1210 // Convert I422 to RGBA.
1211 LIBYUV_API
1212 int I422ToRGBA(const uint8_t* src_y,
1213                int src_stride_y,
1214                const uint8_t* src_u,
1215                int src_stride_u,
1216                const uint8_t* src_v,
1217                int src_stride_v,
1218                uint8_t* dst_rgba,
1219                int dst_stride_rgba,
1220                int width,
1221                int height);
1222 
1223 LIBYUV_API
1224 int I420ToARGB(const uint8_t* src_y,
1225                int src_stride_y,
1226                const uint8_t* src_u,
1227                int src_stride_u,
1228                const uint8_t* src_v,
1229                int src_stride_v,
1230                uint8_t* dst_argb,
1231                int dst_stride_argb,
1232                int width,
1233                int height);
1234 
1235 LIBYUV_API
1236 int I420ToBGRA(const uint8_t* src_y,
1237                int src_stride_y,
1238                const uint8_t* src_u,
1239                int src_stride_u,
1240                const uint8_t* src_v,
1241                int src_stride_v,
1242                uint8_t* dst_bgra,
1243                int dst_stride_bgra,
1244                int width,
1245                int height);
1246 
1247 LIBYUV_API
1248 int I420ToABGR(const uint8_t* src_y,
1249                int src_stride_y,
1250                const uint8_t* src_u,
1251                int src_stride_u,
1252                const uint8_t* src_v,
1253                int src_stride_v,
1254                uint8_t* dst_abgr,
1255                int dst_stride_abgr,
1256                int width,
1257                int height);
1258 
1259 LIBYUV_API
1260 int I420ToRGBA(const uint8_t* src_y,
1261                int src_stride_y,
1262                const uint8_t* src_u,
1263                int src_stride_u,
1264                const uint8_t* src_v,
1265                int src_stride_v,
1266                uint8_t* dst_rgba,
1267                int dst_stride_rgba,
1268                int width,
1269                int height);
1270 
1271 LIBYUV_API
1272 int I420ToRGB24(const uint8_t* src_y,
1273                 int src_stride_y,
1274                 const uint8_t* src_u,
1275                 int src_stride_u,
1276                 const uint8_t* src_v,
1277                 int src_stride_v,
1278                 uint8_t* dst_rgb24,
1279                 int dst_stride_rgb24,
1280                 int width,
1281                 int height);
1282 
1283 LIBYUV_API
1284 int I420ToRAW(const uint8_t* src_y,
1285               int src_stride_y,
1286               const uint8_t* src_u,
1287               int src_stride_u,
1288               const uint8_t* src_v,
1289               int src_stride_v,
1290               uint8_t* dst_raw,
1291               int dst_stride_raw,
1292               int width,
1293               int height);
1294 
1295 LIBYUV_API
1296 int H420ToRGB24(const uint8_t* src_y,
1297                 int src_stride_y,
1298                 const uint8_t* src_u,
1299                 int src_stride_u,
1300                 const uint8_t* src_v,
1301                 int src_stride_v,
1302                 uint8_t* dst_rgb24,
1303                 int dst_stride_rgb24,
1304                 int width,
1305                 int height);
1306 
1307 LIBYUV_API
1308 int H420ToRAW(const uint8_t* src_y,
1309               int src_stride_y,
1310               const uint8_t* src_u,
1311               int src_stride_u,
1312               const uint8_t* src_v,
1313               int src_stride_v,
1314               uint8_t* dst_raw,
1315               int dst_stride_raw,
1316               int width,
1317               int height);
1318 
1319 LIBYUV_API
1320 int J420ToRGB24(const uint8_t* src_y,
1321                 int src_stride_y,
1322                 const uint8_t* src_u,
1323                 int src_stride_u,
1324                 const uint8_t* src_v,
1325                 int src_stride_v,
1326                 uint8_t* dst_rgb24,
1327                 int dst_stride_rgb24,
1328                 int width,
1329                 int height);
1330 
1331 LIBYUV_API
1332 int J420ToRAW(const uint8_t* src_y,
1333               int src_stride_y,
1334               const uint8_t* src_u,
1335               int src_stride_u,
1336               const uint8_t* src_v,
1337               int src_stride_v,
1338               uint8_t* dst_raw,
1339               int dst_stride_raw,
1340               int width,
1341               int height);
1342 
1343 // Convert I422 to RGB24.
1344 LIBYUV_API
1345 int I422ToRGB24(const uint8_t* src_y,
1346                 int src_stride_y,
1347                 const uint8_t* src_u,
1348                 int src_stride_u,
1349                 const uint8_t* src_v,
1350                 int src_stride_v,
1351                 uint8_t* dst_rgb24,
1352                 int dst_stride_rgb24,
1353                 int width,
1354                 int height);
1355 
1356 // Convert I422 to RAW.
1357 LIBYUV_API
1358 int I422ToRAW(const uint8_t* src_y,
1359               int src_stride_y,
1360               const uint8_t* src_u,
1361               int src_stride_u,
1362               const uint8_t* src_v,
1363               int src_stride_v,
1364               uint8_t* dst_raw,
1365               int dst_stride_raw,
1366               int width,
1367               int height);
1368 
1369 LIBYUV_API
1370 int I420ToRGB565(const uint8_t* src_y,
1371                  int src_stride_y,
1372                  const uint8_t* src_u,
1373                  int src_stride_u,
1374                  const uint8_t* src_v,
1375                  int src_stride_v,
1376                  uint8_t* dst_rgb565,
1377                  int dst_stride_rgb565,
1378                  int width,
1379                  int height);
1380 
1381 LIBYUV_API
1382 int J420ToRGB565(const uint8_t* src_y,
1383                  int src_stride_y,
1384                  const uint8_t* src_u,
1385                  int src_stride_u,
1386                  const uint8_t* src_v,
1387                  int src_stride_v,
1388                  uint8_t* dst_rgb565,
1389                  int dst_stride_rgb565,
1390                  int width,
1391                  int height);
1392 
1393 LIBYUV_API
1394 int H420ToRGB565(const uint8_t* src_y,
1395                  int src_stride_y,
1396                  const uint8_t* src_u,
1397                  int src_stride_u,
1398                  const uint8_t* src_v,
1399                  int src_stride_v,
1400                  uint8_t* dst_rgb565,
1401                  int dst_stride_rgb565,
1402                  int width,
1403                  int height);
1404 
1405 LIBYUV_API
1406 int I422ToRGB565(const uint8_t* src_y,
1407                  int src_stride_y,
1408                  const uint8_t* src_u,
1409                  int src_stride_u,
1410                  const uint8_t* src_v,
1411                  int src_stride_v,
1412                  uint8_t* dst_rgb565,
1413                  int dst_stride_rgb565,
1414                  int width,
1415                  int height);
1416 
1417 // Convert I420 To RGB565 with 4x4 dither matrix (16 bytes).
1418 // Values in dither matrix from 0 to 7 recommended.
1419 // The order of the dither matrix is first byte is upper left.
1420 
1421 LIBYUV_API
1422 int I420ToRGB565Dither(const uint8_t* src_y,
1423                        int src_stride_y,
1424                        const uint8_t* src_u,
1425                        int src_stride_u,
1426                        const uint8_t* src_v,
1427                        int src_stride_v,
1428                        uint8_t* dst_rgb565,
1429                        int dst_stride_rgb565,
1430                        const uint8_t* dither4x4,
1431                        int width,
1432                        int height);
1433 
1434 LIBYUV_API
1435 int I420ToARGB1555(const uint8_t* src_y,
1436                    int src_stride_y,
1437                    const uint8_t* src_u,
1438                    int src_stride_u,
1439                    const uint8_t* src_v,
1440                    int src_stride_v,
1441                    uint8_t* dst_argb1555,
1442                    int dst_stride_argb1555,
1443                    int width,
1444                    int height);
1445 
1446 LIBYUV_API
1447 int I420ToARGB4444(const uint8_t* src_y,
1448                    int src_stride_y,
1449                    const uint8_t* src_u,
1450                    int src_stride_u,
1451                    const uint8_t* src_v,
1452                    int src_stride_v,
1453                    uint8_t* dst_argb4444,
1454                    int dst_stride_argb4444,
1455                    int width,
1456                    int height);
1457 
1458 // Convert I420 to AR30.
1459 LIBYUV_API
1460 int I420ToAR30(const uint8_t* src_y,
1461                int src_stride_y,
1462                const uint8_t* src_u,
1463                int src_stride_u,
1464                const uint8_t* src_v,
1465                int src_stride_v,
1466                uint8_t* dst_ar30,
1467                int dst_stride_ar30,
1468                int width,
1469                int height);
1470 
1471 // Convert I420 to AB30.
1472 LIBYUV_API
1473 int I420ToAB30(const uint8_t* src_y,
1474                int src_stride_y,
1475                const uint8_t* src_u,
1476                int src_stride_u,
1477                const uint8_t* src_v,
1478                int src_stride_v,
1479                uint8_t* dst_ab30,
1480                int dst_stride_ab30,
1481                int width,
1482                int height);
1483 
1484 // Convert H420 to AR30.
1485 LIBYUV_API
1486 int H420ToAR30(const uint8_t* src_y,
1487                int src_stride_y,
1488                const uint8_t* src_u,
1489                int src_stride_u,
1490                const uint8_t* src_v,
1491                int src_stride_v,
1492                uint8_t* dst_ar30,
1493                int dst_stride_ar30,
1494                int width,
1495                int height);
1496 
1497 // Convert H420 to AB30.
1498 LIBYUV_API
1499 int H420ToAB30(const uint8_t* src_y,
1500                int src_stride_y,
1501                const uint8_t* src_u,
1502                int src_stride_u,
1503                const uint8_t* src_v,
1504                int src_stride_v,
1505                uint8_t* dst_ab30,
1506                int dst_stride_ab30,
1507                int width,
1508                int height);
1509 
1510 // Convert I420 to ARGB with matrix.
1511 LIBYUV_API
1512 int I420ToARGBMatrix(const uint8_t* src_y,
1513                      int src_stride_y,
1514                      const uint8_t* src_u,
1515                      int src_stride_u,
1516                      const uint8_t* src_v,
1517                      int src_stride_v,
1518                      uint8_t* dst_argb,
1519                      int dst_stride_argb,
1520                      const struct YuvConstants* yuvconstants,
1521                      int width,
1522                      int height);
1523 
1524 // Convert I422 to ARGB with matrix.
1525 LIBYUV_API
1526 int I422ToARGBMatrix(const uint8_t* src_y,
1527                      int src_stride_y,
1528                      const uint8_t* src_u,
1529                      int src_stride_u,
1530                      const uint8_t* src_v,
1531                      int src_stride_v,
1532                      uint8_t* dst_argb,
1533                      int dst_stride_argb,
1534                      const struct YuvConstants* yuvconstants,
1535                      int width,
1536                      int height);
1537 
1538 // Convert I444 to ARGB with matrix.
1539 LIBYUV_API
1540 int I444ToARGBMatrix(const uint8_t* src_y,
1541                      int src_stride_y,
1542                      const uint8_t* src_u,
1543                      int src_stride_u,
1544                      const uint8_t* src_v,
1545                      int src_stride_v,
1546                      uint8_t* dst_argb,
1547                      int dst_stride_argb,
1548                      const struct YuvConstants* yuvconstants,
1549                      int width,
1550                      int height);
1551 
1552 // Convert I444 to RGB24 with matrix.
1553 LIBYUV_API
1554 int I444ToRGB24Matrix(const uint8_t* src_y,
1555                       int src_stride_y,
1556                       const uint8_t* src_u,
1557                       int src_stride_u,
1558                       const uint8_t* src_v,
1559                       int src_stride_v,
1560                       uint8_t* dst_rgb24,
1561                       int dst_stride_rgb24,
1562                       const struct YuvConstants* yuvconstants,
1563                       int width,
1564                       int height);
1565 
1566 // Convert 10 bit 420 YUV to ARGB with matrix.
1567 LIBYUV_API
1568 int I010ToAR30Matrix(const uint16_t* src_y,
1569                      int src_stride_y,
1570                      const uint16_t* src_u,
1571                      int src_stride_u,
1572                      const uint16_t* src_v,
1573                      int src_stride_v,
1574                      uint8_t* dst_ar30,
1575                      int dst_stride_ar30,
1576                      const struct YuvConstants* yuvconstants,
1577                      int width,
1578                      int height);
1579 
1580 // Convert 10 bit 420 YUV to ARGB with matrix.
1581 LIBYUV_API
1582 int I210ToAR30Matrix(const uint16_t* src_y,
1583                      int src_stride_y,
1584                      const uint16_t* src_u,
1585                      int src_stride_u,
1586                      const uint16_t* src_v,
1587                      int src_stride_v,
1588                      uint8_t* dst_ar30,
1589                      int dst_stride_ar30,
1590                      const struct YuvConstants* yuvconstants,
1591                      int width,
1592                      int height);
1593 
1594 // Convert 10 bit 444 YUV to ARGB with matrix.
1595 LIBYUV_API
1596 int I410ToAR30Matrix(const uint16_t* src_y,
1597                      int src_stride_y,
1598                      const uint16_t* src_u,
1599                      int src_stride_u,
1600                      const uint16_t* src_v,
1601                      int src_stride_v,
1602                      uint8_t* dst_ar30,
1603                      int dst_stride_ar30,
1604                      const struct YuvConstants* yuvconstants,
1605                      int width,
1606                      int height);
1607 
1608 // Convert 10 bit YUV to ARGB with matrix.
1609 LIBYUV_API
1610 int I010ToARGBMatrix(const uint16_t* src_y,
1611                      int src_stride_y,
1612                      const uint16_t* src_u,
1613                      int src_stride_u,
1614                      const uint16_t* src_v,
1615                      int src_stride_v,
1616                      uint8_t* dst_argb,
1617                      int dst_stride_argb,
1618                      const struct YuvConstants* yuvconstants,
1619                      int width,
1620                      int height);
1621 
1622 // multiply 12 bit yuv into high bits to allow any number of bits.
1623 LIBYUV_API
1624 int I012ToAR30Matrix(const uint16_t* src_y,
1625                      int src_stride_y,
1626                      const uint16_t* src_u,
1627                      int src_stride_u,
1628                      const uint16_t* src_v,
1629                      int src_stride_v,
1630                      uint8_t* dst_ar30,
1631                      int dst_stride_ar30,
1632                      const struct YuvConstants* yuvconstants,
1633                      int width,
1634                      int height);
1635 
1636 // Convert 12 bit YUV to ARGB with matrix.
1637 LIBYUV_API
1638 int I012ToARGBMatrix(const uint16_t* src_y,
1639                      int src_stride_y,
1640                      const uint16_t* src_u,
1641                      int src_stride_u,
1642                      const uint16_t* src_v,
1643                      int src_stride_v,
1644                      uint8_t* dst_argb,
1645                      int dst_stride_argb,
1646                      const struct YuvConstants* yuvconstants,
1647                      int width,
1648                      int height);
1649 
1650 // Convert 10 bit 422 YUV to ARGB with matrix.
1651 LIBYUV_API
1652 int I210ToARGBMatrix(const uint16_t* src_y,
1653                      int src_stride_y,
1654                      const uint16_t* src_u,
1655                      int src_stride_u,
1656                      const uint16_t* src_v,
1657                      int src_stride_v,
1658                      uint8_t* dst_argb,
1659                      int dst_stride_argb,
1660                      const struct YuvConstants* yuvconstants,
1661                      int width,
1662                      int height);
1663 
1664 // Convert 10 bit 444 YUV to ARGB with matrix.
1665 LIBYUV_API
1666 int I410ToARGBMatrix(const uint16_t* src_y,
1667                      int src_stride_y,
1668                      const uint16_t* src_u,
1669                      int src_stride_u,
1670                      const uint16_t* src_v,
1671                      int src_stride_v,
1672                      uint8_t* dst_argb,
1673                      int dst_stride_argb,
1674                      const struct YuvConstants* yuvconstants,
1675                      int width,
1676                      int height);
1677 
1678 // Convert P010 to ARGB with matrix.
1679 LIBYUV_API
1680 int P010ToARGBMatrix(const uint16_t* src_y,
1681                      int src_stride_y,
1682                      const uint16_t* src_uv,
1683                      int src_stride_uv,
1684                      uint8_t* dst_argb,
1685                      int dst_stride_argb,
1686                      const struct YuvConstants* yuvconstants,
1687                      int width,
1688                      int height);
1689 
1690 // Convert P210 to ARGB with matrix.
1691 LIBYUV_API
1692 int P210ToARGBMatrix(const uint16_t* src_y,
1693                      int src_stride_y,
1694                      const uint16_t* src_uv,
1695                      int src_stride_uv,
1696                      uint8_t* dst_argb,
1697                      int dst_stride_argb,
1698                      const struct YuvConstants* yuvconstants,
1699                      int width,
1700                      int height);
1701 
1702 // Convert P010 to AR30 with matrix.
1703 LIBYUV_API
1704 int P010ToAR30Matrix(const uint16_t* src_y,
1705                      int src_stride_y,
1706                      const uint16_t* src_uv,
1707                      int src_stride_uv,
1708                      uint8_t* dst_ar30,
1709                      int dst_stride_ar30,
1710                      const struct YuvConstants* yuvconstants,
1711                      int width,
1712                      int height);
1713 
1714 // Convert P210 to AR30 with matrix.
1715 LIBYUV_API
1716 int P210ToAR30Matrix(const uint16_t* src_y,
1717                      int src_stride_y,
1718                      const uint16_t* src_uv,
1719                      int src_stride_uv,
1720                      uint8_t* dst_ar30,
1721                      int dst_stride_ar30,
1722                      const struct YuvConstants* yuvconstants,
1723                      int width,
1724                      int height);
1725 
1726 // P012 and P010 use most significant bits so the conversion is the same.
1727 // Convert P012 to ARGB with matrix.
1728 #define P012ToARGBMatrix P010ToARGBMatrix
1729 // Convert P012 to AR30 with matrix.
1730 #define P012ToAR30Matrix P010ToAR30Matrix
1731 // Convert P212 to ARGB with matrix.
1732 #define P212ToARGBMatrix P210ToARGBMatrix
1733 // Convert P212 to AR30 with matrix.
1734 #define P212ToAR30Matrix P210ToAR30Matrix
1735 
1736 // Convert P016 to ARGB with matrix.
1737 #define P016ToARGBMatrix P010ToARGBMatrix
1738 // Convert P016 to AR30 with matrix.
1739 #define P016ToAR30Matrix P010ToAR30Matrix
1740 // Convert P216 to ARGB with matrix.
1741 #define P216ToARGBMatrix P210ToARGBMatrix
1742 // Convert P216 to AR30 with matrix.
1743 #define P216ToAR30Matrix P210ToAR30Matrix
1744 
1745 // Convert I420 with Alpha to preattenuated ARGB with matrix.
1746 LIBYUV_API
1747 int I420AlphaToARGBMatrix(const uint8_t* src_y,
1748                           int src_stride_y,
1749                           const uint8_t* src_u,
1750                           int src_stride_u,
1751                           const uint8_t* src_v,
1752                           int src_stride_v,
1753                           const uint8_t* src_a,
1754                           int src_stride_a,
1755                           uint8_t* dst_argb,
1756                           int dst_stride_argb,
1757                           const struct YuvConstants* yuvconstants,
1758                           int width,
1759                           int height,
1760                           int attenuate);
1761 
1762 // Convert I422 with Alpha to preattenuated ARGB with matrix.
1763 LIBYUV_API
1764 int I422AlphaToARGBMatrix(const uint8_t* src_y,
1765                           int src_stride_y,
1766                           const uint8_t* src_u,
1767                           int src_stride_u,
1768                           const uint8_t* src_v,
1769                           int src_stride_v,
1770                           const uint8_t* src_a,
1771                           int src_stride_a,
1772                           uint8_t* dst_argb,
1773                           int dst_stride_argb,
1774                           const struct YuvConstants* yuvconstants,
1775                           int width,
1776                           int height,
1777                           int attenuate);
1778 
1779 // Convert I444 with Alpha to preattenuated ARGB with matrix.
1780 LIBYUV_API
1781 int I444AlphaToARGBMatrix(const uint8_t* src_y,
1782                           int src_stride_y,
1783                           const uint8_t* src_u,
1784                           int src_stride_u,
1785                           const uint8_t* src_v,
1786                           int src_stride_v,
1787                           const uint8_t* src_a,
1788                           int src_stride_a,
1789                           uint8_t* dst_argb,
1790                           int dst_stride_argb,
1791                           const struct YuvConstants* yuvconstants,
1792                           int width,
1793                           int height,
1794                           int attenuate);
1795 
1796 // Convert I010 with Alpha to preattenuated ARGB with matrix.
1797 LIBYUV_API
1798 int I010AlphaToARGBMatrix(const uint16_t* src_y,
1799                           int src_stride_y,
1800                           const uint16_t* src_u,
1801                           int src_stride_u,
1802                           const uint16_t* src_v,
1803                           int src_stride_v,
1804                           const uint16_t* src_a,
1805                           int src_stride_a,
1806                           uint8_t* dst_argb,
1807                           int dst_stride_argb,
1808                           const struct YuvConstants* yuvconstants,
1809                           int width,
1810                           int height,
1811                           int attenuate);
1812 
1813 // Convert I210 with Alpha to preattenuated ARGB with matrix.
1814 LIBYUV_API
1815 int I210AlphaToARGBMatrix(const uint16_t* src_y,
1816                           int src_stride_y,
1817                           const uint16_t* src_u,
1818                           int src_stride_u,
1819                           const uint16_t* src_v,
1820                           int src_stride_v,
1821                           const uint16_t* src_a,
1822                           int src_stride_a,
1823                           uint8_t* dst_argb,
1824                           int dst_stride_argb,
1825                           const struct YuvConstants* yuvconstants,
1826                           int width,
1827                           int height,
1828                           int attenuate);
1829 
1830 // Convert I410 with Alpha to preattenuated ARGB with matrix.
1831 LIBYUV_API
1832 int I410AlphaToARGBMatrix(const uint16_t* src_y,
1833                           int src_stride_y,
1834                           const uint16_t* src_u,
1835                           int src_stride_u,
1836                           const uint16_t* src_v,
1837                           int src_stride_v,
1838                           const uint16_t* src_a,
1839                           int src_stride_a,
1840                           uint8_t* dst_argb,
1841                           int dst_stride_argb,
1842                           const struct YuvConstants* yuvconstants,
1843                           int width,
1844                           int height,
1845                           int attenuate);
1846 
1847 // Convert NV12 to ARGB with matrix.
1848 LIBYUV_API
1849 int NV12ToARGBMatrix(const uint8_t* src_y,
1850                      int src_stride_y,
1851                      const uint8_t* src_uv,
1852                      int src_stride_uv,
1853                      uint8_t* dst_argb,
1854                      int dst_stride_argb,
1855                      const struct YuvConstants* yuvconstants,
1856                      int width,
1857                      int height);
1858 
1859 // Convert NV21 to ARGB with matrix.
1860 LIBYUV_API
1861 int NV21ToARGBMatrix(const uint8_t* src_y,
1862                      int src_stride_y,
1863                      const uint8_t* src_vu,
1864                      int src_stride_vu,
1865                      uint8_t* dst_argb,
1866                      int dst_stride_argb,
1867                      const struct YuvConstants* yuvconstants,
1868                      int width,
1869                      int height);
1870 
1871 // Convert NV12 to RGB565 with matrix.
1872 LIBYUV_API
1873 int NV12ToRGB565Matrix(const uint8_t* src_y,
1874                        int src_stride_y,
1875                        const uint8_t* src_uv,
1876                        int src_stride_uv,
1877                        uint8_t* dst_rgb565,
1878                        int dst_stride_rgb565,
1879                        const struct YuvConstants* yuvconstants,
1880                        int width,
1881                        int height);
1882 
1883 // Convert NV12 to RGB24 with matrix.
1884 LIBYUV_API
1885 int NV12ToRGB24Matrix(const uint8_t* src_y,
1886                       int src_stride_y,
1887                       const uint8_t* src_uv,
1888                       int src_stride_uv,
1889                       uint8_t* dst_rgb24,
1890                       int dst_stride_rgb24,
1891                       const struct YuvConstants* yuvconstants,
1892                       int width,
1893                       int height);
1894 
1895 // Convert NV21 to RGB24 with matrix.
1896 LIBYUV_API
1897 int NV21ToRGB24Matrix(const uint8_t* src_y,
1898                       int src_stride_y,
1899                       const uint8_t* src_vu,
1900                       int src_stride_vu,
1901                       uint8_t* dst_rgb24,
1902                       int dst_stride_rgb24,
1903                       const struct YuvConstants* yuvconstants,
1904                       int width,
1905                       int height);
1906 
1907 // Convert Android420 to ARGB with matrix.
1908 LIBYUV_API
1909 int Android420ToARGBMatrix(const uint8_t* src_y,
1910                            int src_stride_y,
1911                            const uint8_t* src_u,
1912                            int src_stride_u,
1913                            const uint8_t* src_v,
1914                            int src_stride_v,
1915                            int src_pixel_stride_uv,
1916                            uint8_t* dst_argb,
1917                            int dst_stride_argb,
1918                            const struct YuvConstants* yuvconstants,
1919                            int width,
1920                            int height);
1921 
1922 // Convert I422 to RGBA with matrix.
1923 LIBYUV_API
1924 int I422ToRGBAMatrix(const uint8_t* src_y,
1925                      int src_stride_y,
1926                      const uint8_t* src_u,
1927                      int src_stride_u,
1928                      const uint8_t* src_v,
1929                      int src_stride_v,
1930                      uint8_t* dst_rgba,
1931                      int dst_stride_rgba,
1932                      const struct YuvConstants* yuvconstants,
1933                      int width,
1934                      int height);
1935 
1936 // Convert I420 to RGBA with matrix.
1937 LIBYUV_API
1938 int I420ToRGBAMatrix(const uint8_t* src_y,
1939                      int src_stride_y,
1940                      const uint8_t* src_u,
1941                      int src_stride_u,
1942                      const uint8_t* src_v,
1943                      int src_stride_v,
1944                      uint8_t* dst_rgba,
1945                      int dst_stride_rgba,
1946                      const struct YuvConstants* yuvconstants,
1947                      int width,
1948                      int height);
1949 
1950 // Convert I420 to RGB24 with matrix.
1951 LIBYUV_API
1952 int I420ToRGB24Matrix(const uint8_t* src_y,
1953                       int src_stride_y,
1954                       const uint8_t* src_u,
1955                       int src_stride_u,
1956                       const uint8_t* src_v,
1957                       int src_stride_v,
1958                       uint8_t* dst_rgb24,
1959                       int dst_stride_rgb24,
1960                       const struct YuvConstants* yuvconstants,
1961                       int width,
1962                       int height);
1963 
1964 // Convert I422 to RGB24 with matrix.
1965 LIBYUV_API
1966 int I422ToRGB24Matrix(const uint8_t* src_y,
1967                       int src_stride_y,
1968                       const uint8_t* src_u,
1969                       int src_stride_u,
1970                       const uint8_t* src_v,
1971                       int src_stride_v,
1972                       uint8_t* dst_rgb24,
1973                       int dst_stride_rgb24,
1974                       const struct YuvConstants* yuvconstants,
1975                       int width,
1976                       int height);
1977 
1978 // Convert I420 to RGB565 with specified color matrix.
1979 LIBYUV_API
1980 int I420ToRGB565Matrix(const uint8_t* src_y,
1981                        int src_stride_y,
1982                        const uint8_t* src_u,
1983                        int src_stride_u,
1984                        const uint8_t* src_v,
1985                        int src_stride_v,
1986                        uint8_t* dst_rgb565,
1987                        int dst_stride_rgb565,
1988                        const struct YuvConstants* yuvconstants,
1989                        int width,
1990                        int height);
1991 
1992 // Convert I422 to RGB565 with specified color matrix.
1993 LIBYUV_API
1994 int I422ToRGB565Matrix(const uint8_t* src_y,
1995                        int src_stride_y,
1996                        const uint8_t* src_u,
1997                        int src_stride_u,
1998                        const uint8_t* src_v,
1999                        int src_stride_v,
2000                        uint8_t* dst_rgb565,
2001                        int dst_stride_rgb565,
2002                        const struct YuvConstants* yuvconstants,
2003                        int width,
2004                        int height);
2005 
2006 // Convert I420 to AR30 with matrix.
2007 LIBYUV_API
2008 int I420ToAR30Matrix(const uint8_t* src_y,
2009                      int src_stride_y,
2010                      const uint8_t* src_u,
2011                      int src_stride_u,
2012                      const uint8_t* src_v,
2013                      int src_stride_v,
2014                      uint8_t* dst_ar30,
2015                      int dst_stride_ar30,
2016                      const struct YuvConstants* yuvconstants,
2017                      int width,
2018                      int height);
2019 
2020 // Convert I400 (grey) to ARGB.  Reverse of ARGBToI400.
2021 LIBYUV_API
2022 int I400ToARGBMatrix(const uint8_t* src_y,
2023                      int src_stride_y,
2024                      uint8_t* dst_argb,
2025                      int dst_stride_argb,
2026                      const struct YuvConstants* yuvconstants,
2027                      int width,
2028                      int height);
2029 
2030 // Convert I420 to ARGB with matrix and UV filter mode.
2031 LIBYUV_API
2032 int I420ToARGBMatrixFilter(const uint8_t* src_y,
2033                            int src_stride_y,
2034                            const uint8_t* src_u,
2035                            int src_stride_u,
2036                            const uint8_t* src_v,
2037                            int src_stride_v,
2038                            uint8_t* dst_argb,
2039                            int dst_stride_argb,
2040                            const struct YuvConstants* yuvconstants,
2041                            int width,
2042                            int height,
2043                            enum FilterMode filter);
2044 
2045 // Convert I422 to ARGB with matrix and UV filter mode.
2046 LIBYUV_API
2047 int I422ToARGBMatrixFilter(const uint8_t* src_y,
2048                            int src_stride_y,
2049                            const uint8_t* src_u,
2050                            int src_stride_u,
2051                            const uint8_t* src_v,
2052                            int src_stride_v,
2053                            uint8_t* dst_argb,
2054                            int dst_stride_argb,
2055                            const struct YuvConstants* yuvconstants,
2056                            int width,
2057                            int height,
2058                            enum FilterMode filter);
2059 
2060 // Convert I422 to RGB24 with matrix and UV filter mode.
2061 LIBYUV_API
2062 int I422ToRGB24MatrixFilter(const uint8_t* src_y,
2063                             int src_stride_y,
2064                             const uint8_t* src_u,
2065                             int src_stride_u,
2066                             const uint8_t* src_v,
2067                             int src_stride_v,
2068                             uint8_t* dst_rgb24,
2069                             int dst_stride_rgb24,
2070                             const struct YuvConstants* yuvconstants,
2071                             int width,
2072                             int height,
2073                             enum FilterMode filter);
2074 
2075 // Convert I420 to RGB24 with matrix and UV filter mode.
2076 LIBYUV_API
2077 int I420ToRGB24MatrixFilter(const uint8_t* src_y,
2078                             int src_stride_y,
2079                             const uint8_t* src_u,
2080                             int src_stride_u,
2081                             const uint8_t* src_v,
2082                             int src_stride_v,
2083                             uint8_t* dst_rgb24,
2084                             int dst_stride_rgb24,
2085                             const struct YuvConstants* yuvconstants,
2086                             int width,
2087                             int height,
2088                             enum FilterMode filter);
2089 
2090 // Convert I010 to AR30 with matrix and UV filter mode.
2091 LIBYUV_API
2092 int I010ToAR30MatrixFilter(const uint16_t* src_y,
2093                            int src_stride_y,
2094                            const uint16_t* src_u,
2095                            int src_stride_u,
2096                            const uint16_t* src_v,
2097                            int src_stride_v,
2098                            uint8_t* dst_ar30,
2099                            int dst_stride_ar30,
2100                            const struct YuvConstants* yuvconstants,
2101                            int width,
2102                            int height,
2103                            enum FilterMode filter);
2104 
2105 // Convert I210 to AR30 with matrix and UV filter mode.
2106 LIBYUV_API
2107 int I210ToAR30MatrixFilter(const uint16_t* src_y,
2108                            int src_stride_y,
2109                            const uint16_t* src_u,
2110                            int src_stride_u,
2111                            const uint16_t* src_v,
2112                            int src_stride_v,
2113                            uint8_t* dst_ar30,
2114                            int dst_stride_ar30,
2115                            const struct YuvConstants* yuvconstants,
2116                            int width,
2117                            int height,
2118                            enum FilterMode filter);
2119 
2120 // Convert I010 to ARGB with matrix and UV filter mode.
2121 LIBYUV_API
2122 int I010ToARGBMatrixFilter(const uint16_t* src_y,
2123                            int src_stride_y,
2124                            const uint16_t* src_u,
2125                            int src_stride_u,
2126                            const uint16_t* src_v,
2127                            int src_stride_v,
2128                            uint8_t* dst_argb,
2129                            int dst_stride_argb,
2130                            const struct YuvConstants* yuvconstants,
2131                            int width,
2132                            int height,
2133                            enum FilterMode filter);
2134 
2135 // Convert I210 to ARGB with matrix and UV filter mode.
2136 LIBYUV_API
2137 int I210ToARGBMatrixFilter(const uint16_t* src_y,
2138                            int src_stride_y,
2139                            const uint16_t* src_u,
2140                            int src_stride_u,
2141                            const uint16_t* src_v,
2142                            int src_stride_v,
2143                            uint8_t* dst_argb,
2144                            int dst_stride_argb,
2145                            const struct YuvConstants* yuvconstants,
2146                            int width,
2147                            int height,
2148                            enum FilterMode filter);
2149 
2150 // Convert I420 with Alpha to attenuated ARGB with matrix and UV filter mode.
2151 LIBYUV_API
2152 int I420AlphaToARGBMatrixFilter(const uint8_t* src_y,
2153                                 int src_stride_y,
2154                                 const uint8_t* src_u,
2155                                 int src_stride_u,
2156                                 const uint8_t* src_v,
2157                                 int src_stride_v,
2158                                 const uint8_t* src_a,
2159                                 int src_stride_a,
2160                                 uint8_t* dst_argb,
2161                                 int dst_stride_argb,
2162                                 const struct YuvConstants* yuvconstants,
2163                                 int width,
2164                                 int height,
2165                                 int attenuate,
2166                                 enum FilterMode filter);
2167 
2168 // Convert I422 with Alpha to attenuated ARGB with matrix and UV filter mode.
2169 LIBYUV_API
2170 int I422AlphaToARGBMatrixFilter(const uint8_t* src_y,
2171                                 int src_stride_y,
2172                                 const uint8_t* src_u,
2173                                 int src_stride_u,
2174                                 const uint8_t* src_v,
2175                                 int src_stride_v,
2176                                 const uint8_t* src_a,
2177                                 int src_stride_a,
2178                                 uint8_t* dst_argb,
2179                                 int dst_stride_argb,
2180                                 const struct YuvConstants* yuvconstants,
2181                                 int width,
2182                                 int height,
2183                                 int attenuate,
2184                                 enum FilterMode filter);
2185 
2186 // Convert I010 with Alpha to attenuated ARGB with matrix and UV filter mode.
2187 LIBYUV_API
2188 int I010AlphaToARGBMatrixFilter(const uint16_t* src_y,
2189                                 int src_stride_y,
2190                                 const uint16_t* src_u,
2191                                 int src_stride_u,
2192                                 const uint16_t* src_v,
2193                                 int src_stride_v,
2194                                 const uint16_t* src_a,
2195                                 int src_stride_a,
2196                                 uint8_t* dst_argb,
2197                                 int dst_stride_argb,
2198                                 const struct YuvConstants* yuvconstants,
2199                                 int width,
2200                                 int height,
2201                                 int attenuate,
2202                                 enum FilterMode filter);
2203 
2204 // Convert I210 with Alpha to attenuated ARGB with matrix and UV filter mode.
2205 LIBYUV_API
2206 int I210AlphaToARGBMatrixFilter(const uint16_t* src_y,
2207                                 int src_stride_y,
2208                                 const uint16_t* src_u,
2209                                 int src_stride_u,
2210                                 const uint16_t* src_v,
2211                                 int src_stride_v,
2212                                 const uint16_t* src_a,
2213                                 int src_stride_a,
2214                                 uint8_t* dst_argb,
2215                                 int dst_stride_argb,
2216                                 const struct YuvConstants* yuvconstants,
2217                                 int width,
2218                                 int height,
2219                                 int attenuate,
2220                                 enum FilterMode filter);
2221 
2222 // Convert P010 to ARGB with matrix and UV filter mode.
2223 LIBYUV_API
2224 int P010ToARGBMatrixFilter(const uint16_t* src_y,
2225                            int src_stride_y,
2226                            const uint16_t* src_uv,
2227                            int src_stride_uv,
2228                            uint8_t* dst_argb,
2229                            int dst_stride_argb,
2230                            const struct YuvConstants* yuvconstants,
2231                            int width,
2232                            int height,
2233                            enum FilterMode filter);
2234 
2235 // Convert P210 to ARGB with matrix and UV filter mode.
2236 LIBYUV_API
2237 int P210ToARGBMatrixFilter(const uint16_t* src_y,
2238                            int src_stride_y,
2239                            const uint16_t* src_uv,
2240                            int src_stride_uv,
2241                            uint8_t* dst_argb,
2242                            int dst_stride_argb,
2243                            const struct YuvConstants* yuvconstants,
2244                            int width,
2245                            int height,
2246                            enum FilterMode filter);
2247 
2248 // Convert P010 to AR30 with matrix and UV filter mode.
2249 LIBYUV_API
2250 int P010ToAR30MatrixFilter(const uint16_t* src_y,
2251                            int src_stride_y,
2252                            const uint16_t* src_uv,
2253                            int src_stride_uv,
2254                            uint8_t* dst_ar30,
2255                            int dst_stride_ar30,
2256                            const struct YuvConstants* yuvconstants,
2257                            int width,
2258                            int height,
2259                            enum FilterMode filter);
2260 
2261 // Convert P210 to AR30 with matrix and UV filter mode.
2262 LIBYUV_API
2263 int P210ToAR30MatrixFilter(const uint16_t* src_y,
2264                            int src_stride_y,
2265                            const uint16_t* src_uv,
2266                            int src_stride_uv,
2267                            uint8_t* dst_ar30,
2268                            int dst_stride_ar30,
2269                            const struct YuvConstants* yuvconstants,
2270                            int width,
2271                            int height,
2272                            enum FilterMode filter);
2273 
2274 // Convert camera sample to ARGB with cropping, rotation and vertical flip.
2275 // "sample_size" is needed to parse MJPG.
2276 // "dst_stride_argb" number of bytes in a row of the dst_argb plane.
2277 //   Normally this would be the same as dst_width, with recommended alignment
2278 //   to 16 bytes for better efficiency.
2279 //   If rotation of 90 or 270 is used, stride is affected. The caller should
2280 //   allocate the I420 buffer according to rotation.
2281 // "dst_stride_u" number of bytes in a row of the dst_u plane.
2282 //   Normally this would be the same as (dst_width + 1) / 2, with
2283 //   recommended alignment to 16 bytes for better efficiency.
2284 //   If rotation of 90 or 270 is used, stride is affected.
2285 // "crop_x" and "crop_y" are starting position for cropping.
2286 //   To center, crop_x = (src_width - dst_width) / 2
2287 //              crop_y = (src_height - dst_height) / 2
2288 // "src_width" / "src_height" is size of src_frame in pixels.
2289 //   "src_height" can be negative indicating a vertically flipped image source.
2290 // "crop_width" / "crop_height" is the size to crop the src to.
2291 //    Must be less than or equal to src_width/src_height
2292 //    Cropping parameters are pre-rotation.
2293 // "rotation" can be 0, 90, 180 or 270.
2294 // "fourcc" is a fourcc. ie 'I420', 'YUY2'
2295 // Returns 0 for successful; -1 for invalid parameter. Non-zero for failure.
2296 LIBYUV_API
2297 int ConvertToARGB(const uint8_t* sample,
2298                   size_t sample_size,
2299                   uint8_t* dst_argb,
2300                   int dst_stride_argb,
2301                   int crop_x,
2302                   int crop_y,
2303                   int src_width,
2304                   int src_height,
2305                   int crop_width,
2306                   int crop_height,
2307                   enum RotationMode rotation,
2308                   uint32_t fourcc);
2309 
2310 #ifdef __cplusplus
2311 }  // extern "C"
2312 }  // namespace libyuv
2313 #endif
2314 
2315 #endif  // INCLUDE_LIBYUV_CONVERT_ARGB_H_
2316