FFmpeg
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 
33 void av_read_image_line2(void *dst,
34  const uint8_t *data[4], const int linesize[4],
35  const AVPixFmtDescriptor *desc,
36  int x, int y, int c, int w,
37  int read_pal_component,
38  int dst_element_size)
39 {
41  int plane = comp.plane;
42  int depth = comp.depth;
43  unsigned mask = (1ULL << depth) - 1;
44  int shift = comp.shift;
45  int step = comp.step;
46  int flags = desc->flags;
47  uint16_t *dst16 = dst;
48  uint32_t *dst32 = dst;
49 
51  int skip = x * step + comp.offset;
52  const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
53  int shift = 8 - depth - (skip & 7);
54 
55  while (w--) {
56  int val = (*p >> shift) & mask;
57  if (read_pal_component)
58  val = data[1][4*val + c];
59  shift -= step;
60  p -= shift >> 3;
61  shift &= 7;
62  if (dst_element_size == 4) *dst32++ = val;
63  else *dst16++ = val;
64  }
65  } else {
66  const uint8_t *p = data[plane] + y * linesize[plane] +
67  x * step + comp.offset;
68  int is_8bit = shift + depth <= 8;
69  int is_16bit= shift + depth <=16;
70 
71  if (is_8bit)
72  p += !!(flags & AV_PIX_FMT_FLAG_BE);
73 
74  while (w--) {
75  unsigned val;
76  if (is_8bit) val = *p;
77  else if(is_16bit) val = flags & AV_PIX_FMT_FLAG_BE ? AV_RB16(p) : AV_RL16(p);
78  else val = flags & AV_PIX_FMT_FLAG_BE ? AV_RB32(p) : AV_RL32(p);
79  val = (val >> shift) & mask;
80  if (read_pal_component)
81  val = data[1][4 * val + c];
82  p += step;
83  if (dst_element_size == 4) *dst32++ = val;
84  else *dst16++ = val;
85  }
86  }
87 }
88 
89 void av_read_image_line(uint16_t *dst,
90  const uint8_t *data[4], const int linesize[4],
91  const AVPixFmtDescriptor *desc,
92  int x, int y, int c, int w,
93  int read_pal_component)
94 {
95  av_read_image_line2(dst, data, linesize, desc,x, y, c, w,
96  read_pal_component,
97  2);
98 }
99 
100 void av_write_image_line2(const void *src,
101  uint8_t *data[4], const int linesize[4],
102  const AVPixFmtDescriptor *desc,
103  int x, int y, int c, int w, int src_element_size)
104 {
105  AVComponentDescriptor comp = desc->comp[c];
106  int plane = comp.plane;
107  int depth = comp.depth;
108  int step = comp.step;
109  int flags = desc->flags;
110  const uint32_t *src32 = src;
111  const uint16_t *src16 = src;
112 
114  int skip = x * step + comp.offset;
115  uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
116  int shift = 8 - depth - (skip & 7);
117 
118  while (w--) {
119  *p |= (src_element_size == 4 ? *src32++ : *src16++) << shift;
120  shift -= step;
121  p -= shift >> 3;
122  shift &= 7;
123  }
124  } else {
125  int shift = comp.shift;
126  uint8_t *p = data[plane] + y * linesize[plane] +
127  x * step + comp.offset;
128 
129  if (shift + depth <= 8) {
130  p += !!(flags & AV_PIX_FMT_FLAG_BE);
131  while (w--) {
132  *p |= ((src_element_size == 4 ? *src32++ : *src16++) << shift);
133  p += step;
134  }
135  } else {
136  while (w--) {
137  unsigned s = (src_element_size == 4 ? *src32++ : *src16++);
138  if (shift + depth <= 16) {
139  if (flags & AV_PIX_FMT_FLAG_BE) {
140  uint16_t val = AV_RB16(p) | (s << shift);
141  AV_WB16(p, val);
142  } else {
143  uint16_t val = AV_RL16(p) | (s << shift);
144  AV_WL16(p, val);
145  }
146  } else {
147  if (flags & AV_PIX_FMT_FLAG_BE) {
148  uint32_t val = AV_RB32(p) | (s << shift);
149  AV_WB32(p, val);
150  } else {
151  uint32_t val = AV_RL32(p) | (s << shift);
152  AV_WL32(p, val);
153  }
154  }
155  p += step;
156  }
157  }
158  }
159 }
160 
161 void av_write_image_line(const uint16_t *src,
162  uint8_t *data[4], const int linesize[4],
163  const AVPixFmtDescriptor *desc,
164  int x, int y, int c, int w)
165 {
166  av_write_image_line2(src, data, linesize, desc, x, y, c, w, 2);
167 }
168 
170  [AV_PIX_FMT_YUV420P] = {
171  .name = "yuv420p",
172  .nb_components = 3,
173  .log2_chroma_w = 1,
174  .log2_chroma_h = 1,
175  .comp = {
176  { 0, 1, 0, 0, 8 }, /* Y */
177  { 1, 1, 0, 0, 8 }, /* U */
178  { 2, 1, 0, 0, 8 }, /* V */
179  },
180  .flags = AV_PIX_FMT_FLAG_PLANAR,
181  },
182  [AV_PIX_FMT_YUYV422] = {
183  .name = "yuyv422",
184  .nb_components = 3,
185  .log2_chroma_w = 1,
186  .log2_chroma_h = 0,
187  .comp = {
188  { 0, 2, 0, 0, 8 }, /* Y */
189  { 0, 4, 1, 0, 8 }, /* U */
190  { 0, 4, 3, 0, 8 }, /* V */
191  },
192  },
193  [AV_PIX_FMT_YVYU422] = {
194  .name = "yvyu422",
195  .nb_components = 3,
196  .log2_chroma_w = 1,
197  .log2_chroma_h = 0,
198  .comp = {
199  { 0, 2, 0, 0, 8 }, /* Y */
200  { 0, 4, 3, 0, 8 }, /* U */
201  { 0, 4, 1, 0, 8 }, /* V */
202  },
203  },
204  [AV_PIX_FMT_Y210LE] = {
205  .name = "y210le",
206  .nb_components = 3,
207  .log2_chroma_w = 1,
208  .log2_chroma_h = 0,
209  .comp = {
210  { 0, 4, 0, 6, 10 }, /* Y */
211  { 0, 8, 2, 6, 10 }, /* U */
212  { 0, 8, 6, 6, 10 }, /* V */
213  },
214  },
215  [AV_PIX_FMT_Y210BE] = {
216  .name = "y210be",
217  .nb_components = 3,
218  .log2_chroma_w = 1,
219  .log2_chroma_h = 0,
220  .comp = {
221  { 0, 4, 0, 6, 10 }, /* Y */
222  { 0, 8, 2, 6, 10 }, /* U */
223  { 0, 8, 6, 6, 10 }, /* V */
224  },
225  .flags = AV_PIX_FMT_FLAG_BE,
226  },
227  [AV_PIX_FMT_RGB24] = {
228  .name = "rgb24",
229  .nb_components = 3,
230  .log2_chroma_w = 0,
231  .log2_chroma_h = 0,
232  .comp = {
233  { 0, 3, 0, 0, 8 }, /* R */
234  { 0, 3, 1, 0, 8 }, /* G */
235  { 0, 3, 2, 0, 8 }, /* B */
236  },
237  .flags = AV_PIX_FMT_FLAG_RGB,
238  },
239  [AV_PIX_FMT_BGR24] = {
240  .name = "bgr24",
241  .nb_components = 3,
242  .log2_chroma_w = 0,
243  .log2_chroma_h = 0,
244  .comp = {
245  { 0, 3, 2, 0, 8 }, /* R */
246  { 0, 3, 1, 0, 8 }, /* G */
247  { 0, 3, 0, 0, 8 }, /* B */
248  },
249  .flags = AV_PIX_FMT_FLAG_RGB,
250  },
252  .name = "x2rgb10le",
253  .nb_components= 3,
254  .log2_chroma_w= 0,
255  .log2_chroma_h= 0,
256  .comp = {
257  { 0, 4, 2, 4, 10 }, /* R */
258  { 0, 4, 1, 2, 10 }, /* G */
259  { 0, 4, 0, 0, 10 }, /* B */
260  },
261  .flags = AV_PIX_FMT_FLAG_RGB,
262  },
264  .name = "x2rgb10be",
265  .nb_components= 3,
266  .log2_chroma_w= 0,
267  .log2_chroma_h= 0,
268  .comp = {
269  { 0, 4, 0, 4, 10 }, /* R */
270  { 0, 4, 1, 2, 10 }, /* G */
271  { 0, 4, 2, 0, 10 }, /* B */
272  },
274  },
276  .name = "x2bgr10le",
277  .nb_components= 3,
278  .log2_chroma_w= 0,
279  .log2_chroma_h= 0,
280  .comp = {
281  { 0, 4, 0, 0, 10 }, /* R */
282  { 0, 4, 1, 2, 10 }, /* G */
283  { 0, 4, 2, 4, 10 }, /* B */
284  },
285  .flags = AV_PIX_FMT_FLAG_RGB,
286  },
288  .name = "x2bgr10be",
289  .nb_components= 3,
290  .log2_chroma_w= 0,
291  .log2_chroma_h= 0,
292  .comp = {
293  { 0, 4, 2, 0, 10 }, /* R */
294  { 0, 4, 1, 2, 10 }, /* G */
295  { 0, 4, 0, 4, 10 }, /* B */
296  },
298  },
299  [AV_PIX_FMT_YUV422P] = {
300  .name = "yuv422p",
301  .nb_components = 3,
302  .log2_chroma_w = 1,
303  .log2_chroma_h = 0,
304  .comp = {
305  { 0, 1, 0, 0, 8 }, /* Y */
306  { 1, 1, 0, 0, 8 }, /* U */
307  { 2, 1, 0, 0, 8 }, /* V */
308  },
309  .flags = AV_PIX_FMT_FLAG_PLANAR,
310  },
311  [AV_PIX_FMT_YUV444P] = {
312  .name = "yuv444p",
313  .nb_components = 3,
314  .log2_chroma_w = 0,
315  .log2_chroma_h = 0,
316  .comp = {
317  { 0, 1, 0, 0, 8 }, /* Y */
318  { 1, 1, 0, 0, 8 }, /* U */
319  { 2, 1, 0, 0, 8 }, /* V */
320  },
321  .flags = AV_PIX_FMT_FLAG_PLANAR,
322  },
323  [AV_PIX_FMT_YUV410P] = {
324  .name = "yuv410p",
325  .nb_components = 3,
326  .log2_chroma_w = 2,
327  .log2_chroma_h = 2,
328  .comp = {
329  { 0, 1, 0, 0, 8 }, /* Y */
330  { 1, 1, 0, 0, 8 }, /* U */
331  { 2, 1, 0, 0, 8 }, /* V */
332  },
333  .flags = AV_PIX_FMT_FLAG_PLANAR,
334  },
335  [AV_PIX_FMT_YUV411P] = {
336  .name = "yuv411p",
337  .nb_components = 3,
338  .log2_chroma_w = 2,
339  .log2_chroma_h = 0,
340  .comp = {
341  { 0, 1, 0, 0, 8 }, /* Y */
342  { 1, 1, 0, 0, 8 }, /* U */
343  { 2, 1, 0, 0, 8 }, /* V */
344  },
345  .flags = AV_PIX_FMT_FLAG_PLANAR,
346  },
347  [AV_PIX_FMT_YUVJ411P] = {
348  .name = "yuvj411p",
349  .nb_components = 3,
350  .log2_chroma_w = 2,
351  .log2_chroma_h = 0,
352  .comp = {
353  { 0, 1, 0, 0, 8 }, /* Y */
354  { 1, 1, 0, 0, 8 }, /* U */
355  { 2, 1, 0, 0, 8 }, /* V */
356  },
357  .flags = AV_PIX_FMT_FLAG_PLANAR,
358  },
359  [AV_PIX_FMT_GRAY8] = {
360  .name = "gray",
361  .nb_components = 1,
362  .log2_chroma_w = 0,
363  .log2_chroma_h = 0,
364  .comp = {
365  { 0, 1, 0, 0, 8 }, /* Y */
366  },
367  .alias = "gray8,y8",
368  },
370  .name = "monow",
371  .nb_components = 1,
372  .log2_chroma_w = 0,
373  .log2_chroma_h = 0,
374  .comp = {
375  { 0, 1, 0, 0, 1 }, /* Y */
376  },
377  .flags = AV_PIX_FMT_FLAG_BITSTREAM,
378  },
380  .name = "monob",
381  .nb_components = 1,
382  .log2_chroma_w = 0,
383  .log2_chroma_h = 0,
384  .comp = {
385  { 0, 1, 0, 7, 1 }, /* Y */
386  },
387  .flags = AV_PIX_FMT_FLAG_BITSTREAM,
388  },
389  [AV_PIX_FMT_PAL8] = {
390  .name = "pal8",
391  .nb_components = 1,
392  .log2_chroma_w = 0,
393  .log2_chroma_h = 0,
394  .comp = {
395  { 0, 1, 0, 0, 8 },
396  },
398  },
399  [AV_PIX_FMT_YUVJ420P] = {
400  .name = "yuvj420p",
401  .nb_components = 3,
402  .log2_chroma_w = 1,
403  .log2_chroma_h = 1,
404  .comp = {
405  { 0, 1, 0, 0, 8 }, /* Y */
406  { 1, 1, 0, 0, 8 }, /* U */
407  { 2, 1, 0, 0, 8 }, /* V */
408  },
409  .flags = AV_PIX_FMT_FLAG_PLANAR,
410  },
411  [AV_PIX_FMT_YUVJ422P] = {
412  .name = "yuvj422p",
413  .nb_components = 3,
414  .log2_chroma_w = 1,
415  .log2_chroma_h = 0,
416  .comp = {
417  { 0, 1, 0, 0, 8 }, /* Y */
418  { 1, 1, 0, 0, 8 }, /* U */
419  { 2, 1, 0, 0, 8 }, /* V */
420  },
421  .flags = AV_PIX_FMT_FLAG_PLANAR,
422  },
423  [AV_PIX_FMT_YUVJ444P] = {
424  .name = "yuvj444p",
425  .nb_components = 3,
426  .log2_chroma_w = 0,
427  .log2_chroma_h = 0,
428  .comp = {
429  { 0, 1, 0, 0, 8 }, /* Y */
430  { 1, 1, 0, 0, 8 }, /* U */
431  { 2, 1, 0, 0, 8 }, /* V */
432  },
433  .flags = AV_PIX_FMT_FLAG_PLANAR,
434  },
435 #if FF_API_XVMC
436  [AV_PIX_FMT_XVMC] = {
437  .name = "xvmc",
438  .flags = AV_PIX_FMT_FLAG_HWACCEL,
439  },
440 #endif
441  [AV_PIX_FMT_UYVY422] = {
442  .name = "uyvy422",
443  .nb_components = 3,
444  .log2_chroma_w = 1,
445  .log2_chroma_h = 0,
446  .comp = {
447  { 0, 2, 1, 0, 8 }, /* Y */
448  { 0, 4, 0, 0, 8 }, /* U */
449  { 0, 4, 2, 0, 8 }, /* V */
450  },
451  },
453  .name = "uyyvyy411",
454  .nb_components = 3,
455  .log2_chroma_w = 2,
456  .log2_chroma_h = 0,
457  .comp = {
458  { 0, 4, 1, 0, 8 }, /* Y */
459  { 0, 6, 0, 0, 8 }, /* U */
460  { 0, 6, 3, 0, 8 }, /* V */
461  },
462  },
463  [AV_PIX_FMT_BGR8] = {
464  .name = "bgr8",
465  .nb_components = 3,
466  .log2_chroma_w = 0,
467  .log2_chroma_h = 0,
468  .comp = {
469  { 0, 1, 0, 0, 3 }, /* R */
470  { 0, 1, 0, 3, 3 }, /* G */
471  { 0, 1, 0, 6, 2 }, /* B */
472  },
473  .flags = AV_PIX_FMT_FLAG_RGB,
474  },
475  [AV_PIX_FMT_BGR4] = {
476  .name = "bgr4",
477  .nb_components = 3,
478  .log2_chroma_w = 0,
479  .log2_chroma_h = 0,
480  .comp = {
481  { 0, 4, 3, 0, 1 }, /* R */
482  { 0, 4, 1, 0, 2 }, /* G */
483  { 0, 4, 0, 0, 1 }, /* B */
484  },
486  },
488  .name = "bgr4_byte",
489  .nb_components = 3,
490  .log2_chroma_w = 0,
491  .log2_chroma_h = 0,
492  .comp = {
493  { 0, 1, 0, 0, 1 }, /* R */
494  { 0, 1, 0, 1, 2 }, /* G */
495  { 0, 1, 0, 3, 1 }, /* B */
496  },
497  .flags = AV_PIX_FMT_FLAG_RGB,
498  },
499  [AV_PIX_FMT_RGB8] = {
500  .name = "rgb8",
501  .nb_components = 3,
502  .log2_chroma_w = 0,
503  .log2_chroma_h = 0,
504  .comp = {
505  { 0, 1, 0, 6, 2 }, /* R */
506  { 0, 1, 0, 3, 3 }, /* G */
507  { 0, 1, 0, 0, 3 }, /* B */
508  },
509  .flags = AV_PIX_FMT_FLAG_RGB,
510  },
511  [AV_PIX_FMT_RGB4] = {
512  .name = "rgb4",
513  .nb_components = 3,
514  .log2_chroma_w = 0,
515  .log2_chroma_h = 0,
516  .comp = {
517  { 0, 4, 0, 0, 1 }, /* R */
518  { 0, 4, 1, 0, 2 }, /* G */
519  { 0, 4, 3, 0, 1 }, /* B */
520  },
522  },
524  .name = "rgb4_byte",
525  .nb_components = 3,
526  .log2_chroma_w = 0,
527  .log2_chroma_h = 0,
528  .comp = {
529  { 0, 1, 0, 3, 1 }, /* R */
530  { 0, 1, 0, 1, 2 }, /* G */
531  { 0, 1, 0, 0, 1 }, /* B */
532  },
533  .flags = AV_PIX_FMT_FLAG_RGB,
534  },
535  [AV_PIX_FMT_NV12] = {
536  .name = "nv12",
537  .nb_components = 3,
538  .log2_chroma_w = 1,
539  .log2_chroma_h = 1,
540  .comp = {
541  { 0, 1, 0, 0, 8 }, /* Y */
542  { 1, 2, 0, 0, 8 }, /* U */
543  { 1, 2, 1, 0, 8 }, /* V */
544  },
545  .flags = AV_PIX_FMT_FLAG_PLANAR,
546  },
547  [AV_PIX_FMT_NV21] = {
548  .name = "nv21",
549  .nb_components = 3,
550  .log2_chroma_w = 1,
551  .log2_chroma_h = 1,
552  .comp = {
553  { 0, 1, 0, 0, 8 }, /* Y */
554  { 1, 2, 1, 0, 8 }, /* U */
555  { 1, 2, 0, 0, 8 }, /* V */
556  },
557  .flags = AV_PIX_FMT_FLAG_PLANAR,
558  },
559  [AV_PIX_FMT_ARGB] = {
560  .name = "argb",
561  .nb_components = 4,
562  .log2_chroma_w = 0,
563  .log2_chroma_h = 0,
564  .comp = {
565  { 0, 4, 1, 0, 8 }, /* R */
566  { 0, 4, 2, 0, 8 }, /* G */
567  { 0, 4, 3, 0, 8 }, /* B */
568  { 0, 4, 0, 0, 8 }, /* A */
569  },
571  },
572  [AV_PIX_FMT_RGBA] = {
573  .name = "rgba",
574  .nb_components = 4,
575  .log2_chroma_w = 0,
576  .log2_chroma_h = 0,
577  .comp = {
578  { 0, 4, 0, 0, 8 }, /* R */
579  { 0, 4, 1, 0, 8 }, /* G */
580  { 0, 4, 2, 0, 8 }, /* B */
581  { 0, 4, 3, 0, 8 }, /* A */
582  },
584  },
585  [AV_PIX_FMT_ABGR] = {
586  .name = "abgr",
587  .nb_components = 4,
588  .log2_chroma_w = 0,
589  .log2_chroma_h = 0,
590  .comp = {
591  { 0, 4, 3, 0, 8 }, /* R */
592  { 0, 4, 2, 0, 8 }, /* G */
593  { 0, 4, 1, 0, 8 }, /* B */
594  { 0, 4, 0, 0, 8 }, /* A */
595  },
597  },
598  [AV_PIX_FMT_BGRA] = {
599  .name = "bgra",
600  .nb_components = 4,
601  .log2_chroma_w = 0,
602  .log2_chroma_h = 0,
603  .comp = {
604  { 0, 4, 2, 0, 8 }, /* R */
605  { 0, 4, 1, 0, 8 }, /* G */
606  { 0, 4, 0, 0, 8 }, /* B */
607  { 0, 4, 3, 0, 8 }, /* A */
608  },
610  },
611  [AV_PIX_FMT_0RGB] = {
612  .name = "0rgb",
613  .nb_components= 3,
614  .log2_chroma_w= 0,
615  .log2_chroma_h= 0,
616  .comp = {
617  { 0, 4, 1, 0, 8 }, /* R */
618  { 0, 4, 2, 0, 8 }, /* G */
619  { 0, 4, 3, 0, 8 }, /* B */
620  },
621  .flags = AV_PIX_FMT_FLAG_RGB,
622  },
623  [AV_PIX_FMT_RGB0] = {
624  .name = "rgb0",
625  .nb_components= 3,
626  .log2_chroma_w= 0,
627  .log2_chroma_h= 0,
628  .comp = {
629  { 0, 4, 0, 0, 8 }, /* R */
630  { 0, 4, 1, 0, 8 }, /* G */
631  { 0, 4, 2, 0, 8 }, /* B */
632  },
633  .flags = AV_PIX_FMT_FLAG_RGB,
634  },
635  [AV_PIX_FMT_0BGR] = {
636  .name = "0bgr",
637  .nb_components= 3,
638  .log2_chroma_w= 0,
639  .log2_chroma_h= 0,
640  .comp = {
641  { 0, 4, 3, 0, 8 }, /* R */
642  { 0, 4, 2, 0, 8 }, /* G */
643  { 0, 4, 1, 0, 8 }, /* B */
644  },
645  .flags = AV_PIX_FMT_FLAG_RGB,
646  },
647  [AV_PIX_FMT_BGR0] = {
648  .name = "bgr0",
649  .nb_components= 3,
650  .log2_chroma_w= 0,
651  .log2_chroma_h= 0,
652  .comp = {
653  { 0, 4, 2, 0, 8 }, /* R */
654  { 0, 4, 1, 0, 8 }, /* G */
655  { 0, 4, 0, 0, 8 }, /* B */
656  },
657  .flags = AV_PIX_FMT_FLAG_RGB,
658  },
659  [AV_PIX_FMT_GRAY9BE] = {
660  .name = "gray9be",
661  .nb_components = 1,
662  .log2_chroma_w = 0,
663  .log2_chroma_h = 0,
664  .comp = {
665  { 0, 2, 0, 0, 9 }, /* Y */
666  },
667  .flags = AV_PIX_FMT_FLAG_BE,
668  .alias = "y9be",
669  },
670  [AV_PIX_FMT_GRAY9LE] = {
671  .name = "gray9le",
672  .nb_components = 1,
673  .log2_chroma_w = 0,
674  .log2_chroma_h = 0,
675  .comp = {
676  { 0, 2, 0, 0, 9 }, /* Y */
677  },
678  .alias = "y9le",
679  },
680  [AV_PIX_FMT_GRAY10BE] = {
681  .name = "gray10be",
682  .nb_components = 1,
683  .log2_chroma_w = 0,
684  .log2_chroma_h = 0,
685  .comp = {
686  { 0, 2, 0, 0, 10 }, /* Y */
687  },
688  .flags = AV_PIX_FMT_FLAG_BE,
689  .alias = "y10be",
690  },
691  [AV_PIX_FMT_GRAY10LE] = {
692  .name = "gray10le",
693  .nb_components = 1,
694  .log2_chroma_w = 0,
695  .log2_chroma_h = 0,
696  .comp = {
697  { 0, 2, 0, 0, 10 }, /* Y */
698  },
699  .alias = "y10le",
700  },
701  [AV_PIX_FMT_GRAY12BE] = {
702  .name = "gray12be",
703  .nb_components = 1,
704  .log2_chroma_w = 0,
705  .log2_chroma_h = 0,
706  .comp = {
707  { 0, 2, 0, 0, 12 }, /* Y */
708  },
709  .flags = AV_PIX_FMT_FLAG_BE,
710  .alias = "y12be",
711  },
712  [AV_PIX_FMT_GRAY12LE] = {
713  .name = "gray12le",
714  .nb_components = 1,
715  .log2_chroma_w = 0,
716  .log2_chroma_h = 0,
717  .comp = {
718  { 0, 2, 0, 0, 12 }, /* Y */
719  },
720  .alias = "y12le",
721  },
722  [AV_PIX_FMT_GRAY14BE] = {
723  .name = "gray14be",
724  .nb_components = 1,
725  .log2_chroma_w = 0,
726  .log2_chroma_h = 0,
727  .comp = {
728  { 0, 2, 0, 0, 14 }, /* Y */
729  },
730  .flags = AV_PIX_FMT_FLAG_BE,
731  .alias = "y14be",
732  },
733  [AV_PIX_FMT_GRAY14LE] = {
734  .name = "gray14le",
735  .nb_components = 1,
736  .log2_chroma_w = 0,
737  .log2_chroma_h = 0,
738  .comp = {
739  { 0, 2, 0, 0, 14 }, /* Y */
740  },
741  .alias = "y14le",
742  },
743  [AV_PIX_FMT_GRAY16BE] = {
744  .name = "gray16be",
745  .nb_components = 1,
746  .log2_chroma_w = 0,
747  .log2_chroma_h = 0,
748  .comp = {
749  { 0, 2, 0, 0, 16 }, /* Y */
750  },
751  .flags = AV_PIX_FMT_FLAG_BE,
752  .alias = "y16be",
753  },
754  [AV_PIX_FMT_GRAY16LE] = {
755  .name = "gray16le",
756  .nb_components = 1,
757  .log2_chroma_w = 0,
758  .log2_chroma_h = 0,
759  .comp = {
760  { 0, 2, 0, 0, 16 }, /* Y */
761  },
762  .alias = "y16le",
763  },
764  [AV_PIX_FMT_YUV440P] = {
765  .name = "yuv440p",
766  .nb_components = 3,
767  .log2_chroma_w = 0,
768  .log2_chroma_h = 1,
769  .comp = {
770  { 0, 1, 0, 0, 8 }, /* Y */
771  { 1, 1, 0, 0, 8 }, /* U */
772  { 2, 1, 0, 0, 8 }, /* V */
773  },
774  .flags = AV_PIX_FMT_FLAG_PLANAR,
775  },
776  [AV_PIX_FMT_YUVJ440P] = {
777  .name = "yuvj440p",
778  .nb_components = 3,
779  .log2_chroma_w = 0,
780  .log2_chroma_h = 1,
781  .comp = {
782  { 0, 1, 0, 0, 8 }, /* Y */
783  { 1, 1, 0, 0, 8 }, /* U */
784  { 2, 1, 0, 0, 8 }, /* V */
785  },
786  .flags = AV_PIX_FMT_FLAG_PLANAR,
787  },
789  .name = "yuv440p10le",
790  .nb_components = 3,
791  .log2_chroma_w = 0,
792  .log2_chroma_h = 1,
793  .comp = {
794  { 0, 2, 0, 0, 10 }, /* Y */
795  { 1, 2, 0, 0, 10 }, /* U */
796  { 2, 2, 0, 0, 10 }, /* V */
797  },
798  .flags = AV_PIX_FMT_FLAG_PLANAR,
799  },
801  .name = "yuv440p10be",
802  .nb_components = 3,
803  .log2_chroma_w = 0,
804  .log2_chroma_h = 1,
805  .comp = {
806  { 0, 2, 0, 0, 10 }, /* Y */
807  { 1, 2, 0, 0, 10 }, /* U */
808  { 2, 2, 0, 0, 10 }, /* V */
809  },
811  },
813  .name = "yuv440p12le",
814  .nb_components = 3,
815  .log2_chroma_w = 0,
816  .log2_chroma_h = 1,
817  .comp = {
818  { 0, 2, 0, 0, 12 }, /* Y */
819  { 1, 2, 0, 0, 12 }, /* U */
820  { 2, 2, 0, 0, 12 }, /* V */
821  },
822  .flags = AV_PIX_FMT_FLAG_PLANAR,
823  },
825  .name = "yuv440p12be",
826  .nb_components = 3,
827  .log2_chroma_w = 0,
828  .log2_chroma_h = 1,
829  .comp = {
830  { 0, 2, 0, 0, 12 }, /* Y */
831  { 1, 2, 0, 0, 12 }, /* U */
832  { 2, 2, 0, 0, 12 }, /* V */
833  },
835  },
836  [AV_PIX_FMT_YUVA420P] = {
837  .name = "yuva420p",
838  .nb_components = 4,
839  .log2_chroma_w = 1,
840  .log2_chroma_h = 1,
841  .comp = {
842  { 0, 1, 0, 0, 8 }, /* Y */
843  { 1, 1, 0, 0, 8 }, /* U */
844  { 2, 1, 0, 0, 8 }, /* V */
845  { 3, 1, 0, 0, 8 }, /* A */
846  },
848  },
849  [AV_PIX_FMT_YUVA422P] = {
850  .name = "yuva422p",
851  .nb_components = 4,
852  .log2_chroma_w = 1,
853  .log2_chroma_h = 0,
854  .comp = {
855  { 0, 1, 0, 0, 8 }, /* Y */
856  { 1, 1, 0, 0, 8 }, /* U */
857  { 2, 1, 0, 0, 8 }, /* V */
858  { 3, 1, 0, 0, 8 }, /* A */
859  },
861  },
862  [AV_PIX_FMT_YUVA444P] = {
863  .name = "yuva444p",
864  .nb_components = 4,
865  .log2_chroma_w = 0,
866  .log2_chroma_h = 0,
867  .comp = {
868  { 0, 1, 0, 0, 8 }, /* Y */
869  { 1, 1, 0, 0, 8 }, /* U */
870  { 2, 1, 0, 0, 8 }, /* V */
871  { 3, 1, 0, 0, 8 }, /* A */
872  },
874  },
876  .name = "yuva420p9be",
877  .nb_components = 4,
878  .log2_chroma_w = 1,
879  .log2_chroma_h = 1,
880  .comp = {
881  { 0, 2, 0, 0, 9 }, /* Y */
882  { 1, 2, 0, 0, 9 }, /* U */
883  { 2, 2, 0, 0, 9 }, /* V */
884  { 3, 2, 0, 0, 9 }, /* A */
885  },
887  },
889  .name = "yuva420p9le",
890  .nb_components = 4,
891  .log2_chroma_w = 1,
892  .log2_chroma_h = 1,
893  .comp = {
894  { 0, 2, 0, 0, 9 }, /* Y */
895  { 1, 2, 0, 0, 9 }, /* U */
896  { 2, 2, 0, 0, 9 }, /* V */
897  { 3, 2, 0, 0, 9 }, /* A */
898  },
900  },
902  .name = "yuva422p9be",
903  .nb_components = 4,
904  .log2_chroma_w = 1,
905  .log2_chroma_h = 0,
906  .comp = {
907  { 0, 2, 0, 0, 9 }, /* Y */
908  { 1, 2, 0, 0, 9 }, /* U */
909  { 2, 2, 0, 0, 9 }, /* V */
910  { 3, 2, 0, 0, 9 }, /* A */
911  },
913  },
915  .name = "yuva422p9le",
916  .nb_components = 4,
917  .log2_chroma_w = 1,
918  .log2_chroma_h = 0,
919  .comp = {
920  { 0, 2, 0, 0, 9 }, /* Y */
921  { 1, 2, 0, 0, 9 }, /* U */
922  { 2, 2, 0, 0, 9 }, /* V */
923  { 3, 2, 0, 0, 9 }, /* A */
924  },
926  },
928  .name = "yuva444p9be",
929  .nb_components = 4,
930  .log2_chroma_w = 0,
931  .log2_chroma_h = 0,
932  .comp = {
933  { 0, 2, 0, 0, 9 }, /* Y */
934  { 1, 2, 0, 0, 9 }, /* U */
935  { 2, 2, 0, 0, 9 }, /* V */
936  { 3, 2, 0, 0, 9 }, /* A */
937  },
939  },
941  .name = "yuva444p9le",
942  .nb_components = 4,
943  .log2_chroma_w = 0,
944  .log2_chroma_h = 0,
945  .comp = {
946  { 0, 2, 0, 0, 9 }, /* Y */
947  { 1, 2, 0, 0, 9 }, /* U */
948  { 2, 2, 0, 0, 9 }, /* V */
949  { 3, 2, 0, 0, 9 }, /* A */
950  },
952  },
954  .name = "yuva420p10be",
955  .nb_components = 4,
956  .log2_chroma_w = 1,
957  .log2_chroma_h = 1,
958  .comp = {
959  { 0, 2, 0, 0, 10 }, /* Y */
960  { 1, 2, 0, 0, 10 }, /* U */
961  { 2, 2, 0, 0, 10 }, /* V */
962  { 3, 2, 0, 0, 10 }, /* A */
963  },
965  },
967  .name = "yuva420p10le",
968  .nb_components = 4,
969  .log2_chroma_w = 1,
970  .log2_chroma_h = 1,
971  .comp = {
972  { 0, 2, 0, 0, 10 }, /* Y */
973  { 1, 2, 0, 0, 10 }, /* U */
974  { 2, 2, 0, 0, 10 }, /* V */
975  { 3, 2, 0, 0, 10 }, /* A */
976  },
978  },
980  .name = "yuva422p10be",
981  .nb_components = 4,
982  .log2_chroma_w = 1,
983  .log2_chroma_h = 0,
984  .comp = {
985  { 0, 2, 0, 0, 10 }, /* Y */
986  { 1, 2, 0, 0, 10 }, /* U */
987  { 2, 2, 0, 0, 10 }, /* V */
988  { 3, 2, 0, 0, 10 }, /* A */
989  },
991  },
993  .name = "yuva422p10le",
994  .nb_components = 4,
995  .log2_chroma_w = 1,
996  .log2_chroma_h = 0,
997  .comp = {
998  { 0, 2, 0, 0, 10 }, /* Y */
999  { 1, 2, 0, 0, 10 }, /* U */
1000  { 2, 2, 0, 0, 10 }, /* V */
1001  { 3, 2, 0, 0, 10 }, /* A */
1002  },
1004  },
1006  .name = "yuva444p10be",
1007  .nb_components = 4,
1008  .log2_chroma_w = 0,
1009  .log2_chroma_h = 0,
1010  .comp = {
1011  { 0, 2, 0, 0, 10 }, /* Y */
1012  { 1, 2, 0, 0, 10 }, /* U */
1013  { 2, 2, 0, 0, 10 }, /* V */
1014  { 3, 2, 0, 0, 10 }, /* A */
1015  },
1017  },
1019  .name = "yuva444p10le",
1020  .nb_components = 4,
1021  .log2_chroma_w = 0,
1022  .log2_chroma_h = 0,
1023  .comp = {
1024  { 0, 2, 0, 0, 10 }, /* Y */
1025  { 1, 2, 0, 0, 10 }, /* U */
1026  { 2, 2, 0, 0, 10 }, /* V */
1027  { 3, 2, 0, 0, 10 }, /* A */
1028  },
1030  },
1032  .name = "yuva420p16be",
1033  .nb_components = 4,
1034  .log2_chroma_w = 1,
1035  .log2_chroma_h = 1,
1036  .comp = {
1037  { 0, 2, 0, 0, 16 }, /* Y */
1038  { 1, 2, 0, 0, 16 }, /* U */
1039  { 2, 2, 0, 0, 16 }, /* V */
1040  { 3, 2, 0, 0, 16 }, /* A */
1041  },
1043  },
1045  .name = "yuva420p16le",
1046  .nb_components = 4,
1047  .log2_chroma_w = 1,
1048  .log2_chroma_h = 1,
1049  .comp = {
1050  { 0, 2, 0, 0, 16 }, /* Y */
1051  { 1, 2, 0, 0, 16 }, /* U */
1052  { 2, 2, 0, 0, 16 }, /* V */
1053  { 3, 2, 0, 0, 16 }, /* A */
1054  },
1056  },
1058  .name = "yuva422p16be",
1059  .nb_components = 4,
1060  .log2_chroma_w = 1,
1061  .log2_chroma_h = 0,
1062  .comp = {
1063  { 0, 2, 0, 0, 16 }, /* Y */
1064  { 1, 2, 0, 0, 16 }, /* U */
1065  { 2, 2, 0, 0, 16 }, /* V */
1066  { 3, 2, 0, 0, 16 }, /* A */
1067  },
1069  },
1071  .name = "yuva422p16le",
1072  .nb_components = 4,
1073  .log2_chroma_w = 1,
1074  .log2_chroma_h = 0,
1075  .comp = {
1076  { 0, 2, 0, 0, 16 }, /* Y */
1077  { 1, 2, 0, 0, 16 }, /* U */
1078  { 2, 2, 0, 0, 16 }, /* V */
1079  { 3, 2, 0, 0, 16 }, /* A */
1080  },
1082  },
1084  .name = "yuva444p16be",
1085  .nb_components = 4,
1086  .log2_chroma_w = 0,
1087  .log2_chroma_h = 0,
1088  .comp = {
1089  { 0, 2, 0, 0, 16 }, /* Y */
1090  { 1, 2, 0, 0, 16 }, /* U */
1091  { 2, 2, 0, 0, 16 }, /* V */
1092  { 3, 2, 0, 0, 16 }, /* A */
1093  },
1095  },
1097  .name = "yuva444p16le",
1098  .nb_components = 4,
1099  .log2_chroma_w = 0,
1100  .log2_chroma_h = 0,
1101  .comp = {
1102  { 0, 2, 0, 0, 16 }, /* Y */
1103  { 1, 2, 0, 0, 16 }, /* U */
1104  { 2, 2, 0, 0, 16 }, /* V */
1105  { 3, 2, 0, 0, 16 }, /* A */
1106  },
1108  },
1109  [AV_PIX_FMT_RGB48BE] = {
1110  .name = "rgb48be",
1111  .nb_components = 3,
1112  .log2_chroma_w = 0,
1113  .log2_chroma_h = 0,
1114  .comp = {
1115  { 0, 6, 0, 0, 16 }, /* R */
1116  { 0, 6, 2, 0, 16 }, /* G */
1117  { 0, 6, 4, 0, 16 }, /* B */
1118  },
1120  },
1121  [AV_PIX_FMT_RGB48LE] = {
1122  .name = "rgb48le",
1123  .nb_components = 3,
1124  .log2_chroma_w = 0,
1125  .log2_chroma_h = 0,
1126  .comp = {
1127  { 0, 6, 0, 0, 16 }, /* R */
1128  { 0, 6, 2, 0, 16 }, /* G */
1129  { 0, 6, 4, 0, 16 }, /* B */
1130  },
1131  .flags = AV_PIX_FMT_FLAG_RGB,
1132  },
1133  [AV_PIX_FMT_RGBA64BE] = {
1134  .name = "rgba64be",
1135  .nb_components = 4,
1136  .log2_chroma_w = 0,
1137  .log2_chroma_h = 0,
1138  .comp = {
1139  { 0, 8, 0, 0, 16 }, /* R */
1140  { 0, 8, 2, 0, 16 }, /* G */
1141  { 0, 8, 4, 0, 16 }, /* B */
1142  { 0, 8, 6, 0, 16 }, /* A */
1143  },
1145  },
1146  [AV_PIX_FMT_RGBA64LE] = {
1147  .name = "rgba64le",
1148  .nb_components = 4,
1149  .log2_chroma_w = 0,
1150  .log2_chroma_h = 0,
1151  .comp = {
1152  { 0, 8, 0, 0, 16 }, /* R */
1153  { 0, 8, 2, 0, 16 }, /* G */
1154  { 0, 8, 4, 0, 16 }, /* B */
1155  { 0, 8, 6, 0, 16 }, /* A */
1156  },
1158  },
1159  [AV_PIX_FMT_RGB565BE] = {
1160  .name = "rgb565be",
1161  .nb_components = 3,
1162  .log2_chroma_w = 0,
1163  .log2_chroma_h = 0,
1164  .comp = {
1165  { 0, 2, -1, 3, 5 }, /* R */
1166  { 0, 2, 0, 5, 6 }, /* G */
1167  { 0, 2, 0, 0, 5 }, /* B */
1168  },
1170  },
1171  [AV_PIX_FMT_RGB565LE] = {
1172  .name = "rgb565le",
1173  .nb_components = 3,
1174  .log2_chroma_w = 0,
1175  .log2_chroma_h = 0,
1176  .comp = {
1177  { 0, 2, 1, 3, 5 }, /* R */
1178  { 0, 2, 0, 5, 6 }, /* G */
1179  { 0, 2, 0, 0, 5 }, /* B */
1180  },
1181  .flags = AV_PIX_FMT_FLAG_RGB,
1182  },
1183  [AV_PIX_FMT_RGB555BE] = {
1184  .name = "rgb555be",
1185  .nb_components = 3,
1186  .log2_chroma_w = 0,
1187  .log2_chroma_h = 0,
1188  .comp = {
1189  { 0, 2, -1, 2, 5 }, /* R */
1190  { 0, 2, 0, 5, 5 }, /* G */
1191  { 0, 2, 0, 0, 5 }, /* B */
1192  },
1194  },
1195  [AV_PIX_FMT_RGB555LE] = {
1196  .name = "rgb555le",
1197  .nb_components = 3,
1198  .log2_chroma_w = 0,
1199  .log2_chroma_h = 0,
1200  .comp = {
1201  { 0, 2, 1, 2, 5 }, /* R */
1202  { 0, 2, 0, 5, 5 }, /* G */
1203  { 0, 2, 0, 0, 5 }, /* B */
1204  },
1205  .flags = AV_PIX_FMT_FLAG_RGB,
1206  },
1207  [AV_PIX_FMT_RGB444BE] = {
1208  .name = "rgb444be",
1209  .nb_components = 3,
1210  .log2_chroma_w = 0,
1211  .log2_chroma_h = 0,
1212  .comp = {
1213  { 0, 2, -1, 0, 4 }, /* R */
1214  { 0, 2, 0, 4, 4 }, /* G */
1215  { 0, 2, 0, 0, 4 }, /* B */
1216  },
1218  },
1219  [AV_PIX_FMT_RGB444LE] = {
1220  .name = "rgb444le",
1221  .nb_components = 3,
1222  .log2_chroma_w = 0,
1223  .log2_chroma_h = 0,
1224  .comp = {
1225  { 0, 2, 1, 0, 4 }, /* R */
1226  { 0, 2, 0, 4, 4 }, /* G */
1227  { 0, 2, 0, 0, 4 }, /* B */
1228  },
1229  .flags = AV_PIX_FMT_FLAG_RGB,
1230  },
1231  [AV_PIX_FMT_BGR48BE] = {
1232  .name = "bgr48be",
1233  .nb_components = 3,
1234  .log2_chroma_w = 0,
1235  .log2_chroma_h = 0,
1236  .comp = {
1237  { 0, 6, 4, 0, 16 }, /* R */
1238  { 0, 6, 2, 0, 16 }, /* G */
1239  { 0, 6, 0, 0, 16 }, /* B */
1240  },
1242  },
1243  [AV_PIX_FMT_BGR48LE] = {
1244  .name = "bgr48le",
1245  .nb_components = 3,
1246  .log2_chroma_w = 0,
1247  .log2_chroma_h = 0,
1248  .comp = {
1249  { 0, 6, 4, 0, 16 }, /* R */
1250  { 0, 6, 2, 0, 16 }, /* G */
1251  { 0, 6, 0, 0, 16 }, /* B */
1252  },
1253  .flags = AV_PIX_FMT_FLAG_RGB,
1254  },
1255  [AV_PIX_FMT_BGRA64BE] = {
1256  .name = "bgra64be",
1257  .nb_components = 4,
1258  .log2_chroma_w = 0,
1259  .log2_chroma_h = 0,
1260  .comp = {
1261  { 0, 8, 4, 0, 16 }, /* R */
1262  { 0, 8, 2, 0, 16 }, /* G */
1263  { 0, 8, 0, 0, 16 }, /* B */
1264  { 0, 8, 6, 0, 16 }, /* A */
1265  },
1267  },
1268  [AV_PIX_FMT_BGRA64LE] = {
1269  .name = "bgra64le",
1270  .nb_components = 4,
1271  .log2_chroma_w = 0,
1272  .log2_chroma_h = 0,
1273  .comp = {
1274  { 0, 8, 4, 0, 16 }, /* R */
1275  { 0, 8, 2, 0, 16 }, /* G */
1276  { 0, 8, 0, 0, 16 }, /* B */
1277  { 0, 8, 6, 0, 16 }, /* A */
1278  },
1280  },
1281  [AV_PIX_FMT_BGR565BE] = {
1282  .name = "bgr565be",
1283  .nb_components = 3,
1284  .log2_chroma_w = 0,
1285  .log2_chroma_h = 0,
1286  .comp = {
1287  { 0, 2, 0, 0, 5 }, /* R */
1288  { 0, 2, 0, 5, 6 }, /* G */
1289  { 0, 2, -1, 3, 5 }, /* B */
1290  },
1292  },
1293  [AV_PIX_FMT_BGR565LE] = {
1294  .name = "bgr565le",
1295  .nb_components = 3,
1296  .log2_chroma_w = 0,
1297  .log2_chroma_h = 0,
1298  .comp = {
1299  { 0, 2, 0, 0, 5 }, /* R */
1300  { 0, 2, 0, 5, 6 }, /* G */
1301  { 0, 2, 1, 3, 5 }, /* B */
1302  },
1303  .flags = AV_PIX_FMT_FLAG_RGB,
1304  },
1305  [AV_PIX_FMT_BGR555BE] = {
1306  .name = "bgr555be",
1307  .nb_components = 3,
1308  .log2_chroma_w = 0,
1309  .log2_chroma_h = 0,
1310  .comp = {
1311  { 0, 2, 0, 0, 5 }, /* R */
1312  { 0, 2, 0, 5, 5 }, /* G */
1313  { 0, 2, -1, 2, 5 }, /* B */
1314  },
1316  },
1317  [AV_PIX_FMT_BGR555LE] = {
1318  .name = "bgr555le",
1319  .nb_components = 3,
1320  .log2_chroma_w = 0,
1321  .log2_chroma_h = 0,
1322  .comp = {
1323  { 0, 2, 0, 0, 5 }, /* R */
1324  { 0, 2, 0, 5, 5 }, /* G */
1325  { 0, 2, 1, 2, 5 }, /* B */
1326  },
1327  .flags = AV_PIX_FMT_FLAG_RGB,
1328  },
1329  [AV_PIX_FMT_BGR444BE] = {
1330  .name = "bgr444be",
1331  .nb_components = 3,
1332  .log2_chroma_w = 0,
1333  .log2_chroma_h = 0,
1334  .comp = {
1335  { 0, 2, 0, 0, 4 }, /* R */
1336  { 0, 2, 0, 4, 4 }, /* G */
1337  { 0, 2, -1, 0, 4 }, /* B */
1338  },
1340  },
1341  [AV_PIX_FMT_BGR444LE] = {
1342  .name = "bgr444le",
1343  .nb_components = 3,
1344  .log2_chroma_w = 0,
1345  .log2_chroma_h = 0,
1346  .comp = {
1347  { 0, 2, 0, 0, 4 }, /* R */
1348  { 0, 2, 0, 4, 4 }, /* G */
1349  { 0, 2, 1, 0, 4 }, /* B */
1350  },
1351  .flags = AV_PIX_FMT_FLAG_RGB,
1352  },
1353  [AV_PIX_FMT_VAAPI] = {
1354  .name = "vaapi",
1355  .log2_chroma_w = 1,
1356  .log2_chroma_h = 1,
1357  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1358  },
1359  [AV_PIX_FMT_YUV420P9LE] = {
1360  .name = "yuv420p9le",
1361  .nb_components = 3,
1362  .log2_chroma_w = 1,
1363  .log2_chroma_h = 1,
1364  .comp = {
1365  { 0, 2, 0, 0, 9 }, /* Y */
1366  { 1, 2, 0, 0, 9 }, /* U */
1367  { 2, 2, 0, 0, 9 }, /* V */
1368  },
1369  .flags = AV_PIX_FMT_FLAG_PLANAR,
1370  },
1371  [AV_PIX_FMT_YUV420P9BE] = {
1372  .name = "yuv420p9be",
1373  .nb_components = 3,
1374  .log2_chroma_w = 1,
1375  .log2_chroma_h = 1,
1376  .comp = {
1377  { 0, 2, 0, 0, 9 }, /* Y */
1378  { 1, 2, 0, 0, 9 }, /* U */
1379  { 2, 2, 0, 0, 9 }, /* V */
1380  },
1382  },
1384  .name = "yuv420p10le",
1385  .nb_components = 3,
1386  .log2_chroma_w = 1,
1387  .log2_chroma_h = 1,
1388  .comp = {
1389  { 0, 2, 0, 0, 10 }, /* Y */
1390  { 1, 2, 0, 0, 10 }, /* U */
1391  { 2, 2, 0, 0, 10 }, /* V */
1392  },
1393  .flags = AV_PIX_FMT_FLAG_PLANAR,
1394  },
1396  .name = "yuv420p10be",
1397  .nb_components = 3,
1398  .log2_chroma_w = 1,
1399  .log2_chroma_h = 1,
1400  .comp = {
1401  { 0, 2, 0, 0, 10 }, /* Y */
1402  { 1, 2, 0, 0, 10 }, /* U */
1403  { 2, 2, 0, 0, 10 }, /* V */
1404  },
1406  },
1408  .name = "yuv420p12le",
1409  .nb_components = 3,
1410  .log2_chroma_w = 1,
1411  .log2_chroma_h = 1,
1412  .comp = {
1413  { 0, 2, 0, 0, 12 }, /* Y */
1414  { 1, 2, 0, 0, 12 }, /* U */
1415  { 2, 2, 0, 0, 12 }, /* V */
1416  },
1417  .flags = AV_PIX_FMT_FLAG_PLANAR,
1418  },
1420  .name = "yuv420p12be",
1421  .nb_components = 3,
1422  .log2_chroma_w = 1,
1423  .log2_chroma_h = 1,
1424  .comp = {
1425  { 0, 2, 0, 0, 12 }, /* Y */
1426  { 1, 2, 0, 0, 12 }, /* U */
1427  { 2, 2, 0, 0, 12 }, /* V */
1428  },
1430  },
1432  .name = "yuv420p14le",
1433  .nb_components = 3,
1434  .log2_chroma_w = 1,
1435  .log2_chroma_h = 1,
1436  .comp = {
1437  { 0, 2, 0, 0, 14 }, /* Y */
1438  { 1, 2, 0, 0, 14 }, /* U */
1439  { 2, 2, 0, 0, 14 }, /* V */
1440  },
1441  .flags = AV_PIX_FMT_FLAG_PLANAR,
1442  },
1444  .name = "yuv420p14be",
1445  .nb_components = 3,
1446  .log2_chroma_w = 1,
1447  .log2_chroma_h = 1,
1448  .comp = {
1449  { 0, 2, 0, 0, 14 }, /* Y */
1450  { 1, 2, 0, 0, 14 }, /* U */
1451  { 2, 2, 0, 0, 14 }, /* V */
1452  },
1454  },
1456  .name = "yuv420p16le",
1457  .nb_components = 3,
1458  .log2_chroma_w = 1,
1459  .log2_chroma_h = 1,
1460  .comp = {
1461  { 0, 2, 0, 0, 16 }, /* Y */
1462  { 1, 2, 0, 0, 16 }, /* U */
1463  { 2, 2, 0, 0, 16 }, /* V */
1464  },
1465  .flags = AV_PIX_FMT_FLAG_PLANAR,
1466  },
1468  .name = "yuv420p16be",
1469  .nb_components = 3,
1470  .log2_chroma_w = 1,
1471  .log2_chroma_h = 1,
1472  .comp = {
1473  { 0, 2, 0, 0, 16 }, /* Y */
1474  { 1, 2, 0, 0, 16 }, /* U */
1475  { 2, 2, 0, 0, 16 }, /* V */
1476  },
1478  },
1479  [AV_PIX_FMT_YUV422P9LE] = {
1480  .name = "yuv422p9le",
1481  .nb_components = 3,
1482  .log2_chroma_w = 1,
1483  .log2_chroma_h = 0,
1484  .comp = {
1485  { 0, 2, 0, 0, 9 }, /* Y */
1486  { 1, 2, 0, 0, 9 }, /* U */
1487  { 2, 2, 0, 0, 9 }, /* V */
1488  },
1489  .flags = AV_PIX_FMT_FLAG_PLANAR,
1490  },
1491  [AV_PIX_FMT_YUV422P9BE] = {
1492  .name = "yuv422p9be",
1493  .nb_components = 3,
1494  .log2_chroma_w = 1,
1495  .log2_chroma_h = 0,
1496  .comp = {
1497  { 0, 2, 0, 0, 9 }, /* Y */
1498  { 1, 2, 0, 0, 9 }, /* U */
1499  { 2, 2, 0, 0, 9 }, /* V */
1500  },
1502  },
1504  .name = "yuv422p10le",
1505  .nb_components = 3,
1506  .log2_chroma_w = 1,
1507  .log2_chroma_h = 0,
1508  .comp = {
1509  { 0, 2, 0, 0, 10 }, /* Y */
1510  { 1, 2, 0, 0, 10 }, /* U */
1511  { 2, 2, 0, 0, 10 }, /* V */
1512  },
1513  .flags = AV_PIX_FMT_FLAG_PLANAR,
1514  },
1516  .name = "yuv422p10be",
1517  .nb_components = 3,
1518  .log2_chroma_w = 1,
1519  .log2_chroma_h = 0,
1520  .comp = {
1521  { 0, 2, 0, 0, 10 }, /* Y */
1522  { 1, 2, 0, 0, 10 }, /* U */
1523  { 2, 2, 0, 0, 10 }, /* V */
1524  },
1526  },
1528  .name = "yuv422p12le",
1529  .nb_components = 3,
1530  .log2_chroma_w = 1,
1531  .log2_chroma_h = 0,
1532  .comp = {
1533  { 0, 2, 0, 0, 12 }, /* Y */
1534  { 1, 2, 0, 0, 12 }, /* U */
1535  { 2, 2, 0, 0, 12 }, /* V */
1536  },
1537  .flags = AV_PIX_FMT_FLAG_PLANAR,
1538  },
1540  .name = "yuv422p12be",
1541  .nb_components = 3,
1542  .log2_chroma_w = 1,
1543  .log2_chroma_h = 0,
1544  .comp = {
1545  { 0, 2, 0, 0, 12 }, /* Y */
1546  { 1, 2, 0, 0, 12 }, /* U */
1547  { 2, 2, 0, 0, 12 }, /* V */
1548  },
1550  },
1552  .name = "yuv422p14le",
1553  .nb_components = 3,
1554  .log2_chroma_w = 1,
1555  .log2_chroma_h = 0,
1556  .comp = {
1557  { 0, 2, 0, 0, 14 }, /* Y */
1558  { 1, 2, 0, 0, 14 }, /* U */
1559  { 2, 2, 0, 0, 14 }, /* V */
1560  },
1561  .flags = AV_PIX_FMT_FLAG_PLANAR,
1562  },
1564  .name = "yuv422p14be",
1565  .nb_components = 3,
1566  .log2_chroma_w = 1,
1567  .log2_chroma_h = 0,
1568  .comp = {
1569  { 0, 2, 0, 0, 14 }, /* Y */
1570  { 1, 2, 0, 0, 14 }, /* U */
1571  { 2, 2, 0, 0, 14 }, /* V */
1572  },
1574  },
1576  .name = "yuv422p16le",
1577  .nb_components = 3,
1578  .log2_chroma_w = 1,
1579  .log2_chroma_h = 0,
1580  .comp = {
1581  { 0, 2, 0, 0, 16 }, /* Y */
1582  { 1, 2, 0, 0, 16 }, /* U */
1583  { 2, 2, 0, 0, 16 }, /* V */
1584  },
1585  .flags = AV_PIX_FMT_FLAG_PLANAR,
1586  },
1588  .name = "yuv422p16be",
1589  .nb_components = 3,
1590  .log2_chroma_w = 1,
1591  .log2_chroma_h = 0,
1592  .comp = {
1593  { 0, 2, 0, 0, 16 }, /* Y */
1594  { 1, 2, 0, 0, 16 }, /* U */
1595  { 2, 2, 0, 0, 16 }, /* V */
1596  },
1598  },
1600  .name = "yuv444p16le",
1601  .nb_components = 3,
1602  .log2_chroma_w = 0,
1603  .log2_chroma_h = 0,
1604  .comp = {
1605  { 0, 2, 0, 0, 16 }, /* Y */
1606  { 1, 2, 0, 0, 16 }, /* U */
1607  { 2, 2, 0, 0, 16 }, /* V */
1608  },
1609  .flags = AV_PIX_FMT_FLAG_PLANAR,
1610  },
1612  .name = "yuv444p16be",
1613  .nb_components = 3,
1614  .log2_chroma_w = 0,
1615  .log2_chroma_h = 0,
1616  .comp = {
1617  { 0, 2, 0, 0, 16 }, /* Y */
1618  { 1, 2, 0, 0, 16 }, /* U */
1619  { 2, 2, 0, 0, 16 }, /* V */
1620  },
1622  },
1624  .name = "yuv444p10le",
1625  .nb_components = 3,
1626  .log2_chroma_w = 0,
1627  .log2_chroma_h = 0,
1628  .comp = {
1629  { 0, 2, 0, 0, 10 }, /* Y */
1630  { 1, 2, 0, 0, 10 }, /* U */
1631  { 2, 2, 0, 0, 10 }, /* V */
1632  },
1633  .flags = AV_PIX_FMT_FLAG_PLANAR,
1634  },
1636  .name = "yuv444p10be",
1637  .nb_components = 3,
1638  .log2_chroma_w = 0,
1639  .log2_chroma_h = 0,
1640  .comp = {
1641  { 0, 2, 0, 0, 10 }, /* Y */
1642  { 1, 2, 0, 0, 10 }, /* U */
1643  { 2, 2, 0, 0, 10 }, /* V */
1644  },
1646  },
1647  [AV_PIX_FMT_YUV444P9LE] = {
1648  .name = "yuv444p9le",
1649  .nb_components = 3,
1650  .log2_chroma_w = 0,
1651  .log2_chroma_h = 0,
1652  .comp = {
1653  { 0, 2, 0, 0, 9 }, /* Y */
1654  { 1, 2, 0, 0, 9 }, /* U */
1655  { 2, 2, 0, 0, 9 }, /* V */
1656  },
1657  .flags = AV_PIX_FMT_FLAG_PLANAR,
1658  },
1659  [AV_PIX_FMT_YUV444P9BE] = {
1660  .name = "yuv444p9be",
1661  .nb_components = 3,
1662  .log2_chroma_w = 0,
1663  .log2_chroma_h = 0,
1664  .comp = {
1665  { 0, 2, 0, 0, 9 }, /* Y */
1666  { 1, 2, 0, 0, 9 }, /* U */
1667  { 2, 2, 0, 0, 9 }, /* V */
1668  },
1670  },
1672  .name = "yuv444p12le",
1673  .nb_components = 3,
1674  .log2_chroma_w = 0,
1675  .log2_chroma_h = 0,
1676  .comp = {
1677  { 0, 2, 0, 0, 12 }, /* Y */
1678  { 1, 2, 0, 0, 12 }, /* U */
1679  { 2, 2, 0, 0, 12 }, /* V */
1680  },
1681  .flags = AV_PIX_FMT_FLAG_PLANAR,
1682  },
1684  .name = "yuv444p12be",
1685  .nb_components = 3,
1686  .log2_chroma_w = 0,
1687  .log2_chroma_h = 0,
1688  .comp = {
1689  { 0, 2, 0, 0, 12 }, /* Y */
1690  { 1, 2, 0, 0, 12 }, /* U */
1691  { 2, 2, 0, 0, 12 }, /* V */
1692  },
1694  },
1696  .name = "yuv444p14le",
1697  .nb_components = 3,
1698  .log2_chroma_w = 0,
1699  .log2_chroma_h = 0,
1700  .comp = {
1701  { 0, 2, 0, 0, 14 }, /* Y */
1702  { 1, 2, 0, 0, 14 }, /* U */
1703  { 2, 2, 0, 0, 14 }, /* V */
1704  },
1705  .flags = AV_PIX_FMT_FLAG_PLANAR,
1706  },
1708  .name = "yuv444p14be",
1709  .nb_components = 3,
1710  .log2_chroma_w = 0,
1711  .log2_chroma_h = 0,
1712  .comp = {
1713  { 0, 2, 0, 0, 14 }, /* Y */
1714  { 1, 2, 0, 0, 14 }, /* U */
1715  { 2, 2, 0, 0, 14 }, /* V */
1716  },
1718  },
1720  .name = "d3d11va_vld",
1721  .log2_chroma_w = 1,
1722  .log2_chroma_h = 1,
1723  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1724  },
1725  [AV_PIX_FMT_DXVA2_VLD] = {
1726  .name = "dxva2_vld",
1727  .log2_chroma_w = 1,
1728  .log2_chroma_h = 1,
1729  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1730  },
1731  [AV_PIX_FMT_YA8] = {
1732  .name = "ya8",
1733  .nb_components = 2,
1734  .comp = {
1735  { 0, 2, 0, 0, 8 }, /* Y */
1736  { 0, 2, 1, 0, 8 }, /* A */
1737  },
1738  .flags = AV_PIX_FMT_FLAG_ALPHA,
1739  .alias = "gray8a",
1740  },
1741  [AV_PIX_FMT_YA16LE] = {
1742  .name = "ya16le",
1743  .nb_components = 2,
1744  .comp = {
1745  { 0, 4, 0, 0, 16 }, /* Y */
1746  { 0, 4, 2, 0, 16 }, /* A */
1747  },
1748  .flags = AV_PIX_FMT_FLAG_ALPHA,
1749  },
1750  [AV_PIX_FMT_YA16BE] = {
1751  .name = "ya16be",
1752  .nb_components = 2,
1753  .comp = {
1754  { 0, 4, 0, 0, 16 }, /* Y */
1755  { 0, 4, 2, 0, 16 }, /* A */
1756  },
1758  },
1760  .name = "videotoolbox_vld",
1761  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1762  },
1763  [AV_PIX_FMT_GBRP] = {
1764  .name = "gbrp",
1765  .nb_components = 3,
1766  .log2_chroma_w = 0,
1767  .log2_chroma_h = 0,
1768  .comp = {
1769  { 2, 1, 0, 0, 8 }, /* R */
1770  { 0, 1, 0, 0, 8 }, /* G */
1771  { 1, 1, 0, 0, 8 }, /* B */
1772  },
1774  },
1775  [AV_PIX_FMT_GBRP9LE] = {
1776  .name = "gbrp9le",
1777  .nb_components = 3,
1778  .log2_chroma_w = 0,
1779  .log2_chroma_h = 0,
1780  .comp = {
1781  { 2, 2, 0, 0, 9 }, /* R */
1782  { 0, 2, 0, 0, 9 }, /* G */
1783  { 1, 2, 0, 0, 9 }, /* B */
1784  },
1786  },
1787  [AV_PIX_FMT_GBRP9BE] = {
1788  .name = "gbrp9be",
1789  .nb_components = 3,
1790  .log2_chroma_w = 0,
1791  .log2_chroma_h = 0,
1792  .comp = {
1793  { 2, 2, 0, 0, 9 }, /* R */
1794  { 0, 2, 0, 0, 9 }, /* G */
1795  { 1, 2, 0, 0, 9 }, /* B */
1796  },
1798  },
1799  [AV_PIX_FMT_GBRP10LE] = {
1800  .name = "gbrp10le",
1801  .nb_components = 3,
1802  .log2_chroma_w = 0,
1803  .log2_chroma_h = 0,
1804  .comp = {
1805  { 2, 2, 0, 0, 10 }, /* R */
1806  { 0, 2, 0, 0, 10 }, /* G */
1807  { 1, 2, 0, 0, 10 }, /* B */
1808  },
1810  },
1811  [AV_PIX_FMT_GBRP10BE] = {
1812  .name = "gbrp10be",
1813  .nb_components = 3,
1814  .log2_chroma_w = 0,
1815  .log2_chroma_h = 0,
1816  .comp = {
1817  { 2, 2, 0, 0, 10 }, /* R */
1818  { 0, 2, 0, 0, 10 }, /* G */
1819  { 1, 2, 0, 0, 10 }, /* B */
1820  },
1822  },
1823  [AV_PIX_FMT_GBRP12LE] = {
1824  .name = "gbrp12le",
1825  .nb_components = 3,
1826  .log2_chroma_w = 0,
1827  .log2_chroma_h = 0,
1828  .comp = {
1829  { 2, 2, 0, 0, 12 }, /* R */
1830  { 0, 2, 0, 0, 12 }, /* G */
1831  { 1, 2, 0, 0, 12 }, /* B */
1832  },
1834  },
1835  [AV_PIX_FMT_GBRP12BE] = {
1836  .name = "gbrp12be",
1837  .nb_components = 3,
1838  .log2_chroma_w = 0,
1839  .log2_chroma_h = 0,
1840  .comp = {
1841  { 2, 2, 0, 0, 12 }, /* R */
1842  { 0, 2, 0, 0, 12 }, /* G */
1843  { 1, 2, 0, 0, 12 }, /* B */
1844  },
1846  },
1847  [AV_PIX_FMT_GBRP14LE] = {
1848  .name = "gbrp14le",
1849  .nb_components = 3,
1850  .log2_chroma_w = 0,
1851  .log2_chroma_h = 0,
1852  .comp = {
1853  { 2, 2, 0, 0, 14 }, /* R */
1854  { 0, 2, 0, 0, 14 }, /* G */
1855  { 1, 2, 0, 0, 14 }, /* B */
1856  },
1858  },
1859  [AV_PIX_FMT_GBRP14BE] = {
1860  .name = "gbrp14be",
1861  .nb_components = 3,
1862  .log2_chroma_w = 0,
1863  .log2_chroma_h = 0,
1864  .comp = {
1865  { 2, 2, 0, 0, 14 }, /* R */
1866  { 0, 2, 0, 0, 14 }, /* G */
1867  { 1, 2, 0, 0, 14 }, /* B */
1868  },
1870  },
1871  [AV_PIX_FMT_GBRP16LE] = {
1872  .name = "gbrp16le",
1873  .nb_components = 3,
1874  .log2_chroma_w = 0,
1875  .log2_chroma_h = 0,
1876  .comp = {
1877  { 2, 2, 0, 0, 16 }, /* R */
1878  { 0, 2, 0, 0, 16 }, /* G */
1879  { 1, 2, 0, 0, 16 }, /* B */
1880  },
1882  },
1883  [AV_PIX_FMT_GBRP16BE] = {
1884  .name = "gbrp16be",
1885  .nb_components = 3,
1886  .log2_chroma_w = 0,
1887  .log2_chroma_h = 0,
1888  .comp = {
1889  { 2, 2, 0, 0, 16 }, /* R */
1890  { 0, 2, 0, 0, 16 }, /* G */
1891  { 1, 2, 0, 0, 16 }, /* B */
1892  },
1894  },
1895  [AV_PIX_FMT_GBRAP] = {
1896  .name = "gbrap",
1897  .nb_components = 4,
1898  .log2_chroma_w = 0,
1899  .log2_chroma_h = 0,
1900  .comp = {
1901  { 2, 1, 0, 0, 8 }, /* R */
1902  { 0, 1, 0, 0, 8 }, /* G */
1903  { 1, 1, 0, 0, 8 }, /* B */
1904  { 3, 1, 0, 0, 8 }, /* A */
1905  },
1908  },
1909  [AV_PIX_FMT_GBRAP16LE] = {
1910  .name = "gbrap16le",
1911  .nb_components = 4,
1912  .log2_chroma_w = 0,
1913  .log2_chroma_h = 0,
1914  .comp = {
1915  { 2, 2, 0, 0, 16 }, /* R */
1916  { 0, 2, 0, 0, 16 }, /* G */
1917  { 1, 2, 0, 0, 16 }, /* B */
1918  { 3, 2, 0, 0, 16 }, /* A */
1919  },
1922  },
1923  [AV_PIX_FMT_GBRAP16BE] = {
1924  .name = "gbrap16be",
1925  .nb_components = 4,
1926  .log2_chroma_w = 0,
1927  .log2_chroma_h = 0,
1928  .comp = {
1929  { 2, 2, 0, 0, 16 }, /* R */
1930  { 0, 2, 0, 0, 16 }, /* G */
1931  { 1, 2, 0, 0, 16 }, /* B */
1932  { 3, 2, 0, 0, 16 }, /* A */
1933  },
1936  },
1937  [AV_PIX_FMT_VDPAU] = {
1938  .name = "vdpau",
1939  .log2_chroma_w = 1,
1940  .log2_chroma_h = 1,
1941  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1942  },
1943  [AV_PIX_FMT_XYZ12LE] = {
1944  .name = "xyz12le",
1945  .nb_components = 3,
1946  .log2_chroma_w = 0,
1947  .log2_chroma_h = 0,
1948  .comp = {
1949  { 0, 6, 0, 4, 12 }, /* X */
1950  { 0, 6, 2, 4, 12 }, /* Y */
1951  { 0, 6, 4, 4, 12 }, /* Z */
1952  },
1953  /*.flags = -- not used*/
1954  },
1955  [AV_PIX_FMT_XYZ12BE] = {
1956  .name = "xyz12be",
1957  .nb_components = 3,
1958  .log2_chroma_w = 0,
1959  .log2_chroma_h = 0,
1960  .comp = {
1961  { 0, 6, 0, 4, 12 }, /* X */
1962  { 0, 6, 2, 4, 12 }, /* Y */
1963  { 0, 6, 4, 4, 12 }, /* Z */
1964  },
1965  .flags = AV_PIX_FMT_FLAG_BE,
1966  },
1967 
1968 #define BAYER8_DESC_COMMON \
1969  .nb_components= 3, \
1970  .log2_chroma_w= 0, \
1971  .log2_chroma_h= 0, \
1972  .comp = { \
1973  { 0, 1, 0, 0, 2 }, \
1974  { 0, 1, 0, 0, 4 }, \
1975  { 0, 1, 0, 0, 2 }, \
1976  }, \
1977 
1978 #define BAYER16_DESC_COMMON \
1979  .nb_components= 3, \
1980  .log2_chroma_w= 0, \
1981  .log2_chroma_h= 0, \
1982  .comp = { \
1983  { 0, 2, 0, 0, 4 }, \
1984  { 0, 2, 0, 0, 8 }, \
1985  { 0, 2, 0, 0, 4 }, \
1986  }, \
1987 
1989  .name = "bayer_bggr8",
1992  },
1994  .name = "bayer_bggr16le",
1997  },
1999  .name = "bayer_bggr16be",
2002  },
2004  .name = "bayer_rggb8",
2007  },
2009  .name = "bayer_rggb16le",
2012  },
2014  .name = "bayer_rggb16be",
2017  },
2019  .name = "bayer_gbrg8",
2022  },
2024  .name = "bayer_gbrg16le",
2027  },
2029  .name = "bayer_gbrg16be",
2032  },
2034  .name = "bayer_grbg8",
2037  },
2039  .name = "bayer_grbg16le",
2042  },
2044  .name = "bayer_grbg16be",
2047  },
2048  [AV_PIX_FMT_NV16] = {
2049  .name = "nv16",
2050  .nb_components = 3,
2051  .log2_chroma_w = 1,
2052  .log2_chroma_h = 0,
2053  .comp = {
2054  { 0, 1, 0, 0, 8 }, /* Y */
2055  { 1, 2, 0, 0, 8 }, /* U */
2056  { 1, 2, 1, 0, 8 }, /* V */
2057  },
2058  .flags = AV_PIX_FMT_FLAG_PLANAR,
2059  },
2060  [AV_PIX_FMT_NV20LE] = {
2061  .name = "nv20le",
2062  .nb_components = 3,
2063  .log2_chroma_w = 1,
2064  .log2_chroma_h = 0,
2065  .comp = {
2066  { 0, 2, 0, 0, 10 }, /* Y */
2067  { 1, 4, 0, 0, 10 }, /* U */
2068  { 1, 4, 2, 0, 10 }, /* V */
2069  },
2070  .flags = AV_PIX_FMT_FLAG_PLANAR,
2071  },
2072  [AV_PIX_FMT_NV20BE] = {
2073  .name = "nv20be",
2074  .nb_components = 3,
2075  .log2_chroma_w = 1,
2076  .log2_chroma_h = 0,
2077  .comp = {
2078  { 0, 2, 0, 0, 10 }, /* Y */
2079  { 1, 4, 0, 0, 10 }, /* U */
2080  { 1, 4, 2, 0, 10 }, /* V */
2081  },
2083  },
2084  [AV_PIX_FMT_QSV] = {
2085  .name = "qsv",
2086  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2087  },
2088  [AV_PIX_FMT_MEDIACODEC] = {
2089  .name = "mediacodec",
2090  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2091  },
2092  [AV_PIX_FMT_MMAL] = {
2093  .name = "mmal",
2094  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2095  },
2096  [AV_PIX_FMT_CUDA] = {
2097  .name = "cuda",
2098  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2099  },
2100  [AV_PIX_FMT_AYUV64LE] = {
2101  .name = "ayuv64le",
2102  .nb_components = 4,
2103  .log2_chroma_w = 0,
2104  .log2_chroma_h = 0,
2105  .comp = {
2106  { 0, 8, 2, 0, 16 }, /* Y */
2107  { 0, 8, 4, 0, 16 }, /* U */
2108  { 0, 8, 6, 0, 16 }, /* V */
2109  { 0, 8, 0, 0, 16 }, /* A */
2110  },
2111  .flags = AV_PIX_FMT_FLAG_ALPHA,
2112  },
2113  [AV_PIX_FMT_AYUV64BE] = {
2114  .name = "ayuv64be",
2115  .nb_components = 4,
2116  .log2_chroma_w = 0,
2117  .log2_chroma_h = 0,
2118  .comp = {
2119  { 0, 8, 2, 0, 16 }, /* Y */
2120  { 0, 8, 4, 0, 16 }, /* U */
2121  { 0, 8, 6, 0, 16 }, /* V */
2122  { 0, 8, 0, 0, 16 }, /* A */
2123  },
2125  },
2126  [AV_PIX_FMT_P010LE] = {
2127  .name = "p010le",
2128  .nb_components = 3,
2129  .log2_chroma_w = 1,
2130  .log2_chroma_h = 1,
2131  .comp = {
2132  { 0, 2, 0, 6, 10 }, /* Y */
2133  { 1, 4, 0, 6, 10 }, /* U */
2134  { 1, 4, 2, 6, 10 }, /* V */
2135  },
2136  .flags = AV_PIX_FMT_FLAG_PLANAR,
2137  },
2138  [AV_PIX_FMT_P010BE] = {
2139  .name = "p010be",
2140  .nb_components = 3,
2141  .log2_chroma_w = 1,
2142  .log2_chroma_h = 1,
2143  .comp = {
2144  { 0, 2, 0, 6, 10 }, /* Y */
2145  { 1, 4, 0, 6, 10 }, /* U */
2146  { 1, 4, 2, 6, 10 }, /* V */
2147  },
2149  },
2150  [AV_PIX_FMT_P016LE] = {
2151  .name = "p016le",
2152  .nb_components = 3,
2153  .log2_chroma_w = 1,
2154  .log2_chroma_h = 1,
2155  .comp = {
2156  { 0, 2, 0, 0, 16 }, /* Y */
2157  { 1, 4, 0, 0, 16 }, /* U */
2158  { 1, 4, 2, 0, 16 }, /* V */
2159  },
2160  .flags = AV_PIX_FMT_FLAG_PLANAR,
2161  },
2162  [AV_PIX_FMT_P016BE] = {
2163  .name = "p016be",
2164  .nb_components = 3,
2165  .log2_chroma_w = 1,
2166  .log2_chroma_h = 1,
2167  .comp = {
2168  { 0, 2, 0, 0, 16 }, /* Y */
2169  { 1, 4, 0, 0, 16 }, /* U */
2170  { 1, 4, 2, 0, 16 }, /* V */
2171  },
2173  },
2174  [AV_PIX_FMT_GBRAP12LE] = {
2175  .name = "gbrap12le",
2176  .nb_components = 4,
2177  .log2_chroma_w = 0,
2178  .log2_chroma_h = 0,
2179  .comp = {
2180  { 2, 2, 0, 0, 12 }, /* R */
2181  { 0, 2, 0, 0, 12 }, /* G */
2182  { 1, 2, 0, 0, 12 }, /* B */
2183  { 3, 2, 0, 0, 12 }, /* A */
2184  },
2187  },
2188  [AV_PIX_FMT_GBRAP12BE] = {
2189  .name = "gbrap12be",
2190  .nb_components = 4,
2191  .log2_chroma_w = 0,
2192  .log2_chroma_h = 0,
2193  .comp = {
2194  { 2, 2, 0, 0, 12 }, /* R */
2195  { 0, 2, 0, 0, 12 }, /* G */
2196  { 1, 2, 0, 0, 12 }, /* B */
2197  { 3, 2, 0, 0, 12 }, /* A */
2198  },
2201  },
2202  [AV_PIX_FMT_GBRAP10LE] = {
2203  .name = "gbrap10le",
2204  .nb_components = 4,
2205  .log2_chroma_w = 0,
2206  .log2_chroma_h = 0,
2207  .comp = {
2208  { 2, 2, 0, 0, 10 }, /* R */
2209  { 0, 2, 0, 0, 10 }, /* G */
2210  { 1, 2, 0, 0, 10 }, /* B */
2211  { 3, 2, 0, 0, 10 }, /* A */
2212  },
2215  },
2216  [AV_PIX_FMT_GBRAP10BE] = {
2217  .name = "gbrap10be",
2218  .nb_components = 4,
2219  .log2_chroma_w = 0,
2220  .log2_chroma_h = 0,
2221  .comp = {
2222  { 2, 2, 0, 0, 10 }, /* R */
2223  { 0, 2, 0, 0, 10 }, /* G */
2224  { 1, 2, 0, 0, 10 }, /* B */
2225  { 3, 2, 0, 0, 10 }, /* A */
2226  },
2229  },
2230  [AV_PIX_FMT_D3D11] = {
2231  .name = "d3d11",
2232  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2233  },
2234  [AV_PIX_FMT_GBRPF32BE] = {
2235  .name = "gbrpf32be",
2236  .nb_components = 3,
2237  .log2_chroma_w = 0,
2238  .log2_chroma_h = 0,
2239  .comp = {
2240  { 2, 4, 0, 0, 32 }, /* R */
2241  { 0, 4, 0, 0, 32 }, /* G */
2242  { 1, 4, 0, 0, 32 }, /* B */
2243  },
2246  },
2247  [AV_PIX_FMT_GBRPF32LE] = {
2248  .name = "gbrpf32le",
2249  .nb_components = 3,
2250  .log2_chroma_w = 0,
2251  .log2_chroma_h = 0,
2252  .comp = {
2253  { 2, 4, 0, 0, 32 }, /* R */
2254  { 0, 4, 0, 0, 32 }, /* G */
2255  { 1, 4, 0, 0, 32 }, /* B */
2256  },
2258  },
2259  [AV_PIX_FMT_GBRAPF32BE] = {
2260  .name = "gbrapf32be",
2261  .nb_components = 4,
2262  .log2_chroma_w = 0,
2263  .log2_chroma_h = 0,
2264  .comp = {
2265  { 2, 4, 0, 0, 32 }, /* R */
2266  { 0, 4, 0, 0, 32 }, /* G */
2267  { 1, 4, 0, 0, 32 }, /* B */
2268  { 3, 4, 0, 0, 32 }, /* A */
2269  },
2273  },
2274  [AV_PIX_FMT_GBRAPF32LE] = {
2275  .name = "gbrapf32le",
2276  .nb_components = 4,
2277  .log2_chroma_w = 0,
2278  .log2_chroma_h = 0,
2279  .comp = {
2280  { 2, 4, 0, 0, 32 }, /* R */
2281  { 0, 4, 0, 0, 32 }, /* G */
2282  { 1, 4, 0, 0, 32 }, /* B */
2283  { 3, 4, 0, 0, 32 }, /* A */
2284  },
2287  },
2288  [AV_PIX_FMT_DRM_PRIME] = {
2289  .name = "drm_prime",
2290  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2291  },
2292  [AV_PIX_FMT_OPENCL] = {
2293  .name = "opencl",
2294  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2295  },
2296  [AV_PIX_FMT_GRAYF32BE] = {
2297  .name = "grayf32be",
2298  .nb_components = 1,
2299  .log2_chroma_w = 0,
2300  .log2_chroma_h = 0,
2301  .comp = {
2302  { 0, 4, 0, 0, 32 }, /* Y */
2303  },
2305  .alias = "yf32be",
2306  },
2307  [AV_PIX_FMT_GRAYF32LE] = {
2308  .name = "grayf32le",
2309  .nb_components = 1,
2310  .log2_chroma_w = 0,
2311  .log2_chroma_h = 0,
2312  .comp = {
2313  { 0, 4, 0, 0, 32 }, /* Y */
2314  },
2315  .flags = AV_PIX_FMT_FLAG_FLOAT,
2316  .alias = "yf32le",
2317  },
2319  .name = "yuva422p12be",
2320  .nb_components = 4,
2321  .log2_chroma_w = 1,
2322  .log2_chroma_h = 0,
2323  .comp = {
2324  { 0, 2, 0, 0, 12 }, /* Y */
2325  { 1, 2, 0, 0, 12 }, /* U */
2326  { 2, 2, 0, 0, 12 }, /* V */
2327  { 3, 2, 0, 0, 12 }, /* A */
2328  },
2330  },
2332  .name = "yuva422p12le",
2333  .nb_components = 4,
2334  .log2_chroma_w = 1,
2335  .log2_chroma_h = 0,
2336  .comp = {
2337  { 0, 2, 0, 0, 12 }, /* Y */
2338  { 1, 2, 0, 0, 12 }, /* U */
2339  { 2, 2, 0, 0, 12 }, /* V */
2340  { 3, 2, 0, 0, 12 }, /* A */
2341  },
2343  },
2345  .name = "yuva444p12be",
2346  .nb_components = 4,
2347  .log2_chroma_w = 0,
2348  .log2_chroma_h = 0,
2349  .comp = {
2350  { 0, 2, 0, 0, 12 }, /* Y */
2351  { 1, 2, 0, 0, 12 }, /* U */
2352  { 2, 2, 0, 0, 12 }, /* V */
2353  { 3, 2, 0, 0, 12 }, /* A */
2354  },
2356  },
2358  .name = "yuva444p12le",
2359  .nb_components = 4,
2360  .log2_chroma_w = 0,
2361  .log2_chroma_h = 0,
2362  .comp = {
2363  { 0, 2, 0, 0, 12 }, /* Y */
2364  { 1, 2, 0, 0, 12 }, /* U */
2365  { 2, 2, 0, 0, 12 }, /* V */
2366  { 3, 2, 0, 0, 12 }, /* A */
2367  },
2369  },
2370  [AV_PIX_FMT_NV24] = {
2371  .name = "nv24",
2372  .nb_components = 3,
2373  .log2_chroma_w = 0,
2374  .log2_chroma_h = 0,
2375  .comp = {
2376  { 0, 1, 0, 0, 8 }, /* Y */
2377  { 1, 2, 0, 0, 8 }, /* U */
2378  { 1, 2, 1, 0, 8 }, /* V */
2379  },
2380  .flags = AV_PIX_FMT_FLAG_PLANAR,
2381  },
2382  [AV_PIX_FMT_NV42] = {
2383  .name = "nv42",
2384  .nb_components = 3,
2385  .log2_chroma_w = 0,
2386  .log2_chroma_h = 0,
2387  .comp = {
2388  { 0, 1, 0, 0, 8 }, /* Y */
2389  { 1, 2, 1, 0, 8 }, /* U */
2390  { 1, 2, 0, 0, 8 }, /* V */
2391  },
2392  .flags = AV_PIX_FMT_FLAG_PLANAR,
2393  },
2394  [AV_PIX_FMT_VULKAN] = {
2395  .name = "vulkan",
2396  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2397  },
2398  [AV_PIX_FMT_P210BE] = {
2399  .name = "p210be",
2400  .nb_components = 3,
2401  .log2_chroma_w = 1,
2402  .log2_chroma_h = 0,
2403  .comp = {
2404  { 0, 2, 0, 6, 10 }, /* Y */
2405  { 1, 4, 0, 6, 10 }, /* U */
2406  { 1, 4, 2, 6, 10 }, /* V */
2407  },
2409  },
2410  [AV_PIX_FMT_P210LE] = {
2411  .name = "p210le",
2412  .nb_components = 3,
2413  .log2_chroma_w = 1,
2414  .log2_chroma_h = 0,
2415  .comp = {
2416  { 0, 2, 0, 6, 10 }, /* Y */
2417  { 1, 4, 0, 6, 10 }, /* U */
2418  { 1, 4, 2, 6, 10 }, /* V */
2419  },
2420  .flags = AV_PIX_FMT_FLAG_PLANAR,
2421  },
2422  [AV_PIX_FMT_P410BE] = {
2423  .name = "p410be",
2424  .nb_components = 3,
2425  .log2_chroma_w = 0,
2426  .log2_chroma_h = 0,
2427  .comp = {
2428  { 0, 2, 0, 6, 10 }, /* Y */
2429  { 1, 4, 0, 6, 10 }, /* U */
2430  { 1, 4, 2, 6, 10 }, /* V */
2431  },
2433  },
2434  [AV_PIX_FMT_P410LE] = {
2435  .name = "p410le",
2436  .nb_components = 3,
2437  .log2_chroma_w = 0,
2438  .log2_chroma_h = 0,
2439  .comp = {
2440  { 0, 2, 0, 6, 10 }, /* Y */
2441  { 1, 4, 0, 6, 10 }, /* U */
2442  { 1, 4, 2, 6, 10 }, /* V */
2443  },
2444  .flags = AV_PIX_FMT_FLAG_PLANAR,
2445  },
2446  [AV_PIX_FMT_P216BE] = {
2447  .name = "p216be",
2448  .nb_components = 3,
2449  .log2_chroma_w = 1,
2450  .log2_chroma_h = 0,
2451  .comp = {
2452  { 0, 2, 0, 0, 16 }, /* Y */
2453  { 1, 4, 0, 0, 16 }, /* U */
2454  { 1, 4, 2, 0, 16 }, /* V */
2455  },
2457  },
2458  [AV_PIX_FMT_P216LE] = {
2459  .name = "p216le",
2460  .nb_components = 3,
2461  .log2_chroma_w = 1,
2462  .log2_chroma_h = 0,
2463  .comp = {
2464  { 0, 2, 0, 0, 16 }, /* Y */
2465  { 1, 4, 0, 0, 16 }, /* U */
2466  { 1, 4, 2, 0, 16 }, /* V */
2467  },
2468  .flags = AV_PIX_FMT_FLAG_PLANAR,
2469  },
2470  [AV_PIX_FMT_P416BE] = {
2471  .name = "p416be",
2472  .nb_components = 3,
2473  .log2_chroma_w = 0,
2474  .log2_chroma_h = 0,
2475  .comp = {
2476  { 0, 2, 0, 0, 16 }, /* Y */
2477  { 1, 4, 0, 0, 16 }, /* U */
2478  { 1, 4, 2, 0, 16 }, /* V */
2479  },
2481  },
2482  [AV_PIX_FMT_P416LE] = {
2483  .name = "p416le",
2484  .nb_components = 3,
2485  .log2_chroma_w = 0,
2486  .log2_chroma_h = 0,
2487  .comp = {
2488  { 0, 2, 0, 0, 16 }, /* Y */
2489  { 1, 4, 0, 0, 16 }, /* U */
2490  { 1, 4, 2, 0, 16 }, /* V */
2491  },
2492  .flags = AV_PIX_FMT_FLAG_PLANAR,
2493  },
2494  [AV_PIX_FMT_VUYA] = {
2495  .name = "vuya",
2496  .nb_components = 4,
2497  .log2_chroma_w = 0,
2498  .log2_chroma_h = 0,
2499  .comp = {
2500  { 0, 4, 2, 0, 8 }, /* Y */
2501  { 0, 4, 1, 0, 8 }, /* U */
2502  { 0, 4, 0, 0, 8 }, /* V */
2503  { 0, 4, 3, 0, 8 }, /* A */
2504  },
2505  .flags = AV_PIX_FMT_FLAG_ALPHA,
2506  },
2507  [AV_PIX_FMT_RGBAF16BE] = {
2508  .name = "rgbaf16be",
2509  .nb_components = 4,
2510  .log2_chroma_w = 0,
2511  .log2_chroma_h = 0,
2512  .comp = {
2513  { 0, 8, 0, 0, 16 }, /* R */
2514  { 0, 8, 2, 0, 16 }, /* G */
2515  { 0, 8, 4, 0, 16 }, /* B */
2516  { 0, 8, 6, 0, 16 }, /* A */
2517  },
2520  },
2521  [AV_PIX_FMT_RGBAF16LE] = {
2522  .name = "rgbaf16le",
2523  .nb_components = 4,
2524  .log2_chroma_w = 0,
2525  .log2_chroma_h = 0,
2526  .comp = {
2527  { 0, 8, 0, 0, 16 }, /* R */
2528  { 0, 8, 2, 0, 16 }, /* G */
2529  { 0, 8, 4, 0, 16 }, /* B */
2530  { 0, 8, 6, 0, 16 }, /* A */
2531  },
2534  },
2535 };
2536 
2537 static const char * const color_range_names[] = {
2538  [AVCOL_RANGE_UNSPECIFIED] = "unknown",
2539  [AVCOL_RANGE_MPEG] = "tv",
2540  [AVCOL_RANGE_JPEG] = "pc",
2541 };
2542 
2543 static const char * const color_primaries_names[AVCOL_PRI_NB] = {
2544  [AVCOL_PRI_RESERVED0] = "reserved",
2545  [AVCOL_PRI_BT709] = "bt709",
2546  [AVCOL_PRI_UNSPECIFIED] = "unknown",
2547  [AVCOL_PRI_RESERVED] = "reserved",
2548  [AVCOL_PRI_BT470M] = "bt470m",
2549  [AVCOL_PRI_BT470BG] = "bt470bg",
2550  [AVCOL_PRI_SMPTE170M] = "smpte170m",
2551  [AVCOL_PRI_SMPTE240M] = "smpte240m",
2552  [AVCOL_PRI_FILM] = "film",
2553  [AVCOL_PRI_BT2020] = "bt2020",
2554  [AVCOL_PRI_SMPTE428] = "smpte428",
2555  [AVCOL_PRI_SMPTE431] = "smpte431",
2556  [AVCOL_PRI_SMPTE432] = "smpte432",
2557  [AVCOL_PRI_EBU3213] = "ebu3213",
2558 };
2559 
2560 static const char * const color_transfer_names[] = {
2561  [AVCOL_TRC_RESERVED0] = "reserved",
2562  [AVCOL_TRC_BT709] = "bt709",
2563  [AVCOL_TRC_UNSPECIFIED] = "unknown",
2564  [AVCOL_TRC_RESERVED] = "reserved",
2565  [AVCOL_TRC_GAMMA22] = "bt470m",
2566  [AVCOL_TRC_GAMMA28] = "bt470bg",
2567  [AVCOL_TRC_SMPTE170M] = "smpte170m",
2568  [AVCOL_TRC_SMPTE240M] = "smpte240m",
2569  [AVCOL_TRC_LINEAR] = "linear",
2570  [AVCOL_TRC_LOG] = "log100",
2571  [AVCOL_TRC_LOG_SQRT] = "log316",
2572  [AVCOL_TRC_IEC61966_2_4] = "iec61966-2-4",
2573  [AVCOL_TRC_BT1361_ECG] = "bt1361e",
2574  [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1",
2575  [AVCOL_TRC_BT2020_10] = "bt2020-10",
2576  [AVCOL_TRC_BT2020_12] = "bt2020-12",
2577  [AVCOL_TRC_SMPTE2084] = "smpte2084",
2578  [AVCOL_TRC_SMPTE428] = "smpte428",
2579  [AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
2580 };
2581 
2582 static const char * const color_space_names[] = {
2583  [AVCOL_SPC_RGB] = "gbr",
2584  [AVCOL_SPC_BT709] = "bt709",
2585  [AVCOL_SPC_UNSPECIFIED] = "unknown",
2586  [AVCOL_SPC_RESERVED] = "reserved",
2587  [AVCOL_SPC_FCC] = "fcc",
2588  [AVCOL_SPC_BT470BG] = "bt470bg",
2589  [AVCOL_SPC_SMPTE170M] = "smpte170m",
2590  [AVCOL_SPC_SMPTE240M] = "smpte240m",
2591  [AVCOL_SPC_YCGCO] = "ycgco",
2592  [AVCOL_SPC_BT2020_NCL] = "bt2020nc",
2593  [AVCOL_SPC_BT2020_CL] = "bt2020c",
2594  [AVCOL_SPC_SMPTE2085] = "smpte2085",
2595  [AVCOL_SPC_CHROMA_DERIVED_NCL] = "chroma-derived-nc",
2596  [AVCOL_SPC_CHROMA_DERIVED_CL] = "chroma-derived-c",
2597  [AVCOL_SPC_ICTCP] = "ictcp",
2598 };
2599 
2600 static const char * const chroma_location_names[] = {
2601  [AVCHROMA_LOC_UNSPECIFIED] = "unspecified",
2602  [AVCHROMA_LOC_LEFT] = "left",
2603  [AVCHROMA_LOC_CENTER] = "center",
2604  [AVCHROMA_LOC_TOPLEFT] = "topleft",
2605  [AVCHROMA_LOC_TOP] = "top",
2606  [AVCHROMA_LOC_BOTTOMLEFT] = "bottomleft",
2607  [AVCHROMA_LOC_BOTTOM] = "bottom",
2608 };
2609 
2610 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
2611 {
2612  enum AVPixelFormat pix_fmt;
2613 
2614  for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
2616  (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
2618  return pix_fmt;
2619 
2620  return AV_PIX_FMT_NONE;
2621 }
2622 
2624 {
2625  return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
2627 }
2628 
2629 #if HAVE_BIGENDIAN
2630 # define X_NE(be, le) be
2631 #else
2632 # define X_NE(be, le) le
2633 #endif
2634 
2636 {
2637  enum AVPixelFormat pix_fmt;
2638 
2639  if (!strcmp(name, "rgb32"))
2640  name = X_NE("argb", "bgra");
2641  else if (!strcmp(name, "bgr32"))
2642  name = X_NE("abgr", "rgba");
2643 
2645  if (pix_fmt == AV_PIX_FMT_NONE) {
2646  char name2[32];
2647 
2648  snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
2649  pix_fmt = get_pix_fmt_internal(name2);
2650  }
2651 
2652  return pix_fmt;
2653 }
2654 
2656 {
2657  int c, bits = 0;
2658  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2659 
2660  for (c = 0; c < pixdesc->nb_components; c++) {
2661  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2662  bits += pixdesc->comp[c].depth << s;
2663  }
2664 
2665  return bits >> log2_pixels;
2666 }
2667 
2669 {
2670  int c, bits = 0;
2671  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2672  int steps[4] = {0};
2673 
2674  for (c = 0; c < pixdesc->nb_components; c++) {
2675  const AVComponentDescriptor *comp = &pixdesc->comp[c];
2676  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2677  steps[comp->plane] = comp->step << s;
2678  }
2679  for (c = 0; c < 4; c++)
2680  bits += steps[c];
2681 
2682  if(!(pixdesc->flags & AV_PIX_FMT_FLAG_BITSTREAM))
2683  bits *= 8;
2684 
2685  return bits >> log2_pixels;
2686 }
2687 
2688 char *av_get_pix_fmt_string(char *buf, int buf_size,
2689  enum AVPixelFormat pix_fmt)
2690 {
2691  /* print header */
2692  if (pix_fmt < 0) {
2693  snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
2694  } else {
2696  snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
2697  pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
2698  }
2699 
2700  return buf;
2701 }
2702 
2704 {
2705  if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
2706  return NULL;
2708 }
2709 
2711 {
2712  if (!prev)
2713  return &av_pix_fmt_descriptors[0];
2715  prev++;
2716  if (prev->name)
2717  return prev;
2718  }
2719  return NULL;
2720 }
2721 
2723 {
2724  if (desc < av_pix_fmt_descriptors ||
2726  return AV_PIX_FMT_NONE;
2727 
2728  return desc - av_pix_fmt_descriptors;
2729 }
2730 
2732  int *h_shift, int *v_shift)
2733 {
2735  if (!desc)
2736  return AVERROR(ENOSYS);
2737  *h_shift = desc->log2_chroma_w;
2738  *v_shift = desc->log2_chroma_h;
2739 
2740  return 0;
2741 }
2742 
2744 {
2746  int i, planes[4] = { 0 }, ret = 0;
2747 
2748  if (!desc)
2749  return AVERROR(EINVAL);
2750 
2751  for (i = 0; i < desc->nb_components; i++)
2752  planes[desc->comp[i].plane] = 1;
2753  for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
2754  ret += planes[i];
2755  return ret;
2756 }
2757 
2759  int i, j;
2760 
2761  for (i=0; i<FF_ARRAY_ELEMS(av_pix_fmt_descriptors); i++) {
2763  uint8_t fill[4][8+6+3] = {{0}};
2764  uint8_t *data[4] = {fill[0], fill[1], fill[2], fill[3]};
2765  int linesize[4] = {0,0,0,0};
2766  uint16_t tmp[2];
2767 
2768  if (!d->name && !d->nb_components && !d->log2_chroma_w && !d->log2_chroma_h && !d->flags)
2769  continue;
2770 // av_log(NULL, AV_LOG_DEBUG, "Checking: %s\n", d->name);
2771  av_assert0(d->log2_chroma_w <= 3);
2772  av_assert0(d->log2_chroma_h <= 3);
2773  av_assert0(d->nb_components <= 4);
2774  av_assert0(d->name && d->name[0]);
2775  av_assert2(av_get_pix_fmt(d->name) == i);
2776 
2777  for (j=0; j<FF_ARRAY_ELEMS(d->comp); j++) {
2778  const AVComponentDescriptor *c = &d->comp[j];
2779  if(j>=d->nb_components) {
2780  av_assert0(!c->plane && !c->step && !c->offset && !c->shift && !c->depth);
2781  continue;
2782  }
2783  if (d->flags & AV_PIX_FMT_FLAG_BITSTREAM) {
2784  av_assert0(c->step >= c->depth);
2785  } else {
2786  av_assert0(8*c->step >= c->depth);
2787  }
2788  if (d->flags & AV_PIX_FMT_FLAG_BAYER)
2789  continue;
2790  av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0);
2791  av_assert0(tmp[0] == 0 && tmp[1] == 0);
2792  tmp[0] = tmp[1] = (1ULL << c->depth) - 1;
2793  av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2);
2794  }
2795  }
2796 }
2797 
2798 
2800 {
2802  char name[16];
2803  int i;
2804 
2805  if (!desc || strlen(desc->name) < 2)
2806  return AV_PIX_FMT_NONE;
2807  av_strlcpy(name, desc->name, sizeof(name));
2808  i = strlen(name) - 2;
2809  if (strcmp(name + i, "be") && strcmp(name + i, "le"))
2810  return AV_PIX_FMT_NONE;
2811 
2812  name[i] ^= 'b' ^ 'l';
2813 
2814  return get_pix_fmt_internal(name);
2815 }
2816 
2817 #define FF_COLOR_NA -1
2818 #define FF_COLOR_RGB 0 /**< RGB color space */
2819 #define FF_COLOR_GRAY 1 /**< gray color space */
2820 #define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
2821 #define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
2822 #define FF_COLOR_XYZ 4
2823 
2824 #define pixdesc_has_alpha(pixdesc) \
2825  ((pixdesc)->flags & AV_PIX_FMT_FLAG_ALPHA)
2826 
2827 
2829  if (desc->flags & AV_PIX_FMT_FLAG_PAL)
2830  return FF_COLOR_RGB;
2831 
2832  if(desc->nb_components == 1 || desc->nb_components == 2)
2833  return FF_COLOR_GRAY;
2834 
2835  if (desc->name) {
2836  if (av_strstart(desc->name, "yuvj", NULL))
2837  return FF_COLOR_YUV_JPEG;
2838 
2839  if (av_strstart(desc->name, "xyz", NULL))
2840  return FF_COLOR_XYZ;
2841  }
2842 
2843  if(desc->flags & AV_PIX_FMT_FLAG_RGB)
2844  return FF_COLOR_RGB;
2845 
2846  if(desc->nb_components == 0)
2847  return FF_COLOR_NA;
2848 
2849  return FF_COLOR_YUV;
2850 }
2851 
2852 static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
2853 {
2855  int i;
2856 
2857  if (!desc || !desc->nb_components) {
2858  *min = *max = 0;
2859  return AVERROR(EINVAL);
2860  }
2861 
2862  *min = INT_MAX, *max = -INT_MAX;
2863  for (i = 0; i < desc->nb_components; i++) {
2864  *min = FFMIN(desc->comp[i].depth, *min);
2865  *max = FFMAX(desc->comp[i].depth, *max);
2866  }
2867  return 0;
2868 }
2869 
2870 static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
2871  enum AVPixelFormat src_pix_fmt,
2872  unsigned *lossp, unsigned consider)
2873 {
2874  const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
2875  const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
2876  int src_color, dst_color;
2877  int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
2878  int ret, loss, i, nb_components;
2879  int score = INT_MAX - 1;
2880 
2881  if (!src_desc || !dst_desc)
2882  return -4;
2883 
2884  if ((src_desc->flags & AV_PIX_FMT_FLAG_HWACCEL) ||
2885  (dst_desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
2886  if (dst_pix_fmt == src_pix_fmt)
2887  return -1;
2888  else
2889  return -2;
2890  }
2891 
2892  /* compute loss */
2893  *lossp = loss = 0;
2894 
2895  if (dst_pix_fmt == src_pix_fmt)
2896  return INT_MAX;
2897 
2898  if ((ret = get_pix_fmt_depth(&src_min_depth, &src_max_depth, src_pix_fmt)) < 0)
2899  return -3;
2900  if ((ret = get_pix_fmt_depth(&dst_min_depth, &dst_max_depth, dst_pix_fmt)) < 0)
2901  return -3;
2902 
2903  src_color = get_color_type(src_desc);
2904  dst_color = get_color_type(dst_desc);
2905  if (dst_pix_fmt == AV_PIX_FMT_PAL8)
2906  nb_components = FFMIN(src_desc->nb_components, 4);
2907  else
2908  nb_components = FFMIN(src_desc->nb_components, dst_desc->nb_components);
2909 
2910  for (i = 0; i < nb_components; i++) {
2911  int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : (dst_desc->comp[i].depth - 1);
2912  if (src_desc->comp[i].depth - 1 > depth_minus1 && (consider & FF_LOSS_DEPTH)) {
2913  loss |= FF_LOSS_DEPTH;
2914  score -= 65536 >> depth_minus1;
2915  }
2916  }
2917 
2918  if (consider & FF_LOSS_RESOLUTION) {
2919  if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w) {
2920  loss |= FF_LOSS_RESOLUTION;
2921  score -= 256 << dst_desc->log2_chroma_w;
2922  }
2923  if (dst_desc->log2_chroma_h > src_desc->log2_chroma_h) {
2924  loss |= FF_LOSS_RESOLUTION;
2925  score -= 256 << dst_desc->log2_chroma_h;
2926  }
2927  // don't favor 422 over 420 if downsampling is needed, because 420 has much better support on the decoder side
2928  if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 0 &&
2929  dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 0 ) {
2930  score += 512;
2931  }
2932  }
2933 
2934  if(consider & FF_LOSS_COLORSPACE)
2935  switch(dst_color) {
2936  case FF_COLOR_RGB:
2937  if (src_color != FF_COLOR_RGB &&
2938  src_color != FF_COLOR_GRAY)
2939  loss |= FF_LOSS_COLORSPACE;
2940  break;
2941  case FF_COLOR_GRAY:
2942  if (src_color != FF_COLOR_GRAY)
2943  loss |= FF_LOSS_COLORSPACE;
2944  break;
2945  case FF_COLOR_YUV:
2946  if (src_color != FF_COLOR_YUV)
2947  loss |= FF_LOSS_COLORSPACE;
2948  break;
2949  case FF_COLOR_YUV_JPEG:
2950  if (src_color != FF_COLOR_YUV_JPEG &&
2951  src_color != FF_COLOR_YUV &&
2952  src_color != FF_COLOR_GRAY)
2953  loss |= FF_LOSS_COLORSPACE;
2954  break;
2955  default:
2956  /* fail safe test */
2957  if (src_color != dst_color)
2958  loss |= FF_LOSS_COLORSPACE;
2959  break;
2960  }
2961  if(loss & FF_LOSS_COLORSPACE)
2962  score -= (nb_components * 65536) >> FFMIN(dst_desc->comp[0].depth - 1, src_desc->comp[0].depth - 1);
2963 
2964  if (dst_color == FF_COLOR_GRAY &&
2965  src_color != FF_COLOR_GRAY && (consider & FF_LOSS_CHROMA)) {
2966  loss |= FF_LOSS_CHROMA;
2967  score -= 2 * 65536;
2968  }
2969  if (!pixdesc_has_alpha(dst_desc) && (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))) {
2970  loss |= FF_LOSS_ALPHA;
2971  score -= 65536;
2972  }
2973  if (dst_pix_fmt == AV_PIX_FMT_PAL8 && (consider & FF_LOSS_COLORQUANT) &&
2974  (src_pix_fmt != AV_PIX_FMT_PAL8 && (src_color != FF_COLOR_GRAY || (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))))) {
2975  loss |= FF_LOSS_COLORQUANT;
2976  score -= 65536;
2977  }
2978 
2979  *lossp = loss;
2980  return score;
2981 }
2982 
2983 int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
2984  enum AVPixelFormat src_pix_fmt,
2985  int has_alpha)
2986 {
2987  int loss;
2988  int ret = get_pix_fmt_score(dst_pix_fmt, src_pix_fmt, &loss, has_alpha ? ~0 : ~FF_LOSS_ALPHA);
2989  if (ret < 0)
2990  return ret;
2991  return loss;
2992 }
2993 
2994 enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
2995  enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
2996 {
2997  enum AVPixelFormat dst_pix_fmt;
2998  int loss1, loss2, loss_mask;
2999  const AVPixFmtDescriptor *desc1 = av_pix_fmt_desc_get(dst_pix_fmt1);
3000  const AVPixFmtDescriptor *desc2 = av_pix_fmt_desc_get(dst_pix_fmt2);
3001  int score1, score2;
3002 
3003  if (!desc1) {
3004  dst_pix_fmt = dst_pix_fmt2;
3005  } else if (!desc2) {
3006  dst_pix_fmt = dst_pix_fmt1;
3007  } else {
3008  loss_mask= loss_ptr?~*loss_ptr:~0; /* use loss mask if provided */
3009  if(!has_alpha)
3010  loss_mask &= ~FF_LOSS_ALPHA;
3011 
3012  score1 = get_pix_fmt_score(dst_pix_fmt1, src_pix_fmt, &loss1, loss_mask);
3013  score2 = get_pix_fmt_score(dst_pix_fmt2, src_pix_fmt, &loss2, loss_mask);
3014 
3015  if (score1 == score2) {
3017  dst_pix_fmt = av_get_padded_bits_per_pixel(desc2) < av_get_padded_bits_per_pixel(desc1) ? dst_pix_fmt2 : dst_pix_fmt1;
3018  } else {
3019  dst_pix_fmt = desc2->nb_components < desc1->nb_components ? dst_pix_fmt2 : dst_pix_fmt1;
3020  }
3021  } else {
3022  dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
3023  }
3024  }
3025 
3026  if (loss_ptr)
3027  *loss_ptr = av_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
3028  return dst_pix_fmt;
3029 }
3030 
3031 const char *av_color_range_name(enum AVColorRange range)
3032 {
3033  return (unsigned) range < AVCOL_RANGE_NB ?
3034  color_range_names[range] : NULL;
3035 }
3036 
3038 {
3039  int i;
3040 
3041  for (i = 0; i < FF_ARRAY_ELEMS(color_range_names); i++) {
3043  return i;
3044  }
3045 
3046  return AVERROR(EINVAL);
3047 }
3048 
3049 const char *av_color_primaries_name(enum AVColorPrimaries primaries)
3050 {
3051  return (unsigned) primaries < AVCOL_PRI_NB ?
3052  color_primaries_names[primaries] : NULL;
3053 }
3054 
3056 {
3057  int i;
3058 
3059  for (i = 0; i < FF_ARRAY_ELEMS(color_primaries_names); i++) {
3060  if (!color_primaries_names[i])
3061  continue;
3062 
3064  return i;
3065  }
3066 
3067  return AVERROR(EINVAL);
3068 }
3069 
3071 {
3072  return (unsigned) transfer < AVCOL_TRC_NB ?
3073  color_transfer_names[transfer] : NULL;
3074 }
3075 
3077 {
3078  int i;
3079 
3080  for (i = 0; i < FF_ARRAY_ELEMS(color_transfer_names); i++) {
3081  if (!color_transfer_names[i])
3082  continue;
3083 
3085  return i;
3086  }
3087 
3088  return AVERROR(EINVAL);
3089 }
3090 
3092 {
3093  return (unsigned) space < AVCOL_SPC_NB ?
3095 }
3096 
3098 {
3099  int i;
3100 
3101  for (i = 0; i < FF_ARRAY_ELEMS(color_space_names); i++) {
3102  if (!color_space_names[i])
3103  continue;
3104 
3106  return i;
3107  }
3108 
3109  return AVERROR(EINVAL);
3110 }
3111 
3112 const char *av_chroma_location_name(enum AVChromaLocation location)
3113 {
3114  return (unsigned) location < AVCHROMA_LOC_NB ?
3115  chroma_location_names[location] : NULL;
3116 }
3117 
3119 {
3120  int i;
3121 
3122  for (i = 0; i < FF_ARRAY_ELEMS(chroma_location_names); i++) {
3123  if (!chroma_location_names[i])
3124  continue;
3125 
3127  return i;
3128  }
3129 
3130  return AVERROR(EINVAL);
3131 }
AVCOL_PRI_RESERVED
@ AVCOL_PRI_RESERVED
Definition: pixfmt.h:482
ff_check_pixfmt_descriptors
void ff_check_pixfmt_descriptors(void)
Definition: pixdesc.c:2758
AV_PIX_FMT_XYZ12LE
@ AV_PIX_FMT_XYZ12LE
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:189
av_pix_fmt_swap_endianness
enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
Utility function to swap the endianness of a pixel format.
Definition: pixdesc.c:2799
AV_PIX_FMT_YUV420P9LE
@ AV_PIX_FMT_YUV420P9LE
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:147
AV_PIX_FMT_CUDA
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
Definition: pixfmt.h:225
AV_PIX_FMT_GRAY10BE
@ AV_PIX_FMT_GRAY10BE
Y , 10bpp, big-endian.
Definition: pixfmt.h:289
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
AV_PIX_FMT_BAYER_GBRG16LE
@ AV_PIX_FMT_BAYER_GBRG16LE
bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian
Definition: pixfmt.h:258
AV_PIX_FMT_BGR48LE
@ AV_PIX_FMT_BGR48LE
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:139
AVCOL_PRI_EBU3213
@ AVCOL_PRI_EBU3213
EBU Tech. 3213-E (nothing there) / one of JEDEC P22 group phosphors.
Definition: pixfmt.h:494
AV_PIX_FMT_P416BE
@ AV_PIX_FMT_P416BE
interleaved chroma YUV 4:4:4, 48bpp, big-endian
Definition: pixfmt.h:367
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
AV_PIX_FMT_YA8
@ AV_PIX_FMT_YA8
8 bits gray, 8 bits alpha
Definition: pixfmt.h:133
FF_LOSS_CHROMA
#define FF_LOSS_CHROMA
loss of chroma (e.g.
Definition: pixdesc.h:365
AV_PIX_FMT_BGRA64BE
@ AV_PIX_FMT_BGRA64BE
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:197
space
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated space
Definition: undefined.txt:4
AV_WL32
#define AV_WL32(p, v)
Definition: intreadwrite.h:426
AVColorTransferCharacteristic
AVColorTransferCharacteristic
Color Transfer Characteristic.
Definition: pixfmt.h:503
comp
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
Definition: eamad.c:86
AV_PIX_FMT_RGB444LE
@ AV_PIX_FMT_RGB444LE
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:129
AV_PIX_FMT_GBRP16BE
@ AV_PIX_FMT_GBRP16BE
planar GBR 4:4:4 48bpp, big-endian
Definition: pixfmt.h:164
AV_PIX_FMT_GBRP10BE
@ AV_PIX_FMT_GBRP10BE
planar GBR 4:4:4 30bpp, big-endian
Definition: pixfmt.h:162
BAYER16_DESC_COMMON
#define BAYER16_DESC_COMMON
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2703
AVCOL_TRC_LINEAR
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
Definition: pixfmt.h:512
AVCHROMA_LOC_BOTTOM
@ AVCHROMA_LOC_BOTTOM
Definition: pixfmt.h:632
AV_PIX_FMT_YUV422P14LE
@ AV_PIX_FMT_YUV422P14LE
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:239
AV_PIX_FMT_MMAL
@ AV_PIX_FMT_MMAL
HW acceleration though MMAL, data[3] contains a pointer to the MMAL_BUFFER_HEADER_T structure.
Definition: pixfmt.h:217
AV_PIX_FMT_FLAG_FLOAT
#define AV_PIX_FMT_FLAG_FLOAT
The pixel format contains IEEE-754 floating point values.
Definition: pixdesc.h:158
av_write_image_line
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)
Definition: pixdesc.c:161
av_pix_fmt_descriptors
static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB]
Definition: pixdesc.c:169
av_color_space_from_name
int av_color_space_from_name(const char *name)
Definition: pixdesc.c:3097
AVCOL_TRC_NB
@ AVCOL_TRC_NB
Not part of ABI.
Definition: pixfmt.h:525
tmp
static uint8_t tmp[11]
Definition: aes_ctr.c:28
AV_PIX_FMT_YUVA444P10BE
@ AV_PIX_FMT_YUVA444P10BE
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Definition: pixfmt.h:178
pixdesc.h
AV_PIX_FMT_RGBA64BE
@ AV_PIX_FMT_RGBA64BE
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:195
step
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But a word about which is also called distortion Distortion can be quantified by almost any quality measurement one chooses the sum of squared differences is used but more complex methods that consider psychovisual effects can be used as well It makes no difference in this discussion First step
Definition: rate_distortion.txt:58
AV_PIX_FMT_YUV440P12BE
@ AV_PIX_FMT_YUV440P12BE
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
Definition: pixfmt.h:270
AV_PIX_FMT_GBRAPF32LE
@ AV_PIX_FMT_GBRAPF32LE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, little-endian.
Definition: pixfmt.h:313
av_color_range_from_name
int av_color_range_from_name(const char *name)
Definition: pixdesc.c:3037
w
uint8_t w
Definition: llviddspenc.c:38
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:606
AV_PIX_FMT_X2BGR10BE
@ AV_PIX_FMT_X2BGR10BE
packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), big-endian, X=unused/undefined
Definition: pixfmt.h:356
AV_PIX_FMT_GBRPF32BE
@ AV_PIX_FMT_GBRPF32BE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, big-endian.
Definition: pixfmt.h:310
AV_PIX_FMT_DRM_PRIME
@ AV_PIX_FMT_DRM_PRIME
DRM-managed buffers exposed through PRIME buffer sharing.
Definition: pixfmt.h:320
AVComponentDescriptor::depth
int depth
Number of bits in the component.
Definition: pixdesc.h:57
AVPixFmtDescriptor::name
const char * name
Definition: pixdesc.h:70
AVCOL_SPC_NB
@ AVCOL_SPC_NB
Not part of ABI.
Definition: pixfmt.h:549
AVCOL_TRC_UNSPECIFIED
@ AVCOL_TRC_UNSPECIFIED
Definition: pixfmt.h:506
data
const char data[16]
Definition: mxf.c:146
AV_PIX_FMT_P010BE
@ AV_PIX_FMT_P010BE
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits,...
Definition: pixfmt.h:277
AV_PIX_FMT_MONOWHITE
@ AV_PIX_FMT_MONOWHITE
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb.
Definition: pixfmt.h:75
av_pix_fmt_desc_next
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.
Definition: pixdesc.c:2710
AV_PIX_FMT_YUV420P14BE
@ AV_PIX_FMT_YUV420P14BE
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:234
AV_PIX_FMT_YUV420P16LE
@ AV_PIX_FMT_YUV420P16LE
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:121
AV_PIX_FMT_D3D11VA_VLD
@ AV_PIX_FMT_D3D11VA_VLD
HW decoding through Direct3D11 via old API, Picture.data[3] contains a ID3D11VideoDecoderOutputView p...
Definition: pixfmt.h:219
AVCOL_SPC_RGB
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
Definition: pixfmt.h:533
AVCOL_TRC_BT2020_12
@ AVCOL_TRC_BT2020_12
ITU-R BT2020 for 12-bit system.
Definition: pixfmt.h:519
AV_PIX_FMT_GBRP14BE
@ AV_PIX_FMT_GBRP14BE
planar GBR 4:4:4 42bpp, big-endian
Definition: pixfmt.h:246
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:69
AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:95
av_get_bits_per_pixel
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:2655
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
max
#define max(a, b)
Definition: cuda_runtime.h:33
FFMAX
#define FFMAX(a, b)
Definition: macros.h:47
av_get_pix_fmt_string
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:2688
AVColorPrimaries
AVColorPrimaries
Chromaticity coordinates of the source primaries.
Definition: pixfmt.h:478
FF_COLOR_GRAY
#define FF_COLOR_GRAY
gray color space
Definition: pixdesc.c:2819
AV_PIX_FMT_YUV422P9BE
@ AV_PIX_FMT_YUV422P9BE
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:156
AV_PIX_FMT_YUVA444P9BE
@ AV_PIX_FMT_YUVA444P9BE
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
Definition: pixfmt.h:172
AV_PIX_FMT_BAYER_GRBG16BE
@ AV_PIX_FMT_BAYER_GRBG16BE
bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian
Definition: pixfmt.h:261
AV_PIX_FMT_GRAY10LE
@ AV_PIX_FMT_GRAY10LE
Y , 10bpp, little-endian.
Definition: pixfmt.h:290
AV_PIX_FMT_GRAYF32LE
@ AV_PIX_FMT_GRAYF32LE
IEEE-754 single precision Y, 32bpp, little-endian.
Definition: pixfmt.h:333
AVCOL_SPC_BT2020_CL
@ AVCOL_SPC_BT2020_CL
ITU-R BT2020 constant luminance system.
Definition: pixfmt.h:544
av_chroma_location_name
const char * av_chroma_location_name(enum AVChromaLocation location)
Definition: pixdesc.c:3112
AV_PIX_FMT_VULKAN
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition: pixfmt.h:348
AV_PIX_FMT_RGB555BE
@ AV_PIX_FMT_RGB555BE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian , X=unused/undefined
Definition: pixfmt.h:107
AV_PIX_FMT_RGBAF16LE
@ AV_PIX_FMT_RGBAF16LE
IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., little-endian.
Definition: pixfmt.h:373
AV_PIX_FMT_AYUV64LE
@ AV_PIX_FMT_AYUV64LE
packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
Definition: pixfmt.h:271
AV_PIX_FMT_YUV444P16LE
@ AV_PIX_FMT_YUV444P16LE
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:125
FF_LOSS_ALPHA
#define FF_LOSS_ALPHA
loss of alpha bits
Definition: pixdesc.h:363
AV_PIX_FMT_BAYER_GBRG16BE
@ AV_PIX_FMT_BAYER_GBRG16BE
bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian
Definition: pixfmt.h:259
AV_PIX_FMT_AYUV64BE
@ AV_PIX_FMT_AYUV64BE
packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
Definition: pixfmt.h:272
AV_PIX_FMT_NB
@ AV_PIX_FMT_NB
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
Definition: pixfmt.h:375
AV_PIX_FMT_GBRAP12LE
@ AV_PIX_FMT_GBRAP12LE
planar GBR 4:4:4:4 48bpp, little-endian
Definition: pixfmt.h:280
AV_PIX_FMT_GRAY16BE
@ AV_PIX_FMT_GRAY16BE
Y , 16bpp, big-endian.
Definition: pixfmt.h:97
av_pix_fmt_count_planes
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2743
AVCOL_SPC_BT470BG
@ AVCOL_SPC_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
Definition: pixfmt.h:538
av_chroma_location_from_name
int av_chroma_location_from_name(const char *name)
Definition: pixdesc.c:3118
AVCOL_SPC_RESERVED
@ AVCOL_SPC_RESERVED
reserved for future use by ITU-T and ISO/IEC just like 15-255 are
Definition: pixfmt.h:536
AVCOL_TRC_IEC61966_2_1
@ AVCOL_TRC_IEC61966_2_1
IEC 61966-2-1 (sRGB or sYCC)
Definition: pixfmt.h:517
av_color_space_name
const char * av_color_space_name(enum AVColorSpace space)
Definition: pixdesc.c:3091
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:205
AV_PIX_FMT_YUV420P12LE
@ AV_PIX_FMT_YUV420P12LE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:233
AV_PIX_FMT_FLAG_HWACCEL
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
Definition: pixdesc.h:128
AV_PIX_FMT_GRAY9LE
@ AV_PIX_FMT_GRAY9LE
Y , 9bpp, little-endian.
Definition: pixfmt.h:308
AVCOL_RANGE_NB
@ AVCOL_RANGE_NB
Not part of ABI.
Definition: pixfmt.h:607
AVCOL_TRC_GAMMA28
@ AVCOL_TRC_GAMMA28
also ITU-R BT470BG
Definition: pixfmt.h:509
av_color_transfer_from_name
int av_color_transfer_from_name(const char *name)
Definition: pixdesc.c:3076
val
static double val(void *priv, double ch)
Definition: aeval.c:77
av_pix_fmt_get_chroma_sub_sample
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:2731
chroma_location_names
static const char *const chroma_location_names[]
Definition: pixdesc.c:2600
AVCOL_TRC_LOG_SQRT
@ AVCOL_TRC_LOG_SQRT
"Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)"
Definition: pixfmt.h:514
AV_PIX_FMT_YUVA444P16BE
@ AV_PIX_FMT_YUVA444P16BE
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Definition: pixfmt.h:184
AV_PIX_FMT_YUV444P10BE
@ AV_PIX_FMT_YUV444P10BE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:154
AVCOL_TRC_GAMMA22
@ AVCOL_TRC_GAMMA22
also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
Definition: pixfmt.h:508
AV_PIX_FMT_YUV420P10LE
@ AV_PIX_FMT_YUV420P10LE
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:149
AV_PIX_FMT_VUYA
@ AV_PIX_FMT_VUYA
packed VUYA 4:4:4, 32bpp, VUYAVUYA...
Definition: pixfmt.h:370
AV_PIX_FMT_YUV444P12LE
@ AV_PIX_FMT_YUV444P12LE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:241
AV_PIX_FMT_YUVJ411P
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:248
AV_PIX_FMT_YUV422P12BE
@ AV_PIX_FMT_YUV422P12BE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:236
AV_PIX_FMT_YUV444P14LE
@ AV_PIX_FMT_YUV444P14LE
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:243
AV_PIX_FMT_BGR8
@ AV_PIX_FMT_BGR8
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
Definition: pixfmt.h:83
avassert.h
AV_PIX_FMT_BAYER_RGGB16BE
@ AV_PIX_FMT_BAYER_RGGB16BE
bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian
Definition: pixfmt.h:257
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
AVCOL_PRI_RESERVED0
@ AVCOL_PRI_RESERVED0
Definition: pixfmt.h:479
mask
static const uint16_t mask[17]
Definition: lzw.c:38
AV_PIX_FMT_YUVJ422P
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:79
AV_PIX_FMT_GBRAP16BE
@ AV_PIX_FMT_GBRAP16BE
planar GBRA 4:4:4:4 64bpp, big-endian
Definition: pixfmt.h:206
intreadwrite.h
AV_PIX_FMT_DXVA2_VLD
@ AV_PIX_FMT_DXVA2_VLD
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer.
Definition: pixfmt.h:127
s
#define s(width, name)
Definition: cbs_vp9.c:256
AV_PIX_FMT_GBRP16LE
@ AV_PIX_FMT_GBRP16LE
planar GBR 4:4:4 48bpp, little-endian
Definition: pixfmt.h:165
AVCHROMA_LOC_TOP
@ AVCHROMA_LOC_TOP
Definition: pixfmt.h:630
AVCOL_PRI_NB
@ AVCOL_PRI_NB
Not part of ABI.
Definition: pixfmt.h:496
AV_PIX_FMT_YUVA420P
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:101
AVCOL_TRC_BT1361_ECG
@ AVCOL_TRC_BT1361_ECG
ITU-R BT1361 Extended Colour Gamut.
Definition: pixfmt.h:516
color_space_names
static const char *const color_space_names[]
Definition: pixdesc.c:2582
AV_PIX_FMT_P416LE
@ AV_PIX_FMT_P416LE
interleaved chroma YUV 4:4:4, 48bpp, little-endian
Definition: pixfmt.h:368
AV_PIX_FMT_BAYER_RGGB16LE
@ AV_PIX_FMT_BAYER_RGGB16LE
bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian
Definition: pixfmt.h:256
AV_PIX_FMT_P210LE
@ AV_PIX_FMT_P210LE
interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, little-endian
Definition: pixfmt.h:359
AV_PIX_FMT_BAYER_BGGR8
@ AV_PIX_FMT_BAYER_BGGR8
bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples
Definition: pixfmt.h:250
AVCOL_SPC_SMPTE170M
@ AVCOL_SPC_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
Definition: pixfmt.h:539
AV_PIX_FMT_NV20BE
@ AV_PIX_FMT_NV20BE
interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:193
AV_PIX_FMT_P016BE
@ AV_PIX_FMT_P016BE
like NV12, with 16bpp per component, big-endian
Definition: pixfmt.h:293
bits
uint8_t bits
Definition: vp3data.h:141
AV_PIX_FMT_GBRP12LE
@ AV_PIX_FMT_GBRP12LE
planar GBR 4:4:4 36bpp, little-endian
Definition: pixfmt.h:245
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
AV_PIX_FMT_YUVA420P16BE
@ AV_PIX_FMT_YUVA420P16BE
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
Definition: pixfmt.h:180
AV_PIX_FMT_FLAG_ALPHA
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
Definition: pixdesc.h:147
AV_RL16
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
Definition: bytestream.h:94
AVCOL_PRI_SMPTE428
@ AVCOL_PRI_SMPTE428
SMPTE ST 428-1 (CIE 1931 XYZ)
Definition: pixfmt.h:490
color_range_names
static const char *const color_range_names[]
Definition: pixdesc.c:2537
AV_PIX_FMT_RGB4
@ AV_PIX_FMT_RGB4
packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in ...
Definition: pixfmt.h:87
pix_fmt
static enum AVPixelFormat pix_fmt
Definition: demuxing_decoding.c:41
AVPixFmtDescriptor::log2_chroma_w
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:80
AV_PIX_FMT_GBRP10LE
@ AV_PIX_FMT_GBRP10LE
planar GBR 4:4:4 30bpp, little-endian
Definition: pixfmt.h:163
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
AVCOL_PRI_SMPTE240M
@ AVCOL_PRI_SMPTE240M
identical to above, also called "SMPTE C" even though it uses D65
Definition: pixfmt.h:487
av_read_image_line2
void av_read_image_line2(void *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, int dst_element_size)
Read a line from an image, and write the values of the pixel format component c to dst.
Definition: pixdesc.c:33
AVCOL_PRI_UNSPECIFIED
@ AVCOL_PRI_UNSPECIFIED
Definition: pixfmt.h:481
AV_PIX_FMT_RGBA
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:93
AV_PIX_FMT_YUVJ444P
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80
AVCOL_SPC_CHROMA_DERIVED_CL
@ AVCOL_SPC_CHROMA_DERIVED_CL
Chromaticity-derived constant luminance system.
Definition: pixfmt.h:547
AVCOL_PRI_BT470BG
@ AVCOL_PRI_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
Definition: pixfmt.h:485
AV_PIX_FMT_YUV444P10LE
@ AV_PIX_FMT_YUV444P10LE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:155
AV_PIX_FMT_BAYER_RGGB8
@ AV_PIX_FMT_BAYER_RGGB8
bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples
Definition: pixfmt.h:251
AV_PIX_FMT_MEDIACODEC
@ AV_PIX_FMT_MEDIACODEC
hardware decoding through MediaCodec
Definition: pixfmt.h:285
AVCOL_PRI_SMPTE170M
@ AVCOL_PRI_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: pixfmt.h:486
AV_PIX_FMT_YUVA422P10LE
@ AV_PIX_FMT_YUVA422P10LE
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
Definition: pixfmt.h:177
AV_PIX_FMT_BAYER_GRBG16LE
@ AV_PIX_FMT_BAYER_GRBG16LE
bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian
Definition: pixfmt.h:260
av_color_range_name
const char * av_color_range_name(enum AVColorRange range)
Definition: pixdesc.c:3031
AV_PIX_FMT_YUV444P9BE
@ AV_PIX_FMT_YUV444P9BE
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:152
AV_PIX_FMT_YUV422P10BE
@ AV_PIX_FMT_YUV422P10BE
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:150
AV_PIX_FMT_YUV422P16LE
@ AV_PIX_FMT_YUV422P16LE
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:123
AVCOL_TRC_RESERVED0
@ AVCOL_TRC_RESERVED0
Definition: pixfmt.h:504
AV_PIX_FMT_RGB565LE
@ AV_PIX_FMT_RGB565LE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
Definition: pixfmt.h:106
AV_PIX_FMT_GBRAPF32BE
@ AV_PIX_FMT_GBRAPF32BE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, big-endian.
Definition: pixfmt.h:312
AV_PIX_FMT_GBRAP12BE
@ AV_PIX_FMT_GBRAP12BE
planar GBR 4:4:4:4 48bpp, big-endian
Definition: pixfmt.h:279
NULL
#define NULL
Definition: coverity.c:32
AVComponentDescriptor
Definition: pixdesc.h:30
AVPixFmtDescriptor::nb_components
uint8_t nb_components
The number of components each pixel has, (1-4)
Definition: pixdesc.h:71
AV_WB16
#define AV_WB16(p, v)
Definition: intreadwrite.h:405
AVCHROMA_LOC_LEFT
@ AVCHROMA_LOC_LEFT
MPEG-2/4 4:2:0, H.264 default for 4:2:0.
Definition: pixfmt.h:627
AV_PIX_FMT_YUYV422
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:67
FF_LOSS_DEPTH
#define FF_LOSS_DEPTH
loss due to color depth change
Definition: pixdesc.h:361
AVCHROMA_LOC_TOPLEFT
@ AVCHROMA_LOC_TOPLEFT
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
Definition: pixfmt.h:629
AVCOL_TRC_IEC61966_2_4
@ AVCOL_TRC_IEC61966_2_4
IEC 61966-2-4.
Definition: pixfmt.h:515
AV_PIX_FMT_P210BE
@ AV_PIX_FMT_P210BE
interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, big-endian
Definition: pixfmt.h:358
AV_PIX_FMT_RGB48LE
@ AV_PIX_FMT_RGB48LE
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:103
AV_PIX_FMT_YA16LE
@ AV_PIX_FMT_YA16LE
16 bits gray, 16 bits alpha (little-endian)
Definition: pixfmt.h:203
AV_PIX_FMT_YUVJ420P
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:78
AV_PIX_FMT_MONOBLACK
@ AV_PIX_FMT_MONOBLACK
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb.
Definition: pixfmt.h:76
AV_PIX_FMT_YUVA422P12LE
@ AV_PIX_FMT_YUVA422P12LE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, little-endian
Definition: pixfmt.h:336
AVCOL_PRI_BT709
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
Definition: pixfmt.h:480
AV_PIX_FMT_BGR565LE
@ AV_PIX_FMT_BGR565LE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
Definition: pixfmt.h:111
AV_PIX_FMT_RGBA64LE
@ AV_PIX_FMT_RGBA64LE
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:196
FF_COLOR_YUV_JPEG
#define FF_COLOR_YUV_JPEG
YUV color space.
Definition: pixdesc.c:2821
AV_PIX_FMT_YUVA444P12BE
@ AV_PIX_FMT_YUVA444P12BE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, big-endian
Definition: pixfmt.h:337
AV_PIX_FMT_YUVA444P9LE
@ AV_PIX_FMT_YUVA444P9LE
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
Definition: pixfmt.h:173
AV_PIX_FMT_XVMC
@ AV_PIX_FMT_XVMC
XVideo Motion Acceleration via common packet passing.
Definition: pixfmt.h:264
AV_PIX_FMT_Y210LE
@ AV_PIX_FMT_Y210LE
packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, little-endian
Definition: pixfmt.h:351
av_color_primaries_name
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
Definition: pixdesc.c:3049
AV_PIX_FMT_YUVA420P16LE
@ AV_PIX_FMT_YUVA420P16LE
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:181
AVCOL_TRC_BT2020_10
@ AVCOL_TRC_BT2020_10
ITU-R BT2020 for 10-bit system.
Definition: pixfmt.h:518
AV_PIX_FMT_RGB8
@ AV_PIX_FMT_RGB8
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
Definition: pixfmt.h:86
AV_PIX_FMT_BGR0
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:230
AVCOL_SPC_YCGCO
@ AVCOL_SPC_YCGCO
used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
Definition: pixfmt.h:541
AV_PIX_FMT_OPENCL
@ AV_PIX_FMT_OPENCL
Hardware surfaces for OpenCL.
Definition: pixfmt.h:327
AV_PIX_FMT_BGR4
@ AV_PIX_FMT_BGR4
packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in ...
Definition: pixfmt.h:84
AV_PIX_FMT_YUV440P10LE
@ AV_PIX_FMT_YUV440P10LE
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
Definition: pixfmt.h:267
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:74
AV_PIX_FMT_QSV
@ AV_PIX_FMT_QSV
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
Definition: pixfmt.h:212
AV_PIX_FMT_BGR555BE
@ AV_PIX_FMT_BGR555BE
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian , X=unused/undefined
Definition: pixfmt.h:112
AV_PIX_FMT_YUVA420P9LE
@ AV_PIX_FMT_YUVA420P9LE
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian
Definition: pixfmt.h:169
pixdesc_has_alpha
#define pixdesc_has_alpha(pixdesc)
Definition: pixdesc.c:2824
AVPixFmtDescriptor::flags
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
Definition: pixdesc.h:94
AV_PIX_FMT_ABGR
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:94
AVCOL_RANGE_UNSPECIFIED
@ AVCOL_RANGE_UNSPECIFIED
Definition: pixfmt.h:572
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
BAYER8_DESC_COMMON
#define BAYER8_DESC_COMMON
AV_PIX_FMT_YUV420P14LE
@ AV_PIX_FMT_YUV420P14LE
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:235
AVCOL_PRI_BT2020
@ AVCOL_PRI_BT2020
ITU-R BT2020.
Definition: pixfmt.h:489
AV_PIX_FMT_YUV444P14BE
@ AV_PIX_FMT_YUV444P14BE
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:242
AV_PIX_FMT_BGR4_BYTE
@ AV_PIX_FMT_BGR4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
Definition: pixfmt.h:85
AV_WB32
#define AV_WB32(p, v)
Definition: intreadwrite.h:419
AV_PIX_FMT_X2RGB10LE
@ AV_PIX_FMT_X2RGB10LE
packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:353
AV_PIX_FMT_YUV420P9BE
@ AV_PIX_FMT_YUV420P9BE
The following 12 formats have the disadvantage of needing 1 format for each bit depth.
Definition: pixfmt.h:146
get_color_type
static int get_color_type(const AVPixFmtDescriptor *desc)
Definition: pixdesc.c:2828
color_transfer_names
static const char *const color_transfer_names[]
Definition: pixdesc.c:2560
AVCOL_TRC_SMPTE2084
@ AVCOL_TRC_SMPTE2084
SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.
Definition: pixfmt.h:520
AVCOL_PRI_SMPTE431
@ AVCOL_PRI_SMPTE431
SMPTE ST 431-2 (2011) / DCI P3.
Definition: pixfmt.h:492
planes
static const struct @335 planes[]
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:68
AV_PIX_FMT_YUV440P12LE
@ AV_PIX_FMT_YUV440P12LE
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
Definition: pixfmt.h:269
AVCOL_TRC_SMPTE240M
@ AVCOL_TRC_SMPTE240M
Definition: pixfmt.h:511
av_get_pix_fmt_loss
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:2983
AVCOL_PRI_FILM
@ AVCOL_PRI_FILM
colour filters using Illuminant C
Definition: pixfmt.h:488
av_get_padded_bits_per_pixel
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:2668
AV_PIX_FMT_FLAG_RGB
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
Definition: pixdesc.h:136
AV_PIX_FMT_BAYER_BGGR16LE
@ AV_PIX_FMT_BAYER_BGGR16LE
bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian
Definition: pixfmt.h:254
AV_PIX_FMT_YUV420P12BE
@ AV_PIX_FMT_YUV420P12BE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:232
AV_PIX_FMT_YUV422P10LE
@ AV_PIX_FMT_YUV422P10LE
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:151
AVCOL_TRC_LOG
@ AVCOL_TRC_LOG
"Logarithmic transfer characteristic (100:1 range)"
Definition: pixfmt.h:513
AV_PIX_FMT_RGB444BE
@ AV_PIX_FMT_RGB444BE
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, X=unused/undefined
Definition: pixfmt.h:130
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:425
AV_PIX_FMT_YUV422P14BE
@ AV_PIX_FMT_YUV422P14BE
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:238
AV_PIX_FMT_YA16BE
@ AV_PIX_FMT_YA16BE
16 bits gray, 16 bits alpha (big-endian)
Definition: pixfmt.h:202
AV_PIX_FMT_GRAY12LE
@ AV_PIX_FMT_GRAY12LE
Y , 12bpp, little-endian.
Definition: pixfmt.h:288
AV_RB32
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_RB32
Definition: bytestream.h:96
AV_PIX_FMT_GBRP9BE
@ AV_PIX_FMT_GBRP9BE
planar GBR 4:4:4 27bpp, big-endian
Definition: pixfmt.h:160
AV_PIX_FMT_FLAG_BITSTREAM
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
Definition: pixdesc.h:124
AVCHROMA_LOC_UNSPECIFIED
@ AVCHROMA_LOC_UNSPECIFIED
Definition: pixfmt.h:626
AV_PIX_FMT_YUV420P10BE
@ AV_PIX_FMT_YUV420P10BE
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:148
AV_PIX_FMT_RGBAF16BE
@ AV_PIX_FMT_RGBAF16BE
IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., big-endian.
Definition: pixfmt.h:372
AV_PIX_FMT_NV16
@ AV_PIX_FMT_NV16
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:191
AV_PIX_FMT_BGR444BE
@ AV_PIX_FMT_BGR444BE
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, X=unused/undefined
Definition: pixfmt.h:132
FF_COLOR_RGB
#define FF_COLOR_RGB
RGB color space.
Definition: pixdesc.c:2818
AV_PIX_FMT_GBRP9LE
@ AV_PIX_FMT_GBRP9LE
planar GBR 4:4:4 27bpp, little-endian
Definition: pixfmt.h:161
AV_WL16
#define AV_WL16(p, v)
Definition: intreadwrite.h:412
AV_PIX_FMT_YUVA444P
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:167
AV_PIX_FMT_GBRAP10LE
@ AV_PIX_FMT_GBRAP10LE
planar GBR 4:4:4:4 40bpp, little-endian
Definition: pixfmt.h:283
AV_PIX_FMT_BGR565BE
@ AV_PIX_FMT_BGR565BE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
Definition: pixfmt.h:110
av_pix_fmt_desc_get_id
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
Definition: pixdesc.c:2722
AV_PIX_FMT_RGB0
@ AV_PIX_FMT_RGB0
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
Definition: pixfmt.h:228
AV_PIX_FMT_D3D11
@ AV_PIX_FMT_D3D11
Hardware surfaces for Direct3D11.
Definition: pixfmt.h:305
av_strstart
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
Definition: avstring.c:37
AV_PIX_FMT_P410LE
@ AV_PIX_FMT_P410LE
interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, little-endian
Definition: pixfmt.h:362
AV_PIX_FMT_VAAPI
@ AV_PIX_FMT_VAAPI
Hardware acceleration through VA-API, data[3] contains a VASurfaceID.
Definition: pixfmt.h:119
AV_PIX_FMT_YUVA420P10LE
@ AV_PIX_FMT_YUVA420P10LE
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:175
AVCOL_SPC_CHROMA_DERIVED_NCL
@ AVCOL_SPC_CHROMA_DERIVED_NCL
Chromaticity-derived non-constant luminance system.
Definition: pixfmt.h:546
AV_PIX_FMT_FLAG_BAYER
#define AV_PIX_FMT_FLAG_BAYER
The pixel format is following a Bayer pattern.
Definition: pixdesc.h:152
AVCOL_TRC_BT709
@ AVCOL_TRC_BT709
also ITU-R BT1361
Definition: pixfmt.h:505
AVChromaLocation
AVChromaLocation
Location of chroma samples.
Definition: pixfmt.h:625
AV_PIX_FMT_ARGB
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:92
AV_PIX_FMT_BGRA64LE
@ AV_PIX_FMT_BGRA64LE
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:198
AV_PIX_FMT_YUVA422P10BE
@ AV_PIX_FMT_YUVA422P10BE
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
Definition: pixfmt.h:176
AV_PIX_FMT_VDPAU
@ AV_PIX_FMT_VDPAU
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
Definition: pixfmt.h:187
AVCOL_SPC_SMPTE240M
@ AVCOL_SPC_SMPTE240M
derived from 170M primaries and D65 white point, 170M is derived from BT470 System M's primaries
Definition: pixfmt.h:540
AV_PIX_FMT_VIDEOTOOLBOX
@ AV_PIX_FMT_VIDEOTOOLBOX
hardware decoding through Videotoolbox
Definition: pixfmt.h:274
AV_PIX_FMT_YUVA444P12LE
@ AV_PIX_FMT_YUVA444P12LE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, little-endian
Definition: pixfmt.h:338
AV_PIX_FMT_YUVA422P9BE
@ AV_PIX_FMT_YUVA422P9BE
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
Definition: pixfmt.h:170
av_assert2
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
Definition: avassert.h:64
AV_PIX_FMT_RGB555LE
@ AV_PIX_FMT_RGB555LE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:108
AV_PIX_FMT_RGB48BE
@ AV_PIX_FMT_RGB48BE
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:102
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
AVCOL_SPC_BT2020_NCL
@ AVCOL_SPC_BT2020_NCL
ITU-R BT2020 non-constant luminance system.
Definition: pixfmt.h:543
FF_COLOR_XYZ
#define FF_COLOR_XYZ
Definition: pixdesc.c:2822
internal.h
AVColorSpace
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:532
AV_PIX_FMT_GRAY9BE
@ AV_PIX_FMT_GRAY9BE
Y , 9bpp, big-endian.
Definition: pixfmt.h:307
AV_PIX_FMT_NV24
@ AV_PIX_FMT_NV24
planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition: pixfmt.h:340
av_color_primaries_from_name
int av_color_primaries_from_name(const char *name)
Definition: pixdesc.c:3055
common.h
AV_PIX_FMT_BAYER_GBRG8
@ AV_PIX_FMT_BAYER_GBRG8
bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples
Definition: pixfmt.h:252
color_primaries_names
static const char *const color_primaries_names[AVCOL_PRI_NB]
Definition: pixdesc.c:2543
AV_PIX_FMT_NV20LE
@ AV_PIX_FMT_NV20LE
interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:192
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
AV_PIX_FMT_FLAG_BE
#define AV_PIX_FMT_FLAG_BE
Pixel format is big-endian.
Definition: pixdesc.h:116
AV_PIX_FMT_YUVJ440P
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition: pixfmt.h:100
AV_PIX_FMT_XYZ12BE
@ AV_PIX_FMT_XYZ12BE
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:190
AV_PIX_FMT_X2RGB10BE
@ AV_PIX_FMT_X2RGB10BE
packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), big-endian, X=unused/undefined
Definition: pixfmt.h:354
FF_COLOR_NA
#define FF_COLOR_NA
Definition: pixdesc.c:2817
AV_PIX_FMT_NV21
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
Definition: pixfmt.h:90
get_pix_fmt_score
static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt, unsigned *lossp, unsigned consider)
Definition: pixdesc.c:2870
AV_PIX_FMT_RGB4_BYTE
@ AV_PIX_FMT_RGB4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
Definition: pixfmt.h:88
AVCOL_SPC_UNSPECIFIED
@ AVCOL_SPC_UNSPECIFIED
Definition: pixfmt.h:535
AV_PIX_FMT_YUV444P16BE
@ AV_PIX_FMT_YUV444P16BE
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:126
FF_LOSS_COLORSPACE
#define FF_LOSS_COLORSPACE
loss due to color space conversion
Definition: pixdesc.h:362
FF_COLOR_YUV
#define FF_COLOR_YUV
YUV color space.
Definition: pixdesc.c:2820
AV_PIX_FMT_GBRPF32LE
@ AV_PIX_FMT_GBRPF32LE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, little-endian.
Definition: pixfmt.h:311
AV_PIX_FMT_NV42
@ AV_PIX_FMT_NV42
as above, but U and V bytes are swapped
Definition: pixfmt.h:341
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:589
AV_PIX_FMT_GBRAP16LE
@ AV_PIX_FMT_GBRAP16LE
planar GBRA 4:4:4:4 64bpp, little-endian
Definition: pixfmt.h:207
AV_PIX_FMT_PAL8
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
Definition: pixfmt.h:77
AV_PIX_FMT_GRAY12BE
@ AV_PIX_FMT_GRAY12BE
Y , 12bpp, big-endian.
Definition: pixfmt.h:287
AV_PIX_FMT_YVYU422
@ AV_PIX_FMT_YVYU422
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
Definition: pixfmt.h:200
AVCOL_PRI_BT470M
@ AVCOL_PRI_BT470M
also FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
Definition: pixfmt.h:483
ret
ret
Definition: filter_design.txt:187
pixfmt.h
AV_PIX_FMT_0BGR
@ AV_PIX_FMT_0BGR
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
Definition: pixfmt.h:229
AV_PIX_FMT_NV12
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition: pixfmt.h:89
get_pix_fmt_internal
static enum AVPixelFormat get_pix_fmt_internal(const char *name)
Definition: pixdesc.c:2610
AV_PIX_FMT_BAYER_BGGR16BE
@ AV_PIX_FMT_BAYER_BGGR16BE
bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian
Definition: pixfmt.h:255
AV_PIX_FMT_P410BE
@ AV_PIX_FMT_P410BE
interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, big-endian
Definition: pixfmt.h:361
AV_PIX_FMT_P016LE
@ AV_PIX_FMT_P016LE
like NV12, with 16bpp per component, little-endian
Definition: pixfmt.h:292
get_pix_fmt_depth
static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2852
AV_PIX_FMT_GRAYF32BE
@ AV_PIX_FMT_GRAYF32BE
IEEE-754 single precision Y, 32bpp, big-endian.
Definition: pixfmt.h:332
AV_PIX_FMT_GBRP12BE
@ AV_PIX_FMT_GBRP12BE
planar GBR 4:4:4 36bpp, big-endian
Definition: pixfmt.h:244
AV_PIX_FMT_UYVY422
@ AV_PIX_FMT_UYVY422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:81
AV_RL32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
Definition: bytestream.h:92
AV_PIX_FMT_YUV444P12BE
@ AV_PIX_FMT_YUV444P12BE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:240
av_get_pix_fmt
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
Definition: pixdesc.c:2635
AVCOL_TRC_ARIB_STD_B67
@ AVCOL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
Definition: pixfmt.h:524
av_find_best_pix_fmt_of_2
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:2994
AV_PIX_FMT_Y210BE
@ AV_PIX_FMT_Y210BE
packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, big-endian
Definition: pixfmt.h:350
AVCHROMA_LOC_CENTER
@ AVCHROMA_LOC_CENTER
MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0.
Definition: pixfmt.h:628
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AVCOL_SPC_FCC
@ AVCOL_SPC_FCC
FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
Definition: pixfmt.h:537
AV_PIX_FMT_YUV444P9LE
@ AV_PIX_FMT_YUV444P9LE
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:153
av_match_name
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:356
AVPixFmtDescriptor::comp
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:105
AV_PIX_FMT_FLAG_PLANAR
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.
Definition: pixdesc.h:132
AV_PIX_FMT_P216LE
@ AV_PIX_FMT_P216LE
interleaved chroma YUV 4:2:2, 32bpp, little-endian
Definition: pixfmt.h:365
AVCOL_TRC_SMPTE170M
@ AVCOL_TRC_SMPTE170M
also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
Definition: pixfmt.h:510
AV_PIX_FMT_YUVA420P10BE
@ AV_PIX_FMT_YUVA420P10BE
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
Definition: pixfmt.h:174
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
AV_PIX_FMT_RGB565BE
@ AV_PIX_FMT_RGB565BE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
Definition: pixfmt.h:105
AV_PIX_FMT_YUV420P16BE
@ AV_PIX_FMT_YUV420P16BE
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:122
X_NE
#define X_NE(be, le)
Definition: pixdesc.c:2632
shift
static int shift(int a, int b)
Definition: sonic.c:88
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:158
AV_PIX_FMT_YUV422P16BE
@ AV_PIX_FMT_YUV422P16BE
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:124
desc
const char * desc
Definition: libsvtav1.c:83
FF_LOSS_COLORQUANT
#define FF_LOSS_COLORQUANT
loss due to color quantization
Definition: pixdesc.h:364
AV_PIX_FMT_GRAY16LE
@ AV_PIX_FMT_GRAY16LE
Y , 16bpp, little-endian.
Definition: pixfmt.h:98
AV_PIX_FMT_X2BGR10LE
@ AV_PIX_FMT_X2BGR10LE
packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:355
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
AV_PIX_FMT_P010LE
@ AV_PIX_FMT_P010LE
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits,...
Definition: pixfmt.h:276
AV_PIX_FMT_YUVA444P10LE
@ AV_PIX_FMT_YUVA444P10LE
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:179
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
AVCOL_TRC_RESERVED
@ AVCOL_TRC_RESERVED
Definition: pixfmt.h:507
AV_PIX_FMT_BGR555LE
@ AV_PIX_FMT_BGR555LE
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:113
AVCOL_PRI_SMPTE432
@ AVCOL_PRI_SMPTE432
SMPTE ST 432-1 (2010) / P3 D65 / Display P3.
Definition: pixfmt.h:493
FF_LOSS_RESOLUTION
#define FF_LOSS_RESOLUTION
loss due to resolution change
Definition: pixdesc.h:360
AV_PIX_FMT_P216BE
@ AV_PIX_FMT_P216BE
interleaved chroma YUV 4:2:2, 32bpp, big-endian
Definition: pixfmt.h:364
AV_PIX_FMT_GRAY14LE
@ AV_PIX_FMT_GRAY14LE
Y , 14bpp, little-endian.
Definition: pixfmt.h:330
av_read_image_line
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)
Definition: pixdesc.c:89
AVCOL_SPC_SMPTE2085
@ AVCOL_SPC_SMPTE2085
SMPTE 2085, Y'D'zD'x.
Definition: pixfmt.h:545
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
AV_PIX_FMT_YUV411P
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:73
AV_PIX_FMT_GRAY14BE
@ AV_PIX_FMT_GRAY14BE
Y , 14bpp, big-endian.
Definition: pixfmt.h:329
AV_PIX_FMT_YUVA422P16BE
@ AV_PIX_FMT_YUVA422P16BE
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
Definition: pixfmt.h:182
AV_PIX_FMT_YUV440P10BE
@ AV_PIX_FMT_YUV440P10BE
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
Definition: pixfmt.h:268
AV_PIX_FMT_YUV422P9LE
@ AV_PIX_FMT_YUV422P9LE
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:157
AV_PIX_FMT_YUVA422P16LE
@ AV_PIX_FMT_YUVA422P16LE
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
Definition: pixfmt.h:183
AV_PIX_FMT_GBRP14LE
@ AV_PIX_FMT_GBRP14LE
planar GBR 4:4:4 42bpp, little-endian
Definition: pixfmt.h:247
d
d
Definition: ffmpeg_filter.c:155
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
AVCHROMA_LOC_NB
@ AVCHROMA_LOC_NB
Not part of ABI.
Definition: pixfmt.h:633
AV_PIX_FMT_0RGB
@ AV_PIX_FMT_0RGB
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
Definition: pixfmt.h:227
AV_PIX_FMT_YUV410P
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:72
av_strlcpy
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:86
alias
Definition: mccdec.c:62
AV_PIX_FMT_GBRAP10BE
@ AV_PIX_FMT_GBRAP10BE
planar GBR 4:4:4:4 40bpp, big-endian
Definition: pixfmt.h:282
AVCOL_TRC_SMPTE428
@ AVCOL_TRC_SMPTE428
SMPTE ST 428-1.
Definition: pixfmt.h:522
avstring.h
AV_PIX_FMT_YUVA444P16LE
@ AV_PIX_FMT_YUVA444P16LE
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:185
av_write_image_line2
void av_write_image_line2(const void *src, uint8_t *data[4], const int linesize[4], const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int src_element_size)
Write the values from src to the pixel format component c of an image line.
Definition: pixdesc.c:100
AV_PIX_FMT_YUVA422P12BE
@ AV_PIX_FMT_YUVA422P12BE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, big-endian
Definition: pixfmt.h:335
AVCOL_SPC_BT709
@ AVCOL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
Definition: pixfmt.h:534
AVColorRange
AVColorRange
Visual content value range.
Definition: pixfmt.h:571
AV_PIX_FMT_FLAG_PAL
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
Definition: pixdesc.h:120
AV_PIX_FMT_BGR444LE
@ AV_PIX_FMT_BGR444LE
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:131
AVCOL_SPC_ICTCP
@ AVCOL_SPC_ICTCP
ITU-R BT.2100-0, ICtCp.
Definition: pixfmt.h:548
snprintf
#define snprintf
Definition: snprintf.h:34
AV_PIX_FMT_YUV422P12LE
@ AV_PIX_FMT_YUV422P12LE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:237
AV_PIX_FMT_YUVA420P9BE
@ AV_PIX_FMT_YUVA420P9BE
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
Definition: pixfmt.h:168
av_color_transfer_name
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
Definition: pixdesc.c:3070
AVCHROMA_LOC_BOTTOMLEFT
@ AVCHROMA_LOC_BOTTOMLEFT
Definition: pixfmt.h:631
AV_PIX_FMT_BAYER_GRBG8
@ AV_PIX_FMT_BAYER_GRBG8
bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples
Definition: pixfmt.h:253
AVPixFmtDescriptor::log2_chroma_h
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:89
AV_PIX_FMT_YUVA422P
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:166
av_get_pix_fmt_name
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:2623
AV_RB16
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:98
AV_PIX_FMT_UYYVYY411
@ AV_PIX_FMT_UYYVYY411
packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
Definition: pixfmt.h:82
AV_PIX_FMT_BGR48BE
@ AV_PIX_FMT_BGR48BE
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:138
min
float min
Definition: vorbis_enc_data.h:429
AV_PIX_FMT_YUVA422P9LE
@ AV_PIX_FMT_YUVA422P9LE
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
Definition: pixfmt.h:171