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 #include "version.h"
33 
34 void av_read_image_line2(void *dst,
35  const uint8_t *data[4], const int linesize[4],
36  const AVPixFmtDescriptor *desc,
37  int x, int y, int c, int w,
38  int read_pal_component,
39  int dst_element_size)
40 {
42  int plane = comp.plane;
43  int depth = comp.depth;
44  unsigned mask = (1ULL << depth) - 1;
45  int shift = comp.shift;
46  int step = comp.step;
47  int flags = desc->flags;
48  uint16_t *dst16 = dst;
49  uint32_t *dst32 = dst;
50 
52  int skip = x * step + comp.offset;
53  const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
54  int shift = 8 - depth - (skip & 7);
55 
56  while (w--) {
57  int val = (*p >> shift) & mask;
58  if (read_pal_component)
59  val = data[1][4*val + c];
60  shift -= step;
61  p -= shift >> 3;
62  shift &= 7;
63  if (dst_element_size == 4) *dst32++ = val;
64  else *dst16++ = val;
65  }
66  } else {
67  const uint8_t *p = data[plane] + y * linesize[plane] +
68  x * step + comp.offset;
69  int is_8bit = shift + depth <= 8;
70  int is_16bit= shift + depth <=16;
71 
72  if (is_8bit)
73  p += !!(flags & AV_PIX_FMT_FLAG_BE);
74 
75  while (w--) {
76  unsigned val;
77  if (is_8bit) val = *p;
78  else if(is_16bit) val = flags & AV_PIX_FMT_FLAG_BE ? AV_RB16(p) : AV_RL16(p);
79  else val = flags & AV_PIX_FMT_FLAG_BE ? AV_RB32(p) : AV_RL32(p);
80  val = (val >> shift) & mask;
81  if (read_pal_component)
82  val = data[1][4 * val + c];
83  p += step;
84  if (dst_element_size == 4) *dst32++ = val;
85  else *dst16++ = val;
86  }
87  }
88 }
89 
90 void av_read_image_line(uint16_t *dst,
91  const uint8_t *data[4], const int linesize[4],
92  const AVPixFmtDescriptor *desc,
93  int x, int y, int c, int w,
94  int read_pal_component)
95 {
96  av_read_image_line2(dst, data, linesize, desc,x, y, c, w,
97  read_pal_component,
98  2);
99 }
100 
101 void av_write_image_line2(const void *src,
102  uint8_t *data[4], const int linesize[4],
103  const AVPixFmtDescriptor *desc,
104  int x, int y, int c, int w, int src_element_size)
105 {
106  AVComponentDescriptor comp = desc->comp[c];
107  int plane = comp.plane;
108  int depth = comp.depth;
109  int step = comp.step;
110  int flags = desc->flags;
111  const uint32_t *src32 = src;
112  const uint16_t *src16 = src;
113 
115  int skip = x * step + comp.offset;
116  uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
117  int shift = 8 - depth - (skip & 7);
118 
119  while (w--) {
120  *p |= (src_element_size == 4 ? *src32++ : *src16++) << shift;
121  shift -= step;
122  p -= shift >> 3;
123  shift &= 7;
124  }
125  } else {
126  int shift = comp.shift;
127  uint8_t *p = data[plane] + y * linesize[plane] +
128  x * step + comp.offset;
129 
130  if (shift + depth <= 8) {
131  p += !!(flags & AV_PIX_FMT_FLAG_BE);
132  while (w--) {
133  *p |= ((src_element_size == 4 ? *src32++ : *src16++) << shift);
134  p += step;
135  }
136  } else {
137  while (w--) {
138  unsigned s = (src_element_size == 4 ? *src32++ : *src16++);
139  if (shift + depth <= 16) {
140  if (flags & AV_PIX_FMT_FLAG_BE) {
141  uint16_t val = AV_RB16(p) | (s << shift);
142  AV_WB16(p, val);
143  } else {
144  uint16_t val = AV_RL16(p) | (s << shift);
145  AV_WL16(p, val);
146  }
147  } else {
148  if (flags & AV_PIX_FMT_FLAG_BE) {
149  uint32_t val = AV_RB32(p) | (s << shift);
150  AV_WB32(p, val);
151  } else {
152  uint32_t val = AV_RL32(p) | (s << shift);
153  AV_WL32(p, val);
154  }
155  }
156  p += step;
157  }
158  }
159  }
160 }
161 
162 void av_write_image_line(const uint16_t *src,
163  uint8_t *data[4], const int linesize[4],
164  const AVPixFmtDescriptor *desc,
165  int x, int y, int c, int w)
166 {
167  av_write_image_line2(src, data, linesize, desc, x, y, c, w, 2);
168 }
169 
171  [AV_PIX_FMT_YUV420P] = {
172  .name = "yuv420p",
173  .nb_components = 3,
174  .log2_chroma_w = 1,
175  .log2_chroma_h = 1,
176  .comp = {
177  { 0, 1, 0, 0, 8 }, /* Y */
178  { 1, 1, 0, 0, 8 }, /* U */
179  { 2, 1, 0, 0, 8 }, /* V */
180  },
181  .flags = AV_PIX_FMT_FLAG_PLANAR,
182  },
183  [AV_PIX_FMT_YUYV422] = {
184  .name = "yuyv422",
185  .nb_components = 3,
186  .log2_chroma_w = 1,
187  .log2_chroma_h = 0,
188  .comp = {
189  { 0, 2, 0, 0, 8 }, /* Y */
190  { 0, 4, 1, 0, 8 }, /* U */
191  { 0, 4, 3, 0, 8 }, /* V */
192  },
193  },
194  [AV_PIX_FMT_YVYU422] = {
195  .name = "yvyu422",
196  .nb_components = 3,
197  .log2_chroma_w = 1,
198  .log2_chroma_h = 0,
199  .comp = {
200  { 0, 2, 0, 0, 8 }, /* Y */
201  { 0, 4, 3, 0, 8 }, /* U */
202  { 0, 4, 1, 0, 8 }, /* V */
203  },
204  },
205  [AV_PIX_FMT_Y210LE] = {
206  .name = "y210le",
207  .nb_components = 3,
208  .log2_chroma_w = 1,
209  .log2_chroma_h = 0,
210  .comp = {
211  { 0, 4, 0, 6, 10 }, /* Y */
212  { 0, 8, 2, 6, 10 }, /* U */
213  { 0, 8, 6, 6, 10 }, /* V */
214  },
215  },
216  [AV_PIX_FMT_Y210BE] = {
217  .name = "y210be",
218  .nb_components = 3,
219  .log2_chroma_w = 1,
220  .log2_chroma_h = 0,
221  .comp = {
222  { 0, 4, 0, 6, 10 }, /* Y */
223  { 0, 8, 2, 6, 10 }, /* U */
224  { 0, 8, 6, 6, 10 }, /* V */
225  },
226  .flags = AV_PIX_FMT_FLAG_BE,
227  },
228  [AV_PIX_FMT_RGB24] = {
229  .name = "rgb24",
230  .nb_components = 3,
231  .log2_chroma_w = 0,
232  .log2_chroma_h = 0,
233  .comp = {
234  { 0, 3, 0, 0, 8 }, /* R */
235  { 0, 3, 1, 0, 8 }, /* G */
236  { 0, 3, 2, 0, 8 }, /* B */
237  },
238  .flags = AV_PIX_FMT_FLAG_RGB,
239  },
240  [AV_PIX_FMT_BGR24] = {
241  .name = "bgr24",
242  .nb_components = 3,
243  .log2_chroma_w = 0,
244  .log2_chroma_h = 0,
245  .comp = {
246  { 0, 3, 2, 0, 8 }, /* R */
247  { 0, 3, 1, 0, 8 }, /* G */
248  { 0, 3, 0, 0, 8 }, /* B */
249  },
250  .flags = AV_PIX_FMT_FLAG_RGB,
251  },
253  .name = "x2rgb10le",
254  .nb_components= 3,
255  .log2_chroma_w= 0,
256  .log2_chroma_h= 0,
257  .comp = {
258  { 0, 4, 2, 4, 10 }, /* R */
259  { 0, 4, 1, 2, 10 }, /* G */
260  { 0, 4, 0, 0, 10 }, /* B */
261  },
262  .flags = AV_PIX_FMT_FLAG_RGB,
263  },
265  .name = "x2rgb10be",
266  .nb_components= 3,
267  .log2_chroma_w= 0,
268  .log2_chroma_h= 0,
269  .comp = {
270  { 0, 4, 0, 4, 10 }, /* R */
271  { 0, 4, 1, 2, 10 }, /* G */
272  { 0, 4, 2, 0, 10 }, /* B */
273  },
275  },
276  [AV_PIX_FMT_YUV422P] = {
277  .name = "yuv422p",
278  .nb_components = 3,
279  .log2_chroma_w = 1,
280  .log2_chroma_h = 0,
281  .comp = {
282  { 0, 1, 0, 0, 8 }, /* Y */
283  { 1, 1, 0, 0, 8 }, /* U */
284  { 2, 1, 0, 0, 8 }, /* V */
285  },
286  .flags = AV_PIX_FMT_FLAG_PLANAR,
287  },
288  [AV_PIX_FMT_YUV444P] = {
289  .name = "yuv444p",
290  .nb_components = 3,
291  .log2_chroma_w = 0,
292  .log2_chroma_h = 0,
293  .comp = {
294  { 0, 1, 0, 0, 8 }, /* Y */
295  { 1, 1, 0, 0, 8 }, /* U */
296  { 2, 1, 0, 0, 8 }, /* V */
297  },
298  .flags = AV_PIX_FMT_FLAG_PLANAR,
299  },
300  [AV_PIX_FMT_YUV410P] = {
301  .name = "yuv410p",
302  .nb_components = 3,
303  .log2_chroma_w = 2,
304  .log2_chroma_h = 2,
305  .comp = {
306  { 0, 1, 0, 0, 8 }, /* Y */
307  { 1, 1, 0, 0, 8 }, /* U */
308  { 2, 1, 0, 0, 8 }, /* V */
309  },
310  .flags = AV_PIX_FMT_FLAG_PLANAR,
311  },
312  [AV_PIX_FMT_YUV411P] = {
313  .name = "yuv411p",
314  .nb_components = 3,
315  .log2_chroma_w = 2,
316  .log2_chroma_h = 0,
317  .comp = {
318  { 0, 1, 0, 0, 8 }, /* Y */
319  { 1, 1, 0, 0, 8 }, /* U */
320  { 2, 1, 0, 0, 8 }, /* V */
321  },
322  .flags = AV_PIX_FMT_FLAG_PLANAR,
323  },
324  [AV_PIX_FMT_YUVJ411P] = {
325  .name = "yuvj411p",
326  .nb_components = 3,
327  .log2_chroma_w = 2,
328  .log2_chroma_h = 0,
329  .comp = {
330  { 0, 1, 0, 0, 8 }, /* Y */
331  { 1, 1, 0, 0, 8 }, /* U */
332  { 2, 1, 0, 0, 8 }, /* V */
333  },
334  .flags = AV_PIX_FMT_FLAG_PLANAR,
335  },
336  [AV_PIX_FMT_GRAY8] = {
337  .name = "gray",
338  .nb_components = 1,
339  .log2_chroma_w = 0,
340  .log2_chroma_h = 0,
341  .comp = {
342  { 0, 1, 0, 0, 8 }, /* Y */
343  },
344  .alias = "gray8,y8",
345  },
347  .name = "monow",
348  .nb_components = 1,
349  .log2_chroma_w = 0,
350  .log2_chroma_h = 0,
351  .comp = {
352  { 0, 1, 0, 0, 1 }, /* Y */
353  },
354  .flags = AV_PIX_FMT_FLAG_BITSTREAM,
355  },
357  .name = "monob",
358  .nb_components = 1,
359  .log2_chroma_w = 0,
360  .log2_chroma_h = 0,
361  .comp = {
362  { 0, 1, 0, 7, 1 }, /* Y */
363  },
364  .flags = AV_PIX_FMT_FLAG_BITSTREAM,
365  },
366  [AV_PIX_FMT_PAL8] = {
367  .name = "pal8",
368  .nb_components = 1,
369  .log2_chroma_w = 0,
370  .log2_chroma_h = 0,
371  .comp = {
372  { 0, 1, 0, 0, 8 },
373  },
375  },
376  [AV_PIX_FMT_YUVJ420P] = {
377  .name = "yuvj420p",
378  .nb_components = 3,
379  .log2_chroma_w = 1,
380  .log2_chroma_h = 1,
381  .comp = {
382  { 0, 1, 0, 0, 8 }, /* Y */
383  { 1, 1, 0, 0, 8 }, /* U */
384  { 2, 1, 0, 0, 8 }, /* V */
385  },
386  .flags = AV_PIX_FMT_FLAG_PLANAR,
387  },
388  [AV_PIX_FMT_YUVJ422P] = {
389  .name = "yuvj422p",
390  .nb_components = 3,
391  .log2_chroma_w = 1,
392  .log2_chroma_h = 0,
393  .comp = {
394  { 0, 1, 0, 0, 8 }, /* Y */
395  { 1, 1, 0, 0, 8 }, /* U */
396  { 2, 1, 0, 0, 8 }, /* V */
397  },
398  .flags = AV_PIX_FMT_FLAG_PLANAR,
399  },
400  [AV_PIX_FMT_YUVJ444P] = {
401  .name = "yuvj444p",
402  .nb_components = 3,
403  .log2_chroma_w = 0,
404  .log2_chroma_h = 0,
405  .comp = {
406  { 0, 1, 0, 0, 8 }, /* Y */
407  { 1, 1, 0, 0, 8 }, /* U */
408  { 2, 1, 0, 0, 8 }, /* V */
409  },
410  .flags = AV_PIX_FMT_FLAG_PLANAR,
411  },
412  [AV_PIX_FMT_XVMC] = {
413  .name = "xvmc",
414  .flags = AV_PIX_FMT_FLAG_HWACCEL,
415  },
416  [AV_PIX_FMT_UYVY422] = {
417  .name = "uyvy422",
418  .nb_components = 3,
419  .log2_chroma_w = 1,
420  .log2_chroma_h = 0,
421  .comp = {
422  { 0, 2, 1, 0, 8 }, /* Y */
423  { 0, 4, 0, 0, 8 }, /* U */
424  { 0, 4, 2, 0, 8 }, /* V */
425  },
426  },
428  .name = "uyyvyy411",
429  .nb_components = 3,
430  .log2_chroma_w = 2,
431  .log2_chroma_h = 0,
432  .comp = {
433  { 0, 4, 1, 0, 8 }, /* Y */
434  { 0, 6, 0, 0, 8 }, /* U */
435  { 0, 6, 3, 0, 8 }, /* V */
436  },
437  },
438  [AV_PIX_FMT_BGR8] = {
439  .name = "bgr8",
440  .nb_components = 3,
441  .log2_chroma_w = 0,
442  .log2_chroma_h = 0,
443  .comp = {
444  { 0, 1, 0, 0, 3 }, /* R */
445  { 0, 1, 0, 3, 3 }, /* G */
446  { 0, 1, 0, 6, 2 }, /* B */
447  },
448  .flags = AV_PIX_FMT_FLAG_RGB,
449  },
450  [AV_PIX_FMT_BGR4] = {
451  .name = "bgr4",
452  .nb_components = 3,
453  .log2_chroma_w = 0,
454  .log2_chroma_h = 0,
455  .comp = {
456  { 0, 4, 3, 0, 1 }, /* R */
457  { 0, 4, 1, 0, 2 }, /* G */
458  { 0, 4, 0, 0, 1 }, /* B */
459  },
461  },
463  .name = "bgr4_byte",
464  .nb_components = 3,
465  .log2_chroma_w = 0,
466  .log2_chroma_h = 0,
467  .comp = {
468  { 0, 1, 0, 0, 1 }, /* R */
469  { 0, 1, 0, 1, 2 }, /* G */
470  { 0, 1, 0, 3, 1 }, /* B */
471  },
472  .flags = AV_PIX_FMT_FLAG_RGB,
473  },
474  [AV_PIX_FMT_RGB8] = {
475  .name = "rgb8",
476  .nb_components = 3,
477  .log2_chroma_w = 0,
478  .log2_chroma_h = 0,
479  .comp = {
480  { 0, 1, 0, 6, 2 }, /* R */
481  { 0, 1, 0, 3, 3 }, /* G */
482  { 0, 1, 0, 0, 3 }, /* B */
483  },
484  .flags = AV_PIX_FMT_FLAG_RGB,
485  },
486  [AV_PIX_FMT_RGB4] = {
487  .name = "rgb4",
488  .nb_components = 3,
489  .log2_chroma_w = 0,
490  .log2_chroma_h = 0,
491  .comp = {
492  { 0, 4, 0, 0, 1 }, /* R */
493  { 0, 4, 1, 0, 2 }, /* G */
494  { 0, 4, 3, 0, 1 }, /* B */
495  },
497  },
499  .name = "rgb4_byte",
500  .nb_components = 3,
501  .log2_chroma_w = 0,
502  .log2_chroma_h = 0,
503  .comp = {
504  { 0, 1, 0, 3, 1 }, /* R */
505  { 0, 1, 0, 1, 2 }, /* G */
506  { 0, 1, 0, 0, 1 }, /* B */
507  },
508  .flags = AV_PIX_FMT_FLAG_RGB,
509  },
510  [AV_PIX_FMT_NV12] = {
511  .name = "nv12",
512  .nb_components = 3,
513  .log2_chroma_w = 1,
514  .log2_chroma_h = 1,
515  .comp = {
516  { 0, 1, 0, 0, 8 }, /* Y */
517  { 1, 2, 0, 0, 8 }, /* U */
518  { 1, 2, 1, 0, 8 }, /* V */
519  },
520  .flags = AV_PIX_FMT_FLAG_PLANAR,
521  },
522  [AV_PIX_FMT_NV21] = {
523  .name = "nv21",
524  .nb_components = 3,
525  .log2_chroma_w = 1,
526  .log2_chroma_h = 1,
527  .comp = {
528  { 0, 1, 0, 0, 8 }, /* Y */
529  { 1, 2, 1, 0, 8 }, /* U */
530  { 1, 2, 0, 0, 8 }, /* V */
531  },
532  .flags = AV_PIX_FMT_FLAG_PLANAR,
533  },
534  [AV_PIX_FMT_ARGB] = {
535  .name = "argb",
536  .nb_components = 4,
537  .log2_chroma_w = 0,
538  .log2_chroma_h = 0,
539  .comp = {
540  { 0, 4, 1, 0, 8 }, /* R */
541  { 0, 4, 2, 0, 8 }, /* G */
542  { 0, 4, 3, 0, 8 }, /* B */
543  { 0, 4, 0, 0, 8 }, /* A */
544  },
546  },
547  [AV_PIX_FMT_RGBA] = {
548  .name = "rgba",
549  .nb_components = 4,
550  .log2_chroma_w = 0,
551  .log2_chroma_h = 0,
552  .comp = {
553  { 0, 4, 0, 0, 8 }, /* R */
554  { 0, 4, 1, 0, 8 }, /* G */
555  { 0, 4, 2, 0, 8 }, /* B */
556  { 0, 4, 3, 0, 8 }, /* A */
557  },
559  },
560  [AV_PIX_FMT_ABGR] = {
561  .name = "abgr",
562  .nb_components = 4,
563  .log2_chroma_w = 0,
564  .log2_chroma_h = 0,
565  .comp = {
566  { 0, 4, 3, 0, 8 }, /* R */
567  { 0, 4, 2, 0, 8 }, /* G */
568  { 0, 4, 1, 0, 8 }, /* B */
569  { 0, 4, 0, 0, 8 }, /* A */
570  },
572  },
573  [AV_PIX_FMT_BGRA] = {
574  .name = "bgra",
575  .nb_components = 4,
576  .log2_chroma_w = 0,
577  .log2_chroma_h = 0,
578  .comp = {
579  { 0, 4, 2, 0, 8 }, /* R */
580  { 0, 4, 1, 0, 8 }, /* G */
581  { 0, 4, 0, 0, 8 }, /* B */
582  { 0, 4, 3, 0, 8 }, /* A */
583  },
585  },
586  [AV_PIX_FMT_0RGB] = {
587  .name = "0rgb",
588  .nb_components= 3,
589  .log2_chroma_w= 0,
590  .log2_chroma_h= 0,
591  .comp = {
592  { 0, 4, 1, 0, 8 }, /* R */
593  { 0, 4, 2, 0, 8 }, /* G */
594  { 0, 4, 3, 0, 8 }, /* B */
595  },
596  .flags = AV_PIX_FMT_FLAG_RGB,
597  },
598  [AV_PIX_FMT_RGB0] = {
599  .name = "rgb0",
600  .nb_components= 3,
601  .log2_chroma_w= 0,
602  .log2_chroma_h= 0,
603  .comp = {
604  { 0, 4, 0, 0, 8 }, /* R */
605  { 0, 4, 1, 0, 8 }, /* G */
606  { 0, 4, 2, 0, 8 }, /* B */
607  },
608  .flags = AV_PIX_FMT_FLAG_RGB,
609  },
610  [AV_PIX_FMT_0BGR] = {
611  .name = "0bgr",
612  .nb_components= 3,
613  .log2_chroma_w= 0,
614  .log2_chroma_h= 0,
615  .comp = {
616  { 0, 4, 3, 0, 8 }, /* R */
617  { 0, 4, 2, 0, 8 }, /* G */
618  { 0, 4, 1, 0, 8 }, /* B */
619  },
620  .flags = AV_PIX_FMT_FLAG_RGB,
621  },
622  [AV_PIX_FMT_BGR0] = {
623  .name = "bgr0",
624  .nb_components= 3,
625  .log2_chroma_w= 0,
626  .log2_chroma_h= 0,
627  .comp = {
628  { 0, 4, 2, 0, 8 }, /* R */
629  { 0, 4, 1, 0, 8 }, /* G */
630  { 0, 4, 0, 0, 8 }, /* B */
631  },
632  .flags = AV_PIX_FMT_FLAG_RGB,
633  },
634  [AV_PIX_FMT_GRAY9BE] = {
635  .name = "gray9be",
636  .nb_components = 1,
637  .log2_chroma_w = 0,
638  .log2_chroma_h = 0,
639  .comp = {
640  { 0, 2, 0, 0, 9 }, /* Y */
641  },
642  .flags = AV_PIX_FMT_FLAG_BE,
643  .alias = "y9be",
644  },
645  [AV_PIX_FMT_GRAY9LE] = {
646  .name = "gray9le",
647  .nb_components = 1,
648  .log2_chroma_w = 0,
649  .log2_chroma_h = 0,
650  .comp = {
651  { 0, 2, 0, 0, 9 }, /* Y */
652  },
653  .alias = "y9le",
654  },
655  [AV_PIX_FMT_GRAY10BE] = {
656  .name = "gray10be",
657  .nb_components = 1,
658  .log2_chroma_w = 0,
659  .log2_chroma_h = 0,
660  .comp = {
661  { 0, 2, 0, 0, 10 }, /* Y */
662  },
663  .flags = AV_PIX_FMT_FLAG_BE,
664  .alias = "y10be",
665  },
666  [AV_PIX_FMT_GRAY10LE] = {
667  .name = "gray10le",
668  .nb_components = 1,
669  .log2_chroma_w = 0,
670  .log2_chroma_h = 0,
671  .comp = {
672  { 0, 2, 0, 0, 10 }, /* Y */
673  },
674  .alias = "y10le",
675  },
676  [AV_PIX_FMT_GRAY12BE] = {
677  .name = "gray12be",
678  .nb_components = 1,
679  .log2_chroma_w = 0,
680  .log2_chroma_h = 0,
681  .comp = {
682  { 0, 2, 0, 0, 12 }, /* Y */
683  },
684  .flags = AV_PIX_FMT_FLAG_BE,
685  .alias = "y12be",
686  },
687  [AV_PIX_FMT_GRAY12LE] = {
688  .name = "gray12le",
689  .nb_components = 1,
690  .log2_chroma_w = 0,
691  .log2_chroma_h = 0,
692  .comp = {
693  { 0, 2, 0, 0, 12 }, /* Y */
694  },
695  .alias = "y12le",
696  },
697  [AV_PIX_FMT_GRAY14BE] = {
698  .name = "gray14be",
699  .nb_components = 1,
700  .log2_chroma_w = 0,
701  .log2_chroma_h = 0,
702  .comp = {
703  { 0, 2, 0, 0, 14 }, /* Y */
704  },
705  .flags = AV_PIX_FMT_FLAG_BE,
706  .alias = "y14be",
707  },
708  [AV_PIX_FMT_GRAY14LE] = {
709  .name = "gray14le",
710  .nb_components = 1,
711  .log2_chroma_w = 0,
712  .log2_chroma_h = 0,
713  .comp = {
714  { 0, 2, 0, 0, 14 }, /* Y */
715  },
716  .alias = "y14le",
717  },
718  [AV_PIX_FMT_GRAY16BE] = {
719  .name = "gray16be",
720  .nb_components = 1,
721  .log2_chroma_w = 0,
722  .log2_chroma_h = 0,
723  .comp = {
724  { 0, 2, 0, 0, 16 }, /* Y */
725  },
726  .flags = AV_PIX_FMT_FLAG_BE,
727  .alias = "y16be",
728  },
729  [AV_PIX_FMT_GRAY16LE] = {
730  .name = "gray16le",
731  .nb_components = 1,
732  .log2_chroma_w = 0,
733  .log2_chroma_h = 0,
734  .comp = {
735  { 0, 2, 0, 0, 16 }, /* Y */
736  },
737  .alias = "y16le",
738  },
739  [AV_PIX_FMT_YUV440P] = {
740  .name = "yuv440p",
741  .nb_components = 3,
742  .log2_chroma_w = 0,
743  .log2_chroma_h = 1,
744  .comp = {
745  { 0, 1, 0, 0, 8 }, /* Y */
746  { 1, 1, 0, 0, 8 }, /* U */
747  { 2, 1, 0, 0, 8 }, /* V */
748  },
749  .flags = AV_PIX_FMT_FLAG_PLANAR,
750  },
751  [AV_PIX_FMT_YUVJ440P] = {
752  .name = "yuvj440p",
753  .nb_components = 3,
754  .log2_chroma_w = 0,
755  .log2_chroma_h = 1,
756  .comp = {
757  { 0, 1, 0, 0, 8 }, /* Y */
758  { 1, 1, 0, 0, 8 }, /* U */
759  { 2, 1, 0, 0, 8 }, /* V */
760  },
761  .flags = AV_PIX_FMT_FLAG_PLANAR,
762  },
764  .name = "yuv440p10le",
765  .nb_components = 3,
766  .log2_chroma_w = 0,
767  .log2_chroma_h = 1,
768  .comp = {
769  { 0, 2, 0, 0, 10 }, /* Y */
770  { 1, 2, 0, 0, 10 }, /* U */
771  { 2, 2, 0, 0, 10 }, /* V */
772  },
773  .flags = AV_PIX_FMT_FLAG_PLANAR,
774  },
776  .name = "yuv440p10be",
777  .nb_components = 3,
778  .log2_chroma_w = 0,
779  .log2_chroma_h = 1,
780  .comp = {
781  { 0, 2, 0, 0, 10 }, /* Y */
782  { 1, 2, 0, 0, 10 }, /* U */
783  { 2, 2, 0, 0, 10 }, /* V */
784  },
786  },
788  .name = "yuv440p12le",
789  .nb_components = 3,
790  .log2_chroma_w = 0,
791  .log2_chroma_h = 1,
792  .comp = {
793  { 0, 2, 0, 0, 12 }, /* Y */
794  { 1, 2, 0, 0, 12 }, /* U */
795  { 2, 2, 0, 0, 12 }, /* V */
796  },
797  .flags = AV_PIX_FMT_FLAG_PLANAR,
798  },
800  .name = "yuv440p12be",
801  .nb_components = 3,
802  .log2_chroma_w = 0,
803  .log2_chroma_h = 1,
804  .comp = {
805  { 0, 2, 0, 0, 12 }, /* Y */
806  { 1, 2, 0, 0, 12 }, /* U */
807  { 2, 2, 0, 0, 12 }, /* V */
808  },
810  },
811  [AV_PIX_FMT_YUVA420P] = {
812  .name = "yuva420p",
813  .nb_components = 4,
814  .log2_chroma_w = 1,
815  .log2_chroma_h = 1,
816  .comp = {
817  { 0, 1, 0, 0, 8 }, /* Y */
818  { 1, 1, 0, 0, 8 }, /* U */
819  { 2, 1, 0, 0, 8 }, /* V */
820  { 3, 1, 0, 0, 8 }, /* A */
821  },
823  },
824  [AV_PIX_FMT_YUVA422P] = {
825  .name = "yuva422p",
826  .nb_components = 4,
827  .log2_chroma_w = 1,
828  .log2_chroma_h = 0,
829  .comp = {
830  { 0, 1, 0, 0, 8 }, /* Y */
831  { 1, 1, 0, 0, 8 }, /* U */
832  { 2, 1, 0, 0, 8 }, /* V */
833  { 3, 1, 0, 0, 8 }, /* A */
834  },
836  },
837  [AV_PIX_FMT_YUVA444P] = {
838  .name = "yuva444p",
839  .nb_components = 4,
840  .log2_chroma_w = 0,
841  .log2_chroma_h = 0,
842  .comp = {
843  { 0, 1, 0, 0, 8 }, /* Y */
844  { 1, 1, 0, 0, 8 }, /* U */
845  { 2, 1, 0, 0, 8 }, /* V */
846  { 3, 1, 0, 0, 8 }, /* A */
847  },
849  },
851  .name = "yuva420p9be",
852  .nb_components = 4,
853  .log2_chroma_w = 1,
854  .log2_chroma_h = 1,
855  .comp = {
856  { 0, 2, 0, 0, 9 }, /* Y */
857  { 1, 2, 0, 0, 9 }, /* U */
858  { 2, 2, 0, 0, 9 }, /* V */
859  { 3, 2, 0, 0, 9 }, /* A */
860  },
862  },
864  .name = "yuva420p9le",
865  .nb_components = 4,
866  .log2_chroma_w = 1,
867  .log2_chroma_h = 1,
868  .comp = {
869  { 0, 2, 0, 0, 9 }, /* Y */
870  { 1, 2, 0, 0, 9 }, /* U */
871  { 2, 2, 0, 0, 9 }, /* V */
872  { 3, 2, 0, 0, 9 }, /* A */
873  },
875  },
877  .name = "yuva422p9be",
878  .nb_components = 4,
879  .log2_chroma_w = 1,
880  .log2_chroma_h = 0,
881  .comp = {
882  { 0, 2, 0, 0, 9 }, /* Y */
883  { 1, 2, 0, 0, 9 }, /* U */
884  { 2, 2, 0, 0, 9 }, /* V */
885  { 3, 2, 0, 0, 9 }, /* A */
886  },
888  },
890  .name = "yuva422p9le",
891  .nb_components = 4,
892  .log2_chroma_w = 1,
893  .log2_chroma_h = 0,
894  .comp = {
895  { 0, 2, 0, 0, 9 }, /* Y */
896  { 1, 2, 0, 0, 9 }, /* U */
897  { 2, 2, 0, 0, 9 }, /* V */
898  { 3, 2, 0, 0, 9 }, /* A */
899  },
901  },
903  .name = "yuva444p9be",
904  .nb_components = 4,
905  .log2_chroma_w = 0,
906  .log2_chroma_h = 0,
907  .comp = {
908  { 0, 2, 0, 0, 9 }, /* Y */
909  { 1, 2, 0, 0, 9 }, /* U */
910  { 2, 2, 0, 0, 9 }, /* V */
911  { 3, 2, 0, 0, 9 }, /* A */
912  },
914  },
916  .name = "yuva444p9le",
917  .nb_components = 4,
918  .log2_chroma_w = 0,
919  .log2_chroma_h = 0,
920  .comp = {
921  { 0, 2, 0, 0, 9 }, /* Y */
922  { 1, 2, 0, 0, 9 }, /* U */
923  { 2, 2, 0, 0, 9 }, /* V */
924  { 3, 2, 0, 0, 9 }, /* A */
925  },
927  },
929  .name = "yuva420p10be",
930  .nb_components = 4,
931  .log2_chroma_w = 1,
932  .log2_chroma_h = 1,
933  .comp = {
934  { 0, 2, 0, 0, 10 }, /* Y */
935  { 1, 2, 0, 0, 10 }, /* U */
936  { 2, 2, 0, 0, 10 }, /* V */
937  { 3, 2, 0, 0, 10 }, /* A */
938  },
940  },
942  .name = "yuva420p10le",
943  .nb_components = 4,
944  .log2_chroma_w = 1,
945  .log2_chroma_h = 1,
946  .comp = {
947  { 0, 2, 0, 0, 10 }, /* Y */
948  { 1, 2, 0, 0, 10 }, /* U */
949  { 2, 2, 0, 0, 10 }, /* V */
950  { 3, 2, 0, 0, 10 }, /* A */
951  },
953  },
955  .name = "yuva422p10be",
956  .nb_components = 4,
957  .log2_chroma_w = 1,
958  .log2_chroma_h = 0,
959  .comp = {
960  { 0, 2, 0, 0, 10 }, /* Y */
961  { 1, 2, 0, 0, 10 }, /* U */
962  { 2, 2, 0, 0, 10 }, /* V */
963  { 3, 2, 0, 0, 10 }, /* A */
964  },
966  },
968  .name = "yuva422p10le",
969  .nb_components = 4,
970  .log2_chroma_w = 1,
971  .log2_chroma_h = 0,
972  .comp = {
973  { 0, 2, 0, 0, 10 }, /* Y */
974  { 1, 2, 0, 0, 10 }, /* U */
975  { 2, 2, 0, 0, 10 }, /* V */
976  { 3, 2, 0, 0, 10 }, /* A */
977  },
979  },
981  .name = "yuva444p10be",
982  .nb_components = 4,
983  .log2_chroma_w = 0,
984  .log2_chroma_h = 0,
985  .comp = {
986  { 0, 2, 0, 0, 10 }, /* Y */
987  { 1, 2, 0, 0, 10 }, /* U */
988  { 2, 2, 0, 0, 10 }, /* V */
989  { 3, 2, 0, 0, 10 }, /* A */
990  },
992  },
994  .name = "yuva444p10le",
995  .nb_components = 4,
996  .log2_chroma_w = 0,
997  .log2_chroma_h = 0,
998  .comp = {
999  { 0, 2, 0, 0, 10 }, /* Y */
1000  { 1, 2, 0, 0, 10 }, /* U */
1001  { 2, 2, 0, 0, 10 }, /* V */
1002  { 3, 2, 0, 0, 10 }, /* A */
1003  },
1005  },
1007  .name = "yuva420p16be",
1008  .nb_components = 4,
1009  .log2_chroma_w = 1,
1010  .log2_chroma_h = 1,
1011  .comp = {
1012  { 0, 2, 0, 0, 16 }, /* Y */
1013  { 1, 2, 0, 0, 16 }, /* U */
1014  { 2, 2, 0, 0, 16 }, /* V */
1015  { 3, 2, 0, 0, 16 }, /* A */
1016  },
1018  },
1020  .name = "yuva420p16le",
1021  .nb_components = 4,
1022  .log2_chroma_w = 1,
1023  .log2_chroma_h = 1,
1024  .comp = {
1025  { 0, 2, 0, 0, 16 }, /* Y */
1026  { 1, 2, 0, 0, 16 }, /* U */
1027  { 2, 2, 0, 0, 16 }, /* V */
1028  { 3, 2, 0, 0, 16 }, /* A */
1029  },
1031  },
1033  .name = "yuva422p16be",
1034  .nb_components = 4,
1035  .log2_chroma_w = 1,
1036  .log2_chroma_h = 0,
1037  .comp = {
1038  { 0, 2, 0, 0, 16 }, /* Y */
1039  { 1, 2, 0, 0, 16 }, /* U */
1040  { 2, 2, 0, 0, 16 }, /* V */
1041  { 3, 2, 0, 0, 16 }, /* A */
1042  },
1044  },
1046  .name = "yuva422p16le",
1047  .nb_components = 4,
1048  .log2_chroma_w = 1,
1049  .log2_chroma_h = 0,
1050  .comp = {
1051  { 0, 2, 0, 0, 16 }, /* Y */
1052  { 1, 2, 0, 0, 16 }, /* U */
1053  { 2, 2, 0, 0, 16 }, /* V */
1054  { 3, 2, 0, 0, 16 }, /* A */
1055  },
1057  },
1059  .name = "yuva444p16be",
1060  .nb_components = 4,
1061  .log2_chroma_w = 0,
1062  .log2_chroma_h = 0,
1063  .comp = {
1064  { 0, 2, 0, 0, 16 }, /* Y */
1065  { 1, 2, 0, 0, 16 }, /* U */
1066  { 2, 2, 0, 0, 16 }, /* V */
1067  { 3, 2, 0, 0, 16 }, /* A */
1068  },
1070  },
1072  .name = "yuva444p16le",
1073  .nb_components = 4,
1074  .log2_chroma_w = 0,
1075  .log2_chroma_h = 0,
1076  .comp = {
1077  { 0, 2, 0, 0, 16 }, /* Y */
1078  { 1, 2, 0, 0, 16 }, /* U */
1079  { 2, 2, 0, 0, 16 }, /* V */
1080  { 3, 2, 0, 0, 16 }, /* A */
1081  },
1083  },
1084  [AV_PIX_FMT_RGB48BE] = {
1085  .name = "rgb48be",
1086  .nb_components = 3,
1087  .log2_chroma_w = 0,
1088  .log2_chroma_h = 0,
1089  .comp = {
1090  { 0, 6, 0, 0, 16 }, /* R */
1091  { 0, 6, 2, 0, 16 }, /* G */
1092  { 0, 6, 4, 0, 16 }, /* B */
1093  },
1095  },
1096  [AV_PIX_FMT_RGB48LE] = {
1097  .name = "rgb48le",
1098  .nb_components = 3,
1099  .log2_chroma_w = 0,
1100  .log2_chroma_h = 0,
1101  .comp = {
1102  { 0, 6, 0, 0, 16 }, /* R */
1103  { 0, 6, 2, 0, 16 }, /* G */
1104  { 0, 6, 4, 0, 16 }, /* B */
1105  },
1106  .flags = AV_PIX_FMT_FLAG_RGB,
1107  },
1108  [AV_PIX_FMT_RGBA64BE] = {
1109  .name = "rgba64be",
1110  .nb_components = 4,
1111  .log2_chroma_w = 0,
1112  .log2_chroma_h = 0,
1113  .comp = {
1114  { 0, 8, 0, 0, 16 }, /* R */
1115  { 0, 8, 2, 0, 16 }, /* G */
1116  { 0, 8, 4, 0, 16 }, /* B */
1117  { 0, 8, 6, 0, 16 }, /* A */
1118  },
1120  },
1121  [AV_PIX_FMT_RGBA64LE] = {
1122  .name = "rgba64le",
1123  .nb_components = 4,
1124  .log2_chroma_w = 0,
1125  .log2_chroma_h = 0,
1126  .comp = {
1127  { 0, 8, 0, 0, 16 }, /* R */
1128  { 0, 8, 2, 0, 16 }, /* G */
1129  { 0, 8, 4, 0, 16 }, /* B */
1130  { 0, 8, 6, 0, 16 }, /* A */
1131  },
1133  },
1134  [AV_PIX_FMT_RGB565BE] = {
1135  .name = "rgb565be",
1136  .nb_components = 3,
1137  .log2_chroma_w = 0,
1138  .log2_chroma_h = 0,
1139  .comp = {
1140  { 0, 2, -1, 3, 5 }, /* R */
1141  { 0, 2, 0, 5, 6 }, /* G */
1142  { 0, 2, 0, 0, 5 }, /* B */
1143  },
1145  },
1146  [AV_PIX_FMT_RGB565LE] = {
1147  .name = "rgb565le",
1148  .nb_components = 3,
1149  .log2_chroma_w = 0,
1150  .log2_chroma_h = 0,
1151  .comp = {
1152  { 0, 2, 1, 3, 5 }, /* R */
1153  { 0, 2, 0, 5, 6 }, /* G */
1154  { 0, 2, 0, 0, 5 }, /* B */
1155  },
1156  .flags = AV_PIX_FMT_FLAG_RGB,
1157  },
1158  [AV_PIX_FMT_RGB555BE] = {
1159  .name = "rgb555be",
1160  .nb_components = 3,
1161  .log2_chroma_w = 0,
1162  .log2_chroma_h = 0,
1163  .comp = {
1164  { 0, 2, -1, 2, 5 }, /* R */
1165  { 0, 2, 0, 5, 5 }, /* G */
1166  { 0, 2, 0, 0, 5 }, /* B */
1167  },
1169  },
1170  [AV_PIX_FMT_RGB555LE] = {
1171  .name = "rgb555le",
1172  .nb_components = 3,
1173  .log2_chroma_w = 0,
1174  .log2_chroma_h = 0,
1175  .comp = {
1176  { 0, 2, 1, 2, 5 }, /* R */
1177  { 0, 2, 0, 5, 5 }, /* G */
1178  { 0, 2, 0, 0, 5 }, /* B */
1179  },
1180  .flags = AV_PIX_FMT_FLAG_RGB,
1181  },
1182  [AV_PIX_FMT_RGB444BE] = {
1183  .name = "rgb444be",
1184  .nb_components = 3,
1185  .log2_chroma_w = 0,
1186  .log2_chroma_h = 0,
1187  .comp = {
1188  { 0, 2, -1, 0, 4 }, /* R */
1189  { 0, 2, 0, 4, 4 }, /* G */
1190  { 0, 2, 0, 0, 4 }, /* B */
1191  },
1193  },
1194  [AV_PIX_FMT_RGB444LE] = {
1195  .name = "rgb444le",
1196  .nb_components = 3,
1197  .log2_chroma_w = 0,
1198  .log2_chroma_h = 0,
1199  .comp = {
1200  { 0, 2, 1, 0, 4 }, /* R */
1201  { 0, 2, 0, 4, 4 }, /* G */
1202  { 0, 2, 0, 0, 4 }, /* B */
1203  },
1204  .flags = AV_PIX_FMT_FLAG_RGB,
1205  },
1206  [AV_PIX_FMT_BGR48BE] = {
1207  .name = "bgr48be",
1208  .nb_components = 3,
1209  .log2_chroma_w = 0,
1210  .log2_chroma_h = 0,
1211  .comp = {
1212  { 0, 6, 4, 0, 16 }, /* R */
1213  { 0, 6, 2, 0, 16 }, /* G */
1214  { 0, 6, 0, 0, 16 }, /* B */
1215  },
1217  },
1218  [AV_PIX_FMT_BGR48LE] = {
1219  .name = "bgr48le",
1220  .nb_components = 3,
1221  .log2_chroma_w = 0,
1222  .log2_chroma_h = 0,
1223  .comp = {
1224  { 0, 6, 4, 0, 16 }, /* R */
1225  { 0, 6, 2, 0, 16 }, /* G */
1226  { 0, 6, 0, 0, 16 }, /* B */
1227  },
1228  .flags = AV_PIX_FMT_FLAG_RGB,
1229  },
1230  [AV_PIX_FMT_BGRA64BE] = {
1231  .name = "bgra64be",
1232  .nb_components = 4,
1233  .log2_chroma_w = 0,
1234  .log2_chroma_h = 0,
1235  .comp = {
1236  { 0, 8, 4, 0, 16 }, /* R */
1237  { 0, 8, 2, 0, 16 }, /* G */
1238  { 0, 8, 0, 0, 16 }, /* B */
1239  { 0, 8, 6, 0, 16 }, /* A */
1240  },
1242  },
1243  [AV_PIX_FMT_BGRA64LE] = {
1244  .name = "bgra64le",
1245  .nb_components = 4,
1246  .log2_chroma_w = 0,
1247  .log2_chroma_h = 0,
1248  .comp = {
1249  { 0, 8, 4, 0, 16 }, /* R */
1250  { 0, 8, 2, 0, 16 }, /* G */
1251  { 0, 8, 0, 0, 16 }, /* B */
1252  { 0, 8, 6, 0, 16 }, /* A */
1253  },
1255  },
1256  [AV_PIX_FMT_BGR565BE] = {
1257  .name = "bgr565be",
1258  .nb_components = 3,
1259  .log2_chroma_w = 0,
1260  .log2_chroma_h = 0,
1261  .comp = {
1262  { 0, 2, 0, 0, 5 }, /* R */
1263  { 0, 2, 0, 5, 6 }, /* G */
1264  { 0, 2, -1, 3, 5 }, /* B */
1265  },
1267  },
1268  [AV_PIX_FMT_BGR565LE] = {
1269  .name = "bgr565le",
1270  .nb_components = 3,
1271  .log2_chroma_w = 0,
1272  .log2_chroma_h = 0,
1273  .comp = {
1274  { 0, 2, 0, 0, 5 }, /* R */
1275  { 0, 2, 0, 5, 6 }, /* G */
1276  { 0, 2, 1, 3, 5 }, /* B */
1277  },
1278  .flags = AV_PIX_FMT_FLAG_RGB,
1279  },
1280  [AV_PIX_FMT_BGR555BE] = {
1281  .name = "bgr555be",
1282  .nb_components = 3,
1283  .log2_chroma_w = 0,
1284  .log2_chroma_h = 0,
1285  .comp = {
1286  { 0, 2, 0, 0, 5 }, /* R */
1287  { 0, 2, 0, 5, 5 }, /* G */
1288  { 0, 2, -1, 2, 5 }, /* B */
1289  },
1291  },
1292  [AV_PIX_FMT_BGR555LE] = {
1293  .name = "bgr555le",
1294  .nb_components = 3,
1295  .log2_chroma_w = 0,
1296  .log2_chroma_h = 0,
1297  .comp = {
1298  { 0, 2, 0, 0, 5 }, /* R */
1299  { 0, 2, 0, 5, 5 }, /* G */
1300  { 0, 2, 1, 2, 5 }, /* B */
1301  },
1302  .flags = AV_PIX_FMT_FLAG_RGB,
1303  },
1304  [AV_PIX_FMT_BGR444BE] = {
1305  .name = "bgr444be",
1306  .nb_components = 3,
1307  .log2_chroma_w = 0,
1308  .log2_chroma_h = 0,
1309  .comp = {
1310  { 0, 2, 0, 0, 4 }, /* R */
1311  { 0, 2, 0, 4, 4 }, /* G */
1312  { 0, 2, -1, 0, 4 }, /* B */
1313  },
1315  },
1316  [AV_PIX_FMT_BGR444LE] = {
1317  .name = "bgr444le",
1318  .nb_components = 3,
1319  .log2_chroma_w = 0,
1320  .log2_chroma_h = 0,
1321  .comp = {
1322  { 0, 2, 0, 0, 4 }, /* R */
1323  { 0, 2, 0, 4, 4 }, /* G */
1324  { 0, 2, 1, 0, 4 }, /* B */
1325  },
1326  .flags = AV_PIX_FMT_FLAG_RGB,
1327  },
1328  [AV_PIX_FMT_VAAPI] = {
1329  .name = "vaapi",
1330  .log2_chroma_w = 1,
1331  .log2_chroma_h = 1,
1332  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1333  },
1334  [AV_PIX_FMT_YUV420P9LE] = {
1335  .name = "yuv420p9le",
1336  .nb_components = 3,
1337  .log2_chroma_w = 1,
1338  .log2_chroma_h = 1,
1339  .comp = {
1340  { 0, 2, 0, 0, 9 }, /* Y */
1341  { 1, 2, 0, 0, 9 }, /* U */
1342  { 2, 2, 0, 0, 9 }, /* V */
1343  },
1344  .flags = AV_PIX_FMT_FLAG_PLANAR,
1345  },
1346  [AV_PIX_FMT_YUV420P9BE] = {
1347  .name = "yuv420p9be",
1348  .nb_components = 3,
1349  .log2_chroma_w = 1,
1350  .log2_chroma_h = 1,
1351  .comp = {
1352  { 0, 2, 0, 0, 9 }, /* Y */
1353  { 1, 2, 0, 0, 9 }, /* U */
1354  { 2, 2, 0, 0, 9 }, /* V */
1355  },
1357  },
1359  .name = "yuv420p10le",
1360  .nb_components = 3,
1361  .log2_chroma_w = 1,
1362  .log2_chroma_h = 1,
1363  .comp = {
1364  { 0, 2, 0, 0, 10 }, /* Y */
1365  { 1, 2, 0, 0, 10 }, /* U */
1366  { 2, 2, 0, 0, 10 }, /* V */
1367  },
1368  .flags = AV_PIX_FMT_FLAG_PLANAR,
1369  },
1371  .name = "yuv420p10be",
1372  .nb_components = 3,
1373  .log2_chroma_w = 1,
1374  .log2_chroma_h = 1,
1375  .comp = {
1376  { 0, 2, 0, 0, 10 }, /* Y */
1377  { 1, 2, 0, 0, 10 }, /* U */
1378  { 2, 2, 0, 0, 10 }, /* V */
1379  },
1381  },
1383  .name = "yuv420p12le",
1384  .nb_components = 3,
1385  .log2_chroma_w = 1,
1386  .log2_chroma_h = 1,
1387  .comp = {
1388  { 0, 2, 0, 0, 12 }, /* Y */
1389  { 1, 2, 0, 0, 12 }, /* U */
1390  { 2, 2, 0, 0, 12 }, /* V */
1391  },
1392  .flags = AV_PIX_FMT_FLAG_PLANAR,
1393  },
1395  .name = "yuv420p12be",
1396  .nb_components = 3,
1397  .log2_chroma_w = 1,
1398  .log2_chroma_h = 1,
1399  .comp = {
1400  { 0, 2, 0, 0, 12 }, /* Y */
1401  { 1, 2, 0, 0, 12 }, /* U */
1402  { 2, 2, 0, 0, 12 }, /* V */
1403  },
1405  },
1407  .name = "yuv420p14le",
1408  .nb_components = 3,
1409  .log2_chroma_w = 1,
1410  .log2_chroma_h = 1,
1411  .comp = {
1412  { 0, 2, 0, 0, 14 }, /* Y */
1413  { 1, 2, 0, 0, 14 }, /* U */
1414  { 2, 2, 0, 0, 14 }, /* V */
1415  },
1416  .flags = AV_PIX_FMT_FLAG_PLANAR,
1417  },
1419  .name = "yuv420p14be",
1420  .nb_components = 3,
1421  .log2_chroma_w = 1,
1422  .log2_chroma_h = 1,
1423  .comp = {
1424  { 0, 2, 0, 0, 14 }, /* Y */
1425  { 1, 2, 0, 0, 14 }, /* U */
1426  { 2, 2, 0, 0, 14 }, /* V */
1427  },
1429  },
1431  .name = "yuv420p16le",
1432  .nb_components = 3,
1433  .log2_chroma_w = 1,
1434  .log2_chroma_h = 1,
1435  .comp = {
1436  { 0, 2, 0, 0, 16 }, /* Y */
1437  { 1, 2, 0, 0, 16 }, /* U */
1438  { 2, 2, 0, 0, 16 }, /* V */
1439  },
1440  .flags = AV_PIX_FMT_FLAG_PLANAR,
1441  },
1443  .name = "yuv420p16be",
1444  .nb_components = 3,
1445  .log2_chroma_w = 1,
1446  .log2_chroma_h = 1,
1447  .comp = {
1448  { 0, 2, 0, 0, 16 }, /* Y */
1449  { 1, 2, 0, 0, 16 }, /* U */
1450  { 2, 2, 0, 0, 16 }, /* V */
1451  },
1453  },
1454  [AV_PIX_FMT_YUV422P9LE] = {
1455  .name = "yuv422p9le",
1456  .nb_components = 3,
1457  .log2_chroma_w = 1,
1458  .log2_chroma_h = 0,
1459  .comp = {
1460  { 0, 2, 0, 0, 9 }, /* Y */
1461  { 1, 2, 0, 0, 9 }, /* U */
1462  { 2, 2, 0, 0, 9 }, /* V */
1463  },
1464  .flags = AV_PIX_FMT_FLAG_PLANAR,
1465  },
1466  [AV_PIX_FMT_YUV422P9BE] = {
1467  .name = "yuv422p9be",
1468  .nb_components = 3,
1469  .log2_chroma_w = 1,
1470  .log2_chroma_h = 0,
1471  .comp = {
1472  { 0, 2, 0, 0, 9 }, /* Y */
1473  { 1, 2, 0, 0, 9 }, /* U */
1474  { 2, 2, 0, 0, 9 }, /* V */
1475  },
1477  },
1479  .name = "yuv422p10le",
1480  .nb_components = 3,
1481  .log2_chroma_w = 1,
1482  .log2_chroma_h = 0,
1483  .comp = {
1484  { 0, 2, 0, 0, 10 }, /* Y */
1485  { 1, 2, 0, 0, 10 }, /* U */
1486  { 2, 2, 0, 0, 10 }, /* V */
1487  },
1488  .flags = AV_PIX_FMT_FLAG_PLANAR,
1489  },
1491  .name = "yuv422p10be",
1492  .nb_components = 3,
1493  .log2_chroma_w = 1,
1494  .log2_chroma_h = 0,
1495  .comp = {
1496  { 0, 2, 0, 0, 10 }, /* Y */
1497  { 1, 2, 0, 0, 10 }, /* U */
1498  { 2, 2, 0, 0, 10 }, /* V */
1499  },
1501  },
1503  .name = "yuv422p12le",
1504  .nb_components = 3,
1505  .log2_chroma_w = 1,
1506  .log2_chroma_h = 0,
1507  .comp = {
1508  { 0, 2, 0, 0, 12 }, /* Y */
1509  { 1, 2, 0, 0, 12 }, /* U */
1510  { 2, 2, 0, 0, 12 }, /* V */
1511  },
1512  .flags = AV_PIX_FMT_FLAG_PLANAR,
1513  },
1515  .name = "yuv422p12be",
1516  .nb_components = 3,
1517  .log2_chroma_w = 1,
1518  .log2_chroma_h = 0,
1519  .comp = {
1520  { 0, 2, 0, 0, 12 }, /* Y */
1521  { 1, 2, 0, 0, 12 }, /* U */
1522  { 2, 2, 0, 0, 12 }, /* V */
1523  },
1525  },
1527  .name = "yuv422p14le",
1528  .nb_components = 3,
1529  .log2_chroma_w = 1,
1530  .log2_chroma_h = 0,
1531  .comp = {
1532  { 0, 2, 0, 0, 14 }, /* Y */
1533  { 1, 2, 0, 0, 14 }, /* U */
1534  { 2, 2, 0, 0, 14 }, /* V */
1535  },
1536  .flags = AV_PIX_FMT_FLAG_PLANAR,
1537  },
1539  .name = "yuv422p14be",
1540  .nb_components = 3,
1541  .log2_chroma_w = 1,
1542  .log2_chroma_h = 0,
1543  .comp = {
1544  { 0, 2, 0, 0, 14 }, /* Y */
1545  { 1, 2, 0, 0, 14 }, /* U */
1546  { 2, 2, 0, 0, 14 }, /* V */
1547  },
1549  },
1551  .name = "yuv422p16le",
1552  .nb_components = 3,
1553  .log2_chroma_w = 1,
1554  .log2_chroma_h = 0,
1555  .comp = {
1556  { 0, 2, 0, 0, 16 }, /* Y */
1557  { 1, 2, 0, 0, 16 }, /* U */
1558  { 2, 2, 0, 0, 16 }, /* V */
1559  },
1560  .flags = AV_PIX_FMT_FLAG_PLANAR,
1561  },
1563  .name = "yuv422p16be",
1564  .nb_components = 3,
1565  .log2_chroma_w = 1,
1566  .log2_chroma_h = 0,
1567  .comp = {
1568  { 0, 2, 0, 0, 16 }, /* Y */
1569  { 1, 2, 0, 0, 16 }, /* U */
1570  { 2, 2, 0, 0, 16 }, /* V */
1571  },
1573  },
1575  .name = "yuv444p16le",
1576  .nb_components = 3,
1577  .log2_chroma_w = 0,
1578  .log2_chroma_h = 0,
1579  .comp = {
1580  { 0, 2, 0, 0, 16 }, /* Y */
1581  { 1, 2, 0, 0, 16 }, /* U */
1582  { 2, 2, 0, 0, 16 }, /* V */
1583  },
1584  .flags = AV_PIX_FMT_FLAG_PLANAR,
1585  },
1587  .name = "yuv444p16be",
1588  .nb_components = 3,
1589  .log2_chroma_w = 0,
1590  .log2_chroma_h = 0,
1591  .comp = {
1592  { 0, 2, 0, 0, 16 }, /* Y */
1593  { 1, 2, 0, 0, 16 }, /* U */
1594  { 2, 2, 0, 0, 16 }, /* V */
1595  },
1597  },
1599  .name = "yuv444p10le",
1600  .nb_components = 3,
1601  .log2_chroma_w = 0,
1602  .log2_chroma_h = 0,
1603  .comp = {
1604  { 0, 2, 0, 0, 10 }, /* Y */
1605  { 1, 2, 0, 0, 10 }, /* U */
1606  { 2, 2, 0, 0, 10 }, /* V */
1607  },
1608  .flags = AV_PIX_FMT_FLAG_PLANAR,
1609  },
1611  .name = "yuv444p10be",
1612  .nb_components = 3,
1613  .log2_chroma_w = 0,
1614  .log2_chroma_h = 0,
1615  .comp = {
1616  { 0, 2, 0, 0, 10 }, /* Y */
1617  { 1, 2, 0, 0, 10 }, /* U */
1618  { 2, 2, 0, 0, 10 }, /* V */
1619  },
1621  },
1622  [AV_PIX_FMT_YUV444P9LE] = {
1623  .name = "yuv444p9le",
1624  .nb_components = 3,
1625  .log2_chroma_w = 0,
1626  .log2_chroma_h = 0,
1627  .comp = {
1628  { 0, 2, 0, 0, 9 }, /* Y */
1629  { 1, 2, 0, 0, 9 }, /* U */
1630  { 2, 2, 0, 0, 9 }, /* V */
1631  },
1632  .flags = AV_PIX_FMT_FLAG_PLANAR,
1633  },
1634  [AV_PIX_FMT_YUV444P9BE] = {
1635  .name = "yuv444p9be",
1636  .nb_components = 3,
1637  .log2_chroma_w = 0,
1638  .log2_chroma_h = 0,
1639  .comp = {
1640  { 0, 2, 0, 0, 9 }, /* Y */
1641  { 1, 2, 0, 0, 9 }, /* U */
1642  { 2, 2, 0, 0, 9 }, /* V */
1643  },
1645  },
1647  .name = "yuv444p12le",
1648  .nb_components = 3,
1649  .log2_chroma_w = 0,
1650  .log2_chroma_h = 0,
1651  .comp = {
1652  { 0, 2, 0, 0, 12 }, /* Y */
1653  { 1, 2, 0, 0, 12 }, /* U */
1654  { 2, 2, 0, 0, 12 }, /* V */
1655  },
1656  .flags = AV_PIX_FMT_FLAG_PLANAR,
1657  },
1659  .name = "yuv444p12be",
1660  .nb_components = 3,
1661  .log2_chroma_w = 0,
1662  .log2_chroma_h = 0,
1663  .comp = {
1664  { 0, 2, 0, 0, 12 }, /* Y */
1665  { 1, 2, 0, 0, 12 }, /* U */
1666  { 2, 2, 0, 0, 12 }, /* V */
1667  },
1669  },
1671  .name = "yuv444p14le",
1672  .nb_components = 3,
1673  .log2_chroma_w = 0,
1674  .log2_chroma_h = 0,
1675  .comp = {
1676  { 0, 2, 0, 0, 14 }, /* Y */
1677  { 1, 2, 0, 0, 14 }, /* U */
1678  { 2, 2, 0, 0, 14 }, /* V */
1679  },
1680  .flags = AV_PIX_FMT_FLAG_PLANAR,
1681  },
1683  .name = "yuv444p14be",
1684  .nb_components = 3,
1685  .log2_chroma_w = 0,
1686  .log2_chroma_h = 0,
1687  .comp = {
1688  { 0, 2, 0, 0, 14 }, /* Y */
1689  { 1, 2, 0, 0, 14 }, /* U */
1690  { 2, 2, 0, 0, 14 }, /* V */
1691  },
1693  },
1695  .name = "d3d11va_vld",
1696  .log2_chroma_w = 1,
1697  .log2_chroma_h = 1,
1698  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1699  },
1700  [AV_PIX_FMT_DXVA2_VLD] = {
1701  .name = "dxva2_vld",
1702  .log2_chroma_w = 1,
1703  .log2_chroma_h = 1,
1704  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1705  },
1706  [AV_PIX_FMT_YA8] = {
1707  .name = "ya8",
1708  .nb_components = 2,
1709  .comp = {
1710  { 0, 2, 0, 0, 8 }, /* Y */
1711  { 0, 2, 1, 0, 8 }, /* A */
1712  },
1713  .flags = AV_PIX_FMT_FLAG_ALPHA,
1714  .alias = "gray8a",
1715  },
1716  [AV_PIX_FMT_YA16LE] = {
1717  .name = "ya16le",
1718  .nb_components = 2,
1719  .comp = {
1720  { 0, 4, 0, 0, 16 }, /* Y */
1721  { 0, 4, 2, 0, 16 }, /* A */
1722  },
1723  .flags = AV_PIX_FMT_FLAG_ALPHA,
1724  },
1725  [AV_PIX_FMT_YA16BE] = {
1726  .name = "ya16be",
1727  .nb_components = 2,
1728  .comp = {
1729  { 0, 4, 0, 0, 16 }, /* Y */
1730  { 0, 4, 2, 0, 16 }, /* A */
1731  },
1733  },
1735  .name = "videotoolbox_vld",
1736  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1737  },
1738  [AV_PIX_FMT_GBRP] = {
1739  .name = "gbrp",
1740  .nb_components = 3,
1741  .log2_chroma_w = 0,
1742  .log2_chroma_h = 0,
1743  .comp = {
1744  { 2, 1, 0, 0, 8 }, /* R */
1745  { 0, 1, 0, 0, 8 }, /* G */
1746  { 1, 1, 0, 0, 8 }, /* B */
1747  },
1749  },
1750  [AV_PIX_FMT_GBRP9LE] = {
1751  .name = "gbrp9le",
1752  .nb_components = 3,
1753  .log2_chroma_w = 0,
1754  .log2_chroma_h = 0,
1755  .comp = {
1756  { 2, 2, 0, 0, 9 }, /* R */
1757  { 0, 2, 0, 0, 9 }, /* G */
1758  { 1, 2, 0, 0, 9 }, /* B */
1759  },
1761  },
1762  [AV_PIX_FMT_GBRP9BE] = {
1763  .name = "gbrp9be",
1764  .nb_components = 3,
1765  .log2_chroma_w = 0,
1766  .log2_chroma_h = 0,
1767  .comp = {
1768  { 2, 2, 0, 0, 9 }, /* R */
1769  { 0, 2, 0, 0, 9 }, /* G */
1770  { 1, 2, 0, 0, 9 }, /* B */
1771  },
1773  },
1774  [AV_PIX_FMT_GBRP10LE] = {
1775  .name = "gbrp10le",
1776  .nb_components = 3,
1777  .log2_chroma_w = 0,
1778  .log2_chroma_h = 0,
1779  .comp = {
1780  { 2, 2, 0, 0, 10 }, /* R */
1781  { 0, 2, 0, 0, 10 }, /* G */
1782  { 1, 2, 0, 0, 10 }, /* B */
1783  },
1785  },
1786  [AV_PIX_FMT_GBRP10BE] = {
1787  .name = "gbrp10be",
1788  .nb_components = 3,
1789  .log2_chroma_w = 0,
1790  .log2_chroma_h = 0,
1791  .comp = {
1792  { 2, 2, 0, 0, 10 }, /* R */
1793  { 0, 2, 0, 0, 10 }, /* G */
1794  { 1, 2, 0, 0, 10 }, /* B */
1795  },
1797  },
1798  [AV_PIX_FMT_GBRP12LE] = {
1799  .name = "gbrp12le",
1800  .nb_components = 3,
1801  .log2_chroma_w = 0,
1802  .log2_chroma_h = 0,
1803  .comp = {
1804  { 2, 2, 0, 0, 12 }, /* R */
1805  { 0, 2, 0, 0, 12 }, /* G */
1806  { 1, 2, 0, 0, 12 }, /* B */
1807  },
1809  },
1810  [AV_PIX_FMT_GBRP12BE] = {
1811  .name = "gbrp12be",
1812  .nb_components = 3,
1813  .log2_chroma_w = 0,
1814  .log2_chroma_h = 0,
1815  .comp = {
1816  { 2, 2, 0, 0, 12 }, /* R */
1817  { 0, 2, 0, 0, 12 }, /* G */
1818  { 1, 2, 0, 0, 12 }, /* B */
1819  },
1821  },
1822  [AV_PIX_FMT_GBRP14LE] = {
1823  .name = "gbrp14le",
1824  .nb_components = 3,
1825  .log2_chroma_w = 0,
1826  .log2_chroma_h = 0,
1827  .comp = {
1828  { 2, 2, 0, 0, 14 }, /* R */
1829  { 0, 2, 0, 0, 14 }, /* G */
1830  { 1, 2, 0, 0, 14 }, /* B */
1831  },
1833  },
1834  [AV_PIX_FMT_GBRP14BE] = {
1835  .name = "gbrp14be",
1836  .nb_components = 3,
1837  .log2_chroma_w = 0,
1838  .log2_chroma_h = 0,
1839  .comp = {
1840  { 2, 2, 0, 0, 14 }, /* R */
1841  { 0, 2, 0, 0, 14 }, /* G */
1842  { 1, 2, 0, 0, 14 }, /* B */
1843  },
1845  },
1846  [AV_PIX_FMT_GBRP16LE] = {
1847  .name = "gbrp16le",
1848  .nb_components = 3,
1849  .log2_chroma_w = 0,
1850  .log2_chroma_h = 0,
1851  .comp = {
1852  { 2, 2, 0, 0, 16 }, /* R */
1853  { 0, 2, 0, 0, 16 }, /* G */
1854  { 1, 2, 0, 0, 16 }, /* B */
1855  },
1857  },
1858  [AV_PIX_FMT_GBRP16BE] = {
1859  .name = "gbrp16be",
1860  .nb_components = 3,
1861  .log2_chroma_w = 0,
1862  .log2_chroma_h = 0,
1863  .comp = {
1864  { 2, 2, 0, 0, 16 }, /* R */
1865  { 0, 2, 0, 0, 16 }, /* G */
1866  { 1, 2, 0, 0, 16 }, /* B */
1867  },
1869  },
1870  [AV_PIX_FMT_GBRAP] = {
1871  .name = "gbrap",
1872  .nb_components = 4,
1873  .log2_chroma_w = 0,
1874  .log2_chroma_h = 0,
1875  .comp = {
1876  { 2, 1, 0, 0, 8 }, /* R */
1877  { 0, 1, 0, 0, 8 }, /* G */
1878  { 1, 1, 0, 0, 8 }, /* B */
1879  { 3, 1, 0, 0, 8 }, /* A */
1880  },
1883  },
1884  [AV_PIX_FMT_GBRAP16LE] = {
1885  .name = "gbrap16le",
1886  .nb_components = 4,
1887  .log2_chroma_w = 0,
1888  .log2_chroma_h = 0,
1889  .comp = {
1890  { 2, 2, 0, 0, 16 }, /* R */
1891  { 0, 2, 0, 0, 16 }, /* G */
1892  { 1, 2, 0, 0, 16 }, /* B */
1893  { 3, 2, 0, 0, 16 }, /* A */
1894  },
1897  },
1898  [AV_PIX_FMT_GBRAP16BE] = {
1899  .name = "gbrap16be",
1900  .nb_components = 4,
1901  .log2_chroma_w = 0,
1902  .log2_chroma_h = 0,
1903  .comp = {
1904  { 2, 2, 0, 0, 16 }, /* R */
1905  { 0, 2, 0, 0, 16 }, /* G */
1906  { 1, 2, 0, 0, 16 }, /* B */
1907  { 3, 2, 0, 0, 16 }, /* A */
1908  },
1911  },
1912  [AV_PIX_FMT_VDPAU] = {
1913  .name = "vdpau",
1914  .log2_chroma_w = 1,
1915  .log2_chroma_h = 1,
1916  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1917  },
1918  [AV_PIX_FMT_XYZ12LE] = {
1919  .name = "xyz12le",
1920  .nb_components = 3,
1921  .log2_chroma_w = 0,
1922  .log2_chroma_h = 0,
1923  .comp = {
1924  { 0, 6, 0, 4, 12 }, /* X */
1925  { 0, 6, 2, 4, 12 }, /* Y */
1926  { 0, 6, 4, 4, 12 }, /* Z */
1927  },
1928  /*.flags = -- not used*/
1929  },
1930  [AV_PIX_FMT_XYZ12BE] = {
1931  .name = "xyz12be",
1932  .nb_components = 3,
1933  .log2_chroma_w = 0,
1934  .log2_chroma_h = 0,
1935  .comp = {
1936  { 0, 6, 0, 4, 12 }, /* X */
1937  { 0, 6, 2, 4, 12 }, /* Y */
1938  { 0, 6, 4, 4, 12 }, /* Z */
1939  },
1940  .flags = AV_PIX_FMT_FLAG_BE,
1941  },
1942 
1943 #define BAYER8_DESC_COMMON \
1944  .nb_components= 3, \
1945  .log2_chroma_w= 0, \
1946  .log2_chroma_h= 0, \
1947  .comp = { \
1948  { 0, 1, 0, 0, 2 }, \
1949  { 0, 1, 0, 0, 4 }, \
1950  { 0, 1, 0, 0, 2 }, \
1951  }, \
1952 
1953 #define BAYER16_DESC_COMMON \
1954  .nb_components= 3, \
1955  .log2_chroma_w= 0, \
1956  .log2_chroma_h= 0, \
1957  .comp = { \
1958  { 0, 2, 0, 0, 4 }, \
1959  { 0, 2, 0, 0, 8 }, \
1960  { 0, 2, 0, 0, 4 }, \
1961  }, \
1962 
1964  .name = "bayer_bggr8",
1967  },
1969  .name = "bayer_bggr16le",
1972  },
1974  .name = "bayer_bggr16be",
1977  },
1979  .name = "bayer_rggb8",
1982  },
1984  .name = "bayer_rggb16le",
1987  },
1989  .name = "bayer_rggb16be",
1992  },
1994  .name = "bayer_gbrg8",
1997  },
1999  .name = "bayer_gbrg16le",
2002  },
2004  .name = "bayer_gbrg16be",
2007  },
2009  .name = "bayer_grbg8",
2012  },
2014  .name = "bayer_grbg16le",
2017  },
2019  .name = "bayer_grbg16be",
2022  },
2023  [AV_PIX_FMT_NV16] = {
2024  .name = "nv16",
2025  .nb_components = 3,
2026  .log2_chroma_w = 1,
2027  .log2_chroma_h = 0,
2028  .comp = {
2029  { 0, 1, 0, 0, 8 }, /* Y */
2030  { 1, 2, 0, 0, 8 }, /* U */
2031  { 1, 2, 1, 0, 8 }, /* V */
2032  },
2033  .flags = AV_PIX_FMT_FLAG_PLANAR,
2034  },
2035  [AV_PIX_FMT_NV20LE] = {
2036  .name = "nv20le",
2037  .nb_components = 3,
2038  .log2_chroma_w = 1,
2039  .log2_chroma_h = 0,
2040  .comp = {
2041  { 0, 2, 0, 0, 10 }, /* Y */
2042  { 1, 4, 0, 0, 10 }, /* U */
2043  { 1, 4, 2, 0, 10 }, /* V */
2044  },
2045  .flags = AV_PIX_FMT_FLAG_PLANAR,
2046  },
2047  [AV_PIX_FMT_NV20BE] = {
2048  .name = "nv20be",
2049  .nb_components = 3,
2050  .log2_chroma_w = 1,
2051  .log2_chroma_h = 0,
2052  .comp = {
2053  { 0, 2, 0, 0, 10 }, /* Y */
2054  { 1, 4, 0, 0, 10 }, /* U */
2055  { 1, 4, 2, 0, 10 }, /* V */
2056  },
2058  },
2059  [AV_PIX_FMT_QSV] = {
2060  .name = "qsv",
2061  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2062  },
2063  [AV_PIX_FMT_MEDIACODEC] = {
2064  .name = "mediacodec",
2065  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2066  },
2067  [AV_PIX_FMT_MMAL] = {
2068  .name = "mmal",
2069  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2070  },
2071  [AV_PIX_FMT_CUDA] = {
2072  .name = "cuda",
2073  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2074  },
2075  [AV_PIX_FMT_AYUV64LE] = {
2076  .name = "ayuv64le",
2077  .nb_components = 4,
2078  .log2_chroma_w = 0,
2079  .log2_chroma_h = 0,
2080  .comp = {
2081  { 0, 8, 2, 0, 16 }, /* Y */
2082  { 0, 8, 4, 0, 16 }, /* U */
2083  { 0, 8, 6, 0, 16 }, /* V */
2084  { 0, 8, 0, 0, 16 }, /* A */
2085  },
2086  .flags = AV_PIX_FMT_FLAG_ALPHA,
2087  },
2088  [AV_PIX_FMT_AYUV64BE] = {
2089  .name = "ayuv64be",
2090  .nb_components = 4,
2091  .log2_chroma_w = 0,
2092  .log2_chroma_h = 0,
2093  .comp = {
2094  { 0, 8, 2, 0, 16 }, /* Y */
2095  { 0, 8, 4, 0, 16 }, /* U */
2096  { 0, 8, 6, 0, 16 }, /* V */
2097  { 0, 8, 0, 0, 16 }, /* A */
2098  },
2100  },
2101  [AV_PIX_FMT_P010LE] = {
2102  .name = "p010le",
2103  .nb_components = 3,
2104  .log2_chroma_w = 1,
2105  .log2_chroma_h = 1,
2106  .comp = {
2107  { 0, 2, 0, 6, 10 }, /* Y */
2108  { 1, 4, 0, 6, 10 }, /* U */
2109  { 1, 4, 2, 6, 10 }, /* V */
2110  },
2111  .flags = AV_PIX_FMT_FLAG_PLANAR,
2112  },
2113  [AV_PIX_FMT_P010BE] = {
2114  .name = "p010be",
2115  .nb_components = 3,
2116  .log2_chroma_w = 1,
2117  .log2_chroma_h = 1,
2118  .comp = {
2119  { 0, 2, 0, 6, 10 }, /* Y */
2120  { 1, 4, 0, 6, 10 }, /* U */
2121  { 1, 4, 2, 6, 10 }, /* V */
2122  },
2124  },
2125  [AV_PIX_FMT_P016LE] = {
2126  .name = "p016le",
2127  .nb_components = 3,
2128  .log2_chroma_w = 1,
2129  .log2_chroma_h = 1,
2130  .comp = {
2131  { 0, 2, 0, 0, 16 }, /* Y */
2132  { 1, 4, 0, 0, 16 }, /* U */
2133  { 1, 4, 2, 0, 16 }, /* V */
2134  },
2135  .flags = AV_PIX_FMT_FLAG_PLANAR,
2136  },
2137  [AV_PIX_FMT_P016BE] = {
2138  .name = "p016be",
2139  .nb_components = 3,
2140  .log2_chroma_w = 1,
2141  .log2_chroma_h = 1,
2142  .comp = {
2143  { 0, 2, 0, 0, 16 }, /* Y */
2144  { 1, 4, 0, 0, 16 }, /* U */
2145  { 1, 4, 2, 0, 16 }, /* V */
2146  },
2148  },
2149  [AV_PIX_FMT_GBRAP12LE] = {
2150  .name = "gbrap12le",
2151  .nb_components = 4,
2152  .log2_chroma_w = 0,
2153  .log2_chroma_h = 0,
2154  .comp = {
2155  { 2, 2, 0, 0, 12 }, /* R */
2156  { 0, 2, 0, 0, 12 }, /* G */
2157  { 1, 2, 0, 0, 12 }, /* B */
2158  { 3, 2, 0, 0, 12 }, /* A */
2159  },
2162  },
2163  [AV_PIX_FMT_GBRAP12BE] = {
2164  .name = "gbrap12be",
2165  .nb_components = 4,
2166  .log2_chroma_w = 0,
2167  .log2_chroma_h = 0,
2168  .comp = {
2169  { 2, 2, 0, 0, 12 }, /* R */
2170  { 0, 2, 0, 0, 12 }, /* G */
2171  { 1, 2, 0, 0, 12 }, /* B */
2172  { 3, 2, 0, 0, 12 }, /* A */
2173  },
2176  },
2177  [AV_PIX_FMT_GBRAP10LE] = {
2178  .name = "gbrap10le",
2179  .nb_components = 4,
2180  .log2_chroma_w = 0,
2181  .log2_chroma_h = 0,
2182  .comp = {
2183  { 2, 2, 0, 0, 10 }, /* R */
2184  { 0, 2, 0, 0, 10 }, /* G */
2185  { 1, 2, 0, 0, 10 }, /* B */
2186  { 3, 2, 0, 0, 10 }, /* A */
2187  },
2190  },
2191  [AV_PIX_FMT_GBRAP10BE] = {
2192  .name = "gbrap10be",
2193  .nb_components = 4,
2194  .log2_chroma_w = 0,
2195  .log2_chroma_h = 0,
2196  .comp = {
2197  { 2, 2, 0, 0, 10 }, /* R */
2198  { 0, 2, 0, 0, 10 }, /* G */
2199  { 1, 2, 0, 0, 10 }, /* B */
2200  { 3, 2, 0, 0, 10 }, /* A */
2201  },
2204  },
2205  [AV_PIX_FMT_D3D11] = {
2206  .name = "d3d11",
2207  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2208  },
2209  [AV_PIX_FMT_GBRPF32BE] = {
2210  .name = "gbrpf32be",
2211  .nb_components = 3,
2212  .log2_chroma_w = 0,
2213  .log2_chroma_h = 0,
2214  .comp = {
2215  { 2, 4, 0, 0, 32 }, /* R */
2216  { 0, 4, 0, 0, 32 }, /* G */
2217  { 1, 4, 0, 0, 32 }, /* B */
2218  },
2221  },
2222  [AV_PIX_FMT_GBRPF32LE] = {
2223  .name = "gbrpf32le",
2224  .nb_components = 3,
2225  .log2_chroma_w = 0,
2226  .log2_chroma_h = 0,
2227  .comp = {
2228  { 2, 4, 0, 0, 32 }, /* R */
2229  { 0, 4, 0, 0, 32 }, /* G */
2230  { 1, 4, 0, 0, 32 }, /* B */
2231  },
2233  },
2234  [AV_PIX_FMT_GBRAPF32BE] = {
2235  .name = "gbrapf32be",
2236  .nb_components = 4,
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  { 3, 4, 0, 0, 32 }, /* A */
2244  },
2248  },
2249  [AV_PIX_FMT_GBRAPF32LE] = {
2250  .name = "gbrapf32le",
2251  .nb_components = 4,
2252  .log2_chroma_w = 0,
2253  .log2_chroma_h = 0,
2254  .comp = {
2255  { 2, 4, 0, 0, 32 }, /* R */
2256  { 0, 4, 0, 0, 32 }, /* G */
2257  { 1, 4, 0, 0, 32 }, /* B */
2258  { 3, 4, 0, 0, 32 }, /* A */
2259  },
2262  },
2263  [AV_PIX_FMT_DRM_PRIME] = {
2264  .name = "drm_prime",
2265  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2266  },
2267  [AV_PIX_FMT_OPENCL] = {
2268  .name = "opencl",
2269  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2270  },
2271  [AV_PIX_FMT_GRAYF32BE] = {
2272  .name = "grayf32be",
2273  .nb_components = 1,
2274  .log2_chroma_w = 0,
2275  .log2_chroma_h = 0,
2276  .comp = {
2277  { 0, 4, 0, 0, 32 }, /* Y */
2278  },
2280  .alias = "yf32be",
2281  },
2282  [AV_PIX_FMT_GRAYF32LE] = {
2283  .name = "grayf32le",
2284  .nb_components = 1,
2285  .log2_chroma_w = 0,
2286  .log2_chroma_h = 0,
2287  .comp = {
2288  { 0, 4, 0, 0, 32 }, /* Y */
2289  },
2290  .flags = AV_PIX_FMT_FLAG_FLOAT,
2291  .alias = "yf32le",
2292  },
2294  .name = "yuva422p12be",
2295  .nb_components = 4,
2296  .log2_chroma_w = 1,
2297  .log2_chroma_h = 0,
2298  .comp = {
2299  { 0, 2, 0, 0, 12 }, /* Y */
2300  { 1, 2, 0, 0, 12 }, /* U */
2301  { 2, 2, 0, 0, 12 }, /* V */
2302  { 3, 2, 0, 0, 12 }, /* A */
2303  },
2305  },
2307  .name = "yuva422p12le",
2308  .nb_components = 4,
2309  .log2_chroma_w = 1,
2310  .log2_chroma_h = 0,
2311  .comp = {
2312  { 0, 2, 0, 0, 12 }, /* Y */
2313  { 1, 2, 0, 0, 12 }, /* U */
2314  { 2, 2, 0, 0, 12 }, /* V */
2315  { 3, 2, 0, 0, 12 }, /* A */
2316  },
2318  },
2320  .name = "yuva444p12be",
2321  .nb_components = 4,
2322  .log2_chroma_w = 0,
2323  .log2_chroma_h = 0,
2324  .comp = {
2325  { 0, 2, 0, 0, 12 }, /* Y */
2326  { 1, 2, 0, 0, 12 }, /* U */
2327  { 2, 2, 0, 0, 12 }, /* V */
2328  { 3, 2, 0, 0, 12 }, /* A */
2329  },
2331  },
2333  .name = "yuva444p12le",
2334  .nb_components = 4,
2335  .log2_chroma_w = 0,
2336  .log2_chroma_h = 0,
2337  .comp = {
2338  { 0, 2, 0, 0, 12 }, /* Y */
2339  { 1, 2, 0, 0, 12 }, /* U */
2340  { 2, 2, 0, 0, 12 }, /* V */
2341  { 3, 2, 0, 0, 12 }, /* A */
2342  },
2344  },
2345  [AV_PIX_FMT_NV24] = {
2346  .name = "nv24",
2347  .nb_components = 3,
2348  .log2_chroma_w = 0,
2349  .log2_chroma_h = 0,
2350  .comp = {
2351  { 0, 1, 0, 0, 8 }, /* Y */
2352  { 1, 2, 0, 0, 8 }, /* U */
2353  { 1, 2, 1, 0, 8 }, /* V */
2354  },
2355  .flags = AV_PIX_FMT_FLAG_PLANAR,
2356  },
2357  [AV_PIX_FMT_NV42] = {
2358  .name = "nv42",
2359  .nb_components = 3,
2360  .log2_chroma_w = 0,
2361  .log2_chroma_h = 0,
2362  .comp = {
2363  { 0, 1, 0, 0, 8 }, /* Y */
2364  { 1, 2, 1, 0, 8 }, /* U */
2365  { 1, 2, 0, 0, 8 }, /* V */
2366  },
2367  .flags = AV_PIX_FMT_FLAG_PLANAR,
2368  },
2369  [AV_PIX_FMT_VULKAN] = {
2370  .name = "vulkan",
2371  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2372  },
2373 };
2374 
2375 static const char * const color_range_names[] = {
2376  [AVCOL_RANGE_UNSPECIFIED] = "unknown",
2377  [AVCOL_RANGE_MPEG] = "tv",
2378  [AVCOL_RANGE_JPEG] = "pc",
2379 };
2380 
2381 static const char * const color_primaries_names[AVCOL_PRI_NB] = {
2382  [AVCOL_PRI_RESERVED0] = "reserved",
2383  [AVCOL_PRI_BT709] = "bt709",
2384  [AVCOL_PRI_UNSPECIFIED] = "unknown",
2385  [AVCOL_PRI_RESERVED] = "reserved",
2386  [AVCOL_PRI_BT470M] = "bt470m",
2387  [AVCOL_PRI_BT470BG] = "bt470bg",
2388  [AVCOL_PRI_SMPTE170M] = "smpte170m",
2389  [AVCOL_PRI_SMPTE240M] = "smpte240m",
2390  [AVCOL_PRI_FILM] = "film",
2391  [AVCOL_PRI_BT2020] = "bt2020",
2392  [AVCOL_PRI_SMPTE428] = "smpte428",
2393  [AVCOL_PRI_SMPTE431] = "smpte431",
2394  [AVCOL_PRI_SMPTE432] = "smpte432",
2395  [AVCOL_PRI_EBU3213] = "ebu3213",
2396 };
2397 
2398 static const char * const color_transfer_names[] = {
2399  [AVCOL_TRC_RESERVED0] = "reserved",
2400  [AVCOL_TRC_BT709] = "bt709",
2401  [AVCOL_TRC_UNSPECIFIED] = "unknown",
2402  [AVCOL_TRC_RESERVED] = "reserved",
2403  [AVCOL_TRC_GAMMA22] = "bt470m",
2404  [AVCOL_TRC_GAMMA28] = "bt470bg",
2405  [AVCOL_TRC_SMPTE170M] = "smpte170m",
2406  [AVCOL_TRC_SMPTE240M] = "smpte240m",
2407  [AVCOL_TRC_LINEAR] = "linear",
2408  [AVCOL_TRC_LOG] = "log100",
2409  [AVCOL_TRC_LOG_SQRT] = "log316",
2410  [AVCOL_TRC_IEC61966_2_4] = "iec61966-2-4",
2411  [AVCOL_TRC_BT1361_ECG] = "bt1361e",
2412  [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1",
2413  [AVCOL_TRC_BT2020_10] = "bt2020-10",
2414  [AVCOL_TRC_BT2020_12] = "bt2020-12",
2415  [AVCOL_TRC_SMPTE2084] = "smpte2084",
2416  [AVCOL_TRC_SMPTE428] = "smpte428",
2417  [AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
2418 };
2419 
2420 static const char * const color_space_names[] = {
2421  [AVCOL_SPC_RGB] = "gbr",
2422  [AVCOL_SPC_BT709] = "bt709",
2423  [AVCOL_SPC_UNSPECIFIED] = "unknown",
2424  [AVCOL_SPC_RESERVED] = "reserved",
2425  [AVCOL_SPC_FCC] = "fcc",
2426  [AVCOL_SPC_BT470BG] = "bt470bg",
2427  [AVCOL_SPC_SMPTE170M] = "smpte170m",
2428  [AVCOL_SPC_SMPTE240M] = "smpte240m",
2429  [AVCOL_SPC_YCGCO] = "ycgco",
2430  [AVCOL_SPC_BT2020_NCL] = "bt2020nc",
2431  [AVCOL_SPC_BT2020_CL] = "bt2020c",
2432  [AVCOL_SPC_SMPTE2085] = "smpte2085",
2433  [AVCOL_SPC_CHROMA_DERIVED_NCL] = "chroma-derived-nc",
2434  [AVCOL_SPC_CHROMA_DERIVED_CL] = "chroma-derived-c",
2435  [AVCOL_SPC_ICTCP] = "ictcp",
2436 };
2437 
2438 static const char * const chroma_location_names[] = {
2439  [AVCHROMA_LOC_UNSPECIFIED] = "unspecified",
2440  [AVCHROMA_LOC_LEFT] = "left",
2441  [AVCHROMA_LOC_CENTER] = "center",
2442  [AVCHROMA_LOC_TOPLEFT] = "topleft",
2443  [AVCHROMA_LOC_TOP] = "top",
2444  [AVCHROMA_LOC_BOTTOMLEFT] = "bottomleft",
2445  [AVCHROMA_LOC_BOTTOM] = "bottom",
2446 };
2447 
2448 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
2449 {
2450  enum AVPixelFormat pix_fmt;
2451 
2452  for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
2454  (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
2456  return pix_fmt;
2457 
2458  return AV_PIX_FMT_NONE;
2459 }
2460 
2462 {
2463  return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
2465 }
2466 
2467 #if HAVE_BIGENDIAN
2468 # define X_NE(be, le) be
2469 #else
2470 # define X_NE(be, le) le
2471 #endif
2472 
2474 {
2475  enum AVPixelFormat pix_fmt;
2476 
2477  if (!strcmp(name, "rgb32"))
2478  name = X_NE("argb", "bgra");
2479  else if (!strcmp(name, "bgr32"))
2480  name = X_NE("abgr", "rgba");
2481 
2483  if (pix_fmt == AV_PIX_FMT_NONE) {
2484  char name2[32];
2485 
2486  snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
2487  pix_fmt = get_pix_fmt_internal(name2);
2488  }
2489 
2490  return pix_fmt;
2491 }
2492 
2494 {
2495  int c, bits = 0;
2496  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2497 
2498  for (c = 0; c < pixdesc->nb_components; c++) {
2499  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2500  bits += pixdesc->comp[c].depth << s;
2501  }
2502 
2503  return bits >> log2_pixels;
2504 }
2505 
2507 {
2508  int c, bits = 0;
2509  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2510  int steps[4] = {0};
2511 
2512  for (c = 0; c < pixdesc->nb_components; c++) {
2513  const AVComponentDescriptor *comp = &pixdesc->comp[c];
2514  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2515  steps[comp->plane] = comp->step << s;
2516  }
2517  for (c = 0; c < 4; c++)
2518  bits += steps[c];
2519 
2520  if(!(pixdesc->flags & AV_PIX_FMT_FLAG_BITSTREAM))
2521  bits *= 8;
2522 
2523  return bits >> log2_pixels;
2524 }
2525 
2526 char *av_get_pix_fmt_string(char *buf, int buf_size,
2527  enum AVPixelFormat pix_fmt)
2528 {
2529  /* print header */
2530  if (pix_fmt < 0) {
2531  snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
2532  } else {
2534  snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
2535  pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
2536  }
2537 
2538  return buf;
2539 }
2540 
2542 {
2543  if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
2544  return NULL;
2546 }
2547 
2549 {
2550  if (!prev)
2551  return &av_pix_fmt_descriptors[0];
2553  prev++;
2554  if (prev->name)
2555  return prev;
2556  }
2557  return NULL;
2558 }
2559 
2561 {
2562  if (desc < av_pix_fmt_descriptors ||
2564  return AV_PIX_FMT_NONE;
2565 
2566  return desc - av_pix_fmt_descriptors;
2567 }
2568 
2570  int *h_shift, int *v_shift)
2571 {
2573  if (!desc)
2574  return AVERROR(ENOSYS);
2575  *h_shift = desc->log2_chroma_w;
2576  *v_shift = desc->log2_chroma_h;
2577 
2578  return 0;
2579 }
2580 
2582 {
2584  int i, planes[4] = { 0 }, ret = 0;
2585 
2586  if (!desc)
2587  return AVERROR(EINVAL);
2588 
2589  for (i = 0; i < desc->nb_components; i++)
2590  planes[desc->comp[i].plane] = 1;
2591  for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
2592  ret += planes[i];
2593  return ret;
2594 }
2595 
2597  int i, j;
2598 
2599  for (i=0; i<FF_ARRAY_ELEMS(av_pix_fmt_descriptors); i++) {
2601  uint8_t fill[4][8+6+3] = {{0}};
2602  uint8_t *data[4] = {fill[0], fill[1], fill[2], fill[3]};
2603  int linesize[4] = {0,0,0,0};
2604  uint16_t tmp[2];
2605 
2606  if (!d->name && !d->nb_components && !d->log2_chroma_w && !d->log2_chroma_h && !d->flags)
2607  continue;
2608 // av_log(NULL, AV_LOG_DEBUG, "Checking: %s\n", d->name);
2609  av_assert0(d->log2_chroma_w <= 3);
2610  av_assert0(d->log2_chroma_h <= 3);
2611  av_assert0(d->nb_components <= 4);
2612  av_assert0(d->name && d->name[0]);
2613  av_assert2(av_get_pix_fmt(d->name) == i);
2614 
2615  for (j=0; j<FF_ARRAY_ELEMS(d->comp); j++) {
2616  const AVComponentDescriptor *c = &d->comp[j];
2617  if(j>=d->nb_components) {
2618  av_assert0(!c->plane && !c->step && !c->offset && !c->shift && !c->depth);
2619  continue;
2620  }
2621  if (d->flags & AV_PIX_FMT_FLAG_BITSTREAM) {
2622  av_assert0(c->step >= c->depth);
2623  } else {
2624  av_assert0(8*c->step >= c->depth);
2625  }
2626  if (d->flags & AV_PIX_FMT_FLAG_BAYER)
2627  continue;
2628  av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0);
2629  av_assert0(tmp[0] == 0 && tmp[1] == 0);
2630  tmp[0] = tmp[1] = (1ULL << c->depth) - 1;
2631  av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2);
2632  }
2633  }
2634 }
2635 
2636 
2638 {
2640  char name[16];
2641  int i;
2642 
2643  if (!desc || strlen(desc->name) < 2)
2644  return AV_PIX_FMT_NONE;
2645  av_strlcpy(name, desc->name, sizeof(name));
2646  i = strlen(name) - 2;
2647  if (strcmp(name + i, "be") && strcmp(name + i, "le"))
2648  return AV_PIX_FMT_NONE;
2649 
2650  name[i] ^= 'b' ^ 'l';
2651 
2652  return get_pix_fmt_internal(name);
2653 }
2654 
2655 #define FF_COLOR_NA -1
2656 #define FF_COLOR_RGB 0 /**< RGB color space */
2657 #define FF_COLOR_GRAY 1 /**< gray color space */
2658 #define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
2659 #define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
2660 #define FF_COLOR_XYZ 4
2661 
2662 #define pixdesc_has_alpha(pixdesc) \
2663  ((pixdesc)->flags & AV_PIX_FMT_FLAG_ALPHA)
2664 
2665 
2667  if (desc->flags & AV_PIX_FMT_FLAG_PAL)
2668  return FF_COLOR_RGB;
2669 
2670  if(desc->nb_components == 1 || desc->nb_components == 2)
2671  return FF_COLOR_GRAY;
2672 
2673  if (desc->name) {
2674  if (av_strstart(desc->name, "yuvj", NULL))
2675  return FF_COLOR_YUV_JPEG;
2676 
2677  if (av_strstart(desc->name, "xyz", NULL))
2678  return FF_COLOR_XYZ;
2679  }
2680 
2681  if(desc->flags & AV_PIX_FMT_FLAG_RGB)
2682  return FF_COLOR_RGB;
2683 
2684  if(desc->nb_components == 0)
2685  return FF_COLOR_NA;
2686 
2687  return FF_COLOR_YUV;
2688 }
2689 
2690 static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
2691 {
2693  int i;
2694 
2695  if (!desc || !desc->nb_components) {
2696  *min = *max = 0;
2697  return AVERROR(EINVAL);
2698  }
2699 
2700  *min = INT_MAX, *max = -INT_MAX;
2701  for (i = 0; i < desc->nb_components; i++) {
2702  *min = FFMIN(desc->comp[i].depth, *min);
2703  *max = FFMAX(desc->comp[i].depth, *max);
2704  }
2705  return 0;
2706 }
2707 
2708 static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
2709  enum AVPixelFormat src_pix_fmt,
2710  unsigned *lossp, unsigned consider)
2711 {
2712  const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
2713  const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
2714  int src_color, dst_color;
2715  int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
2716  int ret, loss, i, nb_components;
2717  int score = INT_MAX - 1;
2718 
2719  if (!src_desc || !dst_desc)
2720  return -4;
2721 
2722  if ((src_desc->flags & AV_PIX_FMT_FLAG_HWACCEL) ||
2723  (dst_desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
2724  if (dst_pix_fmt == src_pix_fmt)
2725  return -1;
2726  else
2727  return -2;
2728  }
2729 
2730  /* compute loss */
2731  *lossp = loss = 0;
2732 
2733  if (dst_pix_fmt == src_pix_fmt)
2734  return INT_MAX;
2735 
2736  if ((ret = get_pix_fmt_depth(&src_min_depth, &src_max_depth, src_pix_fmt)) < 0)
2737  return -3;
2738  if ((ret = get_pix_fmt_depth(&dst_min_depth, &dst_max_depth, dst_pix_fmt)) < 0)
2739  return -3;
2740 
2741  src_color = get_color_type(src_desc);
2742  dst_color = get_color_type(dst_desc);
2743  if (dst_pix_fmt == AV_PIX_FMT_PAL8)
2744  nb_components = FFMIN(src_desc->nb_components, 4);
2745  else
2746  nb_components = FFMIN(src_desc->nb_components, dst_desc->nb_components);
2747 
2748  for (i = 0; i < nb_components; i++) {
2749  int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : (dst_desc->comp[i].depth - 1);
2750  if (src_desc->comp[i].depth - 1 > depth_minus1 && (consider & FF_LOSS_DEPTH)) {
2751  loss |= FF_LOSS_DEPTH;
2752  score -= 65536 >> depth_minus1;
2753  }
2754  }
2755 
2756  if (consider & FF_LOSS_RESOLUTION) {
2757  if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w) {
2758  loss |= FF_LOSS_RESOLUTION;
2759  score -= 256 << dst_desc->log2_chroma_w;
2760  }
2761  if (dst_desc->log2_chroma_h > src_desc->log2_chroma_h) {
2762  loss |= FF_LOSS_RESOLUTION;
2763  score -= 256 << dst_desc->log2_chroma_h;
2764  }
2765  // don't favor 422 over 420 if downsampling is needed, because 420 has much better support on the decoder side
2766  if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 0 &&
2767  dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 0 ) {
2768  score += 512;
2769  }
2770  }
2771 
2772  if(consider & FF_LOSS_COLORSPACE)
2773  switch(dst_color) {
2774  case FF_COLOR_RGB:
2775  if (src_color != FF_COLOR_RGB &&
2776  src_color != FF_COLOR_GRAY)
2777  loss |= FF_LOSS_COLORSPACE;
2778  break;
2779  case FF_COLOR_GRAY:
2780  if (src_color != FF_COLOR_GRAY)
2781  loss |= FF_LOSS_COLORSPACE;
2782  break;
2783  case FF_COLOR_YUV:
2784  if (src_color != FF_COLOR_YUV)
2785  loss |= FF_LOSS_COLORSPACE;
2786  break;
2787  case FF_COLOR_YUV_JPEG:
2788  if (src_color != FF_COLOR_YUV_JPEG &&
2789  src_color != FF_COLOR_YUV &&
2790  src_color != FF_COLOR_GRAY)
2791  loss |= FF_LOSS_COLORSPACE;
2792  break;
2793  default:
2794  /* fail safe test */
2795  if (src_color != dst_color)
2796  loss |= FF_LOSS_COLORSPACE;
2797  break;
2798  }
2799  if(loss & FF_LOSS_COLORSPACE)
2800  score -= (nb_components * 65536) >> FFMIN(dst_desc->comp[0].depth - 1, src_desc->comp[0].depth - 1);
2801 
2802  if (dst_color == FF_COLOR_GRAY &&
2803  src_color != FF_COLOR_GRAY && (consider & FF_LOSS_CHROMA)) {
2804  loss |= FF_LOSS_CHROMA;
2805  score -= 2 * 65536;
2806  }
2807  if (!pixdesc_has_alpha(dst_desc) && (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))) {
2808  loss |= FF_LOSS_ALPHA;
2809  score -= 65536;
2810  }
2811  if (dst_pix_fmt == AV_PIX_FMT_PAL8 && (consider & FF_LOSS_COLORQUANT) &&
2812  (src_pix_fmt != AV_PIX_FMT_PAL8 && (src_color != FF_COLOR_GRAY || (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))))) {
2813  loss |= FF_LOSS_COLORQUANT;
2814  score -= 65536;
2815  }
2816 
2817  *lossp = loss;
2818  return score;
2819 }
2820 
2821 int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
2822  enum AVPixelFormat src_pix_fmt,
2823  int has_alpha)
2824 {
2825  int loss;
2826  int ret = get_pix_fmt_score(dst_pix_fmt, src_pix_fmt, &loss, has_alpha ? ~0 : ~FF_LOSS_ALPHA);
2827  if (ret < 0)
2828  return ret;
2829  return loss;
2830 }
2831 
2832 enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
2833  enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
2834 {
2835  enum AVPixelFormat dst_pix_fmt;
2836  int loss1, loss2, loss_mask;
2837  const AVPixFmtDescriptor *desc1 = av_pix_fmt_desc_get(dst_pix_fmt1);
2838  const AVPixFmtDescriptor *desc2 = av_pix_fmt_desc_get(dst_pix_fmt2);
2839  int score1, score2;
2840 
2841  if (!desc1) {
2842  dst_pix_fmt = dst_pix_fmt2;
2843  } else if (!desc2) {
2844  dst_pix_fmt = dst_pix_fmt1;
2845  } else {
2846  loss_mask= loss_ptr?~*loss_ptr:~0; /* use loss mask if provided */
2847  if(!has_alpha)
2848  loss_mask &= ~FF_LOSS_ALPHA;
2849 
2850  score1 = get_pix_fmt_score(dst_pix_fmt1, src_pix_fmt, &loss1, loss_mask);
2851  score2 = get_pix_fmt_score(dst_pix_fmt2, src_pix_fmt, &loss2, loss_mask);
2852 
2853  if (score1 == score2) {
2855  dst_pix_fmt = av_get_padded_bits_per_pixel(desc2) < av_get_padded_bits_per_pixel(desc1) ? dst_pix_fmt2 : dst_pix_fmt1;
2856  } else {
2857  dst_pix_fmt = desc2->nb_components < desc1->nb_components ? dst_pix_fmt2 : dst_pix_fmt1;
2858  }
2859  } else {
2860  dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
2861  }
2862  }
2863 
2864  if (loss_ptr)
2865  *loss_ptr = av_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
2866  return dst_pix_fmt;
2867 }
2868 
2869 const char *av_color_range_name(enum AVColorRange range)
2870 {
2871  return (unsigned) range < AVCOL_RANGE_NB ?
2872  color_range_names[range] : NULL;
2873 }
2874 
2876 {
2877  int i;
2878 
2879  for (i = 0; i < FF_ARRAY_ELEMS(color_range_names); i++) {
2881  return i;
2882  }
2883 
2884  return AVERROR(EINVAL);
2885 }
2886 
2887 const char *av_color_primaries_name(enum AVColorPrimaries primaries)
2888 {
2889  return (unsigned) primaries < AVCOL_PRI_NB ?
2890  color_primaries_names[primaries] : NULL;
2891 }
2892 
2894 {
2895  int i;
2896 
2897  for (i = 0; i < FF_ARRAY_ELEMS(color_primaries_names); i++) {
2898  if (!color_primaries_names[i])
2899  continue;
2900 
2902  return i;
2903  }
2904 
2905  return AVERROR(EINVAL);
2906 }
2907 
2909 {
2910  return (unsigned) transfer < AVCOL_TRC_NB ?
2911  color_transfer_names[transfer] : NULL;
2912 }
2913 
2915 {
2916  int i;
2917 
2918  for (i = 0; i < FF_ARRAY_ELEMS(color_transfer_names); i++) {
2919  if (!color_transfer_names[i])
2920  continue;
2921 
2923  return i;
2924  }
2925 
2926  return AVERROR(EINVAL);
2927 }
2928 
2930 {
2931  return (unsigned) space < AVCOL_SPC_NB ?
2933 }
2934 
2936 {
2937  int i;
2938 
2939  for (i = 0; i < FF_ARRAY_ELEMS(color_space_names); i++) {
2940  if (!color_space_names[i])
2941  continue;
2942 
2944  return i;
2945  }
2946 
2947  return AVERROR(EINVAL);
2948 }
2949 
2950 const char *av_chroma_location_name(enum AVChromaLocation location)
2951 {
2952  return (unsigned) location < AVCHROMA_LOC_NB ?
2953  chroma_location_names[location] : NULL;
2954 }
2955 
2957 {
2958  int i;
2959 
2960  for (i = 0; i < FF_ARRAY_ELEMS(chroma_location_names); i++) {
2961  if (!chroma_location_names[i])
2962  continue;
2963 
2965  return i;
2966  }
2967 
2968  return AVERROR(EINVAL);
2969 }
AVCOL_PRI_RESERVED
@ AVCOL_PRI_RESERVED
Definition: pixfmt.h:452
ff_check_pixfmt_descriptors
void ff_check_pixfmt_descriptors(void)
Definition: pixdesc.c:2596
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:2637
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:287
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 / JEDEC P22 phosphors.
Definition: pixfmt.h:464
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:366
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:473
comp
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
Definition: eamad.c:85
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:2541
AVCOL_TRC_LINEAR
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
Definition: pixfmt.h:482
AVCHROMA_LOC_BOTTOM
@ AVCHROMA_LOC_BOTTOM
Definition: pixfmt.h:602
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:159
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:162
av_pix_fmt_descriptors
static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB]
Definition: pixdesc.c:170
av_color_space_from_name
int av_color_space_from_name(const char *name)
Definition: pixdesc.c:2935
AVCOL_TRC_NB
@ AVCOL_TRC_NB
Not part of ABI.
Definition: pixfmt.h:495
tmp
static uint8_t tmp[11]
Definition: aes_ctr.c:27
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:268
AV_PIX_FMT_GBRAPF32LE
@ AV_PIX_FMT_GBRAPF32LE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, little-endian.
Definition: pixfmt.h:311
av_color_range_from_name
int av_color_range_from_name(const char *name)
Definition: pixdesc.c:2875
w
uint8_t w
Definition: llviddspenc.c:39
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:576
AV_PIX_FMT_GBRPF32BE
@ AV_PIX_FMT_GBRPF32BE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, big-endian.
Definition: pixfmt.h:308
AV_PIX_FMT_DRM_PRIME
@ AV_PIX_FMT_DRM_PRIME
DRM-managed buffers exposed through PRIME buffer sharing.
Definition: pixfmt.h:318
AVComponentDescriptor::depth
int depth
Number of bits in the component.
Definition: pixdesc.h:58
AVPixFmtDescriptor::name
const char * name
Definition: pixdesc.h:71
AVCOL_SPC_NB
@ AVCOL_SPC_NB
Not part of ABI.
Definition: pixfmt.h:519
AVCOL_TRC_UNSPECIFIED
@ AVCOL_TRC_UNSPECIFIED
Definition: pixfmt.h:476
data
const char data[16]
Definition: mxf.c:142
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:275
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:2548
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)
Definition: pixfmt.h:503
AVCOL_TRC_BT2020_12
@ AVCOL_TRC_BT2020_12
ITU-R BT2020 for 12-bit system.
Definition: pixfmt.h:489
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:2493
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
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:2526
AVColorPrimaries
AVColorPrimaries
Chromaticity coordinates of the source primaries.
Definition: pixfmt.h:448
FF_COLOR_GRAY
#define FF_COLOR_GRAY
gray color space
Definition: pixdesc.c:2657
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:288
AV_PIX_FMT_GRAYF32LE
@ AV_PIX_FMT_GRAYF32LE
IEEE-754 single precision Y, 32bpp, little-endian.
Definition: pixfmt.h:331
AVCOL_SPC_BT2020_CL
@ AVCOL_SPC_BT2020_CL
ITU-R BT2020 constant luminance system.
Definition: pixfmt.h:514
av_chroma_location_name
const char * av_chroma_location_name(enum AVChromaLocation location)
Definition: pixdesc.c:2950
AV_PIX_FMT_VULKAN
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition: pixfmt.h:346
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_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:269
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:364
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:270
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:353
AV_PIX_FMT_GBRAP12LE
@ AV_PIX_FMT_GBRAP12LE
planar GBR 4:4:4:4 48bpp, little-endian
Definition: pixfmt.h:278
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:2581
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:508
av_chroma_location_from_name
int av_chroma_location_from_name(const char *name)
Definition: pixdesc.c:2956
AVCOL_SPC_RESERVED
@ AVCOL_SPC_RESERVED
Definition: pixfmt.h:506
AVCOL_TRC_IEC61966_2_1
@ AVCOL_TRC_IEC61966_2_1
IEC 61966-2-1 (sRGB or sYCC)
Definition: pixfmt.h:487
av_color_space_name
const char * av_color_space_name(enum AVColorSpace space)
Definition: pixdesc.c:2929
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:129
AV_PIX_FMT_GRAY9LE
@ AV_PIX_FMT_GRAY9LE
Y , 9bpp, little-endian.
Definition: pixfmt.h:306
AVCOL_RANGE_NB
@ AVCOL_RANGE_NB
Not part of ABI.
Definition: pixfmt.h:577
AVCOL_TRC_GAMMA28
@ AVCOL_TRC_GAMMA28
also ITU-R BT470BG
Definition: pixfmt.h:479
av_color_transfer_from_name
int av_color_transfer_from_name(const char *name)
Definition: pixdesc.c:2914
val
static double val(void *priv, double ch)
Definition: aeval.c:76
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:2569
chroma_location_names
static const char *const chroma_location_names[]
Definition: pixdesc.c:2438
AVCOL_TRC_LOG_SQRT
@ AVCOL_TRC_LOG_SQRT
"Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)"
Definition: pixfmt.h:484
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:478
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_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:449
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:257
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:600
AVCOL_PRI_NB
@ AVCOL_PRI_NB
Not part of ABI.
Definition: pixfmt.h:466
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:486
color_space_names
static const char *const color_space_names[]
Definition: pixdesc.c:2420
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_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
Definition: pixfmt.h:509
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:291
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:148
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:460
color_range_names
static const char *const color_range_names[]
Definition: pixdesc.c:2375
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:40
AVPixFmtDescriptor::log2_chroma_w
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:81
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
functionally identical to above
Definition: pixfmt.h:457
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:34
AVCOL_PRI_UNSPECIFIED
@ AVCOL_PRI_UNSPECIFIED
Definition: pixfmt.h:451
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:517
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:455
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:283
AVCOL_PRI_SMPTE170M
@ AVCOL_PRI_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: pixfmt.h:456
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:2869
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:474
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:310
AV_PIX_FMT_GBRAP12BE
@ AV_PIX_FMT_GBRAP12BE
planar GBR 4:4:4:4 48bpp, big-endian
Definition: pixfmt.h:277
NULL
#define NULL
Definition: coverity.c:32
AVComponentDescriptor
Definition: pixdesc.h:31
AVPixFmtDescriptor::nb_components
uint8_t nb_components
The number of components each pixel has, (1-4)
Definition: pixdesc.h:72
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:597
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:362
AVCHROMA_LOC_TOPLEFT
@ AVCHROMA_LOC_TOPLEFT
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
Definition: pixfmt.h:599
AVCOL_TRC_IEC61966_2_4
@ AVCOL_TRC_IEC61966_2_4
IEC 61966-2-4.
Definition: pixfmt.h:485
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:334
AVCOL_PRI_BT709
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
Definition: pixfmt.h:450
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
src
#define src
Definition: vp8dsp.c:255
FF_COLOR_YUV_JPEG
#define FF_COLOR_YUV_JPEG
YUV color space.
Definition: pixdesc.c:2659
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:335
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:263
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:349
av_color_primaries_name
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
Definition: pixdesc.c:2887
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:488
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:511
AV_PIX_FMT_OPENCL
@ AV_PIX_FMT_OPENCL
Hardware surfaces for OpenCL.
Definition: pixfmt.h:325
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:265
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:2662
AVPixFmtDescriptor::flags
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
Definition: pixdesc.h:95
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:542
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
for
for(j=16;j >0;--j)
Definition: h264pred_template.c:469
AVCOL_PRI_BT2020
@ AVCOL_PRI_BT2020
ITU-R BT2020.
Definition: pixfmt.h:459
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:351
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:2666
color_transfer_names
static const char *const color_transfer_names[]
Definition: pixdesc.c:2398
AVCOL_TRC_SMPTE2084
@ AVCOL_TRC_SMPTE2084
SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.
Definition: pixfmt.h:490
AVCOL_PRI_SMPTE431
@ AVCOL_PRI_SMPTE431
SMPTE ST 431-2 (2011) / DCI P3.
Definition: pixfmt.h:462
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:267
AVCOL_TRC_SMPTE240M
@ AVCOL_TRC_SMPTE240M
Definition: pixfmt.h:481
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:2821
AVCOL_PRI_FILM
@ AVCOL_PRI_FILM
colour filters using Illuminant C
Definition: pixfmt.h:458
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:2506
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:137
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:483
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
FFMAX
#define FFMAX(a, b)
Definition: common.h:103
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:286
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:125
AVCHROMA_LOC_UNSPECIFIED
@ AVCHROMA_LOC_UNSPECIFIED
Definition: pixfmt.h:596
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_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:2656
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
FFMIN
#define FFMIN(a, b)
Definition: common.h:105
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:281
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:2560
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:303
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:34
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:516
AV_PIX_FMT_FLAG_BAYER
#define AV_PIX_FMT_FLAG_BAYER
The pixel format is following a Bayer pattern.
Definition: pixdesc.h:153
AVCOL_TRC_BT709
@ AVCOL_TRC_BT709
also ITU-R BT1361
Definition: pixfmt.h:475
AVChromaLocation
AVChromaLocation
Location of chroma samples.
Definition: pixfmt.h:595
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
functionally identical to above
Definition: pixfmt.h:510
AV_PIX_FMT_VIDEOTOOLBOX
@ AV_PIX_FMT_VIDEOTOOLBOX
hardware decoding through Videotoolbox
Definition: pixfmt.h:272
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:336
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
i
int i
Definition: input.c:407
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
AVCOL_SPC_BT2020_NCL
@ AVCOL_SPC_BT2020_NCL
ITU-R BT2020 non-constant luminance system.
Definition: pixfmt.h:513
FF_COLOR_XYZ
#define FF_COLOR_XYZ
Definition: pixdesc.c:2660
internal.h
AVColorSpace
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:502
AV_PIX_FMT_GRAY9BE
@ AV_PIX_FMT_GRAY9BE
Y , 9bpp, big-endian.
Definition: pixfmt.h:305
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:338
av_color_primaries_from_name
int av_color_primaries_from_name(const char *name)
Definition: pixdesc.c:2893
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:2381
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
AV_PIX_FMT_FLAG_BE
#define AV_PIX_FMT_FLAG_BE
Pixel format is big-endian.
Definition: pixdesc.h:117
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:352
FF_COLOR_NA
#define FF_COLOR_NA
Definition: pixdesc.c:2655
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:2708
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:505
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:363
FF_COLOR_YUV
#define FF_COLOR_YUV
YUV color space.
Definition: pixdesc.c:2658
AV_PIX_FMT_GBRPF32LE
@ AV_PIX_FMT_GBRPF32LE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, little-endian.
Definition: pixfmt.h:309
AV_PIX_FMT_NV42
@ AV_PIX_FMT_NV42
as above, but U and V bytes are swapped
Definition: pixfmt.h:339
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:559
version.h
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:285
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:453
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:2448
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_P016LE
@ AV_PIX_FMT_P016LE
like NV12, with 16bpp per component, little-endian
Definition: pixfmt.h:290
get_pix_fmt_depth
static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2690
AV_PIX_FMT_GRAYF32BE
@ AV_PIX_FMT_GRAYF32BE
IEEE-754 single precision Y, 32bpp, big-endian.
Definition: pixfmt.h:330
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:2473
AVCOL_TRC_ARIB_STD_B67
@ AVCOL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
Definition: pixfmt.h:494
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:2832
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:348
AVCHROMA_LOC_CENTER
@ AVCHROMA_LOC_CENTER
MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0.
Definition: pixfmt.h:598
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:507
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:353
AVPixFmtDescriptor::comp
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:106
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:133
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:480
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:2470
shift
static int shift(int a, int b)
Definition: sonic.c:82
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:158
planes
static const struct @322 planes[]
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:79
FF_LOSS_COLORQUANT
#define FF_LOSS_COLORQUANT
loss due to color quantization
Definition: pixdesc.h:365
AV_PIX_FMT_GRAY16LE
@ AV_PIX_FMT_GRAY16LE
Y , 16bpp, little-endian.
Definition: pixfmt.h:98
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:274
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:70
AVCOL_TRC_RESERVED
@ AVCOL_TRC_RESERVED
Definition: pixfmt.h:477
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:463
FF_LOSS_RESOLUTION
#define FF_LOSS_RESOLUTION
loss due to resolution change
Definition: pixdesc.h:361
AV_PIX_FMT_GRAY14LE
@ AV_PIX_FMT_GRAY14LE
Y , 14bpp, little-endian.
Definition: pixfmt.h:328
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:90
AVCOL_SPC_SMPTE2085
@ AVCOL_SPC_SMPTE2085
SMPTE 2085, Y'D'zD'x.
Definition: pixfmt.h:515
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:327
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:266
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:156
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
AVCHROMA_LOC_NB
@ AVCHROMA_LOC_NB
Not part of ABI.
Definition: pixfmt.h:603
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:83
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:280
AVCOL_TRC_SMPTE428
@ AVCOL_TRC_SMPTE428
SMPTE ST 428-1.
Definition: pixfmt.h:492
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:101
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:333
AVCOL_SPC_BT709
@ AVCOL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
Definition: pixfmt.h:504
AVColorRange
AVColorRange
Visual content value range.
Definition: pixfmt.h:541
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:121
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:518
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:2908
AVCHROMA_LOC_BOTTOMLEFT
@ AVCHROMA_LOC_BOTTOMLEFT
Definition: pixfmt.h:601
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:90
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:2461
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:456
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