FFmpeg  4.0
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  },
291  .flags = AV_PIX_FMT_FLAG_PAL,
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_GRAY16BE] = {
615  .name = "gray16be",
616  .nb_components = 1,
617  .log2_chroma_w = 0,
618  .log2_chroma_h = 0,
619  .comp = {
620  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
621  },
622  .flags = AV_PIX_FMT_FLAG_BE,
623  .alias = "y16be",
624  },
625  [AV_PIX_FMT_GRAY16LE] = {
626  .name = "gray16le",
627  .nb_components = 1,
628  .log2_chroma_w = 0,
629  .log2_chroma_h = 0,
630  .comp = {
631  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
632  },
633  .alias = "y16le",
634  },
635  [AV_PIX_FMT_YUV440P] = {
636  .name = "yuv440p",
637  .nb_components = 3,
638  .log2_chroma_w = 0,
639  .log2_chroma_h = 1,
640  .comp = {
641  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
642  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
643  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
644  },
645  .flags = AV_PIX_FMT_FLAG_PLANAR,
646  },
647  [AV_PIX_FMT_YUVJ440P] = {
648  .name = "yuvj440p",
649  .nb_components = 3,
650  .log2_chroma_w = 0,
651  .log2_chroma_h = 1,
652  .comp = {
653  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
654  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
655  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
656  },
657  .flags = AV_PIX_FMT_FLAG_PLANAR,
658  },
660  .name = "yuv440p10le",
661  .nb_components = 3,
662  .log2_chroma_w = 0,
663  .log2_chroma_h = 1,
664  .comp = {
665  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
666  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
667  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
668  },
669  .flags = AV_PIX_FMT_FLAG_PLANAR,
670  },
672  .name = "yuv440p10be",
673  .nb_components = 3,
674  .log2_chroma_w = 0,
675  .log2_chroma_h = 1,
676  .comp = {
677  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
678  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
679  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
680  },
682  },
684  .name = "yuv440p12le",
685  .nb_components = 3,
686  .log2_chroma_w = 0,
687  .log2_chroma_h = 1,
688  .comp = {
689  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
690  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
691  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
692  },
693  .flags = AV_PIX_FMT_FLAG_PLANAR,
694  },
696  .name = "yuv440p12be",
697  .nb_components = 3,
698  .log2_chroma_w = 0,
699  .log2_chroma_h = 1,
700  .comp = {
701  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
702  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
703  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
704  },
706  },
707  [AV_PIX_FMT_YUVA420P] = {
708  .name = "yuva420p",
709  .nb_components = 4,
710  .log2_chroma_w = 1,
711  .log2_chroma_h = 1,
712  .comp = {
713  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
714  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
715  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
716  { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
717  },
719  },
720  [AV_PIX_FMT_YUVA422P] = {
721  .name = "yuva422p",
722  .nb_components = 4,
723  .log2_chroma_w = 1,
724  .log2_chroma_h = 0,
725  .comp = {
726  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
727  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
728  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
729  { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
730  },
732  },
733  [AV_PIX_FMT_YUVA444P] = {
734  .name = "yuva444p",
735  .nb_components = 4,
736  .log2_chroma_w = 0,
737  .log2_chroma_h = 0,
738  .comp = {
739  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
740  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
741  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
742  { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
743  },
745  },
747  .name = "yuva420p9be",
748  .nb_components = 4,
749  .log2_chroma_w = 1,
750  .log2_chroma_h = 1,
751  .comp = {
752  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
753  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
754  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
755  { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
756  },
758  },
760  .name = "yuva420p9le",
761  .nb_components = 4,
762  .log2_chroma_w = 1,
763  .log2_chroma_h = 1,
764  .comp = {
765  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
766  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
767  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
768  { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
769  },
771  },
773  .name = "yuva422p9be",
774  .nb_components = 4,
775  .log2_chroma_w = 1,
776  .log2_chroma_h = 0,
777  .comp = {
778  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
779  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
780  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
781  { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
782  },
784  },
786  .name = "yuva422p9le",
787  .nb_components = 4,
788  .log2_chroma_w = 1,
789  .log2_chroma_h = 0,
790  .comp = {
791  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
792  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
793  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
794  { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
795  },
797  },
799  .name = "yuva444p9be",
800  .nb_components = 4,
801  .log2_chroma_w = 0,
802  .log2_chroma_h = 0,
803  .comp = {
804  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
805  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
806  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
807  { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
808  },
810  },
812  .name = "yuva444p9le",
813  .nb_components = 4,
814  .log2_chroma_w = 0,
815  .log2_chroma_h = 0,
816  .comp = {
817  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
818  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
819  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
820  { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
821  },
823  },
825  .name = "yuva420p10be",
826  .nb_components = 4,
827  .log2_chroma_w = 1,
828  .log2_chroma_h = 1,
829  .comp = {
830  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
831  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
832  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
833  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
834  },
836  },
838  .name = "yuva420p10le",
839  .nb_components = 4,
840  .log2_chroma_w = 1,
841  .log2_chroma_h = 1,
842  .comp = {
843  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
844  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
845  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
846  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
847  },
849  },
851  .name = "yuva422p10be",
852  .nb_components = 4,
853  .log2_chroma_w = 1,
854  .log2_chroma_h = 0,
855  .comp = {
856  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
857  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
858  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
859  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
860  },
862  },
864  .name = "yuva422p10le",
865  .nb_components = 4,
866  .log2_chroma_w = 1,
867  .log2_chroma_h = 0,
868  .comp = {
869  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
870  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
871  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
872  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
873  },
875  },
877  .name = "yuva444p10be",
878  .nb_components = 4,
879  .log2_chroma_w = 0,
880  .log2_chroma_h = 0,
881  .comp = {
882  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
883  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
884  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
885  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
886  },
888  },
890  .name = "yuva444p10le",
891  .nb_components = 4,
892  .log2_chroma_w = 0,
893  .log2_chroma_h = 0,
894  .comp = {
895  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
896  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
897  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
898  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
899  },
901  },
903  .name = "yuva420p16be",
904  .nb_components = 4,
905  .log2_chroma_w = 1,
906  .log2_chroma_h = 1,
907  .comp = {
908  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
909  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
910  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
911  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
912  },
914  },
916  .name = "yuva420p16le",
917  .nb_components = 4,
918  .log2_chroma_w = 1,
919  .log2_chroma_h = 1,
920  .comp = {
921  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
922  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
923  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
924  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
925  },
927  },
929  .name = "yuva422p16be",
930  .nb_components = 4,
931  .log2_chroma_w = 1,
932  .log2_chroma_h = 0,
933  .comp = {
934  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
935  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
936  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
937  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
938  },
940  },
942  .name = "yuva422p16le",
943  .nb_components = 4,
944  .log2_chroma_w = 1,
945  .log2_chroma_h = 0,
946  .comp = {
947  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
948  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
949  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
950  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
951  },
953  },
955  .name = "yuva444p16be",
956  .nb_components = 4,
957  .log2_chroma_w = 0,
958  .log2_chroma_h = 0,
959  .comp = {
960  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
961  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
962  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
963  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
964  },
966  },
968  .name = "yuva444p16le",
969  .nb_components = 4,
970  .log2_chroma_w = 0,
971  .log2_chroma_h = 0,
972  .comp = {
973  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
974  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
975  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
976  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
977  },
979  },
980  [AV_PIX_FMT_RGB48BE] = {
981  .name = "rgb48be",
982  .nb_components = 3,
983  .log2_chroma_w = 0,
984  .log2_chroma_h = 0,
985  .comp = {
986  { 0, 6, 0, 0, 16, 5, 15, 1 }, /* R */
987  { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
988  { 0, 6, 4, 0, 16, 5, 15, 5 }, /* B */
989  },
991  },
992  [AV_PIX_FMT_RGB48LE] = {
993  .name = "rgb48le",
994  .nb_components = 3,
995  .log2_chroma_w = 0,
996  .log2_chroma_h = 0,
997  .comp = {
998  { 0, 6, 0, 0, 16, 5, 15, 1 }, /* R */
999  { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
1000  { 0, 6, 4, 0, 16, 5, 15, 5 }, /* B */
1001  },
1002  .flags = AV_PIX_FMT_FLAG_RGB,
1003  },
1004  [AV_PIX_FMT_RGBA64BE] = {
1005  .name = "rgba64be",
1006  .nb_components = 4,
1007  .log2_chroma_w = 0,
1008  .log2_chroma_h = 0,
1009  .comp = {
1010  { 0, 8, 0, 0, 16, 7, 15, 1 }, /* R */
1011  { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
1012  { 0, 8, 4, 0, 16, 7, 15, 5 }, /* B */
1013  { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1014  },
1016  },
1017  [AV_PIX_FMT_RGBA64LE] = {
1018  .name = "rgba64le",
1019  .nb_components = 4,
1020  .log2_chroma_w = 0,
1021  .log2_chroma_h = 0,
1022  .comp = {
1023  { 0, 8, 0, 0, 16, 7, 15, 1 }, /* R */
1024  { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
1025  { 0, 8, 4, 0, 16, 7, 15, 5 }, /* B */
1026  { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1027  },
1029  },
1030  [AV_PIX_FMT_RGB565BE] = {
1031  .name = "rgb565be",
1032  .nb_components = 3,
1033  .log2_chroma_w = 0,
1034  .log2_chroma_h = 0,
1035  .comp = {
1036  { 0, 2, -1, 3, 5, 1, 4, 0 }, /* R */
1037  { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
1038  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
1039  },
1041  },
1042  [AV_PIX_FMT_RGB565LE] = {
1043  .name = "rgb565le",
1044  .nb_components = 3,
1045  .log2_chroma_w = 0,
1046  .log2_chroma_h = 0,
1047  .comp = {
1048  { 0, 2, 1, 3, 5, 1, 4, 2 }, /* R */
1049  { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
1050  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
1051  },
1052  .flags = AV_PIX_FMT_FLAG_RGB,
1053  },
1054  [AV_PIX_FMT_RGB555BE] = {
1055  .name = "rgb555be",
1056  .nb_components = 3,
1057  .log2_chroma_w = 0,
1058  .log2_chroma_h = 0,
1059  .comp = {
1060  { 0, 2, -1, 2, 5, 1, 4, 0 }, /* R */
1061  { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
1062  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
1063  },
1065  },
1066  [AV_PIX_FMT_RGB555LE] = {
1067  .name = "rgb555le",
1068  .nb_components = 3,
1069  .log2_chroma_w = 0,
1070  .log2_chroma_h = 0,
1071  .comp = {
1072  { 0, 2, 1, 2, 5, 1, 4, 2 }, /* R */
1073  { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
1074  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
1075  },
1076  .flags = AV_PIX_FMT_FLAG_RGB,
1077  },
1078  [AV_PIX_FMT_RGB444BE] = {
1079  .name = "rgb444be",
1080  .nb_components = 3,
1081  .log2_chroma_w = 0,
1082  .log2_chroma_h = 0,
1083  .comp = {
1084  { 0, 2, -1, 0, 4, 1, 3, 0 }, /* R */
1085  { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
1086  { 0, 2, 0, 0, 4, 1, 3, 1 }, /* B */
1087  },
1089  },
1090  [AV_PIX_FMT_RGB444LE] = {
1091  .name = "rgb444le",
1092  .nb_components = 3,
1093  .log2_chroma_w = 0,
1094  .log2_chroma_h = 0,
1095  .comp = {
1096  { 0, 2, 1, 0, 4, 1, 3, 2 }, /* R */
1097  { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
1098  { 0, 2, 0, 0, 4, 1, 3, 1 }, /* B */
1099  },
1100  .flags = AV_PIX_FMT_FLAG_RGB,
1101  },
1102  [AV_PIX_FMT_BGR48BE] = {
1103  .name = "bgr48be",
1104  .nb_components = 3,
1105  .log2_chroma_w = 0,
1106  .log2_chroma_h = 0,
1107  .comp = {
1108  { 0, 6, 4, 0, 16, 5, 15, 5 }, /* R */
1109  { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
1110  { 0, 6, 0, 0, 16, 5, 15, 1 }, /* B */
1111  },
1113  },
1114  [AV_PIX_FMT_BGR48LE] = {
1115  .name = "bgr48le",
1116  .nb_components = 3,
1117  .log2_chroma_w = 0,
1118  .log2_chroma_h = 0,
1119  .comp = {
1120  { 0, 6, 4, 0, 16, 5, 15, 5 }, /* R */
1121  { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
1122  { 0, 6, 0, 0, 16, 5, 15, 1 }, /* B */
1123  },
1124  .flags = AV_PIX_FMT_FLAG_RGB,
1125  },
1126  [AV_PIX_FMT_BGRA64BE] = {
1127  .name = "bgra64be",
1128  .nb_components = 4,
1129  .log2_chroma_w = 0,
1130  .log2_chroma_h = 0,
1131  .comp = {
1132  { 0, 8, 4, 0, 16, 7, 15, 5 }, /* R */
1133  { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
1134  { 0, 8, 0, 0, 16, 7, 15, 1 }, /* B */
1135  { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1136  },
1138  },
1139  [AV_PIX_FMT_BGRA64LE] = {
1140  .name = "bgra64le",
1141  .nb_components = 4,
1142  .log2_chroma_w = 0,
1143  .log2_chroma_h = 0,
1144  .comp = {
1145  { 0, 8, 4, 0, 16, 7, 15, 5 }, /* R */
1146  { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
1147  { 0, 8, 0, 0, 16, 7, 15, 1 }, /* B */
1148  { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1149  },
1151  },
1152  [AV_PIX_FMT_BGR565BE] = {
1153  .name = "bgr565be",
1154  .nb_components = 3,
1155  .log2_chroma_w = 0,
1156  .log2_chroma_h = 0,
1157  .comp = {
1158  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
1159  { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
1160  { 0, 2, -1, 3, 5, 1, 4, 0 }, /* B */
1161  },
1163  },
1164  [AV_PIX_FMT_BGR565LE] = {
1165  .name = "bgr565le",
1166  .nb_components = 3,
1167  .log2_chroma_w = 0,
1168  .log2_chroma_h = 0,
1169  .comp = {
1170  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
1171  { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
1172  { 0, 2, 1, 3, 5, 1, 4, 2 }, /* B */
1173  },
1174  .flags = AV_PIX_FMT_FLAG_RGB,
1175  },
1176  [AV_PIX_FMT_BGR555BE] = {
1177  .name = "bgr555be",
1178  .nb_components = 3,
1179  .log2_chroma_w = 0,
1180  .log2_chroma_h = 0,
1181  .comp = {
1182  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
1183  { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
1184  { 0, 2, -1, 2, 5, 1, 4, 0 }, /* B */
1185  },
1187  },
1188  [AV_PIX_FMT_BGR555LE] = {
1189  .name = "bgr555le",
1190  .nb_components = 3,
1191  .log2_chroma_w = 0,
1192  .log2_chroma_h = 0,
1193  .comp = {
1194  { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
1195  { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
1196  { 0, 2, 1, 2, 5, 1, 4, 2 }, /* B */
1197  },
1198  .flags = AV_PIX_FMT_FLAG_RGB,
1199  },
1200  [AV_PIX_FMT_BGR444BE] = {
1201  .name = "bgr444be",
1202  .nb_components = 3,
1203  .log2_chroma_w = 0,
1204  .log2_chroma_h = 0,
1205  .comp = {
1206  { 0, 2, 0, 0, 4, 1, 3, 1 }, /* R */
1207  { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
1208  { 0, 2, -1, 0, 4, 1, 3, 0 }, /* B */
1209  },
1211  },
1212  [AV_PIX_FMT_BGR444LE] = {
1213  .name = "bgr444le",
1214  .nb_components = 3,
1215  .log2_chroma_w = 0,
1216  .log2_chroma_h = 0,
1217  .comp = {
1218  { 0, 2, 0, 0, 4, 1, 3, 1 }, /* R */
1219  { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
1220  { 0, 2, 1, 0, 4, 1, 3, 2 }, /* B */
1221  },
1222  .flags = AV_PIX_FMT_FLAG_RGB,
1223  },
1224 #if FF_API_VAAPI
1225  [AV_PIX_FMT_VAAPI_MOCO] = {
1226  .name = "vaapi_moco",
1227  .log2_chroma_w = 1,
1228  .log2_chroma_h = 1,
1229  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1230  },
1231  [AV_PIX_FMT_VAAPI_IDCT] = {
1232  .name = "vaapi_idct",
1233  .log2_chroma_w = 1,
1234  .log2_chroma_h = 1,
1235  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1236  },
1237  [AV_PIX_FMT_VAAPI_VLD] = {
1238  .name = "vaapi_vld",
1239  .log2_chroma_w = 1,
1240  .log2_chroma_h = 1,
1241  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1242  },
1243 #else
1244  [AV_PIX_FMT_VAAPI] = {
1245  .name = "vaapi",
1246  .log2_chroma_w = 1,
1247  .log2_chroma_h = 1,
1248  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1249  },
1250 #endif
1251  [AV_PIX_FMT_YUV420P9LE] = {
1252  .name = "yuv420p9le",
1253  .nb_components = 3,
1254  .log2_chroma_w = 1,
1255  .log2_chroma_h = 1,
1256  .comp = {
1257  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1258  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1259  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1260  },
1261  .flags = AV_PIX_FMT_FLAG_PLANAR,
1262  },
1263  [AV_PIX_FMT_YUV420P9BE] = {
1264  .name = "yuv420p9be",
1265  .nb_components = 3,
1266  .log2_chroma_w = 1,
1267  .log2_chroma_h = 1,
1268  .comp = {
1269  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1270  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1271  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1272  },
1274  },
1276  .name = "yuv420p10le",
1277  .nb_components = 3,
1278  .log2_chroma_w = 1,
1279  .log2_chroma_h = 1,
1280  .comp = {
1281  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1282  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1283  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1284  },
1285  .flags = AV_PIX_FMT_FLAG_PLANAR,
1286  },
1288  .name = "yuv420p10be",
1289  .nb_components = 3,
1290  .log2_chroma_w = 1,
1291  .log2_chroma_h = 1,
1292  .comp = {
1293  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1294  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1295  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1296  },
1298  },
1300  .name = "yuv420p12le",
1301  .nb_components = 3,
1302  .log2_chroma_w = 1,
1303  .log2_chroma_h = 1,
1304  .comp = {
1305  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1306  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1307  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1308  },
1309  .flags = AV_PIX_FMT_FLAG_PLANAR,
1310  },
1312  .name = "yuv420p12be",
1313  .nb_components = 3,
1314  .log2_chroma_w = 1,
1315  .log2_chroma_h = 1,
1316  .comp = {
1317  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1318  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1319  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1320  },
1322  },
1324  .name = "yuv420p14le",
1325  .nb_components = 3,
1326  .log2_chroma_w = 1,
1327  .log2_chroma_h = 1,
1328  .comp = {
1329  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
1330  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
1331  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
1332  },
1333  .flags = AV_PIX_FMT_FLAG_PLANAR,
1334  },
1336  .name = "yuv420p14be",
1337  .nb_components = 3,
1338  .log2_chroma_w = 1,
1339  .log2_chroma_h = 1,
1340  .comp = {
1341  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
1342  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
1343  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
1344  },
1346  },
1348  .name = "yuv420p16le",
1349  .nb_components = 3,
1350  .log2_chroma_w = 1,
1351  .log2_chroma_h = 1,
1352  .comp = {
1353  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1354  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1355  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1356  },
1357  .flags = AV_PIX_FMT_FLAG_PLANAR,
1358  },
1360  .name = "yuv420p16be",
1361  .nb_components = 3,
1362  .log2_chroma_w = 1,
1363  .log2_chroma_h = 1,
1364  .comp = {
1365  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1366  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1367  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1368  },
1370  },
1371  [AV_PIX_FMT_YUV422P9LE] = {
1372  .name = "yuv422p9le",
1373  .nb_components = 3,
1374  .log2_chroma_w = 1,
1375  .log2_chroma_h = 0,
1376  .comp = {
1377  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1378  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1379  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1380  },
1381  .flags = AV_PIX_FMT_FLAG_PLANAR,
1382  },
1383  [AV_PIX_FMT_YUV422P9BE] = {
1384  .name = "yuv422p9be",
1385  .nb_components = 3,
1386  .log2_chroma_w = 1,
1387  .log2_chroma_h = 0,
1388  .comp = {
1389  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1390  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1391  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1392  },
1394  },
1396  .name = "yuv422p10le",
1397  .nb_components = 3,
1398  .log2_chroma_w = 1,
1399  .log2_chroma_h = 0,
1400  .comp = {
1401  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1402  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1403  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1404  },
1405  .flags = AV_PIX_FMT_FLAG_PLANAR,
1406  },
1408  .name = "yuv422p10be",
1409  .nb_components = 3,
1410  .log2_chroma_w = 1,
1411  .log2_chroma_h = 0,
1412  .comp = {
1413  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1414  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1415  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1416  },
1418  },
1420  .name = "yuv422p12le",
1421  .nb_components = 3,
1422  .log2_chroma_w = 1,
1423  .log2_chroma_h = 0,
1424  .comp = {
1425  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1426  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1427  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1428  },
1429  .flags = AV_PIX_FMT_FLAG_PLANAR,
1430  },
1432  .name = "yuv422p12be",
1433  .nb_components = 3,
1434  .log2_chroma_w = 1,
1435  .log2_chroma_h = 0,
1436  .comp = {
1437  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1438  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1439  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1440  },
1442  },
1444  .name = "yuv422p14le",
1445  .nb_components = 3,
1446  .log2_chroma_w = 1,
1447  .log2_chroma_h = 0,
1448  .comp = {
1449  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
1450  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
1451  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
1452  },
1453  .flags = AV_PIX_FMT_FLAG_PLANAR,
1454  },
1456  .name = "yuv422p14be",
1457  .nb_components = 3,
1458  .log2_chroma_w = 1,
1459  .log2_chroma_h = 0,
1460  .comp = {
1461  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
1462  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
1463  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
1464  },
1466  },
1468  .name = "yuv422p16le",
1469  .nb_components = 3,
1470  .log2_chroma_w = 1,
1471  .log2_chroma_h = 0,
1472  .comp = {
1473  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1474  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1475  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1476  },
1477  .flags = AV_PIX_FMT_FLAG_PLANAR,
1478  },
1480  .name = "yuv422p16be",
1481  .nb_components = 3,
1482  .log2_chroma_w = 1,
1483  .log2_chroma_h = 0,
1484  .comp = {
1485  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1486  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1487  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1488  },
1490  },
1492  .name = "yuv444p16le",
1493  .nb_components = 3,
1494  .log2_chroma_w = 0,
1495  .log2_chroma_h = 0,
1496  .comp = {
1497  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1498  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1499  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1500  },
1501  .flags = AV_PIX_FMT_FLAG_PLANAR,
1502  },
1504  .name = "yuv444p16be",
1505  .nb_components = 3,
1506  .log2_chroma_w = 0,
1507  .log2_chroma_h = 0,
1508  .comp = {
1509  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1510  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1511  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1512  },
1514  },
1516  .name = "yuv444p10le",
1517  .nb_components = 3,
1518  .log2_chroma_w = 0,
1519  .log2_chroma_h = 0,
1520  .comp = {
1521  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1522  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1523  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1524  },
1525  .flags = AV_PIX_FMT_FLAG_PLANAR,
1526  },
1528  .name = "yuv444p10be",
1529  .nb_components = 3,
1530  .log2_chroma_w = 0,
1531  .log2_chroma_h = 0,
1532  .comp = {
1533  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1534  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1535  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1536  },
1538  },
1539  [AV_PIX_FMT_YUV444P9LE] = {
1540  .name = "yuv444p9le",
1541  .nb_components = 3,
1542  .log2_chroma_w = 0,
1543  .log2_chroma_h = 0,
1544  .comp = {
1545  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1546  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1547  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1548  },
1549  .flags = AV_PIX_FMT_FLAG_PLANAR,
1550  },
1551  [AV_PIX_FMT_YUV444P9BE] = {
1552  .name = "yuv444p9be",
1553  .nb_components = 3,
1554  .log2_chroma_w = 0,
1555  .log2_chroma_h = 0,
1556  .comp = {
1557  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1558  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1559  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1560  },
1562  },
1564  .name = "yuv444p12le",
1565  .nb_components = 3,
1566  .log2_chroma_w = 0,
1567  .log2_chroma_h = 0,
1568  .comp = {
1569  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1570  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1571  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1572  },
1573  .flags = AV_PIX_FMT_FLAG_PLANAR,
1574  },
1576  .name = "yuv444p12be",
1577  .nb_components = 3,
1578  .log2_chroma_w = 0,
1579  .log2_chroma_h = 0,
1580  .comp = {
1581  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1582  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1583  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1584  },
1586  },
1588  .name = "yuv444p14le",
1589  .nb_components = 3,
1590  .log2_chroma_w = 0,
1591  .log2_chroma_h = 0,
1592  .comp = {
1593  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
1594  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
1595  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
1596  },
1597  .flags = AV_PIX_FMT_FLAG_PLANAR,
1598  },
1600  .name = "yuv444p14be",
1601  .nb_components = 3,
1602  .log2_chroma_w = 0,
1603  .log2_chroma_h = 0,
1604  .comp = {
1605  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
1606  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
1607  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
1608  },
1610  },
1612  .name = "d3d11va_vld",
1613  .log2_chroma_w = 1,
1614  .log2_chroma_h = 1,
1615  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1616  },
1617  [AV_PIX_FMT_DXVA2_VLD] = {
1618  .name = "dxva2_vld",
1619  .log2_chroma_w = 1,
1620  .log2_chroma_h = 1,
1621  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1622  },
1623  [AV_PIX_FMT_YA8] = {
1624  .name = "ya8",
1625  .nb_components = 2,
1626  .comp = {
1627  { 0, 2, 0, 0, 8, 1, 7, 1 }, /* Y */
1628  { 0, 2, 1, 0, 8, 1, 7, 2 }, /* A */
1629  },
1630  .flags = AV_PIX_FMT_FLAG_ALPHA,
1631  .alias = "gray8a",
1632  },
1633  [AV_PIX_FMT_YA16LE] = {
1634  .name = "ya16le",
1635  .nb_components = 2,
1636  .comp = {
1637  { 0, 4, 0, 0, 16, 3, 15, 1 }, /* Y */
1638  { 0, 4, 2, 0, 16, 3, 15, 3 }, /* A */
1639  },
1640  .flags = AV_PIX_FMT_FLAG_ALPHA,
1641  },
1642  [AV_PIX_FMT_YA16BE] = {
1643  .name = "ya16be",
1644  .nb_components = 2,
1645  .comp = {
1646  { 0, 4, 0, 0, 16, 3, 15, 1 }, /* Y */
1647  { 0, 4, 2, 0, 16, 3, 15, 3 }, /* A */
1648  },
1650  },
1652  .name = "videotoolbox_vld",
1653  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1654  },
1655  [AV_PIX_FMT_GBRP] = {
1656  .name = "gbrp",
1657  .nb_components = 3,
1658  .log2_chroma_w = 0,
1659  .log2_chroma_h = 0,
1660  .comp = {
1661  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* R */
1662  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* G */
1663  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* B */
1664  },
1666  },
1667  [AV_PIX_FMT_GBRP9LE] = {
1668  .name = "gbrp9le",
1669  .nb_components = 3,
1670  .log2_chroma_w = 0,
1671  .log2_chroma_h = 0,
1672  .comp = {
1673  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* R */
1674  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* G */
1675  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* B */
1676  },
1678  },
1679  [AV_PIX_FMT_GBRP9BE] = {
1680  .name = "gbrp9be",
1681  .nb_components = 3,
1682  .log2_chroma_w = 0,
1683  .log2_chroma_h = 0,
1684  .comp = {
1685  { 2, 2, 0, 0, 9, 1, 8, 1 }, /* R */
1686  { 0, 2, 0, 0, 9, 1, 8, 1 }, /* G */
1687  { 1, 2, 0, 0, 9, 1, 8, 1 }, /* B */
1688  },
1690  },
1691  [AV_PIX_FMT_GBRP10LE] = {
1692  .name = "gbrp10le",
1693  .nb_components = 3,
1694  .log2_chroma_w = 0,
1695  .log2_chroma_h = 0,
1696  .comp = {
1697  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
1698  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
1699  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
1700  },
1702  },
1703  [AV_PIX_FMT_GBRP10BE] = {
1704  .name = "gbrp10be",
1705  .nb_components = 3,
1706  .log2_chroma_w = 0,
1707  .log2_chroma_h = 0,
1708  .comp = {
1709  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
1710  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
1711  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
1712  },
1714  },
1715  [AV_PIX_FMT_GBRP12LE] = {
1716  .name = "gbrp12le",
1717  .nb_components = 3,
1718  .log2_chroma_w = 0,
1719  .log2_chroma_h = 0,
1720  .comp = {
1721  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1722  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1723  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1724  },
1726  },
1727  [AV_PIX_FMT_GBRP12BE] = {
1728  .name = "gbrp12be",
1729  .nb_components = 3,
1730  .log2_chroma_w = 0,
1731  .log2_chroma_h = 0,
1732  .comp = {
1733  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1734  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1735  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1736  },
1738  },
1739  [AV_PIX_FMT_GBRP14LE] = {
1740  .name = "gbrp14le",
1741  .nb_components = 3,
1742  .log2_chroma_w = 0,
1743  .log2_chroma_h = 0,
1744  .comp = {
1745  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* R */
1746  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* G */
1747  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* B */
1748  },
1750  },
1751  [AV_PIX_FMT_GBRP14BE] = {
1752  .name = "gbrp14be",
1753  .nb_components = 3,
1754  .log2_chroma_w = 0,
1755  .log2_chroma_h = 0,
1756  .comp = {
1757  { 2, 2, 0, 0, 14, 1, 13, 1 }, /* R */
1758  { 0, 2, 0, 0, 14, 1, 13, 1 }, /* G */
1759  { 1, 2, 0, 0, 14, 1, 13, 1 }, /* B */
1760  },
1762  },
1763  [AV_PIX_FMT_GBRP16LE] = {
1764  .name = "gbrp16le",
1765  .nb_components = 3,
1766  .log2_chroma_w = 0,
1767  .log2_chroma_h = 0,
1768  .comp = {
1769  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
1770  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1771  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
1772  },
1774  },
1775  [AV_PIX_FMT_GBRP16BE] = {
1776  .name = "gbrp16be",
1777  .nb_components = 3,
1778  .log2_chroma_w = 0,
1779  .log2_chroma_h = 0,
1780  .comp = {
1781  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
1782  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1783  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
1784  },
1786  },
1787  [AV_PIX_FMT_GBRAP] = {
1788  .name = "gbrap",
1789  .nb_components = 4,
1790  .log2_chroma_w = 0,
1791  .log2_chroma_h = 0,
1792  .comp = {
1793  { 2, 1, 0, 0, 8, 0, 7, 1 }, /* R */
1794  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* G */
1795  { 1, 1, 0, 0, 8, 0, 7, 1 }, /* B */
1796  { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
1797  },
1800  },
1801  [AV_PIX_FMT_GBRAP16LE] = {
1802  .name = "gbrap16le",
1803  .nb_components = 4,
1804  .log2_chroma_w = 0,
1805  .log2_chroma_h = 0,
1806  .comp = {
1807  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
1808  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1809  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
1810  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
1811  },
1814  },
1815  [AV_PIX_FMT_GBRAP16BE] = {
1816  .name = "gbrap16be",
1817  .nb_components = 4,
1818  .log2_chroma_w = 0,
1819  .log2_chroma_h = 0,
1820  .comp = {
1821  { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
1822  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1823  { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
1824  { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
1825  },
1828  },
1829  [AV_PIX_FMT_VDPAU] = {
1830  .name = "vdpau",
1831  .log2_chroma_w = 1,
1832  .log2_chroma_h = 1,
1833  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1834  },
1835  [AV_PIX_FMT_XYZ12LE] = {
1836  .name = "xyz12le",
1837  .nb_components = 3,
1838  .log2_chroma_w = 0,
1839  .log2_chroma_h = 0,
1840  .comp = {
1841  { 0, 6, 0, 4, 12, 5, 11, 1 }, /* X */
1842  { 0, 6, 2, 4, 12, 5, 11, 3 }, /* Y */
1843  { 0, 6, 4, 4, 12, 5, 11, 5 }, /* Z */
1844  },
1845  /*.flags = -- not used*/
1846  },
1847  [AV_PIX_FMT_XYZ12BE] = {
1848  .name = "xyz12be",
1849  .nb_components = 3,
1850  .log2_chroma_w = 0,
1851  .log2_chroma_h = 0,
1852  .comp = {
1853  { 0, 6, 0, 4, 12, 5, 11, 1 }, /* X */
1854  { 0, 6, 2, 4, 12, 5, 11, 3 }, /* Y */
1855  { 0, 6, 4, 4, 12, 5, 11, 5 }, /* Z */
1856  },
1857  .flags = AV_PIX_FMT_FLAG_BE,
1858  },
1859 
1860 #define BAYER8_DESC_COMMON \
1861  .nb_components= 3, \
1862  .log2_chroma_w= 0, \
1863  .log2_chroma_h= 0, \
1864  .comp = { \
1865  {0,1,0,0,2,0,1,1},\
1866  {0,1,0,0,4,0,3,1},\
1867  {0,1,0,0,2,0,1,1},\
1868  }, \
1869 
1870 #define BAYER16_DESC_COMMON \
1871  .nb_components= 3, \
1872  .log2_chroma_w= 0, \
1873  .log2_chroma_h= 0, \
1874  .comp = { \
1875  {0,2,0,0,4,1,3,1},\
1876  {0,2,0,0,8,1,7,1},\
1877  {0,2,0,0,4,1,3,1},\
1878  }, \
1879 
1881  .name = "bayer_bggr8",
1884  },
1886  .name = "bayer_bggr16le",
1889  },
1891  .name = "bayer_bggr16be",
1894  },
1896  .name = "bayer_rggb8",
1899  },
1901  .name = "bayer_rggb16le",
1904  },
1906  .name = "bayer_rggb16be",
1909  },
1911  .name = "bayer_gbrg8",
1914  },
1916  .name = "bayer_gbrg16le",
1919  },
1921  .name = "bayer_gbrg16be",
1924  },
1926  .name = "bayer_grbg8",
1929  },
1931  .name = "bayer_grbg16le",
1934  },
1936  .name = "bayer_grbg16be",
1939  },
1940  [AV_PIX_FMT_NV16] = {
1941  .name = "nv16",
1942  .nb_components = 3,
1943  .log2_chroma_w = 1,
1944  .log2_chroma_h = 0,
1945  .comp = {
1946  { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
1947  { 1, 2, 0, 0, 8, 1, 7, 1 }, /* U */
1948  { 1, 2, 1, 0, 8, 1, 7, 2 }, /* V */
1949  },
1950  .flags = AV_PIX_FMT_FLAG_PLANAR,
1951  },
1952  [AV_PIX_FMT_NV20LE] = {
1953  .name = "nv20le",
1954  .nb_components = 3,
1955  .log2_chroma_w = 1,
1956  .log2_chroma_h = 0,
1957  .comp = {
1958  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1959  { 1, 4, 0, 0, 10, 3, 9, 1 }, /* U */
1960  { 1, 4, 2, 0, 10, 3, 9, 3 }, /* V */
1961  },
1962  .flags = AV_PIX_FMT_FLAG_PLANAR,
1963  },
1964  [AV_PIX_FMT_NV20BE] = {
1965  .name = "nv20be",
1966  .nb_components = 3,
1967  .log2_chroma_w = 1,
1968  .log2_chroma_h = 0,
1969  .comp = {
1970  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1971  { 1, 4, 0, 0, 10, 3, 9, 1 }, /* U */
1972  { 1, 4, 2, 0, 10, 3, 9, 3 }, /* V */
1973  },
1975  },
1976  [AV_PIX_FMT_QSV] = {
1977  .name = "qsv",
1978  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1979  },
1980  [AV_PIX_FMT_MEDIACODEC] = {
1981  .name = "mediacodec",
1982  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1983  },
1984  [AV_PIX_FMT_MMAL] = {
1985  .name = "mmal",
1986  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1987  },
1988  [AV_PIX_FMT_CUDA] = {
1989  .name = "cuda",
1990  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1991  },
1992  [AV_PIX_FMT_AYUV64LE] = {
1993  .name = "ayuv64le",
1994  .nb_components = 4,
1995  .log2_chroma_w = 0,
1996  .log2_chroma_h = 0,
1997  .comp = {
1998  { 0, 8, 2, 0, 16, 7, 15, 3 }, /* Y */
1999  { 0, 8, 4, 0, 16, 7, 15, 5 }, /* U */
2000  { 0, 8, 6, 0, 16, 7, 15, 7 }, /* V */
2001  { 0, 8, 0, 0, 16, 7, 15, 1 }, /* A */
2002  },
2003  .flags = AV_PIX_FMT_FLAG_ALPHA,
2004  },
2005  [AV_PIX_FMT_AYUV64BE] = {
2006  .name = "ayuv64be",
2007  .nb_components = 4,
2008  .log2_chroma_w = 0,
2009  .log2_chroma_h = 0,
2010  .comp = {
2011  { 0, 8, 2, 0, 16, 7, 15, 3 }, /* Y */
2012  { 0, 8, 4, 0, 16, 7, 15, 5 }, /* U */
2013  { 0, 8, 6, 0, 16, 7, 15, 7 }, /* V */
2014  { 0, 8, 0, 0, 16, 7, 15, 1 }, /* A */
2015  },
2017  },
2018  [AV_PIX_FMT_P010LE] = {
2019  .name = "p010le",
2020  .nb_components = 3,
2021  .log2_chroma_w = 1,
2022  .log2_chroma_h = 1,
2023  .comp = {
2024  { 0, 2, 0, 6, 10, 1, 9, 1 }, /* Y */
2025  { 1, 4, 0, 6, 10, 3, 9, 1 }, /* U */
2026  { 1, 4, 2, 6, 10, 3, 9, 3 }, /* V */
2027  },
2028  .flags = AV_PIX_FMT_FLAG_PLANAR,
2029  },
2030  [AV_PIX_FMT_P010BE] = {
2031  .name = "p010be",
2032  .nb_components = 3,
2033  .log2_chroma_w = 1,
2034  .log2_chroma_h = 1,
2035  .comp = {
2036  { 0, 2, 0, 6, 10, 1, 9, 1 }, /* Y */
2037  { 1, 4, 0, 6, 10, 3, 9, 1 }, /* U */
2038  { 1, 4, 2, 6, 10, 3, 9, 3 }, /* V */
2039  },
2041  },
2042  [AV_PIX_FMT_P016LE] = {
2043  .name = "p016le",
2044  .nb_components = 3,
2045  .log2_chroma_w = 1,
2046  .log2_chroma_h = 1,
2047  .comp = {
2048  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
2049  { 1, 4, 0, 0, 16, 3, 15, 1 }, /* U */
2050  { 1, 4, 2, 0, 16, 3, 15, 3 }, /* V */
2051  },
2052  .flags = AV_PIX_FMT_FLAG_PLANAR,
2053  },
2054  [AV_PIX_FMT_P016BE] = {
2055  .name = "p016be",
2056  .nb_components = 3,
2057  .log2_chroma_w = 1,
2058  .log2_chroma_h = 1,
2059  .comp = {
2060  { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
2061  { 1, 4, 0, 0, 16, 3, 15, 1 }, /* U */
2062  { 1, 4, 2, 0, 16, 3, 15, 3 }, /* V */
2063  },
2065  },
2066  [AV_PIX_FMT_GBRAP12LE] = {
2067  .name = "gbrap12le",
2068  .nb_components = 4,
2069  .log2_chroma_w = 0,
2070  .log2_chroma_h = 0,
2071  .comp = {
2072  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
2073  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
2074  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
2075  { 3, 2, 0, 0, 12, 1, 11, 1 }, /* A */
2076  },
2079  },
2080  [AV_PIX_FMT_GBRAP12BE] = {
2081  .name = "gbrap12be",
2082  .nb_components = 4,
2083  .log2_chroma_w = 0,
2084  .log2_chroma_h = 0,
2085  .comp = {
2086  { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
2087  { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
2088  { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
2089  { 3, 2, 0, 0, 12, 1, 11, 1 }, /* A */
2090  },
2093  },
2094  [AV_PIX_FMT_GBRAP10LE] = {
2095  .name = "gbrap10le",
2096  .nb_components = 4,
2097  .log2_chroma_w = 0,
2098  .log2_chroma_h = 0,
2099  .comp = {
2100  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
2101  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
2102  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
2103  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
2104  },
2107  },
2108  [AV_PIX_FMT_GBRAP10BE] = {
2109  .name = "gbrap10be",
2110  .nb_components = 4,
2111  .log2_chroma_w = 0,
2112  .log2_chroma_h = 0,
2113  .comp = {
2114  { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
2115  { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
2116  { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
2117  { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
2118  },
2121  },
2122  [AV_PIX_FMT_D3D11] = {
2123  .name = "d3d11",
2124  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2125  },
2126  [AV_PIX_FMT_GBRPF32BE] = {
2127  .name = "gbrpf32be",
2128  .nb_components = 3,
2129  .log2_chroma_w = 0,
2130  .log2_chroma_h = 0,
2131  .comp = {
2132  { 2, 4, 0, 0, 32, 3, 31, 1 }, /* R */
2133  { 0, 4, 0, 0, 32, 3, 31, 1 }, /* G */
2134  { 1, 4, 0, 0, 32, 3, 31, 1 }, /* B */
2135  },
2138  },
2139  [AV_PIX_FMT_GBRPF32LE] = {
2140  .name = "gbrpf32le",
2141  .nb_components = 3,
2142  .log2_chroma_w = 0,
2143  .log2_chroma_h = 0,
2144  .comp = {
2145  { 2, 4, 0, 0, 32, 3, 31, 1 }, /* R */
2146  { 0, 4, 0, 0, 32, 3, 31, 1 }, /* G */
2147  { 1, 4, 0, 0, 32, 3, 31, 1 }, /* B */
2148  },
2150  },
2151  [AV_PIX_FMT_GBRAPF32BE] = {
2152  .name = "gbrapf32be",
2153  .nb_components = 4,
2154  .log2_chroma_w = 0,
2155  .log2_chroma_h = 0,
2156  .comp = {
2157  { 2, 4, 0, 0, 32, 3, 31, 1 }, /* R */
2158  { 0, 4, 0, 0, 32, 3, 31, 1 }, /* G */
2159  { 1, 4, 0, 0, 32, 3, 31, 1 }, /* B */
2160  { 3, 4, 0, 0, 32, 3, 31, 1 }, /* A */
2161  },
2165  },
2166  [AV_PIX_FMT_GBRAPF32LE] = {
2167  .name = "gbrapf32le",
2168  .nb_components = 4,
2169  .log2_chroma_w = 0,
2170  .log2_chroma_h = 0,
2171  .comp = {
2172  { 2, 4, 0, 0, 32, 3, 31, 1 }, /* R */
2173  { 0, 4, 0, 0, 32, 3, 31, 1 }, /* G */
2174  { 1, 4, 0, 0, 32, 3, 31, 1 }, /* B */
2175  { 3, 4, 0, 0, 32, 3, 31, 1 }, /* A */
2176  },
2179  },
2180  [AV_PIX_FMT_DRM_PRIME] = {
2181  .name = "drm_prime",
2182  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2183  },
2184  [AV_PIX_FMT_OPENCL] = {
2185  .name = "opencl",
2186  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2187  },
2188 };
2189 #if FF_API_PLUS1_MINUS1
2191 #endif
2192 
2193 static const char * const color_range_names[] = {
2194  [AVCOL_RANGE_UNSPECIFIED] = "unknown",
2195  [AVCOL_RANGE_MPEG] = "tv",
2196  [AVCOL_RANGE_JPEG] = "pc",
2197 };
2198 
2199 static const char * const color_primaries_names[AVCOL_PRI_NB] = {
2200  [AVCOL_PRI_RESERVED0] = "reserved",
2201  [AVCOL_PRI_BT709] = "bt709",
2202  [AVCOL_PRI_UNSPECIFIED] = "unknown",
2203  [AVCOL_PRI_RESERVED] = "reserved",
2204  [AVCOL_PRI_BT470M] = "bt470m",
2205  [AVCOL_PRI_BT470BG] = "bt470bg",
2206  [AVCOL_PRI_SMPTE170M] = "smpte170m",
2207  [AVCOL_PRI_SMPTE240M] = "smpte240m",
2208  [AVCOL_PRI_FILM] = "film",
2209  [AVCOL_PRI_BT2020] = "bt2020",
2210  [AVCOL_PRI_SMPTE428] = "smpte428",
2211  [AVCOL_PRI_SMPTE431] = "smpte431",
2212  [AVCOL_PRI_SMPTE432] = "smpte432",
2213  [AVCOL_PRI_JEDEC_P22] = "jedec-p22",
2214 };
2215 
2216 static const char * const color_transfer_names[] = {
2217  [AVCOL_TRC_RESERVED0] = "reserved",
2218  [AVCOL_TRC_BT709] = "bt709",
2219  [AVCOL_TRC_UNSPECIFIED] = "unknown",
2220  [AVCOL_TRC_RESERVED] = "reserved",
2221  [AVCOL_TRC_GAMMA22] = "bt470m",
2222  [AVCOL_TRC_GAMMA28] = "bt470bg",
2223  [AVCOL_TRC_SMPTE170M] = "smpte170m",
2224  [AVCOL_TRC_SMPTE240M] = "smpte240m",
2225  [AVCOL_TRC_LINEAR] = "linear",
2226  [AVCOL_TRC_LOG] = "log100",
2227  [AVCOL_TRC_LOG_SQRT] = "log316",
2228  [AVCOL_TRC_IEC61966_2_4] = "iec61966-2-4",
2229  [AVCOL_TRC_BT1361_ECG] = "bt1361e",
2230  [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1",
2231  [AVCOL_TRC_BT2020_10] = "bt2020-10",
2232  [AVCOL_TRC_BT2020_12] = "bt2020-12",
2233  [AVCOL_TRC_SMPTE2084] = "smpte2084",
2234  [AVCOL_TRC_SMPTE428] = "smpte428",
2235  [AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
2236 };
2237 
2238 static const char * const color_space_names[] = {
2239  [AVCOL_SPC_RGB] = "gbr",
2240  [AVCOL_SPC_BT709] = "bt709",
2241  [AVCOL_SPC_UNSPECIFIED] = "unknown",
2242  [AVCOL_SPC_RESERVED] = "reserved",
2243  [AVCOL_SPC_FCC] = "fcc",
2244  [AVCOL_SPC_BT470BG] = "bt470bg",
2245  [AVCOL_SPC_SMPTE170M] = "smpte170m",
2246  [AVCOL_SPC_SMPTE240M] = "smpte240m",
2247  [AVCOL_SPC_YCGCO] = "ycgco",
2248  [AVCOL_SPC_BT2020_NCL] = "bt2020nc",
2249  [AVCOL_SPC_BT2020_CL] = "bt2020c",
2250  [AVCOL_SPC_SMPTE2085] = "smpte2085",
2251  [AVCOL_SPC_CHROMA_DERIVED_NCL] = "chroma-derived-nc",
2252  [AVCOL_SPC_CHROMA_DERIVED_CL] = "chroma-derived-c",
2253  [AVCOL_SPC_ICTCP] = "ictcp",
2254 };
2255 
2256 static const char * const chroma_location_names[] = {
2257  [AVCHROMA_LOC_UNSPECIFIED] = "unspecified",
2258  [AVCHROMA_LOC_LEFT] = "left",
2259  [AVCHROMA_LOC_CENTER] = "center",
2260  [AVCHROMA_LOC_TOPLEFT] = "topleft",
2261  [AVCHROMA_LOC_TOP] = "top",
2262  [AVCHROMA_LOC_BOTTOMLEFT] = "bottomleft",
2263  [AVCHROMA_LOC_BOTTOM] = "bottom",
2264 };
2265 
2266 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
2267 {
2268  enum AVPixelFormat pix_fmt;
2269 
2270  for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
2271  if (av_pix_fmt_descriptors[pix_fmt].name &&
2272  (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
2273  av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias)))
2274  return pix_fmt;
2275 
2276  return AV_PIX_FMT_NONE;
2277 }
2278 
2280 {
2281  return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
2282  av_pix_fmt_descriptors[pix_fmt].name : NULL;
2283 }
2284 
2285 #if HAVE_BIGENDIAN
2286 # define X_NE(be, le) be
2287 #else
2288 # define X_NE(be, le) le
2289 #endif
2290 
2292 {
2293  enum AVPixelFormat pix_fmt;
2294 
2295  if (!strcmp(name, "rgb32"))
2296  name = X_NE("argb", "bgra");
2297  else if (!strcmp(name, "bgr32"))
2298  name = X_NE("abgr", "rgba");
2299 
2300  pix_fmt = get_pix_fmt_internal(name);
2301  if (pix_fmt == AV_PIX_FMT_NONE) {
2302  char name2[32];
2303 
2304  snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
2305  pix_fmt = get_pix_fmt_internal(name2);
2306  }
2307 
2308 #if FF_API_VAAPI
2309  if (pix_fmt == AV_PIX_FMT_NONE && !strcmp(name, "vaapi"))
2310  pix_fmt = AV_PIX_FMT_VAAPI;
2311 #endif
2312  return pix_fmt;
2313 }
2314 
2316 {
2317  int c, bits = 0;
2318  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2319 
2320  for (c = 0; c < pixdesc->nb_components; c++) {
2321  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2322  bits += pixdesc->comp[c].depth << s;
2323  }
2324 
2325  return bits >> log2_pixels;
2326 }
2327 
2329 {
2330  int c, bits = 0;
2331  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2332  int steps[4] = {0};
2333 
2334  for (c = 0; c < pixdesc->nb_components; c++) {
2335  const AVComponentDescriptor *comp = &pixdesc->comp[c];
2336  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2337  steps[comp->plane] = comp->step << s;
2338  }
2339  for (c = 0; c < 4; c++)
2340  bits += steps[c];
2341 
2342  if(!(pixdesc->flags & AV_PIX_FMT_FLAG_BITSTREAM))
2343  bits *= 8;
2344 
2345  return bits >> log2_pixels;
2346 }
2347 
2348 char *av_get_pix_fmt_string(char *buf, int buf_size,
2349  enum AVPixelFormat pix_fmt)
2350 {
2351  /* print header */
2352  if (pix_fmt < 0) {
2353  snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
2354  } else {
2355  const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
2356  snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
2357  pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
2358  }
2359 
2360  return buf;
2361 }
2362 
2364 {
2365  if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
2366  return NULL;
2367  return &av_pix_fmt_descriptors[pix_fmt];
2368 }
2369 
2371 {
2372  if (!prev)
2373  return &av_pix_fmt_descriptors[0];
2374  while (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1) {
2375  prev++;
2376  if (prev->name)
2377  return prev;
2378  }
2379  return NULL;
2380 }
2381 
2383 {
2384  if (desc < av_pix_fmt_descriptors ||
2385  desc >= av_pix_fmt_descriptors + FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
2386  return AV_PIX_FMT_NONE;
2387 
2388  return desc - av_pix_fmt_descriptors;
2389 }
2390 
2392  int *h_shift, int *v_shift)
2393 {
2394  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2395  if (!desc)
2396  return AVERROR(ENOSYS);
2397  *h_shift = desc->log2_chroma_w;
2398  *v_shift = desc->log2_chroma_h;
2399 
2400  return 0;
2401 }
2402 
2404 {
2405  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2406  int i, planes[4] = { 0 }, ret = 0;
2407 
2408  if (!desc)
2409  return AVERROR(EINVAL);
2410 
2411  for (i = 0; i < desc->nb_components; i++)
2412  planes[desc->comp[i].plane] = 1;
2413  for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
2414  ret += planes[i];
2415  return ret;
2416 }
2417 
2419  int i, j;
2420 
2421  for (i=0; i<FF_ARRAY_ELEMS(av_pix_fmt_descriptors); i++) {
2422  const AVPixFmtDescriptor *d = &av_pix_fmt_descriptors[i];
2423  uint8_t fill[4][8+6+3] = {{0}};
2424  uint8_t *data[4] = {fill[0], fill[1], fill[2], fill[3]};
2425  int linesize[4] = {0,0,0,0};
2426  uint16_t tmp[2];
2427 
2428  if (!d->name && !d->nb_components && !d->log2_chroma_w && !d->log2_chroma_h && !d->flags)
2429  continue;
2430 // av_log(NULL, AV_LOG_DEBUG, "Checking: %s\n", d->name);
2431  av_assert0(d->log2_chroma_w <= 3);
2432  av_assert0(d->log2_chroma_h <= 3);
2433  av_assert0(d->nb_components <= 4);
2434  av_assert0(d->name && d->name[0]);
2435  av_assert0((d->nb_components==4 || d->nb_components==2) == !!(d->flags & AV_PIX_FMT_FLAG_ALPHA));
2436  av_assert2(av_get_pix_fmt(d->name) == i);
2437 
2438  for (j=0; j<FF_ARRAY_ELEMS(d->comp); j++) {
2439  const AVComponentDescriptor *c = &d->comp[j];
2440  if(j>=d->nb_components) {
2441  av_assert0(!c->plane && !c->step && !c->offset && !c->shift && !c->depth);
2442  continue;
2443  }
2444  if (d->flags & AV_PIX_FMT_FLAG_BITSTREAM) {
2445  av_assert0(c->step >= c->depth);
2446  } else {
2447  av_assert0(8*c->step >= c->depth);
2448  }
2449  if (d->flags & AV_PIX_FMT_FLAG_BAYER)
2450  continue;
2451  av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0);
2452  av_assert0(tmp[0] == 0 && tmp[1] == 0);
2453  tmp[0] = tmp[1] = (1<<c->depth) - 1;
2454  av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2);
2455  }
2456  }
2457 }
2458 
2459 
2461 {
2462  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2463  char name[16];
2464  int i;
2465 
2466  if (!desc || strlen(desc->name) < 2)
2467  return AV_PIX_FMT_NONE;
2468  av_strlcpy(name, desc->name, sizeof(name));
2469  i = strlen(name) - 2;
2470  if (strcmp(name + i, "be") && strcmp(name + i, "le"))
2471  return AV_PIX_FMT_NONE;
2472 
2473  name[i] ^= 'b' ^ 'l';
2474 
2475  return get_pix_fmt_internal(name);
2476 }
2477 
2478 #define FF_COLOR_NA -1
2479 #define FF_COLOR_RGB 0 /**< RGB color space */
2480 #define FF_COLOR_GRAY 1 /**< gray color space */
2481 #define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
2482 #define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
2483 #define FF_COLOR_XYZ 4
2484 
2485 #define pixdesc_has_alpha(pixdesc) \
2486  ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
2487 
2488 
2490  if (desc->flags & AV_PIX_FMT_FLAG_PAL)
2491  return FF_COLOR_RGB;
2492 
2493  if(desc->nb_components == 1 || desc->nb_components == 2)
2494  return FF_COLOR_GRAY;
2495 
2496  if(desc->name && !strncmp(desc->name, "yuvj", 4))
2497  return FF_COLOR_YUV_JPEG;
2498 
2499  if(desc->name && !strncmp(desc->name, "xyz", 3))
2500  return FF_COLOR_XYZ;
2501 
2502  if(desc->flags & AV_PIX_FMT_FLAG_RGB)
2503  return FF_COLOR_RGB;
2504 
2505  if(desc->nb_components == 0)
2506  return FF_COLOR_NA;
2507 
2508  return FF_COLOR_YUV;
2509 }
2510 
2511 static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
2512 {
2513  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2514  int i;
2515 
2516  if (!desc || !desc->nb_components) {
2517  *min = *max = 0;
2518  return AVERROR(EINVAL);
2519  }
2520 
2521  *min = INT_MAX, *max = -INT_MAX;
2522  for (i = 0; i < desc->nb_components; i++) {
2523  *min = FFMIN(desc->comp[i].depth, *min);
2524  *max = FFMAX(desc->comp[i].depth, *max);
2525  }
2526  return 0;
2527 }
2528 
2529 static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
2530  enum AVPixelFormat src_pix_fmt,
2531  unsigned *lossp, unsigned consider)
2532 {
2533  const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
2534  const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
2535  int src_color, dst_color;
2536  int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
2537  int ret, loss, i, nb_components;
2538  int score = INT_MAX - 1;
2539 
2540  if (!src_desc || !dst_desc)
2541  return -4;
2542 
2543  if ((src_desc->flags & AV_PIX_FMT_FLAG_HWACCEL) ||
2544  (dst_desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
2545  if (dst_pix_fmt == src_pix_fmt)
2546  return -1;
2547  else
2548  return -2;
2549  }
2550 
2551  /* compute loss */
2552  *lossp = loss = 0;
2553 
2554  if (dst_pix_fmt == src_pix_fmt)
2555  return INT_MAX;
2556 
2557  if ((ret = get_pix_fmt_depth(&src_min_depth, &src_max_depth, src_pix_fmt)) < 0)
2558  return -3;
2559  if ((ret = get_pix_fmt_depth(&dst_min_depth, &dst_max_depth, dst_pix_fmt)) < 0)
2560  return -3;
2561 
2562  src_color = get_color_type(src_desc);
2563  dst_color = get_color_type(dst_desc);
2564  if (dst_pix_fmt == AV_PIX_FMT_PAL8)
2565  nb_components = FFMIN(src_desc->nb_components, 4);
2566  else
2567  nb_components = FFMIN(src_desc->nb_components, dst_desc->nb_components);
2568 
2569  for (i = 0; i < nb_components; i++) {
2570  int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : (dst_desc->comp[i].depth - 1);
2571  if (src_desc->comp[i].depth - 1 > depth_minus1 && (consider & FF_LOSS_DEPTH)) {
2572  loss |= FF_LOSS_DEPTH;
2573  score -= 65536 >> depth_minus1;
2574  }
2575  }
2576 
2577  if (consider & FF_LOSS_RESOLUTION) {
2578  if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w) {
2579  loss |= FF_LOSS_RESOLUTION;
2580  score -= 256 << dst_desc->log2_chroma_w;
2581  }
2582  if (dst_desc->log2_chroma_h > src_desc->log2_chroma_h) {
2583  loss |= FF_LOSS_RESOLUTION;
2584  score -= 256 << dst_desc->log2_chroma_h;
2585  }
2586  // don't favor 422 over 420 if downsampling is needed, because 420 has much better support on the decoder side
2587  if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 0 &&
2588  dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 0 ) {
2589  score += 512;
2590  }
2591  }
2592 
2593  if(consider & FF_LOSS_COLORSPACE)
2594  switch(dst_color) {
2595  case FF_COLOR_RGB:
2596  if (src_color != FF_COLOR_RGB &&
2597  src_color != FF_COLOR_GRAY)
2598  loss |= FF_LOSS_COLORSPACE;
2599  break;
2600  case FF_COLOR_GRAY:
2601  if (src_color != FF_COLOR_GRAY)
2602  loss |= FF_LOSS_COLORSPACE;
2603  break;
2604  case FF_COLOR_YUV:
2605  if (src_color != FF_COLOR_YUV)
2606  loss |= FF_LOSS_COLORSPACE;
2607  break;
2608  case FF_COLOR_YUV_JPEG:
2609  if (src_color != FF_COLOR_YUV_JPEG &&
2610  src_color != FF_COLOR_YUV &&
2611  src_color != FF_COLOR_GRAY)
2612  loss |= FF_LOSS_COLORSPACE;
2613  break;
2614  default:
2615  /* fail safe test */
2616  if (src_color != dst_color)
2617  loss |= FF_LOSS_COLORSPACE;
2618  break;
2619  }
2620  if(loss & FF_LOSS_COLORSPACE)
2621  score -= (nb_components * 65536) >> FFMIN(dst_desc->comp[0].depth - 1, src_desc->comp[0].depth - 1);
2622 
2623  if (dst_color == FF_COLOR_GRAY &&
2624  src_color != FF_COLOR_GRAY && (consider & FF_LOSS_CHROMA)) {
2625  loss |= FF_LOSS_CHROMA;
2626  score -= 2 * 65536;
2627  }
2628  if (!pixdesc_has_alpha(dst_desc) && (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))) {
2629  loss |= FF_LOSS_ALPHA;
2630  score -= 65536;
2631  }
2632  if (dst_pix_fmt == AV_PIX_FMT_PAL8 && (consider & FF_LOSS_COLORQUANT) &&
2633  (src_pix_fmt != AV_PIX_FMT_PAL8 && (src_color != FF_COLOR_GRAY || (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))))) {
2634  loss |= FF_LOSS_COLORQUANT;
2635  score -= 65536;
2636  }
2637 
2638  *lossp = loss;
2639  return score;
2640 }
2641 
2642 int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
2643  enum AVPixelFormat src_pix_fmt,
2644  int has_alpha)
2645 {
2646  int loss;
2647  int ret = get_pix_fmt_score(dst_pix_fmt, src_pix_fmt, &loss, has_alpha ? ~0 : ~FF_LOSS_ALPHA);
2648  if (ret < 0)
2649  return ret;
2650  return loss;
2651 }
2652 
2653 enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
2654  enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
2655 {
2656  enum AVPixelFormat dst_pix_fmt;
2657  int loss1, loss2, loss_mask;
2658  const AVPixFmtDescriptor *desc1 = av_pix_fmt_desc_get(dst_pix_fmt1);
2659  const AVPixFmtDescriptor *desc2 = av_pix_fmt_desc_get(dst_pix_fmt2);
2660  int score1, score2;
2661 
2662  if (!desc1) {
2663  dst_pix_fmt = dst_pix_fmt2;
2664  } else if (!desc2) {
2665  dst_pix_fmt = dst_pix_fmt1;
2666  } else {
2667  loss_mask= loss_ptr?~*loss_ptr:~0; /* use loss mask if provided */
2668  if(!has_alpha)
2669  loss_mask &= ~FF_LOSS_ALPHA;
2670 
2671  score1 = get_pix_fmt_score(dst_pix_fmt1, src_pix_fmt, &loss1, loss_mask);
2672  score2 = get_pix_fmt_score(dst_pix_fmt2, src_pix_fmt, &loss2, loss_mask);
2673 
2674  if (score1 == score2) {
2676  dst_pix_fmt = av_get_padded_bits_per_pixel(desc2) < av_get_padded_bits_per_pixel(desc1) ? dst_pix_fmt2 : dst_pix_fmt1;
2677  } else {
2678  dst_pix_fmt = desc2->nb_components < desc1->nb_components ? dst_pix_fmt2 : dst_pix_fmt1;
2679  }
2680  } else {
2681  dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
2682  }
2683  }
2684 
2685  if (loss_ptr)
2686  *loss_ptr = av_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
2687  return dst_pix_fmt;
2688 }
2689 
2690 const char *av_color_range_name(enum AVColorRange range)
2691 {
2692  return (unsigned) range < AVCOL_RANGE_NB ?
2693  color_range_names[range] : NULL;
2694 }
2695 
2697 {
2698  int i;
2699 
2700  for (i = 0; i < FF_ARRAY_ELEMS(color_range_names); i++) {
2701  size_t len = strlen(color_range_names[i]);
2702  if (!strncmp(color_range_names[i], name, len))
2703  return i;
2704  }
2705 
2706  return AVERROR(EINVAL);
2707 }
2708 
2709 const char *av_color_primaries_name(enum AVColorPrimaries primaries)
2710 {
2711  return (unsigned) primaries < AVCOL_PRI_NB ?
2712  color_primaries_names[primaries] : NULL;
2713 }
2714 
2716 {
2717  int i;
2718 
2719  for (i = 0; i < FF_ARRAY_ELEMS(color_primaries_names); i++) {
2720  size_t len = strlen(color_primaries_names[i]);
2721  if (!strncmp(color_primaries_names[i], name, len))
2722  return i;
2723  }
2724 
2725  return AVERROR(EINVAL);
2726 }
2727 
2729 {
2730  return (unsigned) transfer < AVCOL_TRC_NB ?
2731  color_transfer_names[transfer] : NULL;
2732 }
2733 
2735 {
2736  int i;
2737 
2738  for (i = 0; i < FF_ARRAY_ELEMS(color_transfer_names); i++) {
2739  size_t len = strlen(color_transfer_names[i]);
2740  if (!strncmp(color_transfer_names[i], name, len))
2741  return i;
2742  }
2743 
2744  return AVERROR(EINVAL);
2745 }
2746 
2747 const char *av_color_space_name(enum AVColorSpace space)
2748 {
2749  return (unsigned) space < AVCOL_SPC_NB ?
2750  color_space_names[space] : NULL;
2751 }
2752 
2754 {
2755  int i;
2756 
2757  for (i = 0; i < FF_ARRAY_ELEMS(color_space_names); i++) {
2758  size_t len = strlen(color_space_names[i]);
2759  if (!strncmp(color_space_names[i], name, len))
2760  return i;
2761  }
2762 
2763  return AVERROR(EINVAL);
2764 }
2765 
2766 const char *av_chroma_location_name(enum AVChromaLocation location)
2767 {
2768  return (unsigned) location < AVCHROMA_LOC_NB ?
2769  chroma_location_names[location] : NULL;
2770 }
2771 
2773 {
2774  int i;
2775 
2776  for (i = 0; i < FF_ARRAY_ELEMS(chroma_location_names); i++) {
2777  size_t len = strlen(chroma_location_names[i]);
2778  if (!strncmp(chroma_location_names[i], name, len))
2779  return i;
2780  }
2781 
2782  return AVERROR(EINVAL);
2783 }
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
Definition: pixdesc.h:132
const char * name
Definition: avisynth_c.h:775
ITU-R BT2020 for 12-bit system.
Definition: pixfmt.h:460
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
Definition: pixfmt.h:475
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
const char * s
Definition: avisynth_c.h:768
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:456
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2363
MPEG-2/4 4:2:0, H.264 default for 4:2:0.
Definition: pixfmt.h:520
"Linear transfer characteristics"
Definition: pixfmt.h:453
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:386
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2403
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:436
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:388
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:2315
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 ...
Definition: pixfmt.h:479
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:2348
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:435
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:480
static const char *const chroma_location_names[]
Definition: pixdesc.c:2256
#define AV_RL16
Definition: intreadwrite.h:42
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:434
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
#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:2460
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
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
Definition: pixfmt.h:474
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:444
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:481
const char * av_color_space_name(enum AVColorSpace space)
Definition: pixdesc.c:2747
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:181
#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:2696
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:473
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:2690
#define AV_PIX_FMT_FLAG_FLOAT
The pixel format contains IEEE-754 floating point values.
Definition: pixdesc.h:192
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:482
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:449
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
const char data[16]
Definition: mxf.c:90
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 int flags
Definition: log.c:55
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:500
Y , 10bpp, little-endian.
Definition: pixfmt.h:294
AVColorRange
MPEG vs JPEG YUV range.
Definition: pixfmt.h:496
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:420
#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:2734
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:2766
also FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
Definition: pixfmt.h:425
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:457
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
#define AV_RB16
Definition: intreadwrite.h:53
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:2238
int av_chroma_location_from_name(const char *name)
Definition: pixdesc.c:2772
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:2391
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:2328
Not part of ABI.
Definition: pixfmt.h:437
#define FF_LOSS_DEPTH
loss due to color depth change
Definition: pixdesc.h:384
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:422
#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:432
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:2709
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:2216
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:2382
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:461
#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:430
uint8_t w
Definition: llviddspenc.c:38
#define FF_COLOR_YUV_JPEG
YUV color space.
Definition: pixdesc.c:2482
ITU-R BT2020 non-constant luminance system.
Definition: pixfmt.h:484
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
Definition: pixfmt.h:522
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
Definition: pixfmt.h:427
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:2483
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
Definition: pixfmt.h:206
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:2489
#define pixdesc_has_alpha(pixdesc)
Definition: pixdesc.c:2485
#define AV_PIX_FMT_FLAG_BAYER
The pixel format is following a Bayer pattern.
Definition: pixdesc.h:186
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:478
#define FF_ARRAY_ELEMS(a)
the normal 2^n-1 "JPEG" YUV ranges
Definition: pixfmt.h:499
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:446
ITU-R BT.2100-0, ICtCp.
Definition: pixfmt.h:489
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:451
functionally identical to above
Definition: pixfmt.h:429
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:488
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:2715
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:2529
#define FF_COLOR_YUV
YUV color space.
Definition: pixdesc.c:2481
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:487
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:2266
DRM-managed buffers exposed through PRIME buffer sharing.
Definition: pixfmt.h:324
Not part of ABI.
Definition: pixfmt.h:466
"Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)"
Definition: pixfmt.h:455
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:2642
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:2511
SMPTE ST 428-1.
Definition: pixfmt.h:463
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
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:2479
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:498
static FF_ENABLE_DEPRECATION_WARNINGS const char *const color_range_names[]
Definition: pixdesc.c:2193
ITU-R BT2020 constant luminance system.
Definition: pixfmt.h:485
#define X_NE(be, le)
Definition: pixdesc.c:2288
#define FF_LOSS_COLORSPACE
loss due to color space conversion
Definition: pixdesc.h:385
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:458
#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:2728
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:450
#define AV_WL16(p, v)
Definition: intreadwrite.h:412
SMPTE 2085, Y&#39;D&#39;zD&#39;x.
Definition: pixfmt.h:486
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 struct @272 planes[]
static const char *const color_primaries_names[AVCOL_PRI_NB]
Definition: pixdesc.c:2199
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:2653
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:465
#define FF_LOSS_RESOLUTION
loss due to resolution change
Definition: pixdesc.h:383
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 , 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:526
16 bits gray, 16 bits alpha (little-endian)
Definition: pixfmt.h:209
#define FF_COLOR_NA
Definition: pixdesc.c:2478
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:459
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: pixfmt.h:428
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:333
ITU-R BT2020.
Definition: pixfmt.h:431
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:387
AVChromaLocation
Location of chroma samples.
Definition: pixfmt.h:518
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:2418
MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0.
Definition: pixfmt.h:521
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:2291
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:2279
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:2753
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:490
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:2370
"Logarithmic transfer characteristic (100:1 range)"
Definition: pixfmt.h:454
#define FF_COLOR_GRAY
gray color space
Definition: pixdesc.c:2480
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