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