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