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