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