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",
1919  },
1921  .name = "bayer_bggr16le",
1924  },
1926  .name = "bayer_bggr16be",
1929  },
1931  .name = "bayer_rggb8",
1934  },
1936  .name = "bayer_rggb16le",
1939  },
1941  .name = "bayer_rggb16be",
1944  },
1946  .name = "bayer_gbrg8",
1949  },
1951  .name = "bayer_gbrg16le",
1954  },
1956  .name = "bayer_gbrg16be",
1959  },
1961  .name = "bayer_grbg8",
1964  },
1966  .name = "bayer_grbg16le",
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  [AVCOL_PRI_JEDEC_P22] = "jedec-p22",
2187 };
2188 
2189 static const char *color_transfer_names[] = {
2190  [AVCOL_TRC_RESERVED0] = "reserved",
2191  [AVCOL_TRC_BT709] = "bt709",
2192  [AVCOL_TRC_UNSPECIFIED] = "unknown",
2193  [AVCOL_TRC_RESERVED] = "reserved",
2194  [AVCOL_TRC_GAMMA22] = "bt470m",
2195  [AVCOL_TRC_GAMMA28] = "bt470bg",
2196  [AVCOL_TRC_SMPTE170M] = "smpte170m",
2197  [AVCOL_TRC_SMPTE240M] = "smpte240m",
2198  [AVCOL_TRC_LINEAR] = "linear",
2199  [AVCOL_TRC_LOG] = "log100",
2200  [AVCOL_TRC_LOG_SQRT] = "log316",
2201  [AVCOL_TRC_IEC61966_2_4] = "iec61966-2-4",
2202  [AVCOL_TRC_BT1361_ECG] = "bt1361e",
2203  [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1",
2204  [AVCOL_TRC_BT2020_10] = "bt2020-10",
2205  [AVCOL_TRC_BT2020_12] = "bt2020-12",
2206  [AVCOL_TRC_SMPTE2084] = "smpte2084",
2207  [AVCOL_TRC_SMPTE428] = "smpte428",
2208  [AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
2209 };
2210 
2211 static const char *color_space_names[] = {
2212  [AVCOL_SPC_RGB] = "gbr",
2213  [AVCOL_SPC_BT709] = "bt709",
2214  [AVCOL_SPC_UNSPECIFIED] = "unknown",
2215  [AVCOL_SPC_RESERVED] = "reserved",
2216  [AVCOL_SPC_FCC] = "fcc",
2217  [AVCOL_SPC_BT470BG] = "bt470bg",
2218  [AVCOL_SPC_SMPTE170M] = "smpte170m",
2219  [AVCOL_SPC_SMPTE240M] = "smpte240m",
2220  [AVCOL_SPC_YCGCO] = "ycgco",
2221  [AVCOL_SPC_BT2020_NCL] = "bt2020nc",
2222  [AVCOL_SPC_BT2020_CL] = "bt2020c",
2223  [AVCOL_SPC_SMPTE2085] = "smpte2085",
2224 };
2225 
2226 static const char *chroma_location_names[] = {
2227  [AVCHROMA_LOC_UNSPECIFIED] = "unspecified",
2228  [AVCHROMA_LOC_LEFT] = "left",
2229  [AVCHROMA_LOC_CENTER] = "center",
2230  [AVCHROMA_LOC_TOPLEFT] = "topleft",
2231  [AVCHROMA_LOC_TOP] = "top",
2232  [AVCHROMA_LOC_BOTTOMLEFT] = "bottomleft",
2233  [AVCHROMA_LOC_BOTTOM] = "bottom",
2234 };
2235 
2236 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
2237 {
2238  enum AVPixelFormat pix_fmt;
2239 
2240  for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
2241  if (av_pix_fmt_descriptors[pix_fmt].name &&
2242  (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
2243  av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias)))
2244  return pix_fmt;
2245 
2246  return AV_PIX_FMT_NONE;
2247 }
2248 
2250 {
2251  return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
2252  av_pix_fmt_descriptors[pix_fmt].name : NULL;
2253 }
2254 
2255 #if HAVE_BIGENDIAN
2256 # define X_NE(be, le) be
2257 #else
2258 # define X_NE(be, le) le
2259 #endif
2260 
2262 {
2263  enum AVPixelFormat pix_fmt;
2264 
2265  if (!strcmp(name, "rgb32"))
2266  name = X_NE("argb", "bgra");
2267  else if (!strcmp(name, "bgr32"))
2268  name = X_NE("abgr", "rgba");
2269 
2270  pix_fmt = get_pix_fmt_internal(name);
2271  if (pix_fmt == AV_PIX_FMT_NONE) {
2272  char name2[32];
2273 
2274  snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
2275  pix_fmt = get_pix_fmt_internal(name2);
2276  }
2277 
2278 #if FF_API_VAAPI
2279  if (pix_fmt == AV_PIX_FMT_NONE && !strcmp(name, "vaapi"))
2280  pix_fmt = AV_PIX_FMT_VAAPI;
2281 #endif
2282  return pix_fmt;
2283 }
2284 
2286 {
2287  int c, bits = 0;
2288  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2289 
2290  for (c = 0; c < pixdesc->nb_components; c++) {
2291  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2292  bits += pixdesc->comp[c].depth << s;
2293  }
2294 
2295  return bits >> log2_pixels;
2296 }
2297 
2299 {
2300  int c, bits = 0;
2301  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2302  int steps[4] = {0};
2303 
2304  for (c = 0; c < pixdesc->nb_components; c++) {
2305  const AVComponentDescriptor *comp = &pixdesc->comp[c];
2306  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2307  steps[comp->plane] = comp->step << s;
2308  }
2309  for (c = 0; c < 4; c++)
2310  bits += steps[c];
2311 
2312  if(!(pixdesc->flags & AV_PIX_FMT_FLAG_BITSTREAM))
2313  bits *= 8;
2314 
2315  return bits >> log2_pixels;
2316 }
2317 
2318 char *av_get_pix_fmt_string(char *buf, int buf_size,
2319  enum AVPixelFormat pix_fmt)
2320 {
2321  /* print header */
2322  if (pix_fmt < 0) {
2323  snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
2324  } else {
2325  const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
2326  snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
2327  pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
2328  }
2329 
2330  return buf;
2331 }
2332 
2334 {
2335  if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
2336  return NULL;
2337  return &av_pix_fmt_descriptors[pix_fmt];
2338 }
2339 
2341 {
2342  if (!prev)
2343  return &av_pix_fmt_descriptors[0];
2344  while (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1) {
2345  prev++;
2346  if (prev->name)
2347  return prev;
2348  }
2349  return NULL;
2350 }
2351 
2353 {
2354  if (desc < av_pix_fmt_descriptors ||
2355  desc >= av_pix_fmt_descriptors + FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
2356  return AV_PIX_FMT_NONE;
2357 
2358  return desc - av_pix_fmt_descriptors;
2359 }
2360 
2362  int *h_shift, int *v_shift)
2363 {
2364  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2365  if (!desc)
2366  return AVERROR(ENOSYS);
2367  *h_shift = desc->log2_chroma_w;
2368  *v_shift = desc->log2_chroma_h;
2369 
2370  return 0;
2371 }
2372 
2374 {
2375  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2376  int i, planes[4] = { 0 }, ret = 0;
2377 
2378  if (!desc)
2379  return AVERROR(EINVAL);
2380 
2381  for (i = 0; i < desc->nb_components; i++)
2382  planes[desc->comp[i].plane] = 1;
2383  for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
2384  ret += planes[i];
2385  return ret;
2386 }
2387 
2389  int i, j;
2390 
2391  for (i=0; i<FF_ARRAY_ELEMS(av_pix_fmt_descriptors); i++) {
2392  const AVPixFmtDescriptor *d = &av_pix_fmt_descriptors[i];
2393  uint8_t fill[4][8+6+3] = {{0}};
2394  uint8_t *data[4] = {fill[0], fill[1], fill[2], fill[3]};
2395  int linesize[4] = {0,0,0,0};
2396  uint16_t tmp[2];
2397 
2398  if (!d->name && !d->nb_components && !d->log2_chroma_w && !d->log2_chroma_h && !d->flags)
2399  continue;
2400 // av_log(NULL, AV_LOG_DEBUG, "Checking: %s\n", d->name);
2401  av_assert0(d->log2_chroma_w <= 3);
2402  av_assert0(d->log2_chroma_h <= 3);
2403  av_assert0(d->nb_components <= 4);
2404  av_assert0(d->name && d->name[0]);
2405  av_assert0((d->nb_components==4 || d->nb_components==2) == !!(d->flags & AV_PIX_FMT_FLAG_ALPHA));
2406  av_assert2(av_get_pix_fmt(d->name) == i);
2407 
2408  for (j=0; j<FF_ARRAY_ELEMS(d->comp); j++) {
2409  const AVComponentDescriptor *c = &d->comp[j];
2410  if(j>=d->nb_components) {
2411  av_assert0(!c->plane && !c->step && !c->offset && !c->shift && !c->depth);
2412  continue;
2413  }
2414  if (d->flags & AV_PIX_FMT_FLAG_BITSTREAM) {
2415  av_assert0(c->step >= c->depth);
2416  } else {
2417  av_assert0(8*c->step >= c->depth);
2418  }
2419  if (d->flags & AV_PIX_FMT_FLAG_BAYER)
2420  continue;
2421  av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0);
2422  av_assert0(tmp[0] == 0 && tmp[1] == 0);
2423  tmp[0] = tmp[1] = (1<<c->depth) - 1;
2424  av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2);
2425  }
2426  }
2427 }
2428 
2429 
2431 {
2432  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2433  char name[16];
2434  int i;
2435 
2436  if (!desc || strlen(desc->name) < 2)
2437  return AV_PIX_FMT_NONE;
2438  av_strlcpy(name, desc->name, sizeof(name));
2439  i = strlen(name) - 2;
2440  if (strcmp(name + i, "be") && strcmp(name + i, "le"))
2441  return AV_PIX_FMT_NONE;
2442 
2443  name[i] ^= 'b' ^ 'l';
2444 
2445  return get_pix_fmt_internal(name);
2446 }
2447 
2448 #define FF_COLOR_NA -1
2449 #define FF_COLOR_RGB 0 /**< RGB color space */
2450 #define FF_COLOR_GRAY 1 /**< gray color space */
2451 #define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
2452 #define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
2453 #define FF_COLOR_XYZ 4
2454 
2455 #define pixdesc_has_alpha(pixdesc) \
2456  ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
2457 
2458 
2460  if (desc->flags & AV_PIX_FMT_FLAG_PAL)
2461  return FF_COLOR_RGB;
2462 
2463  if(desc->nb_components == 1 || desc->nb_components == 2)
2464  return FF_COLOR_GRAY;
2465 
2466  if(desc->name && !strncmp(desc->name, "yuvj", 4))
2467  return FF_COLOR_YUV_JPEG;
2468 
2469  if(desc->name && !strncmp(desc->name, "xyz", 3))
2470  return FF_COLOR_XYZ;
2471 
2472  if(desc->flags & AV_PIX_FMT_FLAG_RGB)
2473  return FF_COLOR_RGB;
2474 
2475  if(desc->nb_components == 0)
2476  return FF_COLOR_NA;
2477 
2478  return FF_COLOR_YUV;
2479 }
2480 
2481 static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
2482 {
2483  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2484  int i;
2485 
2486  if (!desc || !desc->nb_components) {
2487  *min = *max = 0;
2488  return AVERROR(EINVAL);
2489  }
2490 
2491  *min = INT_MAX, *max = -INT_MAX;
2492  for (i = 0; i < desc->nb_components; i++) {
2493  *min = FFMIN(desc->comp[i].depth, *min);
2494  *max = FFMAX(desc->comp[i].depth, *max);
2495  }
2496  return 0;
2497 }
2498 
2499 static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
2500  enum AVPixelFormat src_pix_fmt,
2501  unsigned *lossp, unsigned consider)
2502 {
2503  const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
2504  const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
2505  int src_color, dst_color;
2506  int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
2507  int ret, loss, i, nb_components;
2508  int score = INT_MAX - 1;
2509 
2510  if (dst_pix_fmt >= AV_PIX_FMT_NB || dst_pix_fmt <= AV_PIX_FMT_NONE)
2511  return ~0;
2512 
2513  /* compute loss */
2514  *lossp = loss = 0;
2515 
2516  if (dst_pix_fmt == src_pix_fmt)
2517  return INT_MAX;
2518 
2519  if ((ret = get_pix_fmt_depth(&src_min_depth, &src_max_depth, src_pix_fmt)) < 0)
2520  return ret;
2521  if ((ret = get_pix_fmt_depth(&dst_min_depth, &dst_max_depth, dst_pix_fmt)) < 0)
2522  return ret;
2523 
2524  src_color = get_color_type(src_desc);
2525  dst_color = get_color_type(dst_desc);
2526  if (dst_pix_fmt == AV_PIX_FMT_PAL8)
2527  nb_components = FFMIN(src_desc->nb_components, 4);
2528  else
2529  nb_components = FFMIN(src_desc->nb_components, dst_desc->nb_components);
2530 
2531  for (i = 0; i < nb_components; i++) {
2532  int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : (dst_desc->comp[i].depth - 1);
2533  if (src_desc->comp[i].depth - 1 > depth_minus1 && (consider & FF_LOSS_DEPTH)) {
2534  loss |= FF_LOSS_DEPTH;
2535  score -= 65536 >> depth_minus1;
2536  }
2537  }
2538 
2539  if (consider & FF_LOSS_RESOLUTION) {
2540  if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w) {
2541  loss |= FF_LOSS_RESOLUTION;
2542  score -= 256 << dst_desc->log2_chroma_w;
2543  }
2544  if (dst_desc->log2_chroma_h > src_desc->log2_chroma_h) {
2545  loss |= FF_LOSS_RESOLUTION;
2546  score -= 256 << dst_desc->log2_chroma_h;
2547  }
2548  // don't favor 422 over 420 if downsampling is needed, because 420 has much better support on the decoder side
2549  if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 0 &&
2550  dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 0 ) {
2551  score += 512;
2552  }
2553  }
2554 
2555  if(consider & FF_LOSS_COLORSPACE)
2556  switch(dst_color) {
2557  case FF_COLOR_RGB:
2558  if (src_color != FF_COLOR_RGB &&
2559  src_color != FF_COLOR_GRAY)
2560  loss |= FF_LOSS_COLORSPACE;
2561  break;
2562  case FF_COLOR_GRAY:
2563  if (src_color != FF_COLOR_GRAY)
2564  loss |= FF_LOSS_COLORSPACE;
2565  break;
2566  case FF_COLOR_YUV:
2567  if (src_color != FF_COLOR_YUV)
2568  loss |= FF_LOSS_COLORSPACE;
2569  break;
2570  case FF_COLOR_YUV_JPEG:
2571  if (src_color != FF_COLOR_YUV_JPEG &&
2572  src_color != FF_COLOR_YUV &&
2573  src_color != FF_COLOR_GRAY)
2574  loss |= FF_LOSS_COLORSPACE;
2575  break;
2576  default:
2577  /* fail safe test */
2578  if (src_color != dst_color)
2579  loss |= FF_LOSS_COLORSPACE;
2580  break;
2581  }
2582  if(loss & FF_LOSS_COLORSPACE)
2583  score -= (nb_components * 65536) >> FFMIN(dst_desc->comp[0].depth - 1, src_desc->comp[0].depth - 1);
2584 
2585  if (dst_color == FF_COLOR_GRAY &&
2586  src_color != FF_COLOR_GRAY && (consider & FF_LOSS_CHROMA)) {
2587  loss |= FF_LOSS_CHROMA;
2588  score -= 2 * 65536;
2589  }
2590  if (!pixdesc_has_alpha(dst_desc) && (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))) {
2591  loss |= FF_LOSS_ALPHA;
2592  score -= 65536;
2593  }
2594  if (dst_pix_fmt == AV_PIX_FMT_PAL8 && (consider & FF_LOSS_COLORQUANT) &&
2595  (src_pix_fmt != AV_PIX_FMT_PAL8 && (src_color != FF_COLOR_GRAY || (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))))) {
2596  loss |= FF_LOSS_COLORQUANT;
2597  score -= 65536;
2598  }
2599 
2600  *lossp = loss;
2601  return score;
2602 }
2603 
2604 int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
2605  enum AVPixelFormat src_pix_fmt,
2606  int has_alpha)
2607 {
2608  int loss;
2609  int ret = get_pix_fmt_score(dst_pix_fmt, src_pix_fmt, &loss, has_alpha ? ~0 : ~FF_LOSS_ALPHA);
2610  if (ret < 0)
2611  return ret;
2612  return loss;
2613 }
2614 
2615 enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
2616  enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
2617 {
2618  enum AVPixelFormat dst_pix_fmt;
2619  int loss1, loss2, loss_mask;
2620  const AVPixFmtDescriptor *desc1 = av_pix_fmt_desc_get(dst_pix_fmt1);
2621  const AVPixFmtDescriptor *desc2 = av_pix_fmt_desc_get(dst_pix_fmt2);
2622  int score1, score2;
2623 
2624  loss_mask= loss_ptr?~*loss_ptr:~0; /* use loss mask if provided */
2625  if(!has_alpha)
2626  loss_mask &= ~FF_LOSS_ALPHA;
2627 
2628  score1 = get_pix_fmt_score(dst_pix_fmt1, src_pix_fmt, &loss1, loss_mask);
2629  score2 = get_pix_fmt_score(dst_pix_fmt2, src_pix_fmt, &loss2, loss_mask);
2630 
2631  if (score1 == score2) {
2633  dst_pix_fmt = av_get_padded_bits_per_pixel(desc2) < av_get_padded_bits_per_pixel(desc1) ? dst_pix_fmt2 : dst_pix_fmt1;
2634  } else {
2635  dst_pix_fmt = desc2->nb_components < desc1->nb_components ? dst_pix_fmt2 : dst_pix_fmt1;
2636  }
2637  } else {
2638  dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
2639  }
2640 
2641  if (loss_ptr)
2642  *loss_ptr = av_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
2643  return dst_pix_fmt;
2644 }
2645 
2646 const char *av_color_range_name(enum AVColorRange range)
2647 {
2648  return (unsigned) range < AVCOL_RANGE_NB ?
2649  color_range_names[range] : NULL;
2650 }
2651 
2652 const char *av_color_primaries_name(enum AVColorPrimaries primaries)
2653 {
2654  return (unsigned) primaries < AVCOL_PRI_NB ?
2655  color_primaries_names[primaries] : NULL;
2656 }
2657 
2659 {
2660  return (unsigned) transfer < AVCOL_TRC_NB ?
2661  color_transfer_names[transfer] : NULL;
2662 }
2663 
2664 const char *av_color_space_name(enum AVColorSpace space)
2665 {
2666  return (unsigned) space < AVCOL_SPC_NB ?
2667  color_space_names[space] : NULL;
2668 }
2669 
2670 const char *av_chroma_location_name(enum AVChromaLocation location)
2671 {
2672  return (unsigned) location < AVCHROMA_LOC_NB ?
2673  chroma_location_names[location] : NULL;
2674 }
#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:439
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
Definition: pixfmt.h:453
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:435
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2333
MPEG-2/4 4:2:0, H.264 default for 4:2:0.
Definition: pixfmt.h:497
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:101
"Linear transfer characteristics"
Definition: pixfmt.h:432
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:352
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2373
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
JEDEC P22 phosphors.
Definition: pixfmt.h:416
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:354
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:2285
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 ...
Definition: pixfmt.h:457
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:2318
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 (2010) / P3 D65 / Display P3.
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:458
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) / DCI P3.
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:2430
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
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
Definition: pixfmt.h:452
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:423
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:459
const char * av_color_space_name(enum AVColorSpace space)
Definition: pixdesc.c:2664
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:451
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:2646
bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */
Definition: pixfmt.h:283
Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16.
Definition: pixfmt.h:460
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:428
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:477
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:473
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:410
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:2670
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:436
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:2361
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:2298
Not part of ABI.
Definition: pixfmt.h:417
#define FF_LOSS_DEPTH
loss due to color depth change
Definition: pixdesc.h:350
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:2652
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:2189
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:2352
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:440
#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:2452
ITU-R BT2020 non-constant luminance system.
Definition: pixfmt.h:462
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
Definition: pixfmt.h:499
#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:2453
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:2459
#define pixdesc_has_alpha(pixdesc)
Definition: pixdesc.c:2455
#define AV_PIX_FMT_FLAG_BAYER
The pixel format is following a Bayer pattern.
Definition: pixdesc.h:178
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:456
#define FF_ARRAY_ELEMS(a)
the normal 2^n-1 "JPEG" YUV ranges
Definition: pixfmt.h:476
HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state str...
Definition: pixfmt.h:127
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
Definition: eamad.c:83
planar GBR 4:4:4:4 48bpp, little-endian
Definition: pixfmt.h:302
also ITU-R BT1361
Definition: pixfmt.h:425
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:430
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:2499
#define FF_COLOR_YUV
YUV color space.
Definition: pixdesc.c:2451
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:2211
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:2236
Not part of ABI.
Definition: pixfmt.h:445
"Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)"
Definition: pixfmt.h:434
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:2604
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:2481
SMPTE ST 428-1.
Definition: pixfmt.h:442
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:2449
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:475
ITU-R BT2020 constant luminance system.
Definition: pixfmt.h:463
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:2258
#define FF_LOSS_COLORSPACE
loss due to color space conversion
Definition: pixdesc.h:351
hardware decoding through VDA
Definition: pixfmt.h:179
static const char * chroma_location_names[]
Definition: pixdesc.c:2226
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:437
#define FF_DISABLE_DEPRECATION_WARNINGS
Definition: internal.h:83
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
static double c[64]
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
Definition: pixdesc.c:2658
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:429
#define AV_WL16(p, v)
Definition: intreadwrite.h:417
SMPTE 2085, Y'D'zD'x.
Definition: pixfmt.h:464
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:2615
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:444
#define FF_LOSS_RESOLUTION
loss due to resolution change
Definition: pixdesc.h:349
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:84
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:267
Y , 16bpp, little-endian.
Definition: pixfmt.h:99
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:503
16 bits gray, 16 bits alpha (little-endian)
Definition: pixfmt.h:227
#define FF_COLOR_NA
Definition: pixdesc.c:2448
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:438
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
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:353
AVChromaLocation
Location of chroma samples.
Definition: pixfmt.h:495
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:2388
MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0.
Definition: pixfmt.h:498
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:2261
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:2249
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:465
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:2340
const char * name
Definition: opengl_enc.c:103
"Logarithmic transfer characteristic (100:1 range)"
Definition: pixfmt.h:433
#define FF_COLOR_GRAY
gray color space
Definition: pixdesc.c:2450
static uint8_t tmp[11]
Definition: aes_ctr.c:26
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:171