FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pixdesc.c
Go to the documentation of this file.
1 /*
2  * pixel format descriptor
3  * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include <stdio.h>
23 #include <string.h>
24 
25 #include "avassert.h"
26 #include "avstring.h"
27 #include "common.h"
28 #include "pixfmt.h"
29 #include "pixdesc.h"
30 #include "internal.h"
31 #include "intreadwrite.h"
32 #include "version.h"
33 
34 void av_read_image_line(uint16_t *dst,
35  const uint8_t *data[4], const int linesize[4],
36  const AVPixFmtDescriptor *desc,
37  int x, int y, int c, int w,
38  int read_pal_component)
39 {
41  int plane = comp.plane;
42  int depth = comp.depth;
43  int mask = (1 << depth) - 1;
44  int shift = comp.shift;
45  int step = comp.step;
46  int flags = desc->flags;
47 
48  if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
49  int skip = x * step + comp.offset;
50  const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
51  int shift = 8 - depth - (skip & 7);
52 
53  while (w--) {
54  int val = (*p >> shift) & mask;
55  if (read_pal_component)
56  val = data[1][4*val + c];
57  shift -= step;
58  p -= shift >> 3;
59  shift &= 7;
60  *dst++ = val;
61  }
62  } else {
63  const uint8_t *p = data[plane] + y * linesize[plane] +
64  x * step + comp.offset;
65  int is_8bit = shift + depth <= 8;
66 
67  if (is_8bit)
68  p += !!(flags & AV_PIX_FMT_FLAG_BE);
69 
70  while (w--) {
71  int val = is_8bit ? *p :
72  flags & AV_PIX_FMT_FLAG_BE ? AV_RB16(p) : AV_RL16(p);
73  val = (val >> shift) & mask;
74  if (read_pal_component)
75  val = data[1][4 * val + c];
76  p += step;
77  *dst++ = val;
78  }
79  }
80 }
81 
82 void av_write_image_line(const uint16_t *src,
83  uint8_t *data[4], const int linesize[4],
84  const AVPixFmtDescriptor *desc,
85  int x, int y, int c, int w)
86 {
88  int plane = comp.plane;
89  int depth = comp.depth;
90  int step = comp.step;
91  int flags = desc->flags;
92 
93  if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
94  int skip = x * step + comp.offset;
95  uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
96  int shift = 8 - depth - (skip & 7);
97 
98  while (w--) {
99  *p |= *src++ << shift;
100  shift -= step;
101  p -= shift >> 3;
102  shift &= 7;
103  }
104  } else {
105  int shift = comp.shift;
106  uint8_t *p = data[plane] + y * linesize[plane] +
107  x * step + comp.offset;
108 
109  if (shift + depth <= 8) {
110  p += !!(flags & AV_PIX_FMT_FLAG_BE);
111  while (w--) {
112  *p |= (*src++ << shift);
113  p += step;
114  }
115  } else {
116  while (w--) {
117  if (flags & AV_PIX_FMT_FLAG_BE) {
118  uint16_t val = AV_RB16(p) | (*src++ << shift);
119  AV_WB16(p, val);
120  } else {
121  uint16_t val = AV_RL16(p) | (*src++ << shift);
122  AV_WL16(p, val);
123  }
124  p += step;
125  }
126  }
127  }
128 }
129 
130 #if FF_API_PLUS1_MINUS1
132 #endif
134  [AV_PIX_FMT_YUV420P] = {
135  .name = "yuv420p",
136  .nb_components = 3,
137  .log2_chroma_w = 1,
138  .log2_chroma_h = 1,
139  .comp = {
140  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
141  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
142  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
143  },
144  .flags = AV_PIX_FMT_FLAG_PLANAR,
145  },
146  [AV_PIX_FMT_YUYV422] = {
147  .name = "yuyv422",
148  .nb_components = 3,
149  .log2_chroma_w = 1,
150  .log2_chroma_h = 0,
151  .comp = {
152  { 0, 2, 0, 0, 8, 1, 7, 1 }, /* Y */
153  { 0, 4, 1, 0, 8, 3, 7, 2 }, /* U */
154  { 0, 4, 3, 0, 8, 3, 7, 4 }, /* V */
155  },
156  },
157  [AV_PIX_FMT_YVYU422] = {
158  .name = "yvyu422",
159  .nb_components = 3,
160  .log2_chroma_w = 1,
161  .log2_chroma_h = 0,
162  .comp = {
163  { 0, 2, 0, 0, 8, 1, 7, 1 }, /* Y */
164  { 0, 4, 3, 0, 8, 3, 7, 4 }, /* U */
165  { 0, 4, 1, 0, 8, 3, 7, 2 }, /* V */
166  },
167  },
168  [AV_PIX_FMT_RGB24] = {
169  .name = "rgb24",
170  .nb_components = 3,
171  .log2_chroma_w = 0,
172  .log2_chroma_h = 0,
173  .comp = {
174  { 0, 3, 0, 0, 8, 2, 7, 1 }, /* R */
175  { 0, 3, 1, 0, 8, 2, 7, 2 }, /* G */
176  { 0, 3, 2, 0, 8, 2, 7, 3 }, /* B */
177  },
178  .flags = AV_PIX_FMT_FLAG_RGB,
179  },
180  [AV_PIX_FMT_BGR24] = {
181  .name = "bgr24",
182  .nb_components = 3,
183  .log2_chroma_w = 0,
184  .log2_chroma_h = 0,
185  .comp = {
186  { 0, 3, 2, 0, 8, 2, 7, 3 }, /* R */
187  { 0, 3, 1, 0, 8, 2, 7, 2 }, /* G */
188  { 0, 3, 0, 0, 8, 2, 7, 1 }, /* B */
189  },
190  .flags = AV_PIX_FMT_FLAG_RGB,
191  },
192  [AV_PIX_FMT_YUV422P] = {
193  .name = "yuv422p",
194  .nb_components = 3,
195  .log2_chroma_w = 1,
196  .log2_chroma_h = 0,
197  .comp = {
198  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
199  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
200  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
201  },
202  .flags = AV_PIX_FMT_FLAG_PLANAR,
203  },
204  [AV_PIX_FMT_YUV444P] = {
205  .name = "yuv444p",
206  .nb_components = 3,
207  .log2_chroma_w = 0,
208  .log2_chroma_h = 0,
209  .comp = {
210  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
211  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
212  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
213  },
214  .flags = AV_PIX_FMT_FLAG_PLANAR,
215  },
216  [AV_PIX_FMT_YUV410P] = {
217  .name = "yuv410p",
218  .nb_components = 3,
219  .log2_chroma_w = 2,
220  .log2_chroma_h = 2,
221  .comp = {
222  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
223  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
224  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
225  },
226  .flags = AV_PIX_FMT_FLAG_PLANAR,
227  },
228  [AV_PIX_FMT_YUV411P] = {
229  .name = "yuv411p",
230  .nb_components = 3,
231  .log2_chroma_w = 2,
232  .log2_chroma_h = 0,
233  .comp = {
234  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
235  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
236  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
237  },
238  .flags = AV_PIX_FMT_FLAG_PLANAR,
239  },
240  [AV_PIX_FMT_YUVJ411P] = {
241  .name = "yuvj411p",
242  .nb_components = 3,
243  .log2_chroma_w = 2,
244  .log2_chroma_h = 0,
245  .comp = {
246  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
247  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
248  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
249  },
250  .flags = AV_PIX_FMT_FLAG_PLANAR,
251  },
252  [AV_PIX_FMT_GRAY8] = {
253  .name = "gray",
254  .nb_components = 1,
255  .log2_chroma_w = 0,
256  .log2_chroma_h = 0,
257  .comp = {
258  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
259  },
260  .flags = FF_PSEUDOPAL,
261  .alias = "gray8,y8",
262  },
264  .name = "monow",
265  .nb_components = 1,
266  .log2_chroma_w = 0,
267  .log2_chroma_h = 0,
268  .comp = {
269  { 0, 1, 0, 0, 1, 0, 0, 1 }, /* Y */
270  },
271  .flags = AV_PIX_FMT_FLAG_BITSTREAM,
272  },
274  .name = "monob",
275  .nb_components = 1,
276  .log2_chroma_w = 0,
277  .log2_chroma_h = 0,
278  .comp = {
279  { 0, 1, 0, 7, 1, 0, 0, 1 }, /* Y */
280  },
281  .flags = AV_PIX_FMT_FLAG_BITSTREAM,
282  },
283  [AV_PIX_FMT_PAL8] = {
284  .name = "pal8",
285  .nb_components = 1,
286  .log2_chroma_w = 0,
287  .log2_chroma_h = 0,
288  .comp = {
289  { 0, 1, 0, 0, 8, 0, 7, 1 },
290  },
292  },
293  [AV_PIX_FMT_YUVJ420P] = {
294  .name = "yuvj420p",
295  .nb_components = 3,
296  .log2_chroma_w = 1,
297  .log2_chroma_h = 1,
298  .comp = {
299  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
300  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
301  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
302  },
303  .flags = AV_PIX_FMT_FLAG_PLANAR,
304  },
305  [AV_PIX_FMT_YUVJ422P] = {
306  .name = "yuvj422p",
307  .nb_components = 3,
308  .log2_chroma_w = 1,
309  .log2_chroma_h = 0,
310  .comp = {
311  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
312  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
313  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
314  },
315  .flags = AV_PIX_FMT_FLAG_PLANAR,
316  },
317  [AV_PIX_FMT_YUVJ444P] = {
318  .name = "yuvj444p",
319  .nb_components = 3,
320  .log2_chroma_w = 0,
321  .log2_chroma_h = 0,
322  .comp = {
323  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
324  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
325  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
326  },
327  .flags = AV_PIX_FMT_FLAG_PLANAR,
328  },
329  [AV_PIX_FMT_XVMC] = {
330  .name = "xvmc",
331  .flags = AV_PIX_FMT_FLAG_HWACCEL,
332  },
333  [AV_PIX_FMT_UYVY422] = {
334  .name = "uyvy422",
335  .nb_components = 3,
336  .log2_chroma_w = 1,
337  .log2_chroma_h = 0,
338  .comp = {
339  { 0, 2, 1, 0, 8, 1, 7, 2 }, /* Y */
340  { 0, 4, 0, 0, 8, 3, 7, 1 }, /* U */
341  { 0, 4, 2, 0, 8, 3, 7, 3 }, /* V */
342  },
343  },
345  .name = "uyyvyy411",
346  .nb_components = 3,
347  .log2_chroma_w = 2,
348  .log2_chroma_h = 0,
349  .comp = {
350  { 0, 4, 1, 0, 8, 3, 7, 2 }, /* Y */
351  { 0, 6, 0, 0, 8, 5, 7, 1 }, /* U */
352  { 0, 6, 3, 0, 8, 5, 7, 4 }, /* V */
353  },
354  },
355  [AV_PIX_FMT_BGR8] = {
356  .name = "bgr8",
357  .nb_components = 3,
358  .log2_chroma_w = 0,
359  .log2_chroma_h = 0,
360  .comp = {
361  { 0, 1, 0, 0, 3, 0, 2, 1 }, /* R */
362  { 0, 1, 0, 3, 3, 0, 2, 1 }, /* G */
363  { 0, 1, 0, 6, 2, 0, 1, 1 }, /* B */
364  },
366  },
367  [AV_PIX_FMT_BGR4] = {
368  .name = "bgr4",
369  .nb_components = 3,
370  .log2_chroma_w = 0,
371  .log2_chroma_h = 0,
372  .comp = {
373  { 0, 4, 3, 0, 1, 3, 0, 4 }, /* R */
374  { 0, 4, 1, 0, 2, 3, 1, 2 }, /* G */
375  { 0, 4, 0, 0, 1, 3, 0, 1 }, /* B */
376  },
378  },
380  .name = "bgr4_byte",
381  .nb_components = 3,
382  .log2_chroma_w = 0,
383  .log2_chroma_h = 0,
384  .comp = {
385  { 0, 1, 0, 0, 1, 0, 0, 1 }, /* R */
386  { 0, 1, 0, 1, 2, 0, 1, 1 }, /* G */
387  { 0, 1, 0, 3, 1, 0, 0, 1 }, /* B */
388  },
390  },
391  [AV_PIX_FMT_RGB8] = {
392  .name = "rgb8",
393  .nb_components = 3,
394  .log2_chroma_w = 0,
395  .log2_chroma_h = 0,
396  .comp = {
397  { 0, 1, 0, 6, 2, 0, 1, 1 }, /* R */
398  { 0, 1, 0, 3, 3, 0, 2, 1 }, /* G */
399  { 0, 1, 0, 0, 3, 0, 2, 1 }, /* B */
400  },
402  },
403  [AV_PIX_FMT_RGB4] = {
404  .name = "rgb4",
405  .nb_components = 3,
406  .log2_chroma_w = 0,
407  .log2_chroma_h = 0,
408  .comp = {
409  { 0, 4, 0, 0, 1, 3, 0, 1 }, /* R */
410  { 0, 4, 1, 0, 2, 3, 1, 2 }, /* G */
411  { 0, 4, 3, 0, 1, 3, 0, 4 }, /* B */
412  },
414  },
416  .name = "rgb4_byte",
417  .nb_components = 3,
418  .log2_chroma_w = 0,
419  .log2_chroma_h = 0,
420  .comp = {
421  { 0, 1, 0, 3, 1, 0, 0, 1 }, /* R */
422  { 0, 1, 0, 1, 2, 0, 1, 1 }, /* G */
423  { 0, 1, 0, 0, 1, 0, 0, 1 }, /* B */
424  },
426  },
427  [AV_PIX_FMT_NV12] = {
428  .name = "nv12",
429  .nb_components = 3,
430  .log2_chroma_w = 1,
431  .log2_chroma_h = 1,
432  .comp = {
433  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
434  { 1, 2, 0, 0, 8, 1, 7, 1 }, /* U */
435  { 1, 2, 1, 0, 8, 1, 7, 2 }, /* V */
436  },
437  .flags = AV_PIX_FMT_FLAG_PLANAR,
438  },
439  [AV_PIX_FMT_NV21] = {
440  .name = "nv21",
441  .nb_components = 3,
442  .log2_chroma_w = 1,
443  .log2_chroma_h = 1,
444  .comp = {
445  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
446  { 1, 2, 1, 0, 8, 1, 7, 2 }, /* U */
447  { 1, 2, 0, 0, 8, 1, 7, 1 }, /* V */
448  },
449  .flags = AV_PIX_FMT_FLAG_PLANAR,
450  },
451  [AV_PIX_FMT_ARGB] = {
452  .name = "argb",
453  .nb_components = 4,
454  .log2_chroma_w = 0,
455  .log2_chroma_h = 0,
456  .comp = {
457  { 0, 4, 1, 0, 8, 3, 7, 2 }, /* R */
458  { 0, 4, 2, 0, 8, 3, 7, 3 }, /* G */
459  { 0, 4, 3, 0, 8, 3, 7, 4 }, /* B */
460  { 0, 4, 0, 0, 8, 3, 7, 1 }, /* A */
461  },
463  },
464  [AV_PIX_FMT_RGBA] = {
465  .name = "rgba",
466  .nb_components = 4,
467  .log2_chroma_w = 0,
468  .log2_chroma_h = 0,
469  .comp = {
470  { 0, 4, 0, 0, 8, 3, 7, 1 }, /* R */
471  { 0, 4, 1, 0, 8, 3, 7, 2 }, /* G */
472  { 0, 4, 2, 0, 8, 3, 7, 3 }, /* B */
473  { 0, 4, 3, 0, 8, 3, 7, 4 }, /* A */
474  },
476  },
477  [AV_PIX_FMT_ABGR] = {
478  .name = "abgr",
479  .nb_components = 4,
480  .log2_chroma_w = 0,
481  .log2_chroma_h = 0,
482  .comp = {
483  { 0, 4, 3, 0, 8, 3, 7, 4 }, /* R */
484  { 0, 4, 2, 0, 8, 3, 7, 3 }, /* G */
485  { 0, 4, 1, 0, 8, 3, 7, 2 }, /* B */
486  { 0, 4, 0, 0, 8, 3, 7, 1 }, /* A */
487  },
489  },
490  [AV_PIX_FMT_BGRA] = {
491  .name = "bgra",
492  .nb_components = 4,
493  .log2_chroma_w = 0,
494  .log2_chroma_h = 0,
495  .comp = {
496  { 0, 4, 2, 0, 8, 3, 7, 3 }, /* R */
497  { 0, 4, 1, 0, 8, 3, 7, 2 }, /* G */
498  { 0, 4, 0, 0, 8, 3, 7, 1 }, /* B */
499  { 0, 4, 3, 0, 8, 3, 7, 4 }, /* A */
500  },
502  },
503  [AV_PIX_FMT_0RGB] = {
504  .name = "0rgb",
505  .nb_components= 3,
506  .log2_chroma_w= 0,
507  .log2_chroma_h= 0,
508  .comp = {
509  { 0, 4, 1, 0, 8, 3, 7, 2 }, /* R */
510  { 0, 4, 2, 0, 8, 3, 7, 3 }, /* G */
511  { 0, 4, 3, 0, 8, 3, 7, 4 }, /* B */
512  },
513  .flags = AV_PIX_FMT_FLAG_RGB,
514  },
515  [AV_PIX_FMT_RGB0] = {
516  .name = "rgb0",
517  .nb_components= 3,
518  .log2_chroma_w= 0,
519  .log2_chroma_h= 0,
520  .comp = {
521  { 0, 4, 0, 0, 8, 3, 7, 1 }, /* R */
522  { 0, 4, 1, 0, 8, 3, 7, 2 }, /* G */
523  { 0, 4, 2, 0, 8, 3, 7, 3 }, /* B */
524  },
525  .flags = AV_PIX_FMT_FLAG_RGB,
526  },
527  [AV_PIX_FMT_0BGR] = {
528  .name = "0bgr",
529  .nb_components= 3,
530  .log2_chroma_w= 0,
531  .log2_chroma_h= 0,
532  .comp = {
533  { 0, 4, 3, 0, 8, 3, 7, 4 }, /* R */
534  { 0, 4, 2, 0, 8, 3, 7, 3 }, /* G */
535  { 0, 4, 1, 0, 8, 3, 7, 2 }, /* B */
536  },
537  .flags = AV_PIX_FMT_FLAG_RGB,
538  },
539  [AV_PIX_FMT_BGR0] = {
540  .name = "bgr0",
541  .nb_components= 3,
542  .log2_chroma_w= 0,
543  .log2_chroma_h= 0,
544  .comp = {
545  { 0, 4, 2, 0, 8, 3, 7, 3 }, /* R */
546  { 0, 4, 1, 0, 8, 3, 7, 2 }, /* G */
547  { 0, 4, 0, 0, 8, 3, 7, 1 }, /* B */
548  },
549  .flags = AV_PIX_FMT_FLAG_RGB,
550  },
551  [AV_PIX_FMT_GRAY9BE] = {
552  .name = "gray9be",
553  .nb_components = 1,
554  .log2_chroma_w = 0,
555  .log2_chroma_h = 0,
556  .comp = {
557  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
558  },
559  .flags = AV_PIX_FMT_FLAG_BE,
560  .alias = "y9be",
561  },
562  [AV_PIX_FMT_GRAY9LE] = {
563  .name = "gray9le",
564  .nb_components = 1,
565  .log2_chroma_w = 0,
566  .log2_chroma_h = 0,
567  .comp = {
568  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
569  },
570  .alias = "y9le",
571  },
572  [AV_PIX_FMT_GRAY10BE] = {
573  .name = "gray10be",
574  .nb_components = 1,
575  .log2_chroma_w = 0,
576  .log2_chroma_h = 0,
577  .comp = {
578  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
579  },
580  .flags = AV_PIX_FMT_FLAG_BE,
581  .alias = "y10be",
582  },
583  [AV_PIX_FMT_GRAY10LE] = {
584  .name = "gray10le",
585  .nb_components = 1,
586  .log2_chroma_w = 0,
587  .log2_chroma_h = 0,
588  .comp = {
589  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
590  },
591  .alias = "y10le",
592  },
593  [AV_PIX_FMT_GRAY12BE] = {
594  .name = "gray12be",
595  .nb_components = 1,
596  .log2_chroma_w = 0,
597  .log2_chroma_h = 0,
598  .comp = {
599  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
600  },
601  .flags = AV_PIX_FMT_FLAG_BE,
602  .alias = "y12be",
603  },
604  [AV_PIX_FMT_GRAY12LE] = {
605  .name = "gray12le",
606  .nb_components = 1,
607  .log2_chroma_w = 0,
608  .log2_chroma_h = 0,
609  .comp = {
610  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
611  },
612  .alias = "y12le",
613  },
614  [AV_PIX_FMT_GRAY14BE] = {
615  .name = "gray14be",
616  .nb_components = 1,
617  .log2_chroma_w = 0,
618  .log2_chroma_h = 0,
619  .comp = {
620  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
621  },
622  .flags = AV_PIX_FMT_FLAG_BE,
623  .alias = "y14be",
624  },
625  [AV_PIX_FMT_GRAY14LE] = {
626  .name = "gray14le",
627  .nb_components = 1,
628  .log2_chroma_w = 0,
629  .log2_chroma_h = 0,
630  .comp = {
631  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
632  },
633  .alias = "y14le",
634  },
635  [AV_PIX_FMT_GRAY16BE] = {
636  .name = "gray16be",
637  .nb_components = 1,
638  .log2_chroma_w = 0,
639  .log2_chroma_h = 0,
640  .comp = {
641  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
642  },
643  .flags = AV_PIX_FMT_FLAG_BE,
644  .alias = "y16be",
645  },
646  [AV_PIX_FMT_GRAY16LE] = {
647  .name = "gray16le",
648  .nb_components = 1,
649  .log2_chroma_w = 0,
650  .log2_chroma_h = 0,
651  .comp = {
652  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
653  },
654  .alias = "y16le",
655  },
656  [AV_PIX_FMT_YUV440P] = {
657  .name = "yuv440p",
658  .nb_components = 3,
659  .log2_chroma_w = 0,
660  .log2_chroma_h = 1,
661  .comp = {
662  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
663  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
664  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
665  },
666  .flags = AV_PIX_FMT_FLAG_PLANAR,
667  },
668  [AV_PIX_FMT_YUVJ440P] = {
669  .name = "yuvj440p",
670  .nb_components = 3,
671  .log2_chroma_w = 0,
672  .log2_chroma_h = 1,
673  .comp = {
674  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
675  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
676  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
677  },
678  .flags = AV_PIX_FMT_FLAG_PLANAR,
679  },
681  .name = "yuv440p10le",
682  .nb_components = 3,
683  .log2_chroma_w = 0,
684  .log2_chroma_h = 1,
685  .comp = {
686  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
687  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
688  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
689  },
690  .flags = AV_PIX_FMT_FLAG_PLANAR,
691  },
693  .name = "yuv440p10be",
694  .nb_components = 3,
695  .log2_chroma_w = 0,
696  .log2_chroma_h = 1,
697  .comp = {
698  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
699  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
700  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
701  },
703  },
705  .name = "yuv440p12le",
706  .nb_components = 3,
707  .log2_chroma_w = 0,
708  .log2_chroma_h = 1,
709  .comp = {
710  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
711  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
712  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
713  },
714  .flags = AV_PIX_FMT_FLAG_PLANAR,
715  },
717  .name = "yuv440p12be",
718  .nb_components = 3,
719  .log2_chroma_w = 0,
720  .log2_chroma_h = 1,
721  .comp = {
722  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
723  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
724  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
725  },
727  },
728  [AV_PIX_FMT_YUVA420P] = {
729  .name = "yuva420p",
730  .nb_components = 4,
731  .log2_chroma_w = 1,
732  .log2_chroma_h = 1,
733  .comp = {
734  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
735  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
736  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
737  { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
738  },
740  },
741  [AV_PIX_FMT_YUVA422P] = {
742  .name = "yuva422p",
743  .nb_components = 4,
744  .log2_chroma_w = 1,
745  .log2_chroma_h = 0,
746  .comp = {
747  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
748  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
749  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
750  { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
751  },
753  },
754  [AV_PIX_FMT_YUVA444P] = {
755  .name = "yuva444p",
756  .nb_components = 4,
757  .log2_chroma_w = 0,
758  .log2_chroma_h = 0,
759  .comp = {
760  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
761  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
762  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
763  { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
764  },
766  },
768  .name = "yuva420p9be",
769  .nb_components = 4,
770  .log2_chroma_w = 1,
771  .log2_chroma_h = 1,
772  .comp = {
773  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
774  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
775  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
776  { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
777  },
779  },
781  .name = "yuva420p9le",
782  .nb_components = 4,
783  .log2_chroma_w = 1,
784  .log2_chroma_h = 1,
785  .comp = {
786  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
787  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
788  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
789  { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
790  },
792  },
794  .name = "yuva422p9be",
795  .nb_components = 4,
796  .log2_chroma_w = 1,
797  .log2_chroma_h = 0,
798  .comp = {
799  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
800  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
801  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
802  { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
803  },
805  },
807  .name = "yuva422p9le",
808  .nb_components = 4,
809  .log2_chroma_w = 1,
810  .log2_chroma_h = 0,
811  .comp = {
812  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
813  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
814  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
815  { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
816  },
818  },
820  .name = "yuva444p9be",
821  .nb_components = 4,
822  .log2_chroma_w = 0,
823  .log2_chroma_h = 0,
824  .comp = {
825  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
826  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
827  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
828  { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
829  },
831  },
833  .name = "yuva444p9le",
834  .nb_components = 4,
835  .log2_chroma_w = 0,
836  .log2_chroma_h = 0,
837  .comp = {
838  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
839  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
840  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
841  { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
842  },
844  },
846  .name = "yuva420p10be",
847  .nb_components = 4,
848  .log2_chroma_w = 1,
849  .log2_chroma_h = 1,
850  .comp = {
851  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
852  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
853  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
854  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
855  },
857  },
859  .name = "yuva420p10le",
860  .nb_components = 4,
861  .log2_chroma_w = 1,
862  .log2_chroma_h = 1,
863  .comp = {
864  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
865  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
866  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
867  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
868  },
870  },
872  .name = "yuva422p10be",
873  .nb_components = 4,
874  .log2_chroma_w = 1,
875  .log2_chroma_h = 0,
876  .comp = {
877  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
878  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
879  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
880  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
881  },
883  },
885  .name = "yuva422p10le",
886  .nb_components = 4,
887  .log2_chroma_w = 1,
888  .log2_chroma_h = 0,
889  .comp = {
890  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
891  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
892  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
893  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
894  },
896  },
898  .name = "yuva444p10be",
899  .nb_components = 4,
900  .log2_chroma_w = 0,
901  .log2_chroma_h = 0,
902  .comp = {
903  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
904  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
905  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
906  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
907  },
909  },
911  .name = "yuva444p10le",
912  .nb_components = 4,
913  .log2_chroma_w = 0,
914  .log2_chroma_h = 0,
915  .comp = {
916  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
917  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
918  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
919  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
920  },
922  },
924  .name = "yuva420p16be",
925  .nb_components = 4,
926  .log2_chroma_w = 1,
927  .log2_chroma_h = 1,
928  .comp = {
929  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
930  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
931  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
932  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
933  },
935  },
937  .name = "yuva420p16le",
938  .nb_components = 4,
939  .log2_chroma_w = 1,
940  .log2_chroma_h = 1,
941  .comp = {
942  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
943  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
944  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
945  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
946  },
948  },
950  .name = "yuva422p16be",
951  .nb_components = 4,
952  .log2_chroma_w = 1,
953  .log2_chroma_h = 0,
954  .comp = {
955  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
956  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
957  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
958  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
959  },
961  },
963  .name = "yuva422p16le",
964  .nb_components = 4,
965  .log2_chroma_w = 1,
966  .log2_chroma_h = 0,
967  .comp = {
968  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
969  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
970  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
971  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
972  },
974  },
976  .name = "yuva444p16be",
977  .nb_components = 4,
978  .log2_chroma_w = 0,
979  .log2_chroma_h = 0,
980  .comp = {
981  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
982  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
983  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
984  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
985  },
987  },
989  .name = "yuva444p16le",
990  .nb_components = 4,
991  .log2_chroma_w = 0,
992  .log2_chroma_h = 0,
993  .comp = {
994  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
995  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
996  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
997  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
998  },
1000  },
1001  [AV_PIX_FMT_RGB48BE] = {
1002  .name = "rgb48be",
1003  .nb_components = 3,
1004  .log2_chroma_w = 0,
1005  .log2_chroma_h = 0,
1006  .comp = {
1007  { 0, 6, 0, 0, 16, 5, 15, 1 }, /* R */
1008  { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
1009  { 0, 6, 4, 0, 16, 5, 15, 5 }, /* B */
1010  },
1012  },
1013  [AV_PIX_FMT_RGB48LE] = {
1014  .name = "rgb48le",
1015  .nb_components = 3,
1016  .log2_chroma_w = 0,
1017  .log2_chroma_h = 0,
1018  .comp = {
1019  { 0, 6, 0, 0, 16, 5, 15, 1 }, /* R */
1020  { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
1021  { 0, 6, 4, 0, 16, 5, 15, 5 }, /* B */
1022  },
1023  .flags = AV_PIX_FMT_FLAG_RGB,
1024  },
1025  [AV_PIX_FMT_RGBA64BE] = {
1026  .name = "rgba64be",
1027  .nb_components = 4,
1028  .log2_chroma_w = 0,
1029  .log2_chroma_h = 0,
1030  .comp = {
1031  { 0, 8, 0, 0, 16, 7, 15, 1 }, /* R */
1032  { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
1033  { 0, 8, 4, 0, 16, 7, 15, 5 }, /* B */
1034  { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1035  },
1037  },
1038  [AV_PIX_FMT_RGBA64LE] = {
1039  .name = "rgba64le",
1040  .nb_components = 4,
1041  .log2_chroma_w = 0,
1042  .log2_chroma_h = 0,
1043  .comp = {
1044  { 0, 8, 0, 0, 16, 7, 15, 1 }, /* R */
1045  { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
1046  { 0, 8, 4, 0, 16, 7, 15, 5 }, /* B */
1047  { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1048  },
1050  },
1051  [AV_PIX_FMT_RGB565BE] = {
1052  .name = "rgb565be",
1053  .nb_components = 3,
1054  .log2_chroma_w = 0,
1055  .log2_chroma_h = 0,
1056  .comp = {
1057  { 0, 2, -1, 3, 5, 1, 4, 0 }, /* R */
1058  { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
1059  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
1060  },
1062  },
1063  [AV_PIX_FMT_RGB565LE] = {
1064  .name = "rgb565le",
1065  .nb_components = 3,
1066  .log2_chroma_w = 0,
1067  .log2_chroma_h = 0,
1068  .comp = {
1069  { 0, 2, 1, 3, 5, 1, 4, 2 }, /* R */
1070  { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
1071  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
1072  },
1073  .flags = AV_PIX_FMT_FLAG_RGB,
1074  },
1075  [AV_PIX_FMT_RGB555BE] = {
1076  .name = "rgb555be",
1077  .nb_components = 3,
1078  .log2_chroma_w = 0,
1079  .log2_chroma_h = 0,
1080  .comp = {
1081  { 0, 2, -1, 2, 5, 1, 4, 0 }, /* R */
1082  { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
1083  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
1084  },
1086  },
1087  [AV_PIX_FMT_RGB555LE] = {
1088  .name = "rgb555le",
1089  .nb_components = 3,
1090  .log2_chroma_w = 0,
1091  .log2_chroma_h = 0,
1092  .comp = {
1093  { 0, 2, 1, 2, 5, 1, 4, 2 }, /* R */
1094  { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
1095  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
1096  },
1097  .flags = AV_PIX_FMT_FLAG_RGB,
1098  },
1099  [AV_PIX_FMT_RGB444BE] = {
1100  .name = "rgb444be",
1101  .nb_components = 3,
1102  .log2_chroma_w = 0,
1103  .log2_chroma_h = 0,
1104  .comp = {
1105  { 0, 2, -1, 0, 4, 1, 3, 0 }, /* R */
1106  { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
1107  { 0, 2, 0, 0, 4, 1, 3, 1 }, /* B */
1108  },
1110  },
1111  [AV_PIX_FMT_RGB444LE] = {
1112  .name = "rgb444le",
1113  .nb_components = 3,
1114  .log2_chroma_w = 0,
1115  .log2_chroma_h = 0,
1116  .comp = {
1117  { 0, 2, 1, 0, 4, 1, 3, 2 }, /* R */
1118  { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
1119  { 0, 2, 0, 0, 4, 1, 3, 1 }, /* B */
1120  },
1121  .flags = AV_PIX_FMT_FLAG_RGB,
1122  },
1123  [AV_PIX_FMT_BGR48BE] = {
1124  .name = "bgr48be",
1125  .nb_components = 3,
1126  .log2_chroma_w = 0,
1127  .log2_chroma_h = 0,
1128  .comp = {
1129  { 0, 6, 4, 0, 16, 5, 15, 5 }, /* R */
1130  { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
1131  { 0, 6, 0, 0, 16, 5, 15, 1 }, /* B */
1132  },
1134  },
1135  [AV_PIX_FMT_BGR48LE] = {
1136  .name = "bgr48le",
1137  .nb_components = 3,
1138  .log2_chroma_w = 0,
1139  .log2_chroma_h = 0,
1140  .comp = {
1141  { 0, 6, 4, 0, 16, 5, 15, 5 }, /* R */
1142  { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
1143  { 0, 6, 0, 0, 16, 5, 15, 1 }, /* B */
1144  },
1145  .flags = AV_PIX_FMT_FLAG_RGB,
1146  },
1147  [AV_PIX_FMT_BGRA64BE] = {
1148  .name = "bgra64be",
1149  .nb_components = 4,
1150  .log2_chroma_w = 0,
1151  .log2_chroma_h = 0,
1152  .comp = {
1153  { 0, 8, 4, 0, 16, 7, 15, 5 }, /* R */
1154  { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
1155  { 0, 8, 0, 0, 16, 7, 15, 1 }, /* B */
1156  { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1157  },
1159  },
1160  [AV_PIX_FMT_BGRA64LE] = {
1161  .name = "bgra64le",
1162  .nb_components = 4,
1163  .log2_chroma_w = 0,
1164  .log2_chroma_h = 0,
1165  .comp = {
1166  { 0, 8, 4, 0, 16, 7, 15, 5 }, /* R */
1167  { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
1168  { 0, 8, 0, 0, 16, 7, 15, 1 }, /* B */
1169  { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1170  },
1172  },
1173  [AV_PIX_FMT_BGR565BE] = {
1174  .name = "bgr565be",
1175  .nb_components = 3,
1176  .log2_chroma_w = 0,
1177  .log2_chroma_h = 0,
1178  .comp = {
1179  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
1180  { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
1181  { 0, 2, -1, 3, 5, 1, 4, 0 }, /* B */
1182  },
1184  },
1185  [AV_PIX_FMT_BGR565LE] = {
1186  .name = "bgr565le",
1187  .nb_components = 3,
1188  .log2_chroma_w = 0,
1189  .log2_chroma_h = 0,
1190  .comp = {
1191  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
1192  { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
1193  { 0, 2, 1, 3, 5, 1, 4, 2 }, /* B */
1194  },
1195  .flags = AV_PIX_FMT_FLAG_RGB,
1196  },
1197  [AV_PIX_FMT_BGR555BE] = {
1198  .name = "bgr555be",
1199  .nb_components = 3,
1200  .log2_chroma_w = 0,
1201  .log2_chroma_h = 0,
1202  .comp = {
1203  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
1204  { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
1205  { 0, 2, -1, 2, 5, 1, 4, 0 }, /* B */
1206  },
1208  },
1209  [AV_PIX_FMT_BGR555LE] = {
1210  .name = "bgr555le",
1211  .nb_components = 3,
1212  .log2_chroma_w = 0,
1213  .log2_chroma_h = 0,
1214  .comp = {
1215  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
1216  { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
1217  { 0, 2, 1, 2, 5, 1, 4, 2 }, /* B */
1218  },
1219  .flags = AV_PIX_FMT_FLAG_RGB,
1220  },
1221  [AV_PIX_FMT_BGR444BE] = {
1222  .name = "bgr444be",
1223  .nb_components = 3,
1224  .log2_chroma_w = 0,
1225  .log2_chroma_h = 0,
1226  .comp = {
1227  { 0, 2, 0, 0, 4, 1, 3, 1 }, /* R */
1228  { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
1229  { 0, 2, -1, 0, 4, 1, 3, 0 }, /* B */
1230  },
1232  },
1233  [AV_PIX_FMT_BGR444LE] = {
1234  .name = "bgr444le",
1235  .nb_components = 3,
1236  .log2_chroma_w = 0,
1237  .log2_chroma_h = 0,
1238  .comp = {
1239  { 0, 2, 0, 0, 4, 1, 3, 1 }, /* R */
1240  { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
1241  { 0, 2, 1, 0, 4, 1, 3, 2 }, /* B */
1242  },
1243  .flags = AV_PIX_FMT_FLAG_RGB,
1244  },
1245 #if FF_API_VAAPI
1246  [AV_PIX_FMT_VAAPI_MOCO] = {
1247  .name = "vaapi_moco",
1248  .log2_chroma_w = 1,
1249  .log2_chroma_h = 1,
1250  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1251  },
1252  [AV_PIX_FMT_VAAPI_IDCT] = {
1253  .name = "vaapi_idct",
1254  .log2_chroma_w = 1,
1255  .log2_chroma_h = 1,
1256  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1257  },
1258  [AV_PIX_FMT_VAAPI_VLD] = {
1259  .name = "vaapi_vld",
1260  .log2_chroma_w = 1,
1261  .log2_chroma_h = 1,
1262  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1263  },
1264 #else
1265  [AV_PIX_FMT_VAAPI] = {
1266  .name = "vaapi",
1267  .log2_chroma_w = 1,
1268  .log2_chroma_h = 1,
1269  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1270  },
1271 #endif
1272  [AV_PIX_FMT_YUV420P9LE] = {
1273  .name = "yuv420p9le",
1274  .nb_components = 3,
1275  .log2_chroma_w = 1,
1276  .log2_chroma_h = 1,
1277  .comp = {
1278  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1279  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1280  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1281  },
1282  .flags = AV_PIX_FMT_FLAG_PLANAR,
1283  },
1284  [AV_PIX_FMT_YUV420P9BE] = {
1285  .name = "yuv420p9be",
1286  .nb_components = 3,
1287  .log2_chroma_w = 1,
1288  .log2_chroma_h = 1,
1289  .comp = {
1290  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1291  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1292  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1293  },
1295  },
1297  .name = "yuv420p10le",
1298  .nb_components = 3,
1299  .log2_chroma_w = 1,
1300  .log2_chroma_h = 1,
1301  .comp = {
1302  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1303  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1304  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1305  },
1306  .flags = AV_PIX_FMT_FLAG_PLANAR,
1307  },
1309  .name = "yuv420p10be",
1310  .nb_components = 3,
1311  .log2_chroma_w = 1,
1312  .log2_chroma_h = 1,
1313  .comp = {
1314  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1315  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1316  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1317  },
1319  },
1321  .name = "yuv420p12le",
1322  .nb_components = 3,
1323  .log2_chroma_w = 1,
1324  .log2_chroma_h = 1,
1325  .comp = {
1326  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1327  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1328  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1329  },
1330  .flags = AV_PIX_FMT_FLAG_PLANAR,
1331  },
1333  .name = "yuv420p12be",
1334  .nb_components = 3,
1335  .log2_chroma_w = 1,
1336  .log2_chroma_h = 1,
1337  .comp = {
1338  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1339  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1340  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1341  },
1343  },
1345  .name = "yuv420p14le",
1346  .nb_components = 3,
1347  .log2_chroma_w = 1,
1348  .log2_chroma_h = 1,
1349  .comp = {
1350  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
1351  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
1352  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
1353  },
1354  .flags = AV_PIX_FMT_FLAG_PLANAR,
1355  },
1357  .name = "yuv420p14be",
1358  .nb_components = 3,
1359  .log2_chroma_w = 1,
1360  .log2_chroma_h = 1,
1361  .comp = {
1362  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
1363  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
1364  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
1365  },
1367  },
1369  .name = "yuv420p16le",
1370  .nb_components = 3,
1371  .log2_chroma_w = 1,
1372  .log2_chroma_h = 1,
1373  .comp = {
1374  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1375  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1376  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1377  },
1378  .flags = AV_PIX_FMT_FLAG_PLANAR,
1379  },
1381  .name = "yuv420p16be",
1382  .nb_components = 3,
1383  .log2_chroma_w = 1,
1384  .log2_chroma_h = 1,
1385  .comp = {
1386  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1387  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1388  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1389  },
1391  },
1392  [AV_PIX_FMT_YUV422P9LE] = {
1393  .name = "yuv422p9le",
1394  .nb_components = 3,
1395  .log2_chroma_w = 1,
1396  .log2_chroma_h = 0,
1397  .comp = {
1398  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1399  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1400  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1401  },
1402  .flags = AV_PIX_FMT_FLAG_PLANAR,
1403  },
1404  [AV_PIX_FMT_YUV422P9BE] = {
1405  .name = "yuv422p9be",
1406  .nb_components = 3,
1407  .log2_chroma_w = 1,
1408  .log2_chroma_h = 0,
1409  .comp = {
1410  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1411  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1412  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1413  },
1415  },
1417  .name = "yuv422p10le",
1418  .nb_components = 3,
1419  .log2_chroma_w = 1,
1420  .log2_chroma_h = 0,
1421  .comp = {
1422  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1423  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1424  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1425  },
1426  .flags = AV_PIX_FMT_FLAG_PLANAR,
1427  },
1429  .name = "yuv422p10be",
1430  .nb_components = 3,
1431  .log2_chroma_w = 1,
1432  .log2_chroma_h = 0,
1433  .comp = {
1434  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1435  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1436  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1437  },
1439  },
1441  .name = "yuv422p12le",
1442  .nb_components = 3,
1443  .log2_chroma_w = 1,
1444  .log2_chroma_h = 0,
1445  .comp = {
1446  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1447  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1448  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1449  },
1450  .flags = AV_PIX_FMT_FLAG_PLANAR,
1451  },
1453  .name = "yuv422p12be",
1454  .nb_components = 3,
1455  .log2_chroma_w = 1,
1456  .log2_chroma_h = 0,
1457  .comp = {
1458  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1459  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1460  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1461  },
1463  },
1465  .name = "yuv422p14le",
1466  .nb_components = 3,
1467  .log2_chroma_w = 1,
1468  .log2_chroma_h = 0,
1469  .comp = {
1470  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
1471  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
1472  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
1473  },
1474  .flags = AV_PIX_FMT_FLAG_PLANAR,
1475  },
1477  .name = "yuv422p14be",
1478  .nb_components = 3,
1479  .log2_chroma_w = 1,
1480  .log2_chroma_h = 0,
1481  .comp = {
1482  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
1483  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
1484  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
1485  },
1487  },
1489  .name = "yuv422p16le",
1490  .nb_components = 3,
1491  .log2_chroma_w = 1,
1492  .log2_chroma_h = 0,
1493  .comp = {
1494  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1495  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1496  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1497  },
1498  .flags = AV_PIX_FMT_FLAG_PLANAR,
1499  },
1501  .name = "yuv422p16be",
1502  .nb_components = 3,
1503  .log2_chroma_w = 1,
1504  .log2_chroma_h = 0,
1505  .comp = {
1506  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1507  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1508  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1509  },
1511  },
1513  .name = "yuv444p16le",
1514  .nb_components = 3,
1515  .log2_chroma_w = 0,
1516  .log2_chroma_h = 0,
1517  .comp = {
1518  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1519  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1520  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1521  },
1522  .flags = AV_PIX_FMT_FLAG_PLANAR,
1523  },
1525  .name = "yuv444p16be",
1526  .nb_components = 3,
1527  .log2_chroma_w = 0,
1528  .log2_chroma_h = 0,
1529  .comp = {
1530  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1531  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1532  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1533  },
1535  },
1537  .name = "yuv444p10le",
1538  .nb_components = 3,
1539  .log2_chroma_w = 0,
1540  .log2_chroma_h = 0,
1541  .comp = {
1542  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1543  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1544  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1545  },
1546  .flags = AV_PIX_FMT_FLAG_PLANAR,
1547  },
1549  .name = "yuv444p10be",
1550  .nb_components = 3,
1551  .log2_chroma_w = 0,
1552  .log2_chroma_h = 0,
1553  .comp = {
1554  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1555  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1556  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1557  },
1559  },
1560  [AV_PIX_FMT_YUV444P9LE] = {
1561  .name = "yuv444p9le",
1562  .nb_components = 3,
1563  .log2_chroma_w = 0,
1564  .log2_chroma_h = 0,
1565  .comp = {
1566  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1567  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1568  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1569  },
1570  .flags = AV_PIX_FMT_FLAG_PLANAR,
1571  },
1572  [AV_PIX_FMT_YUV444P9BE] = {
1573  .name = "yuv444p9be",
1574  .nb_components = 3,
1575  .log2_chroma_w = 0,
1576  .log2_chroma_h = 0,
1577  .comp = {
1578  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1579  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1580  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1581  },
1583  },
1585  .name = "yuv444p12le",
1586  .nb_components = 3,
1587  .log2_chroma_w = 0,
1588  .log2_chroma_h = 0,
1589  .comp = {
1590  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1591  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1592  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1593  },
1594  .flags = AV_PIX_FMT_FLAG_PLANAR,
1595  },
1597  .name = "yuv444p12be",
1598  .nb_components = 3,
1599  .log2_chroma_w = 0,
1600  .log2_chroma_h = 0,
1601  .comp = {
1602  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1603  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1604  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1605  },
1607  },
1609  .name = "yuv444p14le",
1610  .nb_components = 3,
1611  .log2_chroma_w = 0,
1612  .log2_chroma_h = 0,
1613  .comp = {
1614  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
1615  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
1616  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
1617  },
1618  .flags = AV_PIX_FMT_FLAG_PLANAR,
1619  },
1621  .name = "yuv444p14be",
1622  .nb_components = 3,
1623  .log2_chroma_w = 0,
1624  .log2_chroma_h = 0,
1625  .comp = {
1626  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
1627  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
1628  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
1629  },
1631  },
1633  .name = "d3d11va_vld",
1634  .log2_chroma_w = 1,
1635  .log2_chroma_h = 1,
1636  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1637  },
1638  [AV_PIX_FMT_DXVA2_VLD] = {
1639  .name = "dxva2_vld",
1640  .log2_chroma_w = 1,
1641  .log2_chroma_h = 1,
1642  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1643  },
1644  [AV_PIX_FMT_YA8] = {
1645  .name = "ya8",
1646  .nb_components = 2,
1647  .comp = {
1648  { 0, 2, 0, 0, 8, 1, 7, 1 }, /* Y */
1649  { 0, 2, 1, 0, 8, 1, 7, 2 }, /* A */
1650  },
1651  .flags = AV_PIX_FMT_FLAG_ALPHA,
1652  .alias = "gray8a",
1653  },
1654  [AV_PIX_FMT_YA16LE] = {
1655  .name = "ya16le",
1656  .nb_components = 2,
1657  .comp = {
1658  { 0, 4, 0, 0, 16, 3, 15, 1 }, /* Y */
1659  { 0, 4, 2, 0, 16, 3, 15, 3 }, /* A */
1660  },
1661  .flags = AV_PIX_FMT_FLAG_ALPHA,
1662  },
1663  [AV_PIX_FMT_YA16BE] = {
1664  .name = "ya16be",
1665  .nb_components = 2,
1666  .comp = {
1667  { 0, 4, 0, 0, 16, 3, 15, 1 }, /* Y */
1668  { 0, 4, 2, 0, 16, 3, 15, 3 }, /* A */
1669  },
1671  },
1673  .name = "videotoolbox_vld",
1674  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1675  },
1676  [AV_PIX_FMT_GBRP] = {
1677  .name = "gbrp",
1678  .nb_components = 3,
1679  .log2_chroma_w = 0,
1680  .log2_chroma_h = 0,
1681  .comp = {
1682  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* R */
1683  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* G */
1684  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* B */
1685  },
1687  },
1688  [AV_PIX_FMT_GBRP9LE] = {
1689  .name = "gbrp9le",
1690  .nb_components = 3,
1691  .log2_chroma_w = 0,
1692  .log2_chroma_h = 0,
1693  .comp = {
1694  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* R */
1695  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* G */
1696  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* B */
1697  },
1699  },
1700  [AV_PIX_FMT_GBRP9BE] = {
1701  .name = "gbrp9be",
1702  .nb_components = 3,
1703  .log2_chroma_w = 0,
1704  .log2_chroma_h = 0,
1705  .comp = {
1706  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* R */
1707  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* G */
1708  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* B */
1709  },
1711  },
1712  [AV_PIX_FMT_GBRP10LE] = {
1713  .name = "gbrp10le",
1714  .nb_components = 3,
1715  .log2_chroma_w = 0,
1716  .log2_chroma_h = 0,
1717  .comp = {
1718  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
1719  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
1720  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
1721  },
1723  },
1724  [AV_PIX_FMT_GBRP10BE] = {
1725  .name = "gbrp10be",
1726  .nb_components = 3,
1727  .log2_chroma_w = 0,
1728  .log2_chroma_h = 0,
1729  .comp = {
1730  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
1731  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
1732  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
1733  },
1735  },
1736  [AV_PIX_FMT_GBRP12LE] = {
1737  .name = "gbrp12le",
1738  .nb_components = 3,
1739  .log2_chroma_w = 0,
1740  .log2_chroma_h = 0,
1741  .comp = {
1742  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1743  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1744  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1745  },
1747  },
1748  [AV_PIX_FMT_GBRP12BE] = {
1749  .name = "gbrp12be",
1750  .nb_components = 3,
1751  .log2_chroma_w = 0,
1752  .log2_chroma_h = 0,
1753  .comp = {
1754  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1755  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1756  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1757  },
1759  },
1760  [AV_PIX_FMT_GBRP14LE] = {
1761  .name = "gbrp14le",
1762  .nb_components = 3,
1763  .log2_chroma_w = 0,
1764  .log2_chroma_h = 0,
1765  .comp = {
1766  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* R */
1767  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* G */
1768  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* B */
1769  },
1771  },
1772  [AV_PIX_FMT_GBRP14BE] = {
1773  .name = "gbrp14be",
1774  .nb_components = 3,
1775  .log2_chroma_w = 0,
1776  .log2_chroma_h = 0,
1777  .comp = {
1778  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* R */
1779  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* G */
1780  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* B */
1781  },
1783  },
1784  [AV_PIX_FMT_GBRP16LE] = {
1785  .name = "gbrp16le",
1786  .nb_components = 3,
1787  .log2_chroma_w = 0,
1788  .log2_chroma_h = 0,
1789  .comp = {
1790  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
1791  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1792  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
1793  },
1795  },
1796  [AV_PIX_FMT_GBRP16BE] = {
1797  .name = "gbrp16be",
1798  .nb_components = 3,
1799  .log2_chroma_w = 0,
1800  .log2_chroma_h = 0,
1801  .comp = {
1802  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
1803  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1804  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
1805  },
1807  },
1808  [AV_PIX_FMT_GBRAP] = {
1809  .name = "gbrap",
1810  .nb_components = 4,
1811  .log2_chroma_w = 0,
1812  .log2_chroma_h = 0,
1813  .comp = {
1814  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* R */
1815  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* G */
1816  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* B */
1817  { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
1818  },
1821  },
1822  [AV_PIX_FMT_GBRAP16LE] = {
1823  .name = "gbrap16le",
1824  .nb_components = 4,
1825  .log2_chroma_w = 0,
1826  .log2_chroma_h = 0,
1827  .comp = {
1828  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
1829  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1830  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
1831  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
1832  },
1835  },
1836  [AV_PIX_FMT_GBRAP16BE] = {
1837  .name = "gbrap16be",
1838  .nb_components = 4,
1839  .log2_chroma_w = 0,
1840  .log2_chroma_h = 0,
1841  .comp = {
1842  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
1843  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1844  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
1845  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
1846  },
1849  },
1850  [AV_PIX_FMT_VDPAU] = {
1851  .name = "vdpau",
1852  .log2_chroma_w = 1,
1853  .log2_chroma_h = 1,
1854  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1855  },
1856  [AV_PIX_FMT_XYZ12LE] = {
1857  .name = "xyz12le",
1858  .nb_components = 3,
1859  .log2_chroma_w = 0,
1860  .log2_chroma_h = 0,
1861  .comp = {
1862  { 0, 6, 0, 4, 12, 5, 11, 1 }, /* X */
1863  { 0, 6, 2, 4, 12, 5, 11, 3 }, /* Y */
1864  { 0, 6, 4, 4, 12, 5, 11, 5 }, /* Z */
1865  },
1866  /*.flags = -- not used*/
1867  },
1868  [AV_PIX_FMT_XYZ12BE] = {
1869  .name = "xyz12be",
1870  .nb_components = 3,
1871  .log2_chroma_w = 0,
1872  .log2_chroma_h = 0,
1873  .comp = {
1874  { 0, 6, 0, 4, 12, 5, 11, 1 }, /* X */
1875  { 0, 6, 2, 4, 12, 5, 11, 3 }, /* Y */
1876  { 0, 6, 4, 4, 12, 5, 11, 5 }, /* Z */
1877  },
1878  .flags = AV_PIX_FMT_FLAG_BE,
1879  },
1880 
1881 #define BAYER8_DESC_COMMON \
1882  .nb_components= 3, \
1883  .log2_chroma_w= 0, \
1884  .log2_chroma_h= 0, \
1885  .comp = { \
1886  {0,1,0,0,2,0,1,1},\
1887  {0,1,0,0,4,0,3,1},\
1888  {0,1,0,0,2,0,1,1},\
1889  }, \
1890 
1891 #define BAYER16_DESC_COMMON \
1892  .nb_components= 3, \
1893  .log2_chroma_w= 0, \
1894  .log2_chroma_h= 0, \
1895  .comp = { \
1896  {0,2,0,0,4,1,3,1},\
1897  {0,2,0,0,8,1,7,1},\
1898  {0,2,0,0,4,1,3,1},\
1899  }, \
1900 
1902  .name = "bayer_bggr8",
1905  },
1907  .name = "bayer_bggr16le",
1910  },
1912  .name = "bayer_bggr16be",
1915  },
1917  .name = "bayer_rggb8",
1920  },
1922  .name = "bayer_rggb16le",
1925  },
1927  .name = "bayer_rggb16be",
1930  },
1932  .name = "bayer_gbrg8",
1935  },
1937  .name = "bayer_gbrg16le",
1940  },
1942  .name = "bayer_gbrg16be",
1945  },
1947  .name = "bayer_grbg8",
1950  },
1952  .name = "bayer_grbg16le",
1955  },
1957  .name = "bayer_grbg16be",
1960  },
1961  [AV_PIX_FMT_NV16] = {
1962  .name = "nv16",
1963  .nb_components = 3,
1964  .log2_chroma_w = 1,
1965  .log2_chroma_h = 0,
1966  .comp = {
1967  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
1968  { 1, 2, 0, 0, 8, 1, 7, 1 }, /* U */
1969  { 1, 2, 1, 0, 8, 1, 7, 2 }, /* V */
1970  },
1971  .flags = AV_PIX_FMT_FLAG_PLANAR,
1972  },
1973  [AV_PIX_FMT_NV20LE] = {
1974  .name = "nv20le",
1975  .nb_components = 3,
1976  .log2_chroma_w = 1,
1977  .log2_chroma_h = 0,
1978  .comp = {
1979  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1980  { 1, 4, 0, 0, 10, 3, 9, 1 }, /* U */
1981  { 1, 4, 2, 0, 10, 3, 9, 3 }, /* V */
1982  },
1983  .flags = AV_PIX_FMT_FLAG_PLANAR,
1984  },
1985  [AV_PIX_FMT_NV20BE] = {
1986  .name = "nv20be",
1987  .nb_components = 3,
1988  .log2_chroma_w = 1,
1989  .log2_chroma_h = 0,
1990  .comp = {
1991  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1992  { 1, 4, 0, 0, 10, 3, 9, 1 }, /* U */
1993  { 1, 4, 2, 0, 10, 3, 9, 3 }, /* V */
1994  },
1996  },
1997  [AV_PIX_FMT_QSV] = {
1998  .name = "qsv",
1999  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2000  },
2001  [AV_PIX_FMT_MEDIACODEC] = {
2002  .name = "mediacodec",
2003  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2004  },
2005  [AV_PIX_FMT_MMAL] = {
2006  .name = "mmal",
2007  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2008  },
2009  [AV_PIX_FMT_CUDA] = {
2010  .name = "cuda",
2011  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2012  },
2013  [AV_PIX_FMT_AYUV64LE] = {
2014  .name = "ayuv64le",
2015  .nb_components = 4,
2016  .log2_chroma_w = 0,
2017  .log2_chroma_h = 0,
2018  .comp = {
2019  { 0, 8, 2, 0, 16, 7, 15, 3 }, /* Y */
2020  { 0, 8, 4, 0, 16, 7, 15, 5 }, /* U */
2021  { 0, 8, 6, 0, 16, 7, 15, 7 }, /* V */
2022  { 0, 8, 0, 0, 16, 7, 15, 1 }, /* A */
2023  },
2024  .flags = AV_PIX_FMT_FLAG_ALPHA,
2025  },
2026  [AV_PIX_FMT_AYUV64BE] = {
2027  .name = "ayuv64be",
2028  .nb_components = 4,
2029  .log2_chroma_w = 0,
2030  .log2_chroma_h = 0,
2031  .comp = {
2032  { 0, 8, 2, 0, 16, 7, 15, 3 }, /* Y */
2033  { 0, 8, 4, 0, 16, 7, 15, 5 }, /* U */
2034  { 0, 8, 6, 0, 16, 7, 15, 7 }, /* V */
2035  { 0, 8, 0, 0, 16, 7, 15, 1 }, /* A */
2036  },
2038  },
2039  [AV_PIX_FMT_P010LE] = {
2040  .name = "p010le",
2041  .nb_components = 3,
2042  .log2_chroma_w = 1,
2043  .log2_chroma_h = 1,
2044  .comp = {
2045  { 0, 2, 0, 6, 10, 1, 9, 1 }, /* Y */
2046  { 1, 4, 0, 6, 10, 3, 9, 1 }, /* U */
2047  { 1, 4, 2, 6, 10, 3, 9, 3 }, /* V */
2048  },
2049  .flags = AV_PIX_FMT_FLAG_PLANAR,
2050  },
2051  [AV_PIX_FMT_P010BE] = {
2052  .name = "p010be",
2053  .nb_components = 3,
2054  .log2_chroma_w = 1,
2055  .log2_chroma_h = 1,
2056  .comp = {
2057  { 0, 2, 0, 6, 10, 1, 9, 1 }, /* Y */
2058  { 1, 4, 0, 6, 10, 3, 9, 1 }, /* U */
2059  { 1, 4, 2, 6, 10, 3, 9, 3 }, /* V */
2060  },
2062  },
2063  [AV_PIX_FMT_P016LE] = {
2064  .name = "p016le",
2065  .nb_components = 3,
2066  .log2_chroma_w = 1,
2067  .log2_chroma_h = 1,
2068  .comp = {
2069  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
2070  { 1, 4, 0, 0, 16, 3, 15, 1 }, /* U */
2071  { 1, 4, 2, 0, 16, 3, 15, 3 }, /* V */
2072  },
2073  .flags = AV_PIX_FMT_FLAG_PLANAR,
2074  },
2075  [AV_PIX_FMT_P016BE] = {
2076  .name = "p016be",
2077  .nb_components = 3,
2078  .log2_chroma_w = 1,
2079  .log2_chroma_h = 1,
2080  .comp = {
2081  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
2082  { 1, 4, 0, 0, 16, 3, 15, 1 }, /* U */
2083  { 1, 4, 2, 0, 16, 3, 15, 3 }, /* V */
2084  },
2086  },
2087  [AV_PIX_FMT_GBRAP12LE] = {
2088  .name = "gbrap12le",
2089  .nb_components = 4,
2090  .log2_chroma_w = 0,
2091  .log2_chroma_h = 0,
2092  .comp = {
2093  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
2094  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
2095  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
2096  { 3, 2, 0, 0, 12, 1, 11, 1 }, /* A */
2097  },
2100  },
2101  [AV_PIX_FMT_GBRAP12BE] = {
2102  .name = "gbrap12be",
2103  .nb_components = 4,
2104  .log2_chroma_w = 0,
2105  .log2_chroma_h = 0,
2106  .comp = {
2107  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
2108  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
2109  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
2110  { 3, 2, 0, 0, 12, 1, 11, 1 }, /* A */
2111  },
2114  },
2115  [AV_PIX_FMT_GBRAP10LE] = {
2116  .name = "gbrap10le",
2117  .nb_components = 4,
2118  .log2_chroma_w = 0,
2119  .log2_chroma_h = 0,
2120  .comp = {
2121  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
2122  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
2123  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
2124  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
2125  },
2128  },
2129  [AV_PIX_FMT_GBRAP10BE] = {
2130  .name = "gbrap10be",
2131  .nb_components = 4,
2132  .log2_chroma_w = 0,
2133  .log2_chroma_h = 0,
2134  .comp = {
2135  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
2136  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
2137  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
2138  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
2139  },
2142  },
2143  [AV_PIX_FMT_D3D11] = {
2144  .name = "d3d11",
2145  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2146  },
2147  [AV_PIX_FMT_GBRPF32BE] = {
2148  .name = "gbrpf32be",
2149  .nb_components = 3,
2150  .log2_chroma_w = 0,
2151  .log2_chroma_h = 0,
2152  .comp = {
2153  { 2, 4, 0, 0, 32, 3, 31, 1 }, /* R */
2154  { 0, 4, 0, 0, 32, 3, 31, 1 }, /* G */
2155  { 1, 4, 0, 0, 32, 3, 31, 1 }, /* B */
2156  },
2159  },
2160  [AV_PIX_FMT_GBRPF32LE] = {
2161  .name = "gbrpf32le",
2162  .nb_components = 3,
2163  .log2_chroma_w = 0,
2164  .log2_chroma_h = 0,
2165  .comp = {
2166  { 2, 4, 0, 0, 32, 3, 31, 1 }, /* R */
2167  { 0, 4, 0, 0, 32, 3, 31, 1 }, /* G */
2168  { 1, 4, 0, 0, 32, 3, 31, 1 }, /* B */
2169  },
2171  },
2172  [AV_PIX_FMT_GBRAPF32BE] = {
2173  .name = "gbrapf32be",
2174  .nb_components = 4,
2175  .log2_chroma_w = 0,
2176  .log2_chroma_h = 0,
2177  .comp = {
2178  { 2, 4, 0, 0, 32, 3, 31, 1 }, /* R */
2179  { 0, 4, 0, 0, 32, 3, 31, 1 }, /* G */
2180  { 1, 4, 0, 0, 32, 3, 31, 1 }, /* B */
2181  { 3, 4, 0, 0, 32, 3, 31, 1 }, /* A */
2182  },
2186  },
2187  [AV_PIX_FMT_GBRAPF32LE] = {
2188  .name = "gbrapf32le",
2189  .nb_components = 4,
2190  .log2_chroma_w = 0,
2191  .log2_chroma_h = 0,
2192  .comp = {
2193  { 2, 4, 0, 0, 32, 3, 31, 1 }, /* R */
2194  { 0, 4, 0, 0, 32, 3, 31, 1 }, /* G */
2195  { 1, 4, 0, 0, 32, 3, 31, 1 }, /* B */
2196  { 3, 4, 0, 0, 32, 3, 31, 1 }, /* A */
2197  },
2200  },
2201  [AV_PIX_FMT_DRM_PRIME] = {
2202  .name = "drm_prime",
2203  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2204  },
2205  [AV_PIX_FMT_OPENCL] = {
2206  .name = "opencl",
2207  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2208  },
2209 };
2210 #if FF_API_PLUS1_MINUS1
2212 #endif
2213 
2214 static const char * const color_range_names[] = {
2215  [AVCOL_RANGE_UNSPECIFIED] = "unknown",
2216  [AVCOL_RANGE_MPEG] = "tv",
2217  [AVCOL_RANGE_JPEG] = "pc",
2218 };
2219 
2220 static const char * const color_primaries_names[AVCOL_PRI_NB] = {
2221  [AVCOL_PRI_RESERVED0] = "reserved",
2222  [AVCOL_PRI_BT709] = "bt709",
2223  [AVCOL_PRI_UNSPECIFIED] = "unknown",
2224  [AVCOL_PRI_RESERVED] = "reserved",
2225  [AVCOL_PRI_BT470M] = "bt470m",
2226  [AVCOL_PRI_BT470BG] = "bt470bg",
2227  [AVCOL_PRI_SMPTE170M] = "smpte170m",
2228  [AVCOL_PRI_SMPTE240M] = "smpte240m",
2229  [AVCOL_PRI_FILM] = "film",
2230  [AVCOL_PRI_BT2020] = "bt2020",
2231  [AVCOL_PRI_SMPTE428] = "smpte428",
2232  [AVCOL_PRI_SMPTE431] = "smpte431",
2233  [AVCOL_PRI_SMPTE432] = "smpte432",
2234  [AVCOL_PRI_JEDEC_P22] = "jedec-p22",
2235 };
2236 
2237 static const char * const color_transfer_names[] = {
2238  [AVCOL_TRC_RESERVED0] = "reserved",
2239  [AVCOL_TRC_BT709] = "bt709",
2240  [AVCOL_TRC_UNSPECIFIED] = "unknown",
2241  [AVCOL_TRC_RESERVED] = "reserved",
2242  [AVCOL_TRC_GAMMA22] = "bt470m",
2243  [AVCOL_TRC_GAMMA28] = "bt470bg",
2244  [AVCOL_TRC_SMPTE170M] = "smpte170m",
2245  [AVCOL_TRC_SMPTE240M] = "smpte240m",
2246  [AVCOL_TRC_LINEAR] = "linear",
2247  [AVCOL_TRC_LOG] = "log100",
2248  [AVCOL_TRC_LOG_SQRT] = "log316",
2249  [AVCOL_TRC_IEC61966_2_4] = "iec61966-2-4",
2250  [AVCOL_TRC_BT1361_ECG] = "bt1361e",
2251  [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1",
2252  [AVCOL_TRC_BT2020_10] = "bt2020-10",
2253  [AVCOL_TRC_BT2020_12] = "bt2020-12",
2254  [AVCOL_TRC_SMPTE2084] = "smpte2084",
2255  [AVCOL_TRC_SMPTE428] = "smpte428",
2256  [AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
2257 };
2258 
2259 static const char * const color_space_names[] = {
2260  [AVCOL_SPC_RGB] = "gbr",
2261  [AVCOL_SPC_BT709] = "bt709",
2262  [AVCOL_SPC_UNSPECIFIED] = "unknown",
2263  [AVCOL_SPC_RESERVED] = "reserved",
2264  [AVCOL_SPC_FCC] = "fcc",
2265  [AVCOL_SPC_BT470BG] = "bt470bg",
2266  [AVCOL_SPC_SMPTE170M] = "smpte170m",
2267  [AVCOL_SPC_SMPTE240M] = "smpte240m",
2268  [AVCOL_SPC_YCGCO] = "ycgco",
2269  [AVCOL_SPC_BT2020_NCL] = "bt2020nc",
2270  [AVCOL_SPC_BT2020_CL] = "bt2020c",
2271  [AVCOL_SPC_SMPTE2085] = "smpte2085",
2272  [AVCOL_SPC_CHROMA_DERIVED_NCL] = "chroma-derived-nc",
2273  [AVCOL_SPC_CHROMA_DERIVED_CL] = "chroma-derived-c",
2274  [AVCOL_SPC_ICTCP] = "ictcp",
2275 };
2276 
2277 static const char * const chroma_location_names[] = {
2278  [AVCHROMA_LOC_UNSPECIFIED] = "unspecified",
2279  [AVCHROMA_LOC_LEFT] = "left",
2280  [AVCHROMA_LOC_CENTER] = "center",
2281  [AVCHROMA_LOC_TOPLEFT] = "topleft",
2282  [AVCHROMA_LOC_TOP] = "top",
2283  [AVCHROMA_LOC_BOTTOMLEFT] = "bottomleft",
2284  [AVCHROMA_LOC_BOTTOM] = "bottom",
2285 };
2286 
2287 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
2288 {
2289  enum AVPixelFormat pix_fmt;
2290 
2291  for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
2292  if (av_pix_fmt_descriptors[pix_fmt].name &&
2293  (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
2294  av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias)))
2295  return pix_fmt;
2296 
2297  return AV_PIX_FMT_NONE;
2298 }
2299 
2301 {
2302  return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
2303  av_pix_fmt_descriptors[pix_fmt].name : NULL;
2304 }
2305 
2306 #if HAVE_BIGENDIAN
2307 # define X_NE(be, le) be
2308 #else
2309 # define X_NE(be, le) le
2310 #endif
2311 
2313 {
2314  enum AVPixelFormat pix_fmt;
2315 
2316  if (!strcmp(name, "rgb32"))
2317  name = X_NE("argb", "bgra");
2318  else if (!strcmp(name, "bgr32"))
2319  name = X_NE("abgr", "rgba");
2320 
2321  pix_fmt = get_pix_fmt_internal(name);
2322  if (pix_fmt == AV_PIX_FMT_NONE) {
2323  char name2[32];
2324 
2325  snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
2326  pix_fmt = get_pix_fmt_internal(name2);
2327  }
2328 
2329 #if FF_API_VAAPI
2330  if (pix_fmt == AV_PIX_FMT_NONE && !strcmp(name, "vaapi"))
2331  pix_fmt = AV_PIX_FMT_VAAPI;
2332 #endif
2333  return pix_fmt;
2334 }
2335 
2337 {
2338  int c, bits = 0;
2339  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2340 
2341  for (c = 0; c < pixdesc->nb_components; c++) {
2342  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2343  bits += pixdesc->comp[c].depth << s;
2344  }
2345 
2346  return bits >> log2_pixels;
2347 }
2348 
2350 {
2351  int c, bits = 0;
2352  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2353  int steps[4] = {0};
2354 
2355  for (c = 0; c < pixdesc->nb_components; c++) {
2356  const AVComponentDescriptor *comp = &pixdesc->comp[c];
2357  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2358  steps[comp->plane] = comp->step << s;
2359  }
2360  for (c = 0; c < 4; c++)
2361  bits += steps[c];
2362 
2363  if(!(pixdesc->flags & AV_PIX_FMT_FLAG_BITSTREAM))
2364  bits *= 8;
2365 
2366  return bits >> log2_pixels;
2367 }
2368 
2369 char *av_get_pix_fmt_string(char *buf, int buf_size,
2370  enum AVPixelFormat pix_fmt)
2371 {
2372  /* print header */
2373  if (pix_fmt < 0) {
2374  snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
2375  } else {
2376  const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
2377  snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
2378  pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
2379  }
2380 
2381  return buf;
2382 }
2383 
2385 {
2386  if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
2387  return NULL;
2388  return &av_pix_fmt_descriptors[pix_fmt];
2389 }
2390 
2392 {
2393  if (!prev)
2394  return &av_pix_fmt_descriptors[0];
2395  while (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1) {
2396  prev++;
2397  if (prev->name)
2398  return prev;
2399  }
2400  return NULL;
2401 }
2402 
2404 {
2405  if (desc < av_pix_fmt_descriptors ||
2406  desc >= av_pix_fmt_descriptors + FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
2407  return AV_PIX_FMT_NONE;
2408 
2409  return desc - av_pix_fmt_descriptors;
2410 }
2411 
2413  int *h_shift, int *v_shift)
2414 {
2415  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2416  if (!desc)
2417  return AVERROR(ENOSYS);
2418  *h_shift = desc->log2_chroma_w;
2419  *v_shift = desc->log2_chroma_h;
2420 
2421  return 0;
2422 }
2423 
2425 {
2426  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2427  int i, planes[4] = { 0 }, ret = 0;
2428 
2429  if (!desc)
2430  return AVERROR(EINVAL);
2431 
2432  for (i = 0; i < desc->nb_components; i++)
2433  planes[desc->comp[i].plane] = 1;
2434  for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
2435  ret += planes[i];
2436  return ret;
2437 }
2438 
2440  int i, j;
2441 
2442  for (i=0; i<FF_ARRAY_ELEMS(av_pix_fmt_descriptors); i++) {
2443  const AVPixFmtDescriptor *d = &av_pix_fmt_descriptors[i];
2444  uint8_t fill[4][8+6+3] = {{0}};
2445  uint8_t *data[4] = {fill[0], fill[1], fill[2], fill[3]};
2446  int linesize[4] = {0,0,0,0};
2447  uint16_t tmp[2];
2448 
2449  if (!d->name && !d->nb_components && !d->log2_chroma_w && !d->log2_chroma_h && !d->flags)
2450  continue;
2451 // av_log(NULL, AV_LOG_DEBUG, "Checking: %s\n", d->name);
2452  av_assert0(d->log2_chroma_w <= 3);
2453  av_assert0(d->log2_chroma_h <= 3);
2454  av_assert0(d->nb_components <= 4);
2455  av_assert0(d->name && d->name[0]);
2456  av_assert2(av_get_pix_fmt(d->name) == i);
2457 
2458  for (j=0; j<FF_ARRAY_ELEMS(d->comp); j++) {
2459  const AVComponentDescriptor *c = &d->comp[j];
2460  if(j>=d->nb_components) {
2461  av_assert0(!c->plane && !c->step && !c->offset && !c->shift && !c->depth);
2462  continue;
2463  }
2464  if (d->flags & AV_PIX_FMT_FLAG_BITSTREAM) {
2465  av_assert0(c->step >= c->depth);
2466  } else {
2467  av_assert0(8*c->step >= c->depth);
2468  }
2469  if (d->flags & AV_PIX_FMT_FLAG_BAYER)
2470  continue;
2471  av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0);
2472  av_assert0(tmp[0] == 0 && tmp[1] == 0);
2473  tmp[0] = tmp[1] = (1<<c->depth) - 1;
2474  av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2);
2475  }
2476  }
2477 }
2478 
2479 
2481 {
2482  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2483  char name[16];
2484  int i;
2485 
2486  if (!desc || strlen(desc->name) < 2)
2487  return AV_PIX_FMT_NONE;
2488  av_strlcpy(name, desc->name, sizeof(name));
2489  i = strlen(name) - 2;
2490  if (strcmp(name + i, "be") && strcmp(name + i, "le"))
2491  return AV_PIX_FMT_NONE;
2492 
2493  name[i] ^= 'b' ^ 'l';
2494 
2495  return get_pix_fmt_internal(name);
2496 }
2497 
2498 #define FF_COLOR_NA -1
2499 #define FF_COLOR_RGB 0 /**< RGB color space */
2500 #define FF_COLOR_GRAY 1 /**< gray color space */
2501 #define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
2502 #define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
2503 #define FF_COLOR_XYZ 4
2504 
2505 #define pixdesc_has_alpha(pixdesc) \
2506  ((pixdesc)->flags & AV_PIX_FMT_FLAG_ALPHA)
2507 
2508 
2510  if (desc->flags & AV_PIX_FMT_FLAG_PAL)
2511  return FF_COLOR_RGB;
2512 
2513  if(desc->nb_components == 1 || desc->nb_components == 2)
2514  return FF_COLOR_GRAY;
2515 
2516  if(desc->name && !strncmp(desc->name, "yuvj", 4))
2517  return FF_COLOR_YUV_JPEG;
2518 
2519  if(desc->name && !strncmp(desc->name, "xyz", 3))
2520  return FF_COLOR_XYZ;
2521 
2522  if(desc->flags & AV_PIX_FMT_FLAG_RGB)
2523  return FF_COLOR_RGB;
2524 
2525  if(desc->nb_components == 0)
2526  return FF_COLOR_NA;
2527 
2528  return FF_COLOR_YUV;
2529 }
2530 
2531 static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
2532 {
2533  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2534  int i;
2535 
2536  if (!desc || !desc->nb_components) {
2537  *min = *max = 0;
2538  return AVERROR(EINVAL);
2539  }
2540 
2541  *min = INT_MAX, *max = -INT_MAX;
2542  for (i = 0; i < desc->nb_components; i++) {
2543  *min = FFMIN(desc->comp[i].depth, *min);
2544  *max = FFMAX(desc->comp[i].depth, *max);
2545  }
2546  return 0;
2547 }
2548 
2549 static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
2550  enum AVPixelFormat src_pix_fmt,
2551  unsigned *lossp, unsigned consider)
2552 {
2553  const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
2554  const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
2555  int src_color, dst_color;
2556  int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
2557  int ret, loss, i, nb_components;
2558  int score = INT_MAX - 1;
2559 
2560  if (!src_desc || !dst_desc)
2561  return -4;
2562 
2563  if ((src_desc->flags & AV_PIX_FMT_FLAG_HWACCEL) ||
2564  (dst_desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
2565  if (dst_pix_fmt == src_pix_fmt)
2566  return -1;
2567  else
2568  return -2;
2569  }
2570 
2571  /* compute loss */
2572  *lossp = loss = 0;
2573 
2574  if (dst_pix_fmt == src_pix_fmt)
2575  return INT_MAX;
2576 
2577  if ((ret = get_pix_fmt_depth(&src_min_depth, &src_max_depth, src_pix_fmt)) < 0)
2578  return -3;
2579  if ((ret = get_pix_fmt_depth(&dst_min_depth, &dst_max_depth, dst_pix_fmt)) < 0)
2580  return -3;
2581 
2582  src_color = get_color_type(src_desc);
2583  dst_color = get_color_type(dst_desc);
2584  if (dst_pix_fmt == AV_PIX_FMT_PAL8)
2585  nb_components = FFMIN(src_desc->nb_components, 4);
2586  else
2587  nb_components = FFMIN(src_desc->nb_components, dst_desc->nb_components);
2588 
2589  for (i = 0; i < nb_components; i++) {
2590  int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : (dst_desc->comp[i].depth - 1);
2591  if (src_desc->comp[i].depth - 1 > depth_minus1 && (consider & FF_LOSS_DEPTH)) {
2592  loss |= FF_LOSS_DEPTH;
2593  score -= 65536 >> depth_minus1;
2594  }
2595  }
2596 
2597  if (consider & FF_LOSS_RESOLUTION) {
2598  if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w) {
2599  loss |= FF_LOSS_RESOLUTION;
2600  score -= 256 << dst_desc->log2_chroma_w;
2601  }
2602  if (dst_desc->log2_chroma_h > src_desc->log2_chroma_h) {
2603  loss |= FF_LOSS_RESOLUTION;
2604  score -= 256 << dst_desc->log2_chroma_h;
2605  }
2606  // don't favor 422 over 420 if downsampling is needed, because 420 has much better support on the decoder side
2607  if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 0 &&
2608  dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 0 ) {
2609  score += 512;
2610  }
2611  }
2612 
2613  if(consider & FF_LOSS_COLORSPACE)
2614  switch(dst_color) {
2615  case FF_COLOR_RGB:
2616  if (src_color != FF_COLOR_RGB &&
2617  src_color != FF_COLOR_GRAY)
2618  loss |= FF_LOSS_COLORSPACE;
2619  break;
2620  case FF_COLOR_GRAY:
2621  if (src_color != FF_COLOR_GRAY)
2622  loss |= FF_LOSS_COLORSPACE;
2623  break;
2624  case FF_COLOR_YUV:
2625  if (src_color != FF_COLOR_YUV)
2626  loss |= FF_LOSS_COLORSPACE;
2627  break;
2628  case FF_COLOR_YUV_JPEG:
2629  if (src_color != FF_COLOR_YUV_JPEG &&
2630  src_color != FF_COLOR_YUV &&
2631  src_color != FF_COLOR_GRAY)
2632  loss |= FF_LOSS_COLORSPACE;
2633  break;
2634  default:
2635  /* fail safe test */
2636  if (src_color != dst_color)
2637  loss |= FF_LOSS_COLORSPACE;
2638  break;
2639  }
2640  if(loss & FF_LOSS_COLORSPACE)
2641  score -= (nb_components * 65536) >> FFMIN(dst_desc->comp[0].depth - 1, src_desc->comp[0].depth - 1);
2642 
2643  if (dst_color == FF_COLOR_GRAY &&
2644  src_color != FF_COLOR_GRAY && (consider & FF_LOSS_CHROMA)) {
2645  loss |= FF_LOSS_CHROMA;
2646  score -= 2 * 65536;
2647  }
2648  if (!pixdesc_has_alpha(dst_desc) && (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))) {
2649  loss |= FF_LOSS_ALPHA;
2650  score -= 65536;
2651  }
2652  if (dst_pix_fmt == AV_PIX_FMT_PAL8 && (consider & FF_LOSS_COLORQUANT) &&
2653  (src_pix_fmt != AV_PIX_FMT_PAL8 && (src_color != FF_COLOR_GRAY || (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))))) {
2654  loss |= FF_LOSS_COLORQUANT;
2655  score -= 65536;
2656  }
2657 
2658  *lossp = loss;
2659  return score;
2660 }
2661 
2662 int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
2663  enum AVPixelFormat src_pix_fmt,
2664  int has_alpha)
2665 {
2666  int loss;
2667  int ret = get_pix_fmt_score(dst_pix_fmt, src_pix_fmt, &loss, has_alpha ? ~0 : ~FF_LOSS_ALPHA);
2668  if (ret < 0)
2669  return ret;
2670  return loss;
2671 }
2672 
2673 enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
2674  enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
2675 {
2676  enum AVPixelFormat dst_pix_fmt;
2677  int loss1, loss2, loss_mask;
2678  const AVPixFmtDescriptor *desc1 = av_pix_fmt_desc_get(dst_pix_fmt1);
2679  const AVPixFmtDescriptor *desc2 = av_pix_fmt_desc_get(dst_pix_fmt2);
2680  int score1, score2;
2681 
2682  if (!desc1) {
2683  dst_pix_fmt = dst_pix_fmt2;
2684  } else if (!desc2) {
2685  dst_pix_fmt = dst_pix_fmt1;
2686  } else {
2687  loss_mask= loss_ptr?~*loss_ptr:~0; /* use loss mask if provided */
2688  if(!has_alpha)
2689  loss_mask &= ~FF_LOSS_ALPHA;
2690 
2691  score1 = get_pix_fmt_score(dst_pix_fmt1, src_pix_fmt, &loss1, loss_mask);
2692  score2 = get_pix_fmt_score(dst_pix_fmt2, src_pix_fmt, &loss2, loss_mask);
2693 
2694  if (score1 == score2) {
2696  dst_pix_fmt = av_get_padded_bits_per_pixel(desc2) < av_get_padded_bits_per_pixel(desc1) ? dst_pix_fmt2 : dst_pix_fmt1;
2697  } else {
2698  dst_pix_fmt = desc2->nb_components < desc1->nb_components ? dst_pix_fmt2 : dst_pix_fmt1;
2699  }
2700  } else {
2701  dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
2702  }
2703  }
2704 
2705  if (loss_ptr)
2706  *loss_ptr = av_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
2707  return dst_pix_fmt;
2708 }
2709 
2710 const char *av_color_range_name(enum AVColorRange range)
2711 {
2712  return (unsigned) range < AVCOL_RANGE_NB ?
2713  color_range_names[range] : NULL;
2714 }
2715 
2717 {
2718  int i;
2719 
2720  for (i = 0; i < FF_ARRAY_ELEMS(color_range_names); i++) {
2721  size_t len = strlen(color_range_names[i]);
2722  if (!strncmp(color_range_names[i], name, len))
2723  return i;
2724  }
2725 
2726  return AVERROR(EINVAL);
2727 }
2728 
2729 const char *av_color_primaries_name(enum AVColorPrimaries primaries)
2730 {
2731  return (unsigned) primaries < AVCOL_PRI_NB ?
2732  color_primaries_names[primaries] : NULL;
2733 }
2734 
2736 {
2737  int i;
2738 
2739  for (i = 0; i < FF_ARRAY_ELEMS(color_primaries_names); i++) {
2740  size_t len;
2741 
2742  if (!color_primaries_names[i])
2743  continue;
2744 
2745  len = strlen(color_primaries_names[i]);
2746  if (!strncmp(color_primaries_names[i], name, len))
2747  return i;
2748  }
2749 
2750  return AVERROR(EINVAL);
2751 }
2752 
2754 {
2755  return (unsigned) transfer < AVCOL_TRC_NB ?
2756  color_transfer_names[transfer] : NULL;
2757 }
2758 
2760 {
2761  int i;
2762 
2763  for (i = 0; i < FF_ARRAY_ELEMS(color_transfer_names); i++) {
2764  size_t len;
2765 
2766  if (!color_transfer_names[i])
2767  continue;
2768 
2769  len = strlen(color_transfer_names[i]);
2770  if (!strncmp(color_transfer_names[i], name, len))
2771  return i;
2772  }
2773 
2774  return AVERROR(EINVAL);
2775 }
2776 
2777 const char *av_color_space_name(enum AVColorSpace space)
2778 {
2779  return (unsigned) space < AVCOL_SPC_NB ?
2780  color_space_names[space] : NULL;
2781 }
2782 
2784 {
2785  int i;
2786 
2787  for (i = 0; i < FF_ARRAY_ELEMS(color_space_names); i++) {
2788  size_t len;
2789 
2790  if (!color_space_names[i])
2791  continue;
2792 
2793  len = strlen(color_space_names[i]);
2794  if (!strncmp(color_space_names[i], name, len))
2795  return i;
2796  }
2797 
2798  return AVERROR(EINVAL);
2799 }
2800 
2801 const char *av_chroma_location_name(enum AVChromaLocation location)
2802 {
2803  return (unsigned) location < AVCHROMA_LOC_NB ?
2804  chroma_location_names[location] : NULL;
2805 }
2806 
2808 {
2809  int i;
2810 
2811  for (i = 0; i < FF_ARRAY_ELEMS(chroma_location_names); i++) {
2812  size_t len;
2813 
2814  if (!chroma_location_names[i])
2815  continue;
2816 
2817  len = strlen(chroma_location_names[i]);
2818  if (!strncmp(chroma_location_names[i], name, len))
2819  return i;
2820  }
2821 
2822  return AVERROR(EINVAL);
2823 }
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
Definition: pixdesc.h:132
ITU-R BT2020 for 12-bit system.
Definition: pixfmt.h:464
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
Definition: pixfmt.h:479
int plane
Definition: avisynth_c.h:422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:77
planar GBR 4:4:4:4 40bpp, little-endian
Definition: pixfmt.h:287
int plane
Which of the 4 planes contains the component.
Definition: pixdesc.h:35
#define NULL
Definition: coverity.c:32
HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_r...
Definition: pixfmt.h:114
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:162
const char const char void * val
Definition: avisynth_c.h:771
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
Definition: pixfmt.h:271
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:248
static enum AVPixelFormat pix_fmt
static int shift(int a, int b)
Definition: sonic.c:82
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:241
IEC 61966-2-4.
Definition: pixfmt.h:460
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2384
MPEG-2/4 4:2:0, H.264 default for 4:2:0.
Definition: pixfmt.h:524
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:101
"Linear transfer characteristics"
Definition: pixfmt.h:457
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:245
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:155
8 bits gray, 8 bits alpha
Definition: pixfmt.h:139
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:204
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:67
#define FF_LOSS_ALPHA
loss of alpha bits
Definition: pixdesc.h:382
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2424
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:64
packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in ...
Definition: pixfmt.h:80
JEDEC P22 phosphors.
Definition: pixfmt.h:440
const char * desc
Definition: nvenc.c:65
hardware decoding through Videotoolbox
Definition: pixfmt.h:278
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:158
#define FF_LOSS_CHROMA
loss of chroma (e.g.
Definition: pixdesc.h:384
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
Definition: pixdesc.c:2336
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 ...
Definition: pixfmt.h:483
char * av_get_pix_fmt_string(char *buf, int buf_size, enum AVPixelFormat pix_fmt)
Print in buf the string corresponding to the pixel format with number pix_fmt, or a header if pix_fmt...
Definition: pixdesc.c:2369
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:246
bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */
Definition: pixfmt.h:258
SMPTE ST 432-1 (2010) / P3 D65 / Display P3.
Definition: pixfmt.h:439
bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */
Definition: pixfmt.h:259
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:164
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:203
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined ...
Definition: pixfmt.h:104
bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */
Definition: pixfmt.h:266
HW decoding through VA API, Picture.data[3] contains a VASurfaceID.
Definition: pixfmt.h:116
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:185
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: pixfmt.h:484
static const char *const chroma_location_names[]
Definition: pixdesc.c:2277
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
Definition: pixfmt.h:107
planar GBR 4:4:4 36bpp, little-endian
Definition: pixfmt.h:251
SMPTE ST 431-2 (2011) / DCI P3.
Definition: pixfmt.h:438
The following 12 formats have the disadvantage of needing 1 format for each bit depth.
Definition: pixfmt.h:152
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, X=unused/undefined
Definition: pixfmt.h:136
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
Definition: pixfmt.h:235
bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */
Definition: pixfmt.h:256
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
Definition: bytestream.h:87
#define src
Definition: vp8dsp.c:254
Y , 12bpp, little-endian.
Definition: pixfmt.h:292
enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
Utility function to swap the endianness of a pixel format.
Definition: pixdesc.c:2480
planar GBR 4:4:4 36bpp, big-endian
Definition: pixfmt.h:250
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:127
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
Definition: bytestream.h:87
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
Definition: pixfmt.h:478
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:92
AVColorTransferCharacteristic
Color Transfer Characteristic.
Definition: pixfmt.h:448
packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in ...
Definition: pixfmt.h:83
functionally identical to above
Definition: pixfmt.h:485
const char * av_color_space_name(enum AVColorSpace space)
Definition: pixdesc.c:2777
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
Definition: pixfmt.h:102
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
Definition: pixfmt.h:81
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian ...
Definition: pixfmt.h:175
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
planar GBRA 4:4:4:4 64bpp, big-endian
Definition: pixfmt.h:212
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
Definition: pixfmt.h:186
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:97
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:117
uint8_t
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
Definition: pixdesc.h:177
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
Definition: avassert.h:64
#define BAYER16_DESC_COMMON
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
Definition: pixfmt.h:234
8 bits with AV_PIX_FMT_RGB32 palette
Definition: pixfmt.h:73
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:99
int av_color_range_from_name(const char *name)
Definition: pixdesc.c:2716
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:477
bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */
Definition: pixfmt.h:264
const char * av_color_range_name(enum AVColorRange range)
Definition: pixdesc.c:2710
#define AV_PIX_FMT_FLAG_FLOAT
The pixel format contains IEEE-754 floating point values.
Definition: pixdesc.h:188
bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */
Definition: pixfmt.h:265
Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16.
Definition: pixfmt.h:486
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:201
also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
Definition: pixfmt.h:453
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, X=unused/undefined ...
Definition: pixfmt.h:135
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:247
void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4], const AVPixFmtDescriptor *desc, int x, int y, int c, int w)
Write the values from src to the pixel format component c of an image line.
Definition: pixdesc.c:82
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
Definition: pixfmt.h:101
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:90
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:187
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
Definition: pixfmt.h:272
planar GBR 4:4:4 48bpp, big-endian
Definition: pixfmt.h:170
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
Definition: pixfmt.h:96
Y , 9bpp, little-endian.
Definition: pixfmt.h:312
static const struct @283 planes[]
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:75
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Definition: pixfmt.h:190
Not part of ABI.
Definition: pixfmt.h:504
Y , 10bpp, little-endian.
Definition: pixfmt.h:294
AVColorRange
MPEG vs JPEG YUV range.
Definition: pixfmt.h:500
#define flags(name, subs,...)
Definition: cbs_h2645.c:263
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
Definition: pixfmt.h:274
AVColorPrimaries
Chromaticity coordinates of the source primaries.
Definition: pixfmt.h:424
#define AV_WB16(p, v)
Definition: intreadwrite.h:405
bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */
Definition: pixfmt.h:260
int av_color_transfer_from_name(const char *name)
Definition: pixdesc.c:2759
const char * name
Definition: pixdesc.h:82
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:153
planar GBR 4:4:4 27bpp, big-endian
Definition: pixfmt.h:166
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:161
const char * av_chroma_location_name(enum AVChromaLocation location)
Definition: pixdesc.c:2801
also FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
Definition: pixfmt.h:429
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:172
16 bits gray, 16 bits alpha (big-endian)
Definition: pixfmt.h:208
ITU-R BT1361 Extended Colour Gamut.
Definition: pixfmt.h:461
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:101
static const uint16_t mask[17]
Definition: lzw.c:38
like NV12, with 16bpp per component, big-endian
Definition: pixfmt.h:297
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:132
#define AVERROR(e)
Definition: error.h:43
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
Definition: pixdesc.h:148
static const char *const color_space_names[]
Definition: pixdesc.c:2259
int av_chroma_location_from_name(const char *name)
Definition: pixdesc.c:2807
int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor.
Definition: pixdesc.c:2412
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:91
int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel for the pixel format described by pixdesc, including any padding ...
Definition: pixdesc.c:2349
Not part of ABI.
Definition: pixfmt.h:441
#define FF_LOSS_DEPTH
loss due to color depth change
Definition: pixdesc.h:380
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
Definition: pixfmt.h:178
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:157
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition: pixfmt.h:85
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
Definition: pixfmt.h:426
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
Definition: pixdesc.h:140
simple assert() macros that are a bit more flexible than ISO C assert().
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:244
like NV12, with 16bpp per component, little-endian
Definition: pixfmt.h:296
SMPTE ST 428-1 (CIE 1931 XYZ)
Definition: pixfmt.h:436
int av_match_name(const char *name, const char *names)
Match instances of a name in a comma-separated list of names.
Definition: avstring.c:343
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:130
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian
Definition: pixfmt.h:281
Libavutil version macros.
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
Definition: pixfmt.h:179
#define FFMAX(a, b)
Definition: common.h:94
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:88
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
Definition: avstring.c:83
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:145
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:89
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
Definition: pixdesc.c:2729
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
Definition: pixfmt.h:180
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:66
XVideo Motion Acceleration via common packet passing.
Definition: pixfmt.h:269
static const char *const color_transfer_names[]
Definition: pixdesc.c:2237
common internal API header
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
Definition: pixdesc.h:106
as above, but U and V bytes are swapped
Definition: pixfmt.h:86
planar GBR 4:4:4:4 48bpp, big-endian
Definition: pixfmt.h:283
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
Definition: pixdesc.c:2403
uint8_t nb_components
The number of components each pixel has, (1-4)
Definition: pixdesc.h:83
SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.
Definition: pixfmt.h:465
#define BAYER8_DESC_COMMON
planar GBR 4:4:4:4 40bpp, big-endian
Definition: pixfmt.h:286
IEEE-754 single precision planar GBR 4:4:4, 96bpp, little-endian.
Definition: pixfmt.h:315
#define FFMIN(a, b)
Definition: common.h:96
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
Definition: pixfmt.h:84
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:74
colour filters using Illuminant C
Definition: pixfmt.h:434
uint8_t w
Definition: llviddspenc.c:38
#define FF_COLOR_YUV_JPEG
YUV color space.
Definition: pixdesc.c:2502
ITU-R BT2020 non-constant luminance system.
Definition: pixfmt.h:488
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
Definition: pixfmt.h:526
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
Definition: pixfmt.h:431
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Definition: pixfmt.h:184
#define FF_COLOR_XYZ
Definition: pixdesc.c:2503
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
Definition: pixfmt.h:206
#define s(width, name)
Definition: cbs_vp9.c:257
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
Definition: pixfmt.h:176
Hardware surfaces for OpenCL.
Definition: pixfmt.h:331
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:65
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:239
packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big...
Definition: pixfmt.h:196
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:154
interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian ...
Definition: pixfmt.h:199
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian
Definition: pixfmt.h:280
static int get_color_type(const AVPixFmtDescriptor *desc)
Definition: pixdesc.c:2509
#define pixdesc_has_alpha(pixdesc)
Definition: pixdesc.c:2505
#define AV_PIX_FMT_FLAG_BAYER
The pixel format is following a Bayer pattern.
Definition: pixdesc.h:182
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:163
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:144
HW acceleration through CUDA.
Definition: pixfmt.h:231
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
Definition: pixfmt.h:106
FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
Definition: pixfmt.h:482
#define FF_ARRAY_ELEMS(a)
the normal 2^n-1 "JPEG" YUV ranges
Definition: pixfmt.h:503
HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state str...
Definition: pixfmt.h:115
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
Definition: eamad.c:83
planar GBR 4:4:4:4 48bpp, little-endian
Definition: pixfmt.h:284
also ITU-R BT1361
Definition: pixfmt.h:450
ITU-R BT.2100-0, ICtCp.
Definition: pixfmt.h:493
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
Definition: pixfmt.h:79
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:128
also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
Definition: pixfmt.h:455
functionally identical to above
Definition: pixfmt.h:433
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:173
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
Chromaticity-derived constant luminance system.
Definition: pixfmt.h:492
bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */
Definition: pixfmt.h:263
planar GBR 4:4:4 30bpp, big-endian
Definition: pixfmt.h:168
int av_color_primaries_from_name(const char *name)
Definition: pixdesc.c:2735
bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */
Definition: pixfmt.h:267
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
Definition: pixfmt.h:188
static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt, unsigned *lossp, unsigned consider)
Definition: pixdesc.c:2549
#define FF_COLOR_YUV
YUV color space.
Definition: pixdesc.c:2501
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:63
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
Definition: pixfmt.h:273
planar GBR 4:4:4 42bpp, little-endian
Definition: pixfmt.h:253
void * buf
Definition: avisynth_c.h:690
static FF_DISABLE_DEPRECATION_WARNINGS const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB]
Definition: pixdesc.c:133
Chromaticity-derived non-constant luminance system.
Definition: pixfmt.h:491
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:68
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
Definition: pixfmt.h:189
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:191
Y , 16bpp, big-endian.
Definition: pixfmt.h:93
IEEE-754 single precision planar GBR 4:4:4, 96bpp, big-endian.
Definition: pixfmt.h:314
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
Definition: pixfmt.h:193
static enum AVPixelFormat get_pix_fmt_internal(const char *name)
Definition: pixdesc.c:2287
DRM-managed buffers exposed through PRIME buffer sharing.
Definition: pixfmt.h:324
Not part of ABI.
Definition: pixfmt.h:470
"Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)"
Definition: pixfmt.h:459
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:240
int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt, int has_alpha)
Compute what kind of losses will occur when converting from one specific pixel format to another...
Definition: pixdesc.c:2662
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
Definition: pixfmt.h:218
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:236
Y , 9bpp, big-endian.
Definition: pixfmt.h:311
planar GBR 4:4:4 42bpp, big-endian
Definition: pixfmt.h:252
static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2531
SMPTE ST 428-1.
Definition: pixfmt.h:467
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
Definition: pixfmt.h:174
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined ...
Definition: pixfmt.h:109
#define snprintf
Definition: snprintf.h:34
Y , 14bpp, little-endian.
Definition: pixfmt.h:334
bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */
Definition: pixfmt.h:261
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
Definition: pixdesc.h:136
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer. ...
Definition: pixfmt.h:133
int shift
Number of least significant bits that must be shifted away to get the value.
Definition: pixdesc.h:53
void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4], const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component)
Read a line from an image, and write the values of the pixel format component c to dst...
Definition: pixdesc.c:34
int offset
Number of elements before the component of the first pixel.
Definition: pixdesc.h:47
hardware decoding through MediaCodec
Definition: pixfmt.h:289
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
Definition: pixfmt.h:183
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian , X=unused/undefined
Definition: pixfmt.h:103
bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */
Definition: pixfmt.h:262
Y , 10bpp, big-endian.
Definition: pixfmt.h:293
#define FF_COLOR_RGB
RGB color space.
Definition: pixdesc.c:2499
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, X=unused/undefined
Definition: pixfmt.h:138
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:159
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:131
Hardware surfaces for Direct3D11.
Definition: pixfmt.h:309
the normal 219*2^(n-8) "MPEG" YUV ranges
Definition: pixfmt.h:502
static FF_ENABLE_DEPRECATION_WARNINGS const char *const color_range_names[]
Definition: pixdesc.c:2214
ITU-R BT2020 constant luminance system.
Definition: pixfmt.h:489
#define X_NE(be, le)
Definition: pixdesc.c:2309
#define FF_LOSS_COLORSPACE
loss due to color space conversion
Definition: pixdesc.h:381
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
Definition: pixfmt.h:72
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:62
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:243
Y , 8bpp.
Definition: pixfmt.h:70
IEC 61966-2-1 (sRGB or sYCC)
Definition: pixfmt.h:462
#define FF_DISABLE_DEPRECATION_WARNINGS
Definition: internal.h:84
common internal and external API header
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
Definition: pixfmt.h:71
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:211
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, little-endian.
Definition: pixfmt.h:317
planar GBR 4:4:4 27bpp, little-endian
Definition: pixfmt.h:167
static double c[64]
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
Definition: pixdesc.c:2753
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:98
also ITU-R BT470BG
Definition: pixfmt.h:454
#define AV_WL16(p, v)
Definition: intreadwrite.h:412
SMPTE 2085, Y'D'zD'x.
Definition: pixfmt.h:490
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:129
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:76
bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */
Definition: pixfmt.h:257
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
Definition: pixfmt.h:82
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:69
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:197
static const char *const color_primaries_names[AVCOL_PRI_NB]
Definition: pixdesc.c:2220
enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
Compute what kind of losses will occur when converting from one specific pixel format to another...
Definition: pixdesc.c:2673
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:181
#define AV_PIX_FMT_FLAG_BE
Pixel format is big-endian.
Definition: pixdesc.h:128
ARIB STD-B67, known as "Hybrid log-gamma".
Definition: pixfmt.h:469
#define FF_LOSS_RESOLUTION
loss due to resolution change
Definition: pixdesc.h:379
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, big-endian.
Definition: pixfmt.h:316
#define FF_PSEUDOPAL
Definition: internal.h:367
pixel format definitions
packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as lit...
Definition: pixfmt.h:195
packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
Definition: pixfmt.h:276
#define FF_ENABLE_DEPRECATION_WARNINGS
Definition: internal.h:85
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:249
int len
Y , 14bpp, big-endian.
Definition: pixfmt.h:333
Y , 16bpp, little-endian.
Definition: pixfmt.h:94
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:254
Not part of ABI.
Definition: pixfmt.h:530
16 bits gray, 16 bits alpha (little-endian)
Definition: pixfmt.h:209
#define FF_COLOR_NA
Definition: pixdesc.c:2498
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
Definition: pixfmt.h:182
Y , 12bpp, big-endian.
Definition: pixfmt.h:291
ITU-R BT2020 for 10-bit system.
Definition: pixfmt.h:463
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: pixfmt.h:432
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian , X=unused/undefined
Definition: pixfmt.h:108
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
Definition: pixfmt.h:336
ITU-R BT2020.
Definition: pixfmt.h:435
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:95
#define FF_LOSS_COLORQUANT
loss due to color quantization
Definition: pixdesc.h:383
AVChromaLocation
Location of chroma samples.
Definition: pixfmt.h:522
HW decoding through Direct3D11 via old API, Picture.data[3] contains a ID3D11VideoDecoderOutputView p...
Definition: pixfmt.h:225
planar GBR 4:4:4 48bpp, little-endian
Definition: pixfmt.h:171
void ff_check_pixfmt_descriptors(void)
Definition: pixdesc.c:2439
MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0.
Definition: pixfmt.h:525
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, X=unused/undefined ...
Definition: pixfmt.h:137
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
Definition: pixdesc.c:2312
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
Definition: pixdesc.c:2300
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
Definition: pixfmt.h:177
int depth
Number of bits in the component.
Definition: pixdesc.h:58
interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian ...
Definition: pixfmt.h:198
HW acceleration though MMAL, data[3] contains a pointer to the MMAL_BUFFER_HEADER_T structure...
Definition: pixfmt.h:223
planar GBRA 4:4:4:4 64bpp, little-endian
Definition: pixfmt.h:213
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
Definition: pixfmt.h:233
packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
Definition: pixfmt.h:78
int av_color_space_from_name(const char *name)
Definition: pixdesc.c:2783
float min
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.
Definition: pixdesc.h:144
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:238
Not part of ABI.
Definition: pixfmt.h:494
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:160
for(j=16;j >0;--j)
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:242
planar GBR 4:4:4 30bpp, little-endian
Definition: pixfmt.h:169
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:202
int step
Number of elements between 2 horizontally consecutive pixels.
Definition: pixdesc.h:41
packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
Definition: pixfmt.h:275
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.
Definition: pixdesc.c:2391
const char * name
Definition: opengl_enc.c:103
"Logarithmic transfer characteristic (100:1 range)"
Definition: pixfmt.h:458
#define FF_COLOR_GRAY
gray color space
Definition: pixdesc.c:2500
static uint8_t tmp[11]
Definition: aes_ctr.c:26
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:156