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 "avstring.h"
26 #include "common.h"
27 #include "pixfmt.h"
28 #include "pixdesc.h"
29 #include "intreadwrite.h"
30 
32  const uint8_t *data[4], const int linesize[4],
33  const AVPixFmtDescriptor *desc,
34  int x, int y, int c, int w,
35  int read_pal_component,
36  int dst_element_size)
37 {
39  int plane = comp.plane;
40  int depth = comp.depth;
41  unsigned mask = (1ULL << depth) - 1;
42  int shift = comp.shift;
43  int step = comp.step;
44  int flags = desc->flags;
45  uint16_t *dst16 = dst;
46  uint32_t *dst32 = dst;
47 
48  if (!depth)
49  return;
50 
52  if (step > 8) {
53  // Assume all channels are packed into a 32bit value
54  const uint8_t *byte_p = data[plane] + y * linesize[plane];
55  const uint32_t *p = (uint32_t *)byte_p;
56 
57  while (w--) {
58  int val = AV_RB32(p);
59  val = (val >> comp.offset) & mask;
60  if (read_pal_component)
61  val = data[1][4*val + c];
62  if (dst_element_size == 4) *dst32++ = val;
63  else *dst16++ = val;
64  p++;
65  }
66  } else {
67  int skip = x * step + comp.offset;
68  const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
69  int shift = 8 - depth - (skip & 7);
70 
71  while (w--) {
72  int val = (*p >> shift) & mask;
73  if (read_pal_component)
74  val = data[1][4*val + c];
75  shift -= step;
76  p -= shift >> 3;
77  shift &= 7;
78  if (dst_element_size == 4) *dst32++ = val;
79  else *dst16++ = val;
80  }
81  }
82  } else {
83  const uint8_t *p = data[plane] + y * linesize[plane] +
84  x * step + comp.offset;
85  int is_8bit = shift + depth <= 8;
86  int is_16bit= shift + depth <=16;
87 
88  if (is_8bit)
89  p += !!(flags & AV_PIX_FMT_FLAG_BE);
90 
91  while (w--) {
92  unsigned val;
93  if (is_8bit) val = *p;
94  else if(is_16bit) val = flags & AV_PIX_FMT_FLAG_BE ? AV_RB16(p) : AV_RL16(p);
95  else val = flags & AV_PIX_FMT_FLAG_BE ? AV_RB32(p) : AV_RL32(p);
96  val = (val >> shift) & mask;
97  if (read_pal_component)
98  val = data[1][4 * val + c];
99  p += step;
100  if (dst_element_size == 4) *dst32++ = val;
101  else *dst16++ = val;
102  }
103  }
104 }
105 
106 void av_read_image_line(uint16_t *dst,
107  const uint8_t *data[4], const int linesize[4],
108  const AVPixFmtDescriptor *desc,
109  int x, int y, int c, int w,
110  int read_pal_component)
111 {
112  av_read_image_line2(dst, data, linesize, desc,x, y, c, w,
113  read_pal_component,
114  2);
115 }
116 
117 void av_write_image_line2(const void *src,
118  uint8_t *data[4], const int linesize[4],
119  const AVPixFmtDescriptor *desc,
120  int x, int y, int c, int w, int src_element_size)
121 {
122  AVComponentDescriptor comp = desc->comp[c];
123  int plane = comp.plane;
124  int depth = comp.depth;
125  int step = comp.step;
126  int flags = desc->flags;
127  const uint32_t *src32 = src;
128  const uint16_t *src16 = src;
129 
130  if (!depth)
131  return;
132 
134  if (step > 8) {
135  // Assume all channels are packed into a 32bit value
136  const uint8_t *byte_p = data[plane] + y * linesize[plane];
137  uint32_t *p = (uint32_t *)byte_p;
138  int offset = comp.offset;
139  uint32_t mask = ((1ULL << depth) - 1) << offset;
140 
141  while (w--) {
142  unsigned val = src_element_size == 4 ? *src32++ : *src16++;
143  AV_WB32(p, (AV_RB32(p) & ~mask) | (val << offset));
144  p++;
145  }
146  } else {
147  int skip = x * step + comp.offset;
148  uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
149  int shift = 8 - depth - (skip & 7);
150 
151  while (w--) {
152  *p |= (src_element_size == 4 ? *src32++ : *src16++) << shift;
153  shift -= step;
154  p -= shift >> 3;
155  shift &= 7;
156  }
157  }
158  } else {
159  int shift = comp.shift;
160  uint8_t *p = data[plane] + y * linesize[plane] +
161  x * step + comp.offset;
162 
163  if (shift + depth <= 8) {
164  p += !!(flags & AV_PIX_FMT_FLAG_BE);
165  while (w--) {
166  *p |= ((src_element_size == 4 ? *src32++ : *src16++) << shift);
167  p += step;
168  }
169  } else {
170  while (w--) {
171  unsigned s = (src_element_size == 4 ? *src32++ : *src16++);
172  if (shift + depth <= 16) {
173  if (flags & AV_PIX_FMT_FLAG_BE) {
174  uint16_t val = AV_RB16(p) | (s << shift);
175  AV_WB16(p, val);
176  } else {
177  uint16_t val = AV_RL16(p) | (s << shift);
178  AV_WL16(p, val);
179  }
180  } else {
181  if (flags & AV_PIX_FMT_FLAG_BE) {
182  uint32_t val = AV_RB32(p) | (s << shift);
183  AV_WB32(p, val);
184  } else {
185  uint32_t val = AV_RL32(p) | (s << shift);
186  AV_WL32(p, val);
187  }
188  }
189  p += step;
190  }
191  }
192  }
193 }
194 
195 void av_write_image_line(const uint16_t *src,
196  uint8_t *data[4], const int linesize[4],
197  const AVPixFmtDescriptor *desc,
198  int x, int y, int c, int w)
199 {
200  av_write_image_line2(src, data, linesize, desc, x, y, c, w, 2);
201 }
202 
204  [AV_PIX_FMT_YUV420P] = {
205  .name = "yuv420p",
206  .nb_components = 3,
207  .log2_chroma_w = 1,
208  .log2_chroma_h = 1,
209  .comp = {
210  { 0, 1, 0, 0, 8 }, /* Y */
211  { 1, 1, 0, 0, 8 }, /* U */
212  { 2, 1, 0, 0, 8 }, /* V */
213  },
214  .flags = AV_PIX_FMT_FLAG_PLANAR,
215  },
216  [AV_PIX_FMT_YUYV422] = {
217  .name = "yuyv422",
218  .nb_components = 3,
219  .log2_chroma_w = 1,
220  .log2_chroma_h = 0,
221  .comp = {
222  { 0, 2, 0, 0, 8 }, /* Y */
223  { 0, 4, 1, 0, 8 }, /* U */
224  { 0, 4, 3, 0, 8 }, /* V */
225  },
226  },
227  [AV_PIX_FMT_YVYU422] = {
228  .name = "yvyu422",
229  .nb_components = 3,
230  .log2_chroma_w = 1,
231  .log2_chroma_h = 0,
232  .comp = {
233  { 0, 2, 0, 0, 8 }, /* Y */
234  { 0, 4, 3, 0, 8 }, /* U */
235  { 0, 4, 1, 0, 8 }, /* V */
236  },
237  },
238  [AV_PIX_FMT_Y210LE] = {
239  .name = "y210le",
240  .nb_components = 3,
241  .log2_chroma_w = 1,
242  .log2_chroma_h = 0,
243  .comp = {
244  { 0, 4, 0, 6, 10 }, /* Y */
245  { 0, 8, 2, 6, 10 }, /* U */
246  { 0, 8, 6, 6, 10 }, /* V */
247  },
248  },
249  [AV_PIX_FMT_Y210BE] = {
250  .name = "y210be",
251  .nb_components = 3,
252  .log2_chroma_w = 1,
253  .log2_chroma_h = 0,
254  .comp = {
255  { 0, 4, 0, 6, 10 }, /* Y */
256  { 0, 8, 2, 6, 10 }, /* U */
257  { 0, 8, 6, 6, 10 }, /* V */
258  },
259  .flags = AV_PIX_FMT_FLAG_BE,
260  },
261  [AV_PIX_FMT_RGB24] = {
262  .name = "rgb24",
263  .nb_components = 3,
264  .log2_chroma_w = 0,
265  .log2_chroma_h = 0,
266  .comp = {
267  { 0, 3, 0, 0, 8 }, /* R */
268  { 0, 3, 1, 0, 8 }, /* G */
269  { 0, 3, 2, 0, 8 }, /* B */
270  },
271  .flags = AV_PIX_FMT_FLAG_RGB,
272  },
273  [AV_PIX_FMT_BGR24] = {
274  .name = "bgr24",
275  .nb_components = 3,
276  .log2_chroma_w = 0,
277  .log2_chroma_h = 0,
278  .comp = {
279  { 0, 3, 2, 0, 8 }, /* R */
280  { 0, 3, 1, 0, 8 }, /* G */
281  { 0, 3, 0, 0, 8 }, /* B */
282  },
283  .flags = AV_PIX_FMT_FLAG_RGB,
284  },
286  .name = "x2rgb10le",
287  .nb_components= 3,
288  .log2_chroma_w= 0,
289  .log2_chroma_h= 0,
290  .comp = {
291  { 0, 4, 2, 4, 10 }, /* R */
292  { 0, 4, 1, 2, 10 }, /* G */
293  { 0, 4, 0, 0, 10 }, /* B */
294  { 0, 4, 3, 6, 2 }, /* X */
295  },
296  .flags = AV_PIX_FMT_FLAG_RGB,
297  },
299  .name = "x2rgb10be",
300  .nb_components= 3,
301  .log2_chroma_w= 0,
302  .log2_chroma_h= 0,
303  .comp = {
304  { 0, 4, 0, 4, 10 }, /* R */
305  { 0, 4, 1, 2, 10 }, /* G */
306  { 0, 4, 2, 0, 10 }, /* B */
307  { 0, 4, 3, 6, 2 }, /* X */
308  },
310  },
312  .name = "x2bgr10le",
313  .nb_components= 3,
314  .log2_chroma_w= 0,
315  .log2_chroma_h= 0,
316  .comp = {
317  { 0, 4, 0, 0, 10 }, /* R */
318  { 0, 4, 1, 2, 10 }, /* G */
319  { 0, 4, 2, 4, 10 }, /* B */
320  { 0, 4, 3, 6, 2 }, /* X */
321  },
322  .flags = AV_PIX_FMT_FLAG_RGB,
323  },
325  .name = "x2bgr10be",
326  .nb_components= 3,
327  .log2_chroma_w= 0,
328  .log2_chroma_h= 0,
329  .comp = {
330  { 0, 4, 2, 0, 10 }, /* R */
331  { 0, 4, 1, 2, 10 }, /* G */
332  { 0, 4, 0, 4, 10 }, /* B */
333  { 0, 4, 3, 6, 2 }, /* X */
334  },
336  },
337  [AV_PIX_FMT_YUV422P] = {
338  .name = "yuv422p",
339  .nb_components = 3,
340  .log2_chroma_w = 1,
341  .log2_chroma_h = 0,
342  .comp = {
343  { 0, 1, 0, 0, 8 }, /* Y */
344  { 1, 1, 0, 0, 8 }, /* U */
345  { 2, 1, 0, 0, 8 }, /* V */
346  },
347  .flags = AV_PIX_FMT_FLAG_PLANAR,
348  },
349  [AV_PIX_FMT_YUV444P] = {
350  .name = "yuv444p",
351  .nb_components = 3,
352  .log2_chroma_w = 0,
353  .log2_chroma_h = 0,
354  .comp = {
355  { 0, 1, 0, 0, 8 }, /* Y */
356  { 1, 1, 0, 0, 8 }, /* U */
357  { 2, 1, 0, 0, 8 }, /* V */
358  },
359  .flags = AV_PIX_FMT_FLAG_PLANAR,
360  },
361  [AV_PIX_FMT_YUV410P] = {
362  .name = "yuv410p",
363  .nb_components = 3,
364  .log2_chroma_w = 2,
365  .log2_chroma_h = 2,
366  .comp = {
367  { 0, 1, 0, 0, 8 }, /* Y */
368  { 1, 1, 0, 0, 8 }, /* U */
369  { 2, 1, 0, 0, 8 }, /* V */
370  },
371  .flags = AV_PIX_FMT_FLAG_PLANAR,
372  },
373  [AV_PIX_FMT_YUV411P] = {
374  .name = "yuv411p",
375  .nb_components = 3,
376  .log2_chroma_w = 2,
377  .log2_chroma_h = 0,
378  .comp = {
379  { 0, 1, 0, 0, 8 }, /* Y */
380  { 1, 1, 0, 0, 8 }, /* U */
381  { 2, 1, 0, 0, 8 }, /* V */
382  },
383  .flags = AV_PIX_FMT_FLAG_PLANAR,
384  },
385  [AV_PIX_FMT_YUVJ411P] = {
386  .name = "yuvj411p",
387  .nb_components = 3,
388  .log2_chroma_w = 2,
389  .log2_chroma_h = 0,
390  .comp = {
391  { 0, 1, 0, 0, 8 }, /* Y */
392  { 1, 1, 0, 0, 8 }, /* U */
393  { 2, 1, 0, 0, 8 }, /* V */
394  },
395  .flags = AV_PIX_FMT_FLAG_PLANAR,
396  },
397  [AV_PIX_FMT_GRAY8] = {
398  .name = "gray",
399  .nb_components = 1,
400  .log2_chroma_w = 0,
401  .log2_chroma_h = 0,
402  .comp = {
403  { 0, 1, 0, 0, 8 }, /* Y */
404  },
405  .alias = "gray8,y8",
406  },
408  .name = "monow",
409  .nb_components = 1,
410  .log2_chroma_w = 0,
411  .log2_chroma_h = 0,
412  .comp = {
413  { 0, 1, 0, 0, 1 }, /* Y */
414  },
415  .flags = AV_PIX_FMT_FLAG_BITSTREAM,
416  },
418  .name = "monob",
419  .nb_components = 1,
420  .log2_chroma_w = 0,
421  .log2_chroma_h = 0,
422  .comp = {
423  { 0, 1, 0, 7, 1 }, /* Y */
424  },
425  .flags = AV_PIX_FMT_FLAG_BITSTREAM,
426  },
427  [AV_PIX_FMT_PAL8] = {
428  .name = "pal8",
429  .nb_components = 1,
430  .log2_chroma_w = 0,
431  .log2_chroma_h = 0,
432  .comp = {
433  { 0, 1, 0, 0, 8 },
434  },
436  },
437  [AV_PIX_FMT_YUVJ420P] = {
438  .name = "yuvj420p",
439  .nb_components = 3,
440  .log2_chroma_w = 1,
441  .log2_chroma_h = 1,
442  .comp = {
443  { 0, 1, 0, 0, 8 }, /* Y */
444  { 1, 1, 0, 0, 8 }, /* U */
445  { 2, 1, 0, 0, 8 }, /* V */
446  },
447  .flags = AV_PIX_FMT_FLAG_PLANAR,
448  },
449  [AV_PIX_FMT_YUVJ422P] = {
450  .name = "yuvj422p",
451  .nb_components = 3,
452  .log2_chroma_w = 1,
453  .log2_chroma_h = 0,
454  .comp = {
455  { 0, 1, 0, 0, 8 }, /* Y */
456  { 1, 1, 0, 0, 8 }, /* U */
457  { 2, 1, 0, 0, 8 }, /* V */
458  },
459  .flags = AV_PIX_FMT_FLAG_PLANAR,
460  },
461  [AV_PIX_FMT_YUVJ444P] = {
462  .name = "yuvj444p",
463  .nb_components = 3,
464  .log2_chroma_w = 0,
465  .log2_chroma_h = 0,
466  .comp = {
467  { 0, 1, 0, 0, 8 }, /* Y */
468  { 1, 1, 0, 0, 8 }, /* U */
469  { 2, 1, 0, 0, 8 }, /* V */
470  },
471  .flags = AV_PIX_FMT_FLAG_PLANAR,
472  },
473  [AV_PIX_FMT_UYVY422] = {
474  .name = "uyvy422",
475  .nb_components = 3,
476  .log2_chroma_w = 1,
477  .log2_chroma_h = 0,
478  .comp = {
479  { 0, 2, 1, 0, 8 }, /* Y */
480  { 0, 4, 0, 0, 8 }, /* U */
481  { 0, 4, 2, 0, 8 }, /* V */
482  },
483  },
485  .name = "uyyvyy411",
486  .nb_components = 3,
487  .log2_chroma_w = 2,
488  .log2_chroma_h = 0,
489  .comp = {
490  { 0, 4, 1, 0, 8 }, /* Y */
491  { 0, 6, 0, 0, 8 }, /* U */
492  { 0, 6, 3, 0, 8 }, /* V */
493  },
494  },
495  [AV_PIX_FMT_BGR8] = {
496  .name = "bgr8",
497  .nb_components = 3,
498  .log2_chroma_w = 0,
499  .log2_chroma_h = 0,
500  .comp = {
501  { 0, 1, 0, 0, 3 }, /* R */
502  { 0, 1, 0, 3, 3 }, /* G */
503  { 0, 1, 0, 6, 2 }, /* B */
504  },
505  .flags = AV_PIX_FMT_FLAG_RGB,
506  },
507  [AV_PIX_FMT_BGR4] = {
508  .name = "bgr4",
509  .nb_components = 3,
510  .log2_chroma_w = 0,
511  .log2_chroma_h = 0,
512  .comp = {
513  { 0, 4, 3, 0, 1 }, /* R */
514  { 0, 4, 1, 0, 2 }, /* G */
515  { 0, 4, 0, 0, 1 }, /* B */
516  },
518  },
520  .name = "bgr4_byte",
521  .nb_components = 3,
522  .log2_chroma_w = 0,
523  .log2_chroma_h = 0,
524  .comp = {
525  { 0, 1, 0, 0, 1 }, /* R */
526  { 0, 1, 0, 1, 2 }, /* G */
527  { 0, 1, 0, 3, 1 }, /* B */
528  },
529  .flags = AV_PIX_FMT_FLAG_RGB,
530  },
531  [AV_PIX_FMT_RGB8] = {
532  .name = "rgb8",
533  .nb_components = 3,
534  .log2_chroma_w = 0,
535  .log2_chroma_h = 0,
536  .comp = {
537  { 0, 1, 0, 5, 3 }, /* R */
538  { 0, 1, 0, 2, 3 }, /* G */
539  { 0, 1, 0, 0, 2 }, /* B */
540  },
541  .flags = AV_PIX_FMT_FLAG_RGB,
542  },
543  [AV_PIX_FMT_RGB4] = {
544  .name = "rgb4",
545  .nb_components = 3,
546  .log2_chroma_w = 0,
547  .log2_chroma_h = 0,
548  .comp = {
549  { 0, 4, 0, 0, 1 }, /* R */
550  { 0, 4, 1, 0, 2 }, /* G */
551  { 0, 4, 3, 0, 1 }, /* B */
552  },
554  },
556  .name = "rgb4_byte",
557  .nb_components = 3,
558  .log2_chroma_w = 0,
559  .log2_chroma_h = 0,
560  .comp = {
561  { 0, 1, 0, 3, 1 }, /* R */
562  { 0, 1, 0, 1, 2 }, /* G */
563  { 0, 1, 0, 0, 1 }, /* B */
564  },
565  .flags = AV_PIX_FMT_FLAG_RGB,
566  },
567  [AV_PIX_FMT_NV12] = {
568  .name = "nv12",
569  .nb_components = 3,
570  .log2_chroma_w = 1,
571  .log2_chroma_h = 1,
572  .comp = {
573  { 0, 1, 0, 0, 8 }, /* Y */
574  { 1, 2, 0, 0, 8 }, /* U */
575  { 1, 2, 1, 0, 8 }, /* V */
576  },
577  .flags = AV_PIX_FMT_FLAG_PLANAR,
578  },
579  [AV_PIX_FMT_NV21] = {
580  .name = "nv21",
581  .nb_components = 3,
582  .log2_chroma_w = 1,
583  .log2_chroma_h = 1,
584  .comp = {
585  { 0, 1, 0, 0, 8 }, /* Y */
586  { 1, 2, 1, 0, 8 }, /* U */
587  { 1, 2, 0, 0, 8 }, /* V */
588  },
589  .flags = AV_PIX_FMT_FLAG_PLANAR,
590  },
591  [AV_PIX_FMT_ARGB] = {
592  .name = "argb",
593  .nb_components = 4,
594  .log2_chroma_w = 0,
595  .log2_chroma_h = 0,
596  .comp = {
597  { 0, 4, 1, 0, 8 }, /* R */
598  { 0, 4, 2, 0, 8 }, /* G */
599  { 0, 4, 3, 0, 8 }, /* B */
600  { 0, 4, 0, 0, 8 }, /* A */
601  },
603  },
604  [AV_PIX_FMT_RGBA] = {
605  .name = "rgba",
606  .nb_components = 4,
607  .log2_chroma_w = 0,
608  .log2_chroma_h = 0,
609  .comp = {
610  { 0, 4, 0, 0, 8 }, /* R */
611  { 0, 4, 1, 0, 8 }, /* G */
612  { 0, 4, 2, 0, 8 }, /* B */
613  { 0, 4, 3, 0, 8 }, /* A */
614  },
616  },
617  [AV_PIX_FMT_ABGR] = {
618  .name = "abgr",
619  .nb_components = 4,
620  .log2_chroma_w = 0,
621  .log2_chroma_h = 0,
622  .comp = {
623  { 0, 4, 3, 0, 8 }, /* R */
624  { 0, 4, 2, 0, 8 }, /* G */
625  { 0, 4, 1, 0, 8 }, /* B */
626  { 0, 4, 0, 0, 8 }, /* A */
627  },
629  },
630  [AV_PIX_FMT_BGRA] = {
631  .name = "bgra",
632  .nb_components = 4,
633  .log2_chroma_w = 0,
634  .log2_chroma_h = 0,
635  .comp = {
636  { 0, 4, 2, 0, 8 }, /* R */
637  { 0, 4, 1, 0, 8 }, /* G */
638  { 0, 4, 0, 0, 8 }, /* B */
639  { 0, 4, 3, 0, 8 }, /* A */
640  },
642  },
643  [AV_PIX_FMT_0RGB] = {
644  .name = "0rgb",
645  .nb_components= 3,
646  .log2_chroma_w= 0,
647  .log2_chroma_h= 0,
648  .comp = {
649  { 0, 4, 1, 0, 8 }, /* R */
650  { 0, 4, 2, 0, 8 }, /* G */
651  { 0, 4, 3, 0, 8 }, /* B */
652  { 0, 4, 0, 0, 8 }, /* X */
653  },
654  .flags = AV_PIX_FMT_FLAG_RGB,
655  },
656  [AV_PIX_FMT_RGB0] = {
657  .name = "rgb0",
658  .nb_components= 3,
659  .log2_chroma_w= 0,
660  .log2_chroma_h= 0,
661  .comp = {
662  { 0, 4, 0, 0, 8 }, /* R */
663  { 0, 4, 1, 0, 8 }, /* G */
664  { 0, 4, 2, 0, 8 }, /* B */
665  { 0, 4, 3, 0, 8 }, /* X */
666  },
667  .flags = AV_PIX_FMT_FLAG_RGB,
668  },
669  [AV_PIX_FMT_0BGR] = {
670  .name = "0bgr",
671  .nb_components= 3,
672  .log2_chroma_w= 0,
673  .log2_chroma_h= 0,
674  .comp = {
675  { 0, 4, 3, 0, 8 }, /* R */
676  { 0, 4, 2, 0, 8 }, /* G */
677  { 0, 4, 1, 0, 8 }, /* B */
678  { 0, 4, 0, 0, 8 }, /* X */
679  },
680  .flags = AV_PIX_FMT_FLAG_RGB,
681  },
682  [AV_PIX_FMT_BGR0] = {
683  .name = "bgr0",
684  .nb_components= 3,
685  .log2_chroma_w= 0,
686  .log2_chroma_h= 0,
687  .comp = {
688  { 0, 4, 2, 0, 8 }, /* R */
689  { 0, 4, 1, 0, 8 }, /* G */
690  { 0, 4, 0, 0, 8 }, /* B */
691  { 0, 4, 3, 0, 8 }, /* X */
692  },
693  .flags = AV_PIX_FMT_FLAG_RGB,
694  },
695  [AV_PIX_FMT_GRAY9BE] = {
696  .name = "gray9be",
697  .nb_components = 1,
698  .log2_chroma_w = 0,
699  .log2_chroma_h = 0,
700  .comp = {
701  { 0, 2, 0, 0, 9 }, /* Y */
702  },
703  .flags = AV_PIX_FMT_FLAG_BE,
704  .alias = "y9be",
705  },
706  [AV_PIX_FMT_GRAY9LE] = {
707  .name = "gray9le",
708  .nb_components = 1,
709  .log2_chroma_w = 0,
710  .log2_chroma_h = 0,
711  .comp = {
712  { 0, 2, 0, 0, 9 }, /* Y */
713  },
714  .alias = "y9le",
715  },
716  [AV_PIX_FMT_GRAY10BE] = {
717  .name = "gray10be",
718  .nb_components = 1,
719  .log2_chroma_w = 0,
720  .log2_chroma_h = 0,
721  .comp = {
722  { 0, 2, 0, 0, 10 }, /* Y */
723  },
724  .flags = AV_PIX_FMT_FLAG_BE,
725  .alias = "y10be",
726  },
727  [AV_PIX_FMT_GRAY10LE] = {
728  .name = "gray10le",
729  .nb_components = 1,
730  .log2_chroma_w = 0,
731  .log2_chroma_h = 0,
732  .comp = {
733  { 0, 2, 0, 0, 10 }, /* Y */
734  },
735  .alias = "y10le",
736  },
737  [AV_PIX_FMT_GRAY12BE] = {
738  .name = "gray12be",
739  .nb_components = 1,
740  .log2_chroma_w = 0,
741  .log2_chroma_h = 0,
742  .comp = {
743  { 0, 2, 0, 0, 12 }, /* Y */
744  },
745  .flags = AV_PIX_FMT_FLAG_BE,
746  .alias = "y12be",
747  },
748  [AV_PIX_FMT_GRAY12LE] = {
749  .name = "gray12le",
750  .nb_components = 1,
751  .log2_chroma_w = 0,
752  .log2_chroma_h = 0,
753  .comp = {
754  { 0, 2, 0, 0, 12 }, /* Y */
755  },
756  .alias = "y12le",
757  },
758  [AV_PIX_FMT_GRAY14BE] = {
759  .name = "gray14be",
760  .nb_components = 1,
761  .log2_chroma_w = 0,
762  .log2_chroma_h = 0,
763  .comp = {
764  { 0, 2, 0, 0, 14 }, /* Y */
765  },
766  .flags = AV_PIX_FMT_FLAG_BE,
767  .alias = "y14be",
768  },
769  [AV_PIX_FMT_GRAY14LE] = {
770  .name = "gray14le",
771  .nb_components = 1,
772  .log2_chroma_w = 0,
773  .log2_chroma_h = 0,
774  .comp = {
775  { 0, 2, 0, 0, 14 }, /* Y */
776  },
777  .alias = "y14le",
778  },
779  [AV_PIX_FMT_GRAY16BE] = {
780  .name = "gray16be",
781  .nb_components = 1,
782  .log2_chroma_w = 0,
783  .log2_chroma_h = 0,
784  .comp = {
785  { 0, 2, 0, 0, 16 }, /* Y */
786  },
787  .flags = AV_PIX_FMT_FLAG_BE,
788  .alias = "y16be",
789  },
790  [AV_PIX_FMT_GRAY16LE] = {
791  .name = "gray16le",
792  .nb_components = 1,
793  .log2_chroma_w = 0,
794  .log2_chroma_h = 0,
795  .comp = {
796  { 0, 2, 0, 0, 16 }, /* Y */
797  },
798  .alias = "y16le",
799  },
800  [AV_PIX_FMT_YUV440P] = {
801  .name = "yuv440p",
802  .nb_components = 3,
803  .log2_chroma_w = 0,
804  .log2_chroma_h = 1,
805  .comp = {
806  { 0, 1, 0, 0, 8 }, /* Y */
807  { 1, 1, 0, 0, 8 }, /* U */
808  { 2, 1, 0, 0, 8 }, /* V */
809  },
810  .flags = AV_PIX_FMT_FLAG_PLANAR,
811  },
812  [AV_PIX_FMT_YUVJ440P] = {
813  .name = "yuvj440p",
814  .nb_components = 3,
815  .log2_chroma_w = 0,
816  .log2_chroma_h = 1,
817  .comp = {
818  { 0, 1, 0, 0, 8 }, /* Y */
819  { 1, 1, 0, 0, 8 }, /* U */
820  { 2, 1, 0, 0, 8 }, /* V */
821  },
822  .flags = AV_PIX_FMT_FLAG_PLANAR,
823  },
825  .name = "yuv440p10le",
826  .nb_components = 3,
827  .log2_chroma_w = 0,
828  .log2_chroma_h = 1,
829  .comp = {
830  { 0, 2, 0, 0, 10 }, /* Y */
831  { 1, 2, 0, 0, 10 }, /* U */
832  { 2, 2, 0, 0, 10 }, /* V */
833  },
834  .flags = AV_PIX_FMT_FLAG_PLANAR,
835  },
837  .name = "yuv440p10be",
838  .nb_components = 3,
839  .log2_chroma_w = 0,
840  .log2_chroma_h = 1,
841  .comp = {
842  { 0, 2, 0, 0, 10 }, /* Y */
843  { 1, 2, 0, 0, 10 }, /* U */
844  { 2, 2, 0, 0, 10 }, /* V */
845  },
847  },
849  .name = "yuv440p12le",
850  .nb_components = 3,
851  .log2_chroma_w = 0,
852  .log2_chroma_h = 1,
853  .comp = {
854  { 0, 2, 0, 0, 12 }, /* Y */
855  { 1, 2, 0, 0, 12 }, /* U */
856  { 2, 2, 0, 0, 12 }, /* V */
857  },
858  .flags = AV_PIX_FMT_FLAG_PLANAR,
859  },
861  .name = "yuv440p12be",
862  .nb_components = 3,
863  .log2_chroma_w = 0,
864  .log2_chroma_h = 1,
865  .comp = {
866  { 0, 2, 0, 0, 12 }, /* Y */
867  { 1, 2, 0, 0, 12 }, /* U */
868  { 2, 2, 0, 0, 12 }, /* V */
869  },
871  },
872  [AV_PIX_FMT_YUVA420P] = {
873  .name = "yuva420p",
874  .nb_components = 4,
875  .log2_chroma_w = 1,
876  .log2_chroma_h = 1,
877  .comp = {
878  { 0, 1, 0, 0, 8 }, /* Y */
879  { 1, 1, 0, 0, 8 }, /* U */
880  { 2, 1, 0, 0, 8 }, /* V */
881  { 3, 1, 0, 0, 8 }, /* A */
882  },
884  },
885  [AV_PIX_FMT_YUVA422P] = {
886  .name = "yuva422p",
887  .nb_components = 4,
888  .log2_chroma_w = 1,
889  .log2_chroma_h = 0,
890  .comp = {
891  { 0, 1, 0, 0, 8 }, /* Y */
892  { 1, 1, 0, 0, 8 }, /* U */
893  { 2, 1, 0, 0, 8 }, /* V */
894  { 3, 1, 0, 0, 8 }, /* A */
895  },
897  },
898  [AV_PIX_FMT_YUVA444P] = {
899  .name = "yuva444p",
900  .nb_components = 4,
901  .log2_chroma_w = 0,
902  .log2_chroma_h = 0,
903  .comp = {
904  { 0, 1, 0, 0, 8 }, /* Y */
905  { 1, 1, 0, 0, 8 }, /* U */
906  { 2, 1, 0, 0, 8 }, /* V */
907  { 3, 1, 0, 0, 8 }, /* A */
908  },
910  },
912  .name = "yuva420p9be",
913  .nb_components = 4,
914  .log2_chroma_w = 1,
915  .log2_chroma_h = 1,
916  .comp = {
917  { 0, 2, 0, 0, 9 }, /* Y */
918  { 1, 2, 0, 0, 9 }, /* U */
919  { 2, 2, 0, 0, 9 }, /* V */
920  { 3, 2, 0, 0, 9 }, /* A */
921  },
923  },
925  .name = "yuva420p9le",
926  .nb_components = 4,
927  .log2_chroma_w = 1,
928  .log2_chroma_h = 1,
929  .comp = {
930  { 0, 2, 0, 0, 9 }, /* Y */
931  { 1, 2, 0, 0, 9 }, /* U */
932  { 2, 2, 0, 0, 9 }, /* V */
933  { 3, 2, 0, 0, 9 }, /* A */
934  },
936  },
938  .name = "yuva422p9be",
939  .nb_components = 4,
940  .log2_chroma_w = 1,
941  .log2_chroma_h = 0,
942  .comp = {
943  { 0, 2, 0, 0, 9 }, /* Y */
944  { 1, 2, 0, 0, 9 }, /* U */
945  { 2, 2, 0, 0, 9 }, /* V */
946  { 3, 2, 0, 0, 9 }, /* A */
947  },
949  },
951  .name = "yuva422p9le",
952  .nb_components = 4,
953  .log2_chroma_w = 1,
954  .log2_chroma_h = 0,
955  .comp = {
956  { 0, 2, 0, 0, 9 }, /* Y */
957  { 1, 2, 0, 0, 9 }, /* U */
958  { 2, 2, 0, 0, 9 }, /* V */
959  { 3, 2, 0, 0, 9 }, /* A */
960  },
962  },
964  .name = "yuva444p9be",
965  .nb_components = 4,
966  .log2_chroma_w = 0,
967  .log2_chroma_h = 0,
968  .comp = {
969  { 0, 2, 0, 0, 9 }, /* Y */
970  { 1, 2, 0, 0, 9 }, /* U */
971  { 2, 2, 0, 0, 9 }, /* V */
972  { 3, 2, 0, 0, 9 }, /* A */
973  },
975  },
977  .name = "yuva444p9le",
978  .nb_components = 4,
979  .log2_chroma_w = 0,
980  .log2_chroma_h = 0,
981  .comp = {
982  { 0, 2, 0, 0, 9 }, /* Y */
983  { 1, 2, 0, 0, 9 }, /* U */
984  { 2, 2, 0, 0, 9 }, /* V */
985  { 3, 2, 0, 0, 9 }, /* A */
986  },
988  },
990  .name = "yuva420p10be",
991  .nb_components = 4,
992  .log2_chroma_w = 1,
993  .log2_chroma_h = 1,
994  .comp = {
995  { 0, 2, 0, 0, 10 }, /* Y */
996  { 1, 2, 0, 0, 10 }, /* U */
997  { 2, 2, 0, 0, 10 }, /* V */
998  { 3, 2, 0, 0, 10 }, /* A */
999  },
1001  },
1003  .name = "yuva420p10le",
1004  .nb_components = 4,
1005  .log2_chroma_w = 1,
1006  .log2_chroma_h = 1,
1007  .comp = {
1008  { 0, 2, 0, 0, 10 }, /* Y */
1009  { 1, 2, 0, 0, 10 }, /* U */
1010  { 2, 2, 0, 0, 10 }, /* V */
1011  { 3, 2, 0, 0, 10 }, /* A */
1012  },
1014  },
1016  .name = "yuva422p10be",
1017  .nb_components = 4,
1018  .log2_chroma_w = 1,
1019  .log2_chroma_h = 0,
1020  .comp = {
1021  { 0, 2, 0, 0, 10 }, /* Y */
1022  { 1, 2, 0, 0, 10 }, /* U */
1023  { 2, 2, 0, 0, 10 }, /* V */
1024  { 3, 2, 0, 0, 10 }, /* A */
1025  },
1027  },
1029  .name = "yuva422p10le",
1030  .nb_components = 4,
1031  .log2_chroma_w = 1,
1032  .log2_chroma_h = 0,
1033  .comp = {
1034  { 0, 2, 0, 0, 10 }, /* Y */
1035  { 1, 2, 0, 0, 10 }, /* U */
1036  { 2, 2, 0, 0, 10 }, /* V */
1037  { 3, 2, 0, 0, 10 }, /* A */
1038  },
1040  },
1042  .name = "yuva444p10be",
1043  .nb_components = 4,
1044  .log2_chroma_w = 0,
1045  .log2_chroma_h = 0,
1046  .comp = {
1047  { 0, 2, 0, 0, 10 }, /* Y */
1048  { 1, 2, 0, 0, 10 }, /* U */
1049  { 2, 2, 0, 0, 10 }, /* V */
1050  { 3, 2, 0, 0, 10 }, /* A */
1051  },
1053  },
1055  .name = "yuva444p10le",
1056  .nb_components = 4,
1057  .log2_chroma_w = 0,
1058  .log2_chroma_h = 0,
1059  .comp = {
1060  { 0, 2, 0, 0, 10 }, /* Y */
1061  { 1, 2, 0, 0, 10 }, /* U */
1062  { 2, 2, 0, 0, 10 }, /* V */
1063  { 3, 2, 0, 0, 10 }, /* A */
1064  },
1066  },
1068  .name = "yuva420p16be",
1069  .nb_components = 4,
1070  .log2_chroma_w = 1,
1071  .log2_chroma_h = 1,
1072  .comp = {
1073  { 0, 2, 0, 0, 16 }, /* Y */
1074  { 1, 2, 0, 0, 16 }, /* U */
1075  { 2, 2, 0, 0, 16 }, /* V */
1076  { 3, 2, 0, 0, 16 }, /* A */
1077  },
1079  },
1081  .name = "yuva420p16le",
1082  .nb_components = 4,
1083  .log2_chroma_w = 1,
1084  .log2_chroma_h = 1,
1085  .comp = {
1086  { 0, 2, 0, 0, 16 }, /* Y */
1087  { 1, 2, 0, 0, 16 }, /* U */
1088  { 2, 2, 0, 0, 16 }, /* V */
1089  { 3, 2, 0, 0, 16 }, /* A */
1090  },
1092  },
1094  .name = "yuva422p16be",
1095  .nb_components = 4,
1096  .log2_chroma_w = 1,
1097  .log2_chroma_h = 0,
1098  .comp = {
1099  { 0, 2, 0, 0, 16 }, /* Y */
1100  { 1, 2, 0, 0, 16 }, /* U */
1101  { 2, 2, 0, 0, 16 }, /* V */
1102  { 3, 2, 0, 0, 16 }, /* A */
1103  },
1105  },
1107  .name = "yuva422p16le",
1108  .nb_components = 4,
1109  .log2_chroma_w = 1,
1110  .log2_chroma_h = 0,
1111  .comp = {
1112  { 0, 2, 0, 0, 16 }, /* Y */
1113  { 1, 2, 0, 0, 16 }, /* U */
1114  { 2, 2, 0, 0, 16 }, /* V */
1115  { 3, 2, 0, 0, 16 }, /* A */
1116  },
1118  },
1120  .name = "yuva444p16be",
1121  .nb_components = 4,
1122  .log2_chroma_w = 0,
1123  .log2_chroma_h = 0,
1124  .comp = {
1125  { 0, 2, 0, 0, 16 }, /* Y */
1126  { 1, 2, 0, 0, 16 }, /* U */
1127  { 2, 2, 0, 0, 16 }, /* V */
1128  { 3, 2, 0, 0, 16 }, /* A */
1129  },
1131  },
1133  .name = "yuva444p16le",
1134  .nb_components = 4,
1135  .log2_chroma_w = 0,
1136  .log2_chroma_h = 0,
1137  .comp = {
1138  { 0, 2, 0, 0, 16 }, /* Y */
1139  { 1, 2, 0, 0, 16 }, /* U */
1140  { 2, 2, 0, 0, 16 }, /* V */
1141  { 3, 2, 0, 0, 16 }, /* A */
1142  },
1144  },
1145  [AV_PIX_FMT_RGB48BE] = {
1146  .name = "rgb48be",
1147  .nb_components = 3,
1148  .log2_chroma_w = 0,
1149  .log2_chroma_h = 0,
1150  .comp = {
1151  { 0, 6, 0, 0, 16 }, /* R */
1152  { 0, 6, 2, 0, 16 }, /* G */
1153  { 0, 6, 4, 0, 16 }, /* B */
1154  },
1156  },
1157  [AV_PIX_FMT_RGB48LE] = {
1158  .name = "rgb48le",
1159  .nb_components = 3,
1160  .log2_chroma_w = 0,
1161  .log2_chroma_h = 0,
1162  .comp = {
1163  { 0, 6, 0, 0, 16 }, /* R */
1164  { 0, 6, 2, 0, 16 }, /* G */
1165  { 0, 6, 4, 0, 16 }, /* B */
1166  },
1167  .flags = AV_PIX_FMT_FLAG_RGB,
1168  },
1169  [AV_PIX_FMT_RGBA64BE] = {
1170  .name = "rgba64be",
1171  .nb_components = 4,
1172  .log2_chroma_w = 0,
1173  .log2_chroma_h = 0,
1174  .comp = {
1175  { 0, 8, 0, 0, 16 }, /* R */
1176  { 0, 8, 2, 0, 16 }, /* G */
1177  { 0, 8, 4, 0, 16 }, /* B */
1178  { 0, 8, 6, 0, 16 }, /* A */
1179  },
1181  },
1182  [AV_PIX_FMT_RGBA64LE] = {
1183  .name = "rgba64le",
1184  .nb_components = 4,
1185  .log2_chroma_w = 0,
1186  .log2_chroma_h = 0,
1187  .comp = {
1188  { 0, 8, 0, 0, 16 }, /* R */
1189  { 0, 8, 2, 0, 16 }, /* G */
1190  { 0, 8, 4, 0, 16 }, /* B */
1191  { 0, 8, 6, 0, 16 }, /* A */
1192  },
1194  },
1195  [AV_PIX_FMT_RGB565BE] = {
1196  .name = "rgb565be",
1197  .nb_components = 3,
1198  .log2_chroma_w = 0,
1199  .log2_chroma_h = 0,
1200  .comp = {
1201  { 0, 2, -1, 3, 5 }, /* R */
1202  { 0, 2, 0, 5, 6 }, /* G */
1203  { 0, 2, 0, 0, 5 }, /* B */
1204  },
1206  },
1207  [AV_PIX_FMT_RGB565LE] = {
1208  .name = "rgb565le",
1209  .nb_components = 3,
1210  .log2_chroma_w = 0,
1211  .log2_chroma_h = 0,
1212  .comp = {
1213  { 0, 2, 1, 3, 5 }, /* R */
1214  { 0, 2, 0, 5, 6 }, /* G */
1215  { 0, 2, 0, 0, 5 }, /* B */
1216  },
1217  .flags = AV_PIX_FMT_FLAG_RGB,
1218  },
1219  [AV_PIX_FMT_RGB555BE] = {
1220  .name = "rgb555be",
1221  .nb_components = 3,
1222  .log2_chroma_w = 0,
1223  .log2_chroma_h = 0,
1224  .comp = {
1225  { 0, 2, -1, 2, 5 }, /* R */
1226  { 0, 2, 0, 5, 5 }, /* G */
1227  { 0, 2, 0, 0, 5 }, /* B */
1228  },
1230  },
1231  [AV_PIX_FMT_RGB555LE] = {
1232  .name = "rgb555le",
1233  .nb_components = 3,
1234  .log2_chroma_w = 0,
1235  .log2_chroma_h = 0,
1236  .comp = {
1237  { 0, 2, 1, 2, 5 }, /* R */
1238  { 0, 2, 0, 5, 5 }, /* G */
1239  { 0, 2, 0, 0, 5 }, /* B */
1240  },
1241  .flags = AV_PIX_FMT_FLAG_RGB,
1242  },
1243  [AV_PIX_FMT_RGB444BE] = {
1244  .name = "rgb444be",
1245  .nb_components = 3,
1246  .log2_chroma_w = 0,
1247  .log2_chroma_h = 0,
1248  .comp = {
1249  { 0, 2, -1, 0, 4 }, /* R */
1250  { 0, 2, 0, 4, 4 }, /* G */
1251  { 0, 2, 0, 0, 4 }, /* B */
1252  },
1254  },
1255  [AV_PIX_FMT_RGB444LE] = {
1256  .name = "rgb444le",
1257  .nb_components = 3,
1258  .log2_chroma_w = 0,
1259  .log2_chroma_h = 0,
1260  .comp = {
1261  { 0, 2, 1, 0, 4 }, /* R */
1262  { 0, 2, 0, 4, 4 }, /* G */
1263  { 0, 2, 0, 0, 4 }, /* B */
1264  },
1265  .flags = AV_PIX_FMT_FLAG_RGB,
1266  },
1267  [AV_PIX_FMT_BGR48BE] = {
1268  .name = "bgr48be",
1269  .nb_components = 3,
1270  .log2_chroma_w = 0,
1271  .log2_chroma_h = 0,
1272  .comp = {
1273  { 0, 6, 4, 0, 16 }, /* R */
1274  { 0, 6, 2, 0, 16 }, /* G */
1275  { 0, 6, 0, 0, 16 }, /* B */
1276  },
1278  },
1279  [AV_PIX_FMT_BGR48LE] = {
1280  .name = "bgr48le",
1281  .nb_components = 3,
1282  .log2_chroma_w = 0,
1283  .log2_chroma_h = 0,
1284  .comp = {
1285  { 0, 6, 4, 0, 16 }, /* R */
1286  { 0, 6, 2, 0, 16 }, /* G */
1287  { 0, 6, 0, 0, 16 }, /* B */
1288  },
1289  .flags = AV_PIX_FMT_FLAG_RGB,
1290  },
1291  [AV_PIX_FMT_BGRA64BE] = {
1292  .name = "bgra64be",
1293  .nb_components = 4,
1294  .log2_chroma_w = 0,
1295  .log2_chroma_h = 0,
1296  .comp = {
1297  { 0, 8, 4, 0, 16 }, /* R */
1298  { 0, 8, 2, 0, 16 }, /* G */
1299  { 0, 8, 0, 0, 16 }, /* B */
1300  { 0, 8, 6, 0, 16 }, /* A */
1301  },
1303  },
1304  [AV_PIX_FMT_BGRA64LE] = {
1305  .name = "bgra64le",
1306  .nb_components = 4,
1307  .log2_chroma_w = 0,
1308  .log2_chroma_h = 0,
1309  .comp = {
1310  { 0, 8, 4, 0, 16 }, /* R */
1311  { 0, 8, 2, 0, 16 }, /* G */
1312  { 0, 8, 0, 0, 16 }, /* B */
1313  { 0, 8, 6, 0, 16 }, /* A */
1314  },
1316  },
1317  [AV_PIX_FMT_BGR565BE] = {
1318  .name = "bgr565be",
1319  .nb_components = 3,
1320  .log2_chroma_w = 0,
1321  .log2_chroma_h = 0,
1322  .comp = {
1323  { 0, 2, 0, 0, 5 }, /* R */
1324  { 0, 2, 0, 5, 6 }, /* G */
1325  { 0, 2, -1, 3, 5 }, /* B */
1326  },
1328  },
1329  [AV_PIX_FMT_BGR565LE] = {
1330  .name = "bgr565le",
1331  .nb_components = 3,
1332  .log2_chroma_w = 0,
1333  .log2_chroma_h = 0,
1334  .comp = {
1335  { 0, 2, 0, 0, 5 }, /* R */
1336  { 0, 2, 0, 5, 6 }, /* G */
1337  { 0, 2, 1, 3, 5 }, /* B */
1338  },
1339  .flags = AV_PIX_FMT_FLAG_RGB,
1340  },
1341  [AV_PIX_FMT_BGR555BE] = {
1342  .name = "bgr555be",
1343  .nb_components = 3,
1344  .log2_chroma_w = 0,
1345  .log2_chroma_h = 0,
1346  .comp = {
1347  { 0, 2, 0, 0, 5 }, /* R */
1348  { 0, 2, 0, 5, 5 }, /* G */
1349  { 0, 2, -1, 2, 5 }, /* B */
1350  },
1352  },
1353  [AV_PIX_FMT_BGR555LE] = {
1354  .name = "bgr555le",
1355  .nb_components = 3,
1356  .log2_chroma_w = 0,
1357  .log2_chroma_h = 0,
1358  .comp = {
1359  { 0, 2, 0, 0, 5 }, /* R */
1360  { 0, 2, 0, 5, 5 }, /* G */
1361  { 0, 2, 1, 2, 5 }, /* B */
1362  },
1363  .flags = AV_PIX_FMT_FLAG_RGB,
1364  },
1365  [AV_PIX_FMT_BGR444BE] = {
1366  .name = "bgr444be",
1367  .nb_components = 3,
1368  .log2_chroma_w = 0,
1369  .log2_chroma_h = 0,
1370  .comp = {
1371  { 0, 2, 0, 0, 4 }, /* R */
1372  { 0, 2, 0, 4, 4 }, /* G */
1373  { 0, 2, -1, 0, 4 }, /* B */
1374  },
1376  },
1377  [AV_PIX_FMT_BGR444LE] = {
1378  .name = "bgr444le",
1379  .nb_components = 3,
1380  .log2_chroma_w = 0,
1381  .log2_chroma_h = 0,
1382  .comp = {
1383  { 0, 2, 0, 0, 4 }, /* R */
1384  { 0, 2, 0, 4, 4 }, /* G */
1385  { 0, 2, 1, 0, 4 }, /* B */
1386  },
1387  .flags = AV_PIX_FMT_FLAG_RGB,
1388  },
1389  [AV_PIX_FMT_VAAPI] = {
1390  .name = "vaapi",
1391  .log2_chroma_w = 1,
1392  .log2_chroma_h = 1,
1393  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1394  },
1395  [AV_PIX_FMT_YUV420P9LE] = {
1396  .name = "yuv420p9le",
1397  .nb_components = 3,
1398  .log2_chroma_w = 1,
1399  .log2_chroma_h = 1,
1400  .comp = {
1401  { 0, 2, 0, 0, 9 }, /* Y */
1402  { 1, 2, 0, 0, 9 }, /* U */
1403  { 2, 2, 0, 0, 9 }, /* V */
1404  },
1405  .flags = AV_PIX_FMT_FLAG_PLANAR,
1406  },
1407  [AV_PIX_FMT_YUV420P9BE] = {
1408  .name = "yuv420p9be",
1409  .nb_components = 3,
1410  .log2_chroma_w = 1,
1411  .log2_chroma_h = 1,
1412  .comp = {
1413  { 0, 2, 0, 0, 9 }, /* Y */
1414  { 1, 2, 0, 0, 9 }, /* U */
1415  { 2, 2, 0, 0, 9 }, /* V */
1416  },
1418  },
1420  .name = "yuv420p10le",
1421  .nb_components = 3,
1422  .log2_chroma_w = 1,
1423  .log2_chroma_h = 1,
1424  .comp = {
1425  { 0, 2, 0, 0, 10 }, /* Y */
1426  { 1, 2, 0, 0, 10 }, /* U */
1427  { 2, 2, 0, 0, 10 }, /* V */
1428  },
1429  .flags = AV_PIX_FMT_FLAG_PLANAR,
1430  },
1432  .name = "yuv420p10be",
1433  .nb_components = 3,
1434  .log2_chroma_w = 1,
1435  .log2_chroma_h = 1,
1436  .comp = {
1437  { 0, 2, 0, 0, 10 }, /* Y */
1438  { 1, 2, 0, 0, 10 }, /* U */
1439  { 2, 2, 0, 0, 10 }, /* V */
1440  },
1442  },
1444  .name = "yuv420p12le",
1445  .nb_components = 3,
1446  .log2_chroma_w = 1,
1447  .log2_chroma_h = 1,
1448  .comp = {
1449  { 0, 2, 0, 0, 12 }, /* Y */
1450  { 1, 2, 0, 0, 12 }, /* U */
1451  { 2, 2, 0, 0, 12 }, /* V */
1452  },
1453  .flags = AV_PIX_FMT_FLAG_PLANAR,
1454  },
1456  .name = "yuv420p12be",
1457  .nb_components = 3,
1458  .log2_chroma_w = 1,
1459  .log2_chroma_h = 1,
1460  .comp = {
1461  { 0, 2, 0, 0, 12 }, /* Y */
1462  { 1, 2, 0, 0, 12 }, /* U */
1463  { 2, 2, 0, 0, 12 }, /* V */
1464  },
1466  },
1468  .name = "yuv420p14le",
1469  .nb_components = 3,
1470  .log2_chroma_w = 1,
1471  .log2_chroma_h = 1,
1472  .comp = {
1473  { 0, 2, 0, 0, 14 }, /* Y */
1474  { 1, 2, 0, 0, 14 }, /* U */
1475  { 2, 2, 0, 0, 14 }, /* V */
1476  },
1477  .flags = AV_PIX_FMT_FLAG_PLANAR,
1478  },
1480  .name = "yuv420p14be",
1481  .nb_components = 3,
1482  .log2_chroma_w = 1,
1483  .log2_chroma_h = 1,
1484  .comp = {
1485  { 0, 2, 0, 0, 14 }, /* Y */
1486  { 1, 2, 0, 0, 14 }, /* U */
1487  { 2, 2, 0, 0, 14 }, /* V */
1488  },
1490  },
1492  .name = "yuv420p16le",
1493  .nb_components = 3,
1494  .log2_chroma_w = 1,
1495  .log2_chroma_h = 1,
1496  .comp = {
1497  { 0, 2, 0, 0, 16 }, /* Y */
1498  { 1, 2, 0, 0, 16 }, /* U */
1499  { 2, 2, 0, 0, 16 }, /* V */
1500  },
1501  .flags = AV_PIX_FMT_FLAG_PLANAR,
1502  },
1504  .name = "yuv420p16be",
1505  .nb_components = 3,
1506  .log2_chroma_w = 1,
1507  .log2_chroma_h = 1,
1508  .comp = {
1509  { 0, 2, 0, 0, 16 }, /* Y */
1510  { 1, 2, 0, 0, 16 }, /* U */
1511  { 2, 2, 0, 0, 16 }, /* V */
1512  },
1514  },
1515  [AV_PIX_FMT_YUV422P9LE] = {
1516  .name = "yuv422p9le",
1517  .nb_components = 3,
1518  .log2_chroma_w = 1,
1519  .log2_chroma_h = 0,
1520  .comp = {
1521  { 0, 2, 0, 0, 9 }, /* Y */
1522  { 1, 2, 0, 0, 9 }, /* U */
1523  { 2, 2, 0, 0, 9 }, /* V */
1524  },
1525  .flags = AV_PIX_FMT_FLAG_PLANAR,
1526  },
1527  [AV_PIX_FMT_YUV422P9BE] = {
1528  .name = "yuv422p9be",
1529  .nb_components = 3,
1530  .log2_chroma_w = 1,
1531  .log2_chroma_h = 0,
1532  .comp = {
1533  { 0, 2, 0, 0, 9 }, /* Y */
1534  { 1, 2, 0, 0, 9 }, /* U */
1535  { 2, 2, 0, 0, 9 }, /* V */
1536  },
1538  },
1540  .name = "yuv422p10le",
1541  .nb_components = 3,
1542  .log2_chroma_w = 1,
1543  .log2_chroma_h = 0,
1544  .comp = {
1545  { 0, 2, 0, 0, 10 }, /* Y */
1546  { 1, 2, 0, 0, 10 }, /* U */
1547  { 2, 2, 0, 0, 10 }, /* V */
1548  },
1549  .flags = AV_PIX_FMT_FLAG_PLANAR,
1550  },
1552  .name = "yuv422p10be",
1553  .nb_components = 3,
1554  .log2_chroma_w = 1,
1555  .log2_chroma_h = 0,
1556  .comp = {
1557  { 0, 2, 0, 0, 10 }, /* Y */
1558  { 1, 2, 0, 0, 10 }, /* U */
1559  { 2, 2, 0, 0, 10 }, /* V */
1560  },
1562  },
1564  .name = "yuv422p12le",
1565  .nb_components = 3,
1566  .log2_chroma_w = 1,
1567  .log2_chroma_h = 0,
1568  .comp = {
1569  { 0, 2, 0, 0, 12 }, /* Y */
1570  { 1, 2, 0, 0, 12 }, /* U */
1571  { 2, 2, 0, 0, 12 }, /* V */
1572  },
1573  .flags = AV_PIX_FMT_FLAG_PLANAR,
1574  },
1576  .name = "yuv422p12be",
1577  .nb_components = 3,
1578  .log2_chroma_w = 1,
1579  .log2_chroma_h = 0,
1580  .comp = {
1581  { 0, 2, 0, 0, 12 }, /* Y */
1582  { 1, 2, 0, 0, 12 }, /* U */
1583  { 2, 2, 0, 0, 12 }, /* V */
1584  },
1586  },
1588  .name = "yuv422p14le",
1589  .nb_components = 3,
1590  .log2_chroma_w = 1,
1591  .log2_chroma_h = 0,
1592  .comp = {
1593  { 0, 2, 0, 0, 14 }, /* Y */
1594  { 1, 2, 0, 0, 14 }, /* U */
1595  { 2, 2, 0, 0, 14 }, /* V */
1596  },
1597  .flags = AV_PIX_FMT_FLAG_PLANAR,
1598  },
1600  .name = "yuv422p14be",
1601  .nb_components = 3,
1602  .log2_chroma_w = 1,
1603  .log2_chroma_h = 0,
1604  .comp = {
1605  { 0, 2, 0, 0, 14 }, /* Y */
1606  { 1, 2, 0, 0, 14 }, /* U */
1607  { 2, 2, 0, 0, 14 }, /* V */
1608  },
1610  },
1612  .name = "yuv422p16le",
1613  .nb_components = 3,
1614  .log2_chroma_w = 1,
1615  .log2_chroma_h = 0,
1616  .comp = {
1617  { 0, 2, 0, 0, 16 }, /* Y */
1618  { 1, 2, 0, 0, 16 }, /* U */
1619  { 2, 2, 0, 0, 16 }, /* V */
1620  },
1621  .flags = AV_PIX_FMT_FLAG_PLANAR,
1622  },
1624  .name = "yuv422p16be",
1625  .nb_components = 3,
1626  .log2_chroma_w = 1,
1627  .log2_chroma_h = 0,
1628  .comp = {
1629  { 0, 2, 0, 0, 16 }, /* Y */
1630  { 1, 2, 0, 0, 16 }, /* U */
1631  { 2, 2, 0, 0, 16 }, /* V */
1632  },
1634  },
1636  .name = "yuv444p16le",
1637  .nb_components = 3,
1638  .log2_chroma_w = 0,
1639  .log2_chroma_h = 0,
1640  .comp = {
1641  { 0, 2, 0, 0, 16 }, /* Y */
1642  { 1, 2, 0, 0, 16 }, /* U */
1643  { 2, 2, 0, 0, 16 }, /* V */
1644  },
1645  .flags = AV_PIX_FMT_FLAG_PLANAR,
1646  },
1648  .name = "yuv444p16be",
1649  .nb_components = 3,
1650  .log2_chroma_w = 0,
1651  .log2_chroma_h = 0,
1652  .comp = {
1653  { 0, 2, 0, 0, 16 }, /* Y */
1654  { 1, 2, 0, 0, 16 }, /* U */
1655  { 2, 2, 0, 0, 16 }, /* V */
1656  },
1658  },
1660  .name = "yuv444p10le",
1661  .nb_components = 3,
1662  .log2_chroma_w = 0,
1663  .log2_chroma_h = 0,
1664  .comp = {
1665  { 0, 2, 0, 0, 10 }, /* Y */
1666  { 1, 2, 0, 0, 10 }, /* U */
1667  { 2, 2, 0, 0, 10 }, /* V */
1668  },
1669  .flags = AV_PIX_FMT_FLAG_PLANAR,
1670  },
1672  .name = "yuv444p10be",
1673  .nb_components = 3,
1674  .log2_chroma_w = 0,
1675  .log2_chroma_h = 0,
1676  .comp = {
1677  { 0, 2, 0, 0, 10 }, /* Y */
1678  { 1, 2, 0, 0, 10 }, /* U */
1679  { 2, 2, 0, 0, 10 }, /* V */
1680  },
1682  },
1683  [AV_PIX_FMT_YUV444P9LE] = {
1684  .name = "yuv444p9le",
1685  .nb_components = 3,
1686  .log2_chroma_w = 0,
1687  .log2_chroma_h = 0,
1688  .comp = {
1689  { 0, 2, 0, 0, 9 }, /* Y */
1690  { 1, 2, 0, 0, 9 }, /* U */
1691  { 2, 2, 0, 0, 9 }, /* V */
1692  },
1693  .flags = AV_PIX_FMT_FLAG_PLANAR,
1694  },
1695  [AV_PIX_FMT_YUV444P9BE] = {
1696  .name = "yuv444p9be",
1697  .nb_components = 3,
1698  .log2_chroma_w = 0,
1699  .log2_chroma_h = 0,
1700  .comp = {
1701  { 0, 2, 0, 0, 9 }, /* Y */
1702  { 1, 2, 0, 0, 9 }, /* U */
1703  { 2, 2, 0, 0, 9 }, /* V */
1704  },
1706  },
1708  .name = "yuv444p12le",
1709  .nb_components = 3,
1710  .log2_chroma_w = 0,
1711  .log2_chroma_h = 0,
1712  .comp = {
1713  { 0, 2, 0, 0, 12 }, /* Y */
1714  { 1, 2, 0, 0, 12 }, /* U */
1715  { 2, 2, 0, 0, 12 }, /* V */
1716  },
1717  .flags = AV_PIX_FMT_FLAG_PLANAR,
1718  },
1720  .name = "yuv444p12be",
1721  .nb_components = 3,
1722  .log2_chroma_w = 0,
1723  .log2_chroma_h = 0,
1724  .comp = {
1725  { 0, 2, 0, 0, 12 }, /* Y */
1726  { 1, 2, 0, 0, 12 }, /* U */
1727  { 2, 2, 0, 0, 12 }, /* V */
1728  },
1730  },
1732  .name = "yuv444p14le",
1733  .nb_components = 3,
1734  .log2_chroma_w = 0,
1735  .log2_chroma_h = 0,
1736  .comp = {
1737  { 0, 2, 0, 0, 14 }, /* Y */
1738  { 1, 2, 0, 0, 14 }, /* U */
1739  { 2, 2, 0, 0, 14 }, /* V */
1740  },
1741  .flags = AV_PIX_FMT_FLAG_PLANAR,
1742  },
1744  .name = "yuv444p14be",
1745  .nb_components = 3,
1746  .log2_chroma_w = 0,
1747  .log2_chroma_h = 0,
1748  .comp = {
1749  { 0, 2, 0, 0, 14 }, /* Y */
1750  { 1, 2, 0, 0, 14 }, /* U */
1751  { 2, 2, 0, 0, 14 }, /* V */
1752  },
1754  },
1756  .name = "d3d11va_vld",
1757  .log2_chroma_w = 1,
1758  .log2_chroma_h = 1,
1759  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1760  },
1761  [AV_PIX_FMT_DXVA2_VLD] = {
1762  .name = "dxva2_vld",
1763  .log2_chroma_w = 1,
1764  .log2_chroma_h = 1,
1765  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1766  },
1767  [AV_PIX_FMT_YA8] = {
1768  .name = "ya8",
1769  .nb_components = 2,
1770  .comp = {
1771  { 0, 2, 0, 0, 8 }, /* Y */
1772  { 0, 2, 1, 0, 8 }, /* A */
1773  },
1774  .flags = AV_PIX_FMT_FLAG_ALPHA,
1775  .alias = "gray8a",
1776  },
1777  [AV_PIX_FMT_YA16LE] = {
1778  .name = "ya16le",
1779  .nb_components = 2,
1780  .comp = {
1781  { 0, 4, 0, 0, 16 }, /* Y */
1782  { 0, 4, 2, 0, 16 }, /* A */
1783  },
1784  .flags = AV_PIX_FMT_FLAG_ALPHA,
1785  },
1786  [AV_PIX_FMT_YA16BE] = {
1787  .name = "ya16be",
1788  .nb_components = 2,
1789  .comp = {
1790  { 0, 4, 0, 0, 16 }, /* Y */
1791  { 0, 4, 2, 0, 16 }, /* A */
1792  },
1794  },
1796  .name = "videotoolbox_vld",
1797  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1798  },
1799  [AV_PIX_FMT_GBRP] = {
1800  .name = "gbrp",
1801  .nb_components = 3,
1802  .log2_chroma_w = 0,
1803  .log2_chroma_h = 0,
1804  .comp = {
1805  { 2, 1, 0, 0, 8 }, /* R */
1806  { 0, 1, 0, 0, 8 }, /* G */
1807  { 1, 1, 0, 0, 8 }, /* B */
1808  },
1810  },
1811  [AV_PIX_FMT_GBRP9LE] = {
1812  .name = "gbrp9le",
1813  .nb_components = 3,
1814  .log2_chroma_w = 0,
1815  .log2_chroma_h = 0,
1816  .comp = {
1817  { 2, 2, 0, 0, 9 }, /* R */
1818  { 0, 2, 0, 0, 9 }, /* G */
1819  { 1, 2, 0, 0, 9 }, /* B */
1820  },
1822  },
1823  [AV_PIX_FMT_GBRP9BE] = {
1824  .name = "gbrp9be",
1825  .nb_components = 3,
1826  .log2_chroma_w = 0,
1827  .log2_chroma_h = 0,
1828  .comp = {
1829  { 2, 2, 0, 0, 9 }, /* R */
1830  { 0, 2, 0, 0, 9 }, /* G */
1831  { 1, 2, 0, 0, 9 }, /* B */
1832  },
1834  },
1835  [AV_PIX_FMT_GBRP10LE] = {
1836  .name = "gbrp10le",
1837  .nb_components = 3,
1838  .log2_chroma_w = 0,
1839  .log2_chroma_h = 0,
1840  .comp = {
1841  { 2, 2, 0, 0, 10 }, /* R */
1842  { 0, 2, 0, 0, 10 }, /* G */
1843  { 1, 2, 0, 0, 10 }, /* B */
1844  },
1846  },
1847  [AV_PIX_FMT_GBRP10BE] = {
1848  .name = "gbrp10be",
1849  .nb_components = 3,
1850  .log2_chroma_w = 0,
1851  .log2_chroma_h = 0,
1852  .comp = {
1853  { 2, 2, 0, 0, 10 }, /* R */
1854  { 0, 2, 0, 0, 10 }, /* G */
1855  { 1, 2, 0, 0, 10 }, /* B */
1856  },
1858  },
1859  [AV_PIX_FMT_GBRP12LE] = {
1860  .name = "gbrp12le",
1861  .nb_components = 3,
1862  .log2_chroma_w = 0,
1863  .log2_chroma_h = 0,
1864  .comp = {
1865  { 2, 2, 0, 0, 12 }, /* R */
1866  { 0, 2, 0, 0, 12 }, /* G */
1867  { 1, 2, 0, 0, 12 }, /* B */
1868  },
1870  },
1871  [AV_PIX_FMT_GBRP12BE] = {
1872  .name = "gbrp12be",
1873  .nb_components = 3,
1874  .log2_chroma_w = 0,
1875  .log2_chroma_h = 0,
1876  .comp = {
1877  { 2, 2, 0, 0, 12 }, /* R */
1878  { 0, 2, 0, 0, 12 }, /* G */
1879  { 1, 2, 0, 0, 12 }, /* B */
1880  },
1882  },
1883  [AV_PIX_FMT_GBRP14LE] = {
1884  .name = "gbrp14le",
1885  .nb_components = 3,
1886  .log2_chroma_w = 0,
1887  .log2_chroma_h = 0,
1888  .comp = {
1889  { 2, 2, 0, 0, 14 }, /* R */
1890  { 0, 2, 0, 0, 14 }, /* G */
1891  { 1, 2, 0, 0, 14 }, /* B */
1892  },
1894  },
1895  [AV_PIX_FMT_GBRP14BE] = {
1896  .name = "gbrp14be",
1897  .nb_components = 3,
1898  .log2_chroma_w = 0,
1899  .log2_chroma_h = 0,
1900  .comp = {
1901  { 2, 2, 0, 0, 14 }, /* R */
1902  { 0, 2, 0, 0, 14 }, /* G */
1903  { 1, 2, 0, 0, 14 }, /* B */
1904  },
1906  },
1907  [AV_PIX_FMT_GBRP16LE] = {
1908  .name = "gbrp16le",
1909  .nb_components = 3,
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  },
1918  },
1919  [AV_PIX_FMT_GBRP16BE] = {
1920  .name = "gbrp16be",
1921  .nb_components = 3,
1922  .log2_chroma_w = 0,
1923  .log2_chroma_h = 0,
1924  .comp = {
1925  { 2, 2, 0, 0, 16 }, /* R */
1926  { 0, 2, 0, 0, 16 }, /* G */
1927  { 1, 2, 0, 0, 16 }, /* B */
1928  },
1930  },
1931  [AV_PIX_FMT_GBRAP] = {
1932  .name = "gbrap",
1933  .nb_components = 4,
1934  .log2_chroma_w = 0,
1935  .log2_chroma_h = 0,
1936  .comp = {
1937  { 2, 1, 0, 0, 8 }, /* R */
1938  { 0, 1, 0, 0, 8 }, /* G */
1939  { 1, 1, 0, 0, 8 }, /* B */
1940  { 3, 1, 0, 0, 8 }, /* A */
1941  },
1944  },
1945  [AV_PIX_FMT_GBRAP16LE] = {
1946  .name = "gbrap16le",
1947  .nb_components = 4,
1948  .log2_chroma_w = 0,
1949  .log2_chroma_h = 0,
1950  .comp = {
1951  { 2, 2, 0, 0, 16 }, /* R */
1952  { 0, 2, 0, 0, 16 }, /* G */
1953  { 1, 2, 0, 0, 16 }, /* B */
1954  { 3, 2, 0, 0, 16 }, /* A */
1955  },
1958  },
1959  [AV_PIX_FMT_GBRAP16BE] = {
1960  .name = "gbrap16be",
1961  .nb_components = 4,
1962  .log2_chroma_w = 0,
1963  .log2_chroma_h = 0,
1964  .comp = {
1965  { 2, 2, 0, 0, 16 }, /* R */
1966  { 0, 2, 0, 0, 16 }, /* G */
1967  { 1, 2, 0, 0, 16 }, /* B */
1968  { 3, 2, 0, 0, 16 }, /* A */
1969  },
1972  },
1973  [AV_PIX_FMT_VDPAU] = {
1974  .name = "vdpau",
1975  .log2_chroma_w = 1,
1976  .log2_chroma_h = 1,
1977  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1978  },
1979  [AV_PIX_FMT_XYZ12LE] = {
1980  .name = "xyz12le",
1981  .nb_components = 3,
1982  .log2_chroma_w = 0,
1983  .log2_chroma_h = 0,
1984  .comp = {
1985  { 0, 6, 0, 4, 12 }, /* X */
1986  { 0, 6, 2, 4, 12 }, /* Y */
1987  { 0, 6, 4, 4, 12 }, /* Z */
1988  },
1989  .flags = AV_PIX_FMT_FLAG_XYZ,
1990  },
1991  [AV_PIX_FMT_XYZ12BE] = {
1992  .name = "xyz12be",
1993  .nb_components = 3,
1994  .log2_chroma_w = 0,
1995  .log2_chroma_h = 0,
1996  .comp = {
1997  { 0, 6, 0, 4, 12 }, /* X */
1998  { 0, 6, 2, 4, 12 }, /* Y */
1999  { 0, 6, 4, 4, 12 }, /* Z */
2000  },
2002  },
2003 
2004 #define BAYER8_DESC_COMMON \
2005  .nb_components= 3, \
2006  .log2_chroma_w= 0, \
2007  .log2_chroma_h= 0, \
2008  .comp = { \
2009  { 0, 1, 0, 0, 2 }, \
2010  { 0, 1, 0, 0, 4 }, \
2011  { 0, 1, 0, 0, 2 }, \
2012  }, \
2013 
2014 #define BAYER16_DESC_COMMON \
2015  .nb_components= 3, \
2016  .log2_chroma_w= 0, \
2017  .log2_chroma_h= 0, \
2018  .comp = { \
2019  { 0, 2, 0, 0, 4 }, \
2020  { 0, 2, 0, 0, 8 }, \
2021  { 0, 2, 0, 0, 4 }, \
2022  }, \
2023 
2025  .name = "bayer_bggr8",
2028  },
2030  .name = "bayer_bggr16le",
2033  },
2035  .name = "bayer_bggr16be",
2038  },
2040  .name = "bayer_rggb8",
2043  },
2045  .name = "bayer_rggb16le",
2048  },
2050  .name = "bayer_rggb16be",
2053  },
2055  .name = "bayer_gbrg8",
2058  },
2060  .name = "bayer_gbrg16le",
2063  },
2065  .name = "bayer_gbrg16be",
2068  },
2070  .name = "bayer_grbg8",
2073  },
2075  .name = "bayer_grbg16le",
2078  },
2080  .name = "bayer_grbg16be",
2083  },
2084  [AV_PIX_FMT_NV16] = {
2085  .name = "nv16",
2086  .nb_components = 3,
2087  .log2_chroma_w = 1,
2088  .log2_chroma_h = 0,
2089  .comp = {
2090  { 0, 1, 0, 0, 8 }, /* Y */
2091  { 1, 2, 0, 0, 8 }, /* U */
2092  { 1, 2, 1, 0, 8 }, /* V */
2093  },
2094  .flags = AV_PIX_FMT_FLAG_PLANAR,
2095  },
2096  [AV_PIX_FMT_NV20LE] = {
2097  .name = "nv20le",
2098  .nb_components = 3,
2099  .log2_chroma_w = 1,
2100  .log2_chroma_h = 0,
2101  .comp = {
2102  { 0, 2, 0, 0, 10 }, /* Y */
2103  { 1, 4, 0, 0, 10 }, /* U */
2104  { 1, 4, 2, 0, 10 }, /* V */
2105  },
2106  .flags = AV_PIX_FMT_FLAG_PLANAR,
2107  },
2108  [AV_PIX_FMT_NV20BE] = {
2109  .name = "nv20be",
2110  .nb_components = 3,
2111  .log2_chroma_w = 1,
2112  .log2_chroma_h = 0,
2113  .comp = {
2114  { 0, 2, 0, 0, 10 }, /* Y */
2115  { 1, 4, 0, 0, 10 }, /* U */
2116  { 1, 4, 2, 0, 10 }, /* V */
2117  },
2119  },
2120  [AV_PIX_FMT_QSV] = {
2121  .name = "qsv",
2122  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2123  },
2124  [AV_PIX_FMT_MEDIACODEC] = {
2125  .name = "mediacodec",
2126  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2127  },
2128  [AV_PIX_FMT_MMAL] = {
2129  .name = "mmal",
2130  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2131  },
2132  [AV_PIX_FMT_CUDA] = {
2133  .name = "cuda",
2134  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2135  },
2136  [AV_PIX_FMT_VYU444] = {
2137  .name = "vyu444",
2138  .nb_components = 3,
2139  .log2_chroma_w = 0,
2140  .log2_chroma_h = 0,
2141  .comp = {
2142  { 0, 3, 1, 0, 8 }, /* Y */
2143  { 0, 3, 2, 0, 8 }, /* U */
2144  { 0, 3, 0, 0, 8 }, /* V */
2145  },
2146  },
2147  [AV_PIX_FMT_UYVA] = {
2148  .name = "uyva",
2149  .nb_components = 4,
2150  .log2_chroma_w = 0,
2151  .log2_chroma_h = 0,
2152  .comp = {
2153  { 0, 4, 1, 0, 8 }, /* Y */
2154  { 0, 4, 0, 0, 8 }, /* U */
2155  { 0, 4, 2, 0, 8 }, /* V */
2156  { 0, 4, 3, 0, 8 }, /* A */
2157  },
2158  .flags = AV_PIX_FMT_FLAG_ALPHA,
2159  },
2160  [AV_PIX_FMT_AYUV] = {
2161  .name = "ayuv",
2162  .nb_components = 4,
2163  .log2_chroma_w = 0,
2164  .log2_chroma_h = 0,
2165  .comp = {
2166  { 0, 4, 1, 0, 8 }, /* Y */
2167  { 0, 4, 2, 0, 8 }, /* U */
2168  { 0, 4, 3, 0, 8 }, /* V */
2169  { 0, 4, 0, 0, 8 }, /* A */
2170  },
2171  .flags = AV_PIX_FMT_FLAG_ALPHA,
2172  },
2173  [AV_PIX_FMT_AYUV64LE] = {
2174  .name = "ayuv64le",
2175  .nb_components = 4,
2176  .log2_chroma_w = 0,
2177  .log2_chroma_h = 0,
2178  .comp = {
2179  { 0, 8, 2, 0, 16 }, /* Y */
2180  { 0, 8, 4, 0, 16 }, /* U */
2181  { 0, 8, 6, 0, 16 }, /* V */
2182  { 0, 8, 0, 0, 16 }, /* A */
2183  },
2184  .flags = AV_PIX_FMT_FLAG_ALPHA,
2185  },
2186  [AV_PIX_FMT_AYUV64BE] = {
2187  .name = "ayuv64be",
2188  .nb_components = 4,
2189  .log2_chroma_w = 0,
2190  .log2_chroma_h = 0,
2191  .comp = {
2192  { 0, 8, 2, 0, 16 }, /* Y */
2193  { 0, 8, 4, 0, 16 }, /* U */
2194  { 0, 8, 6, 0, 16 }, /* V */
2195  { 0, 8, 0, 0, 16 }, /* A */
2196  },
2198  },
2199  [AV_PIX_FMT_P010LE] = {
2200  .name = "p010le",
2201  .nb_components = 3,
2202  .log2_chroma_w = 1,
2203  .log2_chroma_h = 1,
2204  .comp = {
2205  { 0, 2, 0, 6, 10 }, /* Y */
2206  { 1, 4, 0, 6, 10 }, /* U */
2207  { 1, 4, 2, 6, 10 }, /* V */
2208  },
2209  .flags = AV_PIX_FMT_FLAG_PLANAR,
2210  },
2211  [AV_PIX_FMT_P010BE] = {
2212  .name = "p010be",
2213  .nb_components = 3,
2214  .log2_chroma_w = 1,
2215  .log2_chroma_h = 1,
2216  .comp = {
2217  { 0, 2, 0, 6, 10 }, /* Y */
2218  { 1, 4, 0, 6, 10 }, /* U */
2219  { 1, 4, 2, 6, 10 }, /* V */
2220  },
2222  },
2223  [AV_PIX_FMT_P012LE] = {
2224  .name = "p012le",
2225  .nb_components = 3,
2226  .log2_chroma_w = 1,
2227  .log2_chroma_h = 1,
2228  .comp = {
2229  { 0, 2, 0, 4, 12 }, /* Y */
2230  { 1, 4, 0, 4, 12 }, /* U */
2231  { 1, 4, 2, 4, 12 }, /* V */
2232  },
2233  .flags = AV_PIX_FMT_FLAG_PLANAR,
2234  },
2235  [AV_PIX_FMT_P012BE] = {
2236  .name = "p012be",
2237  .nb_components = 3,
2238  .log2_chroma_w = 1,
2239  .log2_chroma_h = 1,
2240  .comp = {
2241  { 0, 2, 0, 4, 12 }, /* Y */
2242  { 1, 4, 0, 4, 12 }, /* U */
2243  { 1, 4, 2, 4, 12 }, /* V */
2244  },
2246  },
2247  [AV_PIX_FMT_P016LE] = {
2248  .name = "p016le",
2249  .nb_components = 3,
2250  .log2_chroma_w = 1,
2251  .log2_chroma_h = 1,
2252  .comp = {
2253  { 0, 2, 0, 0, 16 }, /* Y */
2254  { 1, 4, 0, 0, 16 }, /* U */
2255  { 1, 4, 2, 0, 16 }, /* V */
2256  },
2257  .flags = AV_PIX_FMT_FLAG_PLANAR,
2258  },
2259  [AV_PIX_FMT_P016BE] = {
2260  .name = "p016be",
2261  .nb_components = 3,
2262  .log2_chroma_w = 1,
2263  .log2_chroma_h = 1,
2264  .comp = {
2265  { 0, 2, 0, 0, 16 }, /* Y */
2266  { 1, 4, 0, 0, 16 }, /* U */
2267  { 1, 4, 2, 0, 16 }, /* V */
2268  },
2270  },
2271  [AV_PIX_FMT_GBRAP14LE] = {
2272  .name = "gbrap14le",
2273  .nb_components = 4,
2274  .log2_chroma_w = 0,
2275  .log2_chroma_h = 0,
2276  .comp = {
2277  { 2, 2, 0, 0, 14 }, /* R */
2278  { 0, 2, 0, 0, 14 }, /* G */
2279  { 1, 2, 0, 0, 14 }, /* B */
2280  { 3, 2, 0, 0, 14 }, /* A */
2281  },
2284  },
2285  [AV_PIX_FMT_GBRAP14BE] = {
2286  .name = "gbrap14be",
2287  .nb_components = 4,
2288  .log2_chroma_w = 0,
2289  .log2_chroma_h = 0,
2290  .comp = {
2291  { 2, 2, 0, 0, 14 }, /* R */
2292  { 0, 2, 0, 0, 14 }, /* G */
2293  { 1, 2, 0, 0, 14 }, /* B */
2294  { 3, 2, 0, 0, 14 }, /* A */
2295  },
2298  },
2299  [AV_PIX_FMT_GBRAP12LE] = {
2300  .name = "gbrap12le",
2301  .nb_components = 4,
2302  .log2_chroma_w = 0,
2303  .log2_chroma_h = 0,
2304  .comp = {
2305  { 2, 2, 0, 0, 12 }, /* R */
2306  { 0, 2, 0, 0, 12 }, /* G */
2307  { 1, 2, 0, 0, 12 }, /* B */
2308  { 3, 2, 0, 0, 12 }, /* A */
2309  },
2312  },
2313  [AV_PIX_FMT_GBRAP12BE] = {
2314  .name = "gbrap12be",
2315  .nb_components = 4,
2316  .log2_chroma_w = 0,
2317  .log2_chroma_h = 0,
2318  .comp = {
2319  { 2, 2, 0, 0, 12 }, /* R */
2320  { 0, 2, 0, 0, 12 }, /* G */
2321  { 1, 2, 0, 0, 12 }, /* B */
2322  { 3, 2, 0, 0, 12 }, /* A */
2323  },
2326  },
2327  [AV_PIX_FMT_GBRAP10LE] = {
2328  .name = "gbrap10le",
2329  .nb_components = 4,
2330  .log2_chroma_w = 0,
2331  .log2_chroma_h = 0,
2332  .comp = {
2333  { 2, 2, 0, 0, 10 }, /* R */
2334  { 0, 2, 0, 0, 10 }, /* G */
2335  { 1, 2, 0, 0, 10 }, /* B */
2336  { 3, 2, 0, 0, 10 }, /* A */
2337  },
2340  },
2341  [AV_PIX_FMT_GBRAP10BE] = {
2342  .name = "gbrap10be",
2343  .nb_components = 4,
2344  .log2_chroma_w = 0,
2345  .log2_chroma_h = 0,
2346  .comp = {
2347  { 2, 2, 0, 0, 10 }, /* R */
2348  { 0, 2, 0, 0, 10 }, /* G */
2349  { 1, 2, 0, 0, 10 }, /* B */
2350  { 3, 2, 0, 0, 10 }, /* A */
2351  },
2354  },
2355  [AV_PIX_FMT_D3D11] = {
2356  .name = "d3d11",
2357  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2358  },
2359  [AV_PIX_FMT_D3D12] = {
2360  .name = "d3d12",
2361  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2362  },
2363  [AV_PIX_FMT_GBRPF32BE] = {
2364  .name = "gbrpf32be",
2365  .nb_components = 3,
2366  .log2_chroma_w = 0,
2367  .log2_chroma_h = 0,
2368  .comp = {
2369  { 2, 4, 0, 0, 32 }, /* R */
2370  { 0, 4, 0, 0, 32 }, /* G */
2371  { 1, 4, 0, 0, 32 }, /* B */
2372  },
2375  },
2376  [AV_PIX_FMT_GBRPF32LE] = {
2377  .name = "gbrpf32le",
2378  .nb_components = 3,
2379  .log2_chroma_w = 0,
2380  .log2_chroma_h = 0,
2381  .comp = {
2382  { 2, 4, 0, 0, 32 }, /* R */
2383  { 0, 4, 0, 0, 32 }, /* G */
2384  { 1, 4, 0, 0, 32 }, /* B */
2385  },
2387  },
2388  [AV_PIX_FMT_GBRAPF32BE] = {
2389  .name = "gbrapf32be",
2390  .nb_components = 4,
2391  .log2_chroma_w = 0,
2392  .log2_chroma_h = 0,
2393  .comp = {
2394  { 2, 4, 0, 0, 32 }, /* R */
2395  { 0, 4, 0, 0, 32 }, /* G */
2396  { 1, 4, 0, 0, 32 }, /* B */
2397  { 3, 4, 0, 0, 32 }, /* A */
2398  },
2402  },
2403  [AV_PIX_FMT_GBRAPF32LE] = {
2404  .name = "gbrapf32le",
2405  .nb_components = 4,
2406  .log2_chroma_w = 0,
2407  .log2_chroma_h = 0,
2408  .comp = {
2409  { 2, 4, 0, 0, 32 }, /* R */
2410  { 0, 4, 0, 0, 32 }, /* G */
2411  { 1, 4, 0, 0, 32 }, /* B */
2412  { 3, 4, 0, 0, 32 }, /* A */
2413  },
2416  },
2417  [AV_PIX_FMT_DRM_PRIME] = {
2418  .name = "drm_prime",
2419  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2420  },
2421  [AV_PIX_FMT_OPENCL] = {
2422  .name = "opencl",
2423  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2424  },
2425  [AV_PIX_FMT_GRAYF32BE] = {
2426  .name = "grayf32be",
2427  .nb_components = 1,
2428  .log2_chroma_w = 0,
2429  .log2_chroma_h = 0,
2430  .comp = {
2431  { 0, 4, 0, 0, 32 }, /* Y */
2432  },
2434  .alias = "yf32be",
2435  },
2436  [AV_PIX_FMT_GRAYF32LE] = {
2437  .name = "grayf32le",
2438  .nb_components = 1,
2439  .log2_chroma_w = 0,
2440  .log2_chroma_h = 0,
2441  .comp = {
2442  { 0, 4, 0, 0, 32 }, /* Y */
2443  },
2444  .flags = AV_PIX_FMT_FLAG_FLOAT,
2445  .alias = "yf32le",
2446  },
2448  .name = "yuva422p12be",
2449  .nb_components = 4,
2450  .log2_chroma_w = 1,
2451  .log2_chroma_h = 0,
2452  .comp = {
2453  { 0, 2, 0, 0, 12 }, /* Y */
2454  { 1, 2, 0, 0, 12 }, /* U */
2455  { 2, 2, 0, 0, 12 }, /* V */
2456  { 3, 2, 0, 0, 12 }, /* A */
2457  },
2459  },
2461  .name = "yuva422p12le",
2462  .nb_components = 4,
2463  .log2_chroma_w = 1,
2464  .log2_chroma_h = 0,
2465  .comp = {
2466  { 0, 2, 0, 0, 12 }, /* Y */
2467  { 1, 2, 0, 0, 12 }, /* U */
2468  { 2, 2, 0, 0, 12 }, /* V */
2469  { 3, 2, 0, 0, 12 }, /* A */
2470  },
2472  },
2474  .name = "yuva444p12be",
2475  .nb_components = 4,
2476  .log2_chroma_w = 0,
2477  .log2_chroma_h = 0,
2478  .comp = {
2479  { 0, 2, 0, 0, 12 }, /* Y */
2480  { 1, 2, 0, 0, 12 }, /* U */
2481  { 2, 2, 0, 0, 12 }, /* V */
2482  { 3, 2, 0, 0, 12 }, /* A */
2483  },
2485  },
2487  .name = "yuva444p12le",
2488  .nb_components = 4,
2489  .log2_chroma_w = 0,
2490  .log2_chroma_h = 0,
2491  .comp = {
2492  { 0, 2, 0, 0, 12 }, /* Y */
2493  { 1, 2, 0, 0, 12 }, /* U */
2494  { 2, 2, 0, 0, 12 }, /* V */
2495  { 3, 2, 0, 0, 12 }, /* A */
2496  },
2498  },
2499  [AV_PIX_FMT_NV24] = {
2500  .name = "nv24",
2501  .nb_components = 3,
2502  .log2_chroma_w = 0,
2503  .log2_chroma_h = 0,
2504  .comp = {
2505  { 0, 1, 0, 0, 8 }, /* Y */
2506  { 1, 2, 0, 0, 8 }, /* U */
2507  { 1, 2, 1, 0, 8 }, /* V */
2508  },
2509  .flags = AV_PIX_FMT_FLAG_PLANAR,
2510  },
2511  [AV_PIX_FMT_NV42] = {
2512  .name = "nv42",
2513  .nb_components = 3,
2514  .log2_chroma_w = 0,
2515  .log2_chroma_h = 0,
2516  .comp = {
2517  { 0, 1, 0, 0, 8 }, /* Y */
2518  { 1, 2, 1, 0, 8 }, /* U */
2519  { 1, 2, 0, 0, 8 }, /* V */
2520  },
2521  .flags = AV_PIX_FMT_FLAG_PLANAR,
2522  },
2523  [AV_PIX_FMT_VULKAN] = {
2524  .name = "vulkan",
2525  .flags = AV_PIX_FMT_FLAG_HWACCEL,
2526  },
2527  [AV_PIX_FMT_P210BE] = {
2528  .name = "p210be",
2529  .nb_components = 3,
2530  .log2_chroma_w = 1,
2531  .log2_chroma_h = 0,
2532  .comp = {
2533  { 0, 2, 0, 6, 10 }, /* Y */
2534  { 1, 4, 0, 6, 10 }, /* U */
2535  { 1, 4, 2, 6, 10 }, /* V */
2536  },
2538  },
2539  [AV_PIX_FMT_P210LE] = {
2540  .name = "p210le",
2541  .nb_components = 3,
2542  .log2_chroma_w = 1,
2543  .log2_chroma_h = 0,
2544  .comp = {
2545  { 0, 2, 0, 6, 10 }, /* Y */
2546  { 1, 4, 0, 6, 10 }, /* U */
2547  { 1, 4, 2, 6, 10 }, /* V */
2548  },
2549  .flags = AV_PIX_FMT_FLAG_PLANAR,
2550  },
2551  [AV_PIX_FMT_P410BE] = {
2552  .name = "p410be",
2553  .nb_components = 3,
2554  .log2_chroma_w = 0,
2555  .log2_chroma_h = 0,
2556  .comp = {
2557  { 0, 2, 0, 6, 10 }, /* Y */
2558  { 1, 4, 0, 6, 10 }, /* U */
2559  { 1, 4, 2, 6, 10 }, /* V */
2560  },
2562  },
2563  [AV_PIX_FMT_P410LE] = {
2564  .name = "p410le",
2565  .nb_components = 3,
2566  .log2_chroma_w = 0,
2567  .log2_chroma_h = 0,
2568  .comp = {
2569  { 0, 2, 0, 6, 10 }, /* Y */
2570  { 1, 4, 0, 6, 10 }, /* U */
2571  { 1, 4, 2, 6, 10 }, /* V */
2572  },
2573  .flags = AV_PIX_FMT_FLAG_PLANAR,
2574  },
2575  [AV_PIX_FMT_P216BE] = {
2576  .name = "p216be",
2577  .nb_components = 3,
2578  .log2_chroma_w = 1,
2579  .log2_chroma_h = 0,
2580  .comp = {
2581  { 0, 2, 0, 0, 16 }, /* Y */
2582  { 1, 4, 0, 0, 16 }, /* U */
2583  { 1, 4, 2, 0, 16 }, /* V */
2584  },
2586  },
2587  [AV_PIX_FMT_P216LE] = {
2588  .name = "p216le",
2589  .nb_components = 3,
2590  .log2_chroma_w = 1,
2591  .log2_chroma_h = 0,
2592  .comp = {
2593  { 0, 2, 0, 0, 16 }, /* Y */
2594  { 1, 4, 0, 0, 16 }, /* U */
2595  { 1, 4, 2, 0, 16 }, /* V */
2596  },
2597  .flags = AV_PIX_FMT_FLAG_PLANAR,
2598  },
2599  [AV_PIX_FMT_P416BE] = {
2600  .name = "p416be",
2601  .nb_components = 3,
2602  .log2_chroma_w = 0,
2603  .log2_chroma_h = 0,
2604  .comp = {
2605  { 0, 2, 0, 0, 16 }, /* Y */
2606  { 1, 4, 0, 0, 16 }, /* U */
2607  { 1, 4, 2, 0, 16 }, /* V */
2608  },
2610  },
2611  [AV_PIX_FMT_P416LE] = {
2612  .name = "p416le",
2613  .nb_components = 3,
2614  .log2_chroma_w = 0,
2615  .log2_chroma_h = 0,
2616  .comp = {
2617  { 0, 2, 0, 0, 16 }, /* Y */
2618  { 1, 4, 0, 0, 16 }, /* U */
2619  { 1, 4, 2, 0, 16 }, /* V */
2620  },
2621  .flags = AV_PIX_FMT_FLAG_PLANAR,
2622  },
2623  [AV_PIX_FMT_VUYA] = {
2624  .name = "vuya",
2625  .nb_components = 4,
2626  .log2_chroma_w = 0,
2627  .log2_chroma_h = 0,
2628  .comp = {
2629  { 0, 4, 2, 0, 8 }, /* Y */
2630  { 0, 4, 1, 0, 8 }, /* U */
2631  { 0, 4, 0, 0, 8 }, /* V */
2632  { 0, 4, 3, 0, 8 }, /* A */
2633  },
2634  .flags = AV_PIX_FMT_FLAG_ALPHA,
2635  },
2636  [AV_PIX_FMT_VUYX] = {
2637  .name = "vuyx",
2638  .nb_components = 3,
2639  .log2_chroma_w = 0,
2640  .log2_chroma_h = 0,
2641  .comp = {
2642  { 0, 4, 2, 0, 8 }, /* Y */
2643  { 0, 4, 1, 0, 8 }, /* U */
2644  { 0, 4, 0, 0, 8 }, /* V */
2645  { 0, 4, 3, 0, 8 }, /* X */
2646  },
2647  },
2648  [AV_PIX_FMT_RGBF16BE] = {
2649  .name = "rgbf16be",
2650  .nb_components = 3,
2651  .log2_chroma_w = 0,
2652  .log2_chroma_h = 0,
2653  .comp = {
2654  { 0, 6, 0, 0, 16 }, /* R */
2655  { 0, 6, 2, 0, 16 }, /* G */
2656  { 0, 6, 4, 0, 16 }, /* B */
2657  },
2660  },
2661  [AV_PIX_FMT_RGBF16LE] = {
2662  .name = "rgbf16le",
2663  .nb_components = 3,
2664  .log2_chroma_w = 0,
2665  .log2_chroma_h = 0,
2666  .comp = {
2667  { 0, 6, 0, 0, 16 }, /* R */
2668  { 0, 6, 2, 0, 16 }, /* G */
2669  { 0, 6, 4, 0, 16 }, /* B */
2670  },
2672  },
2673  [AV_PIX_FMT_RGBAF16BE] = {
2674  .name = "rgbaf16be",
2675  .nb_components = 4,
2676  .log2_chroma_w = 0,
2677  .log2_chroma_h = 0,
2678  .comp = {
2679  { 0, 8, 0, 0, 16 }, /* R */
2680  { 0, 8, 2, 0, 16 }, /* G */
2681  { 0, 8, 4, 0, 16 }, /* B */
2682  { 0, 8, 6, 0, 16 }, /* A */
2683  },
2686  },
2687  [AV_PIX_FMT_RGBAF16LE] = {
2688  .name = "rgbaf16le",
2689  .nb_components = 4,
2690  .log2_chroma_w = 0,
2691  .log2_chroma_h = 0,
2692  .comp = {
2693  { 0, 8, 0, 0, 16 }, /* R */
2694  { 0, 8, 2, 0, 16 }, /* G */
2695  { 0, 8, 4, 0, 16 }, /* B */
2696  { 0, 8, 6, 0, 16 }, /* A */
2697  },
2700  },
2701  [AV_PIX_FMT_Y212LE] = {
2702  .name = "y212le",
2703  .nb_components = 3,
2704  .log2_chroma_w = 1,
2705  .log2_chroma_h = 0,
2706  .comp = {
2707  { 0, 4, 0, 4, 12 }, /* Y */
2708  { 0, 8, 2, 4, 12 }, /* U */
2709  { 0, 8, 6, 4, 12 }, /* V */
2710  },
2711  },
2712  [AV_PIX_FMT_Y212BE] = {
2713  .name = "y212be",
2714  .nb_components = 3,
2715  .log2_chroma_w = 1,
2716  .log2_chroma_h = 0,
2717  .comp = {
2718  { 0, 4, 0, 4, 12 }, /* Y */
2719  { 0, 8, 2, 4, 12 }, /* U */
2720  { 0, 8, 6, 4, 12 }, /* V */
2721  },
2722  .flags = AV_PIX_FMT_FLAG_BE,
2723  },
2724  [AV_PIX_FMT_XV30LE] = {
2725  .name = "xv30le",
2726  .nb_components= 3,
2727  .log2_chroma_w= 0,
2728  .log2_chroma_h= 0,
2729  .comp = {
2730  { 0, 4, 1, 2, 10 }, /* Y */
2731  { 0, 4, 0, 0, 10 }, /* U */
2732  { 0, 4, 2, 4, 10 }, /* V */
2733  { 0, 4, 3, 6, 2 }, /* X */
2734  },
2735  },
2736  [AV_PIX_FMT_XV30BE] = {
2737  .name = "xv30be",
2738  .nb_components= 3,
2739  .log2_chroma_w= 0,
2740  .log2_chroma_h= 0,
2741  .comp = {
2742  { 0, 32, 10, 0, 10 }, /* Y */
2743  { 0, 32, 0, 0, 10 }, /* U */
2744  { 0, 32, 20, 0, 10 }, /* V */
2745  { 0, 32, 30, 0, 2 }, /* X */
2746  },
2748  },
2749  [AV_PIX_FMT_XV36LE] = {
2750  .name = "xv36le",
2751  .nb_components= 3,
2752  .log2_chroma_w= 0,
2753  .log2_chroma_h= 0,
2754  .comp = {
2755  { 0, 8, 2, 4, 12 }, /* Y */
2756  { 0, 8, 0, 4, 12 }, /* U */
2757  { 0, 8, 4, 4, 12 }, /* V */
2758  { 0, 8, 6, 4, 12 }, /* X */
2759  },
2760  },
2761  [AV_PIX_FMT_XV36BE] = {
2762  .name = "xv36be",
2763  .nb_components= 3,
2764  .log2_chroma_w= 0,
2765  .log2_chroma_h= 0,
2766  .comp = {
2767  { 0, 8, 2, 4, 12 }, /* Y */
2768  { 0, 8, 0, 4, 12 }, /* U */
2769  { 0, 8, 4, 4, 12 }, /* V */
2770  { 0, 8, 6, 4, 12 }, /* X */
2771  },
2772  .flags = AV_PIX_FMT_FLAG_BE,
2773  },
2774  [AV_PIX_FMT_XV48LE] = {
2775  .name = "xv48le",
2776  .nb_components = 3,
2777  .log2_chroma_w = 0,
2778  .log2_chroma_h = 0,
2779  .comp = {
2780  { 0, 8, 2, 0, 16 }, /* Y */
2781  { 0, 8, 0, 0, 16 }, /* U */
2782  { 0, 8, 4, 0, 16 }, /* V */
2783  { 0, 8, 6, 0, 16 }, /* X */
2784  },
2785  },
2786  [AV_PIX_FMT_XV48BE] = {
2787  .name = "xv48be",
2788  .nb_components = 3,
2789  .log2_chroma_w = 0,
2790  .log2_chroma_h = 0,
2791  .comp = {
2792  { 0, 8, 2, 0, 16 }, /* Y */
2793  { 0, 8, 0, 0, 16 }, /* U */
2794  { 0, 8, 4, 0, 16 }, /* V */
2795  { 0, 8, 6, 0, 16 }, /* X */
2796  },
2797  .flags = AV_PIX_FMT_FLAG_BE,
2798  },
2799  [AV_PIX_FMT_V30XLE] = {
2800  .name = "v30xle",
2801  .nb_components = 3,
2802  .log2_chroma_w = 0,
2803  .log2_chroma_h = 0,
2804  .comp = {
2805  { 0, 4, 1, 4, 10 }, /* Y */
2806  { 0, 4, 0, 2, 10 }, /* U */
2807  { 0, 4, 2, 6, 10 }, /* V */
2808  { 0, 4, 0, 0, 2 }, /* X */
2809  },
2810  },
2811  [AV_PIX_FMT_V30XBE] = {
2812  .name = "v30xbe",
2813  .nb_components= 3,
2814  .log2_chroma_w= 0,
2815  .log2_chroma_h= 0,
2816  .comp = {
2817  { 0, 32, 12, 0, 10 }, /* Y */
2818  { 0, 32, 2, 0, 10 }, /* U */
2819  { 0, 32, 22, 0, 10 }, /* V */
2820  { 0, 32, 0, 0, 2 }, /* X */
2821  },
2823  },
2824  [AV_PIX_FMT_RGBF32BE] = {
2825  .name = "rgbf32be",
2826  .nb_components = 3,
2827  .log2_chroma_w = 0,
2828  .log2_chroma_h = 0,
2829  .comp = {
2830  { 0, 12, 0, 0, 32 }, /* R */
2831  { 0, 12, 4, 0, 32 }, /* G */
2832  { 0, 12, 8, 0, 32 }, /* B */
2833  },
2836  },
2837  [AV_PIX_FMT_RGBF32LE] = {
2838  .name = "rgbf32le",
2839  .nb_components = 3,
2840  .log2_chroma_w = 0,
2841  .log2_chroma_h = 0,
2842  .comp = {
2843  { 0, 12, 0, 0, 32 }, /* R */
2844  { 0, 12, 4, 0, 32 }, /* G */
2845  { 0, 12, 8, 0, 32 }, /* B */
2846  },
2848  },
2849  [AV_PIX_FMT_RGB96BE] = {
2850  .name = "rgb96be",
2851  .nb_components = 3,
2852  .log2_chroma_w = 0,
2853  .log2_chroma_h = 0,
2854  .comp = {
2855  { 0, 12, 0, 0, 32 }, /* R */
2856  { 0, 12, 4, 0, 32 }, /* G */
2857  { 0, 12, 8, 0, 32 }, /* B */
2858  },
2860  },
2861  [AV_PIX_FMT_RGB96LE] = {
2862  .name = "rgb96le",
2863  .nb_components = 3,
2864  .log2_chroma_w = 0,
2865  .log2_chroma_h = 0,
2866  .comp = {
2867  { 0, 12, 0, 0, 32 }, /* R */
2868  { 0, 12, 4, 0, 32 }, /* G */
2869  { 0, 12, 8, 0, 32 }, /* B */
2870  },
2871  .flags = AV_PIX_FMT_FLAG_RGB,
2872  },
2873  [AV_PIX_FMT_RGBAF32BE] = {
2874  .name = "rgbaf32be",
2875  .nb_components = 4,
2876  .log2_chroma_w = 0,
2877  .log2_chroma_h = 0,
2878  .comp = {
2879  { 0, 16, 0, 0, 32 }, /* R */
2880  { 0, 16, 4, 0, 32 }, /* G */
2881  { 0, 16, 8, 0, 32 }, /* B */
2882  { 0, 16, 12, 0, 32 }, /* A */
2883  },
2886  },
2887  [AV_PIX_FMT_RGBAF32LE] = {
2888  .name = "rgbaf32le",
2889  .nb_components = 4,
2890  .log2_chroma_w = 0,
2891  .log2_chroma_h = 0,
2892  .comp = {
2893  { 0, 16, 0, 0, 32 }, /* R */
2894  { 0, 16, 4, 0, 32 }, /* G */
2895  { 0, 16, 8, 0, 32 }, /* B */
2896  { 0, 16, 12, 0, 32 }, /* A */
2897  },
2900  },
2901  [AV_PIX_FMT_RGBA128BE] = {
2902  .name = "rgba128be",
2903  .nb_components = 4,
2904  .log2_chroma_w = 0,
2905  .log2_chroma_h = 0,
2906  .comp = {
2907  { 0, 16, 0, 0, 32 }, /* R */
2908  { 0, 16, 4, 0, 32 }, /* G */
2909  { 0, 16, 8, 0, 32 }, /* B */
2910  { 0, 16, 12, 0, 32 }, /* A */
2911  },
2914  },
2915  [AV_PIX_FMT_RGBA128LE] = {
2916  .name = "rgba128le",
2917  .nb_components = 4,
2918  .log2_chroma_w = 0,
2919  .log2_chroma_h = 0,
2920  .comp = {
2921  { 0, 16, 0, 0, 32 }, /* R */
2922  { 0, 16, 4, 0, 32 }, /* G */
2923  { 0, 16, 8, 0, 32 }, /* B */
2924  { 0, 16, 12, 0, 32 }, /* A */
2925  },
2927  },
2928  [AV_PIX_FMT_P212BE] = {
2929  .name = "p212be",
2930  .nb_components = 3,
2931  .log2_chroma_w = 1,
2932  .log2_chroma_h = 0,
2933  .comp = {
2934  { 0, 2, 0, 4, 12 }, /* Y */
2935  { 1, 4, 0, 4, 12 }, /* U */
2936  { 1, 4, 2, 4, 12 }, /* V */
2937  },
2939  },
2940  [AV_PIX_FMT_P212LE] = {
2941  .name = "p212le",
2942  .nb_components = 3,
2943  .log2_chroma_w = 1,
2944  .log2_chroma_h = 0,
2945  .comp = {
2946  { 0, 2, 0, 4, 12 }, /* Y */
2947  { 1, 4, 0, 4, 12 }, /* U */
2948  { 1, 4, 2, 4, 12 }, /* V */
2949  },
2950  .flags = AV_PIX_FMT_FLAG_PLANAR,
2951  },
2952  [AV_PIX_FMT_P412BE] = {
2953  .name = "p412be",
2954  .nb_components = 3,
2955  .log2_chroma_w = 0,
2956  .log2_chroma_h = 0,
2957  .comp = {
2958  { 0, 2, 0, 4, 12 }, /* Y */
2959  { 1, 4, 0, 4, 12 }, /* U */
2960  { 1, 4, 2, 4, 12 }, /* V */
2961  },
2963  },
2964  [AV_PIX_FMT_P412LE] = {
2965  .name = "p412le",
2966  .nb_components = 3,
2967  .log2_chroma_w = 0,
2968  .log2_chroma_h = 0,
2969  .comp = {
2970  { 0, 2, 0, 4, 12 }, /* Y */
2971  { 1, 4, 0, 4, 12 }, /* U */
2972  { 1, 4, 2, 4, 12 }, /* V */
2973  },
2974  .flags = AV_PIX_FMT_FLAG_PLANAR,
2975  },
2976  [AV_PIX_FMT_Y216LE] = {
2977  .name = "y216le",
2978  .nb_components = 3,
2979  .log2_chroma_w = 1,
2980  .log2_chroma_h = 0,
2981  .comp = {
2982  { 0, 4, 0, 0, 16 }, /* Y */
2983  { 0, 8, 2, 0, 16 }, /* U */
2984  { 0, 8, 6, 0, 16 }, /* V */
2985  },
2986  },
2987  [AV_PIX_FMT_Y216BE] = {
2988  .name = "y216be",
2989  .nb_components = 3,
2990  .log2_chroma_w = 1,
2991  .log2_chroma_h = 0,
2992  .comp = {
2993  { 0, 4, 0, 0, 16 }, /* Y */
2994  { 0, 8, 2, 0, 16 }, /* U */
2995  { 0, 8, 6, 0, 16 }, /* V */
2996  },
2997  .flags = AV_PIX_FMT_FLAG_BE,
2998  },
2999 };
3000 
3001 static const char * const color_range_names[] = {
3002  [AVCOL_RANGE_UNSPECIFIED] = "unknown",
3003  [AVCOL_RANGE_MPEG] = "tv",
3004  [AVCOL_RANGE_JPEG] = "pc",
3005 };
3006 
3007 static const char * const color_primaries_names[AVCOL_PRI_NB] = {
3008  [AVCOL_PRI_RESERVED0] = "reserved",
3009  [AVCOL_PRI_BT709] = "bt709",
3010  [AVCOL_PRI_UNSPECIFIED] = "unknown",
3011  [AVCOL_PRI_RESERVED] = "reserved",
3012  [AVCOL_PRI_BT470M] = "bt470m",
3013  [AVCOL_PRI_BT470BG] = "bt470bg",
3014  [AVCOL_PRI_SMPTE170M] = "smpte170m",
3015  [AVCOL_PRI_SMPTE240M] = "smpte240m",
3016  [AVCOL_PRI_FILM] = "film",
3017  [AVCOL_PRI_BT2020] = "bt2020",
3018  [AVCOL_PRI_SMPTE428] = "smpte428",
3019  [AVCOL_PRI_SMPTE431] = "smpte431",
3020  [AVCOL_PRI_SMPTE432] = "smpte432",
3021  [AVCOL_PRI_EBU3213] = "ebu3213",
3022 };
3023 
3024 static const char * const color_transfer_names[] = {
3025  [AVCOL_TRC_RESERVED0] = "reserved",
3026  [AVCOL_TRC_BT709] = "bt709",
3027  [AVCOL_TRC_UNSPECIFIED] = "unknown",
3028  [AVCOL_TRC_RESERVED] = "reserved",
3029  [AVCOL_TRC_GAMMA22] = "bt470m",
3030  [AVCOL_TRC_GAMMA28] = "bt470bg",
3031  [AVCOL_TRC_SMPTE170M] = "smpte170m",
3032  [AVCOL_TRC_SMPTE240M] = "smpte240m",
3033  [AVCOL_TRC_LINEAR] = "linear",
3034  [AVCOL_TRC_LOG] = "log100",
3035  [AVCOL_TRC_LOG_SQRT] = "log316",
3036  [AVCOL_TRC_IEC61966_2_4] = "iec61966-2-4",
3037  [AVCOL_TRC_BT1361_ECG] = "bt1361e",
3038  [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1",
3039  [AVCOL_TRC_BT2020_10] = "bt2020-10",
3040  [AVCOL_TRC_BT2020_12] = "bt2020-12",
3041  [AVCOL_TRC_SMPTE2084] = "smpte2084",
3042  [AVCOL_TRC_SMPTE428] = "smpte428",
3043  [AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
3044 };
3045 
3046 static const char * const color_space_names[] = {
3047  [AVCOL_SPC_RGB] = "gbr",
3048  [AVCOL_SPC_BT709] = "bt709",
3049  [AVCOL_SPC_UNSPECIFIED] = "unknown",
3050  [AVCOL_SPC_RESERVED] = "reserved",
3051  [AVCOL_SPC_FCC] = "fcc",
3052  [AVCOL_SPC_BT470BG] = "bt470bg",
3053  [AVCOL_SPC_SMPTE170M] = "smpte170m",
3054  [AVCOL_SPC_SMPTE240M] = "smpte240m",
3055  [AVCOL_SPC_YCGCO] = "ycgco",
3056  [AVCOL_SPC_BT2020_NCL] = "bt2020nc",
3057  [AVCOL_SPC_BT2020_CL] = "bt2020c",
3058  [AVCOL_SPC_SMPTE2085] = "smpte2085",
3059  [AVCOL_SPC_CHROMA_DERIVED_NCL] = "chroma-derived-nc",
3060  [AVCOL_SPC_CHROMA_DERIVED_CL] = "chroma-derived-c",
3061  [AVCOL_SPC_ICTCP] = "ictcp",
3062  [AVCOL_SPC_IPT_C2] = "ipt-c2",
3063  [AVCOL_SPC_YCGCO_RE] = "ycgco-re",
3064  [AVCOL_SPC_YCGCO_RO] = "ycgco-ro",
3065 };
3066 
3067 static const char * const chroma_location_names[] = {
3068  [AVCHROMA_LOC_UNSPECIFIED] = "unspecified",
3069  [AVCHROMA_LOC_LEFT] = "left",
3070  [AVCHROMA_LOC_CENTER] = "center",
3071  [AVCHROMA_LOC_TOPLEFT] = "topleft",
3072  [AVCHROMA_LOC_TOP] = "top",
3073  [AVCHROMA_LOC_BOTTOMLEFT] = "bottomleft",
3074  [AVCHROMA_LOC_BOTTOM] = "bottom",
3075 };
3076 
3077 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
3078 {
3079  enum AVPixelFormat pix_fmt;
3080 
3081  for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
3083  (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
3085  return pix_fmt;
3086 
3087  return AV_PIX_FMT_NONE;
3088 }
3089 
3091 {
3092  return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
3094 }
3095 
3096 #if HAVE_BIGENDIAN
3097 # define X_NE(be, le) be
3098 #else
3099 # define X_NE(be, le) le
3100 #endif
3101 
3103 {
3104  enum AVPixelFormat pix_fmt;
3105 
3106  if (!strcmp(name, "rgb32"))
3107  name = X_NE("argb", "bgra");
3108  else if (!strcmp(name, "bgr32"))
3109  name = X_NE("abgr", "rgba");
3110 
3112  if (pix_fmt == AV_PIX_FMT_NONE) {
3113  char name2[32];
3114 
3115  snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
3116  pix_fmt = get_pix_fmt_internal(name2);
3117  }
3118 
3119  return pix_fmt;
3120 }
3121 
3123 {
3124  int c, bits = 0;
3125  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
3126 
3127  for (c = 0; c < pixdesc->nb_components; c++) {
3128  int s = c == 1 || c == 2 ? 0 : log2_pixels;
3129  bits += pixdesc->comp[c].depth << s;
3130  }
3131 
3132  return bits >> log2_pixels;
3133 }
3134 
3136 {
3137  int c, bits = 0;
3138  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
3139  int steps[4] = {0};
3140 
3141  for (c = 0; c < pixdesc->nb_components; c++) {
3142  const AVComponentDescriptor *comp = &pixdesc->comp[c];
3143  int s = c == 1 || c == 2 ? 0 : log2_pixels;
3144  steps[comp->plane] = comp->step << s;
3145  }
3146  for (c = 0; c < 4; c++)
3147  bits += steps[c];
3148 
3149  if(!(pixdesc->flags & AV_PIX_FMT_FLAG_BITSTREAM))
3150  bits *= 8;
3151 
3152  return bits >> log2_pixels;
3153 }
3154 
3155 char *av_get_pix_fmt_string(char *buf, int buf_size,
3156  enum AVPixelFormat pix_fmt)
3157 {
3158  /* print header */
3159  if (pix_fmt < 0) {
3160  snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
3161  } else {
3163  snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
3164  pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
3165  }
3166 
3167  return buf;
3168 }
3169 
3171 {
3172  if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
3173  return NULL;
3175 }
3176 
3178 {
3179  if (!prev)
3180  return &av_pix_fmt_descriptors[0];
3182  prev++;
3183  if (prev->name)
3184  return prev;
3185  }
3186  return NULL;
3187 }
3188 
3190 {
3191  if (desc < av_pix_fmt_descriptors ||
3193  return AV_PIX_FMT_NONE;
3194 
3195  return desc - av_pix_fmt_descriptors;
3196 }
3197 
3199  int *h_shift, int *v_shift)
3200 {
3202  if (!desc)
3203  return AVERROR(ENOSYS);
3204  *h_shift = desc->log2_chroma_w;
3205  *v_shift = desc->log2_chroma_h;
3206 
3207  return 0;
3208 }
3209 
3211 {
3213  int i, planes[4] = { 0 }, ret = 0;
3214 
3215  if (!desc)
3216  return AVERROR(EINVAL);
3217 
3218  for (i = 0; i < desc->nb_components; i++)
3219  planes[desc->comp[i].plane] = 1;
3220  for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
3221  ret += planes[i];
3222  return ret;
3223 }
3224 
3226 {
3228  char name[16];
3229  int i;
3230 
3231  if (!desc || strlen(desc->name) < 2)
3232  return AV_PIX_FMT_NONE;
3233  av_strlcpy(name, desc->name, sizeof(name));
3234  i = strlen(name) - 2;
3235  if (strcmp(name + i, "be") && strcmp(name + i, "le"))
3236  return AV_PIX_FMT_NONE;
3237 
3238  name[i] ^= 'b' ^ 'l';
3239 
3240  return get_pix_fmt_internal(name);
3241 }
3242 
3243 #define FF_COLOR_NA -1
3244 #define FF_COLOR_RGB 0 /**< RGB color space */
3245 #define FF_COLOR_GRAY 1 /**< gray color space */
3246 #define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
3247 #define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
3248 #define FF_COLOR_XYZ 4
3249 
3250 #define pixdesc_has_alpha(pixdesc) \
3251  ((pixdesc)->flags & AV_PIX_FMT_FLAG_ALPHA)
3252 
3253 
3255  if (desc->flags & AV_PIX_FMT_FLAG_PAL)
3256  return FF_COLOR_RGB;
3257 
3258  if(desc->nb_components == 1 || desc->nb_components == 2)
3259  return FF_COLOR_GRAY;
3260 
3261  if (desc->name) {
3262  if (av_strstart(desc->name, "yuvj", NULL))
3263  return FF_COLOR_YUV_JPEG;
3264  }
3265 
3266  if(desc->flags & AV_PIX_FMT_FLAG_RGB)
3267  return FF_COLOR_RGB;
3268 
3269  if(desc->flags & AV_PIX_FMT_FLAG_XYZ)
3270  return FF_COLOR_XYZ;
3271 
3272  if(desc->nb_components == 0)
3273  return FF_COLOR_NA;
3274 
3275  return FF_COLOR_YUV;
3276 }
3277 
3278 static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
3279 {
3281  int i;
3282 
3283  if (!desc || !desc->nb_components) {
3284  *min = *max = 0;
3285  return AVERROR(EINVAL);
3286  }
3287 
3288  *min = INT_MAX, *max = -INT_MAX;
3289  for (i = 0; i < desc->nb_components; i++) {
3290  *min = FFMIN(desc->comp[i].depth, *min);
3291  *max = FFMAX(desc->comp[i].depth, *max);
3292  }
3293  return 0;
3294 }
3295 
3296 static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
3297  enum AVPixelFormat src_pix_fmt,
3298  unsigned *lossp, unsigned consider)
3299 {
3300  const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
3301  const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
3302  int src_color, dst_color;
3303  int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
3304  int ret, loss, i, nb_components;
3305  int score = INT_MAX - 1;
3306 
3307  if (!src_desc || !dst_desc)
3308  return -4;
3309 
3310  if ((src_desc->flags & AV_PIX_FMT_FLAG_HWACCEL) ||
3311  (dst_desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
3312  if (dst_pix_fmt == src_pix_fmt)
3313  return -1;
3314  else
3315  return -2;
3316  }
3317 
3318  /* compute loss */
3319  *lossp = loss = 0;
3320 
3321  if (dst_pix_fmt == src_pix_fmt)
3322  return INT_MAX;
3323 
3324  if ((ret = get_pix_fmt_depth(&src_min_depth, &src_max_depth, src_pix_fmt)) < 0)
3325  return -3;
3326  if ((ret = get_pix_fmt_depth(&dst_min_depth, &dst_max_depth, dst_pix_fmt)) < 0)
3327  return -3;
3328 
3329  src_color = get_color_type(src_desc);
3330  dst_color = get_color_type(dst_desc);
3331  if (dst_pix_fmt == AV_PIX_FMT_PAL8)
3332  nb_components = FFMIN(src_desc->nb_components, 4);
3333  else
3334  nb_components = FFMIN(src_desc->nb_components, dst_desc->nb_components);
3335 
3336  for (i = 0; i < nb_components; i++) {
3337  int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : (dst_desc->comp[i].depth - 1);
3338  int depth_delta = src_desc->comp[i].depth - 1 - depth_minus1;
3339  if (depth_delta > 0 && (consider & FF_LOSS_DEPTH)) {
3340  loss |= FF_LOSS_DEPTH;
3341  score -= 65536 >> depth_minus1;
3342  } else if (depth_delta < 0 && (consider & FF_LOSS_EXCESS_DEPTH)) {
3343  // Favour formats where bit depth exactly matches. If all other
3344  // scoring is equal, we'd rather use the bit depth that most closely
3345  // matches the source.
3346  loss |= FF_LOSS_EXCESS_DEPTH;
3347  score += depth_delta;
3348  }
3349  }
3350 
3351  if (consider & FF_LOSS_RESOLUTION) {
3352  if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w) {
3353  loss |= FF_LOSS_RESOLUTION;
3354  score -= 256 << dst_desc->log2_chroma_w;
3355  }
3356  if (dst_desc->log2_chroma_h > src_desc->log2_chroma_h) {
3357  loss |= FF_LOSS_RESOLUTION;
3358  score -= 256 << dst_desc->log2_chroma_h;
3359  }
3360  // don't favor 422 over 420 if downsampling is needed, because 420 has much better support on the decoder side
3361  if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 0 &&
3362  dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 0 ) {
3363  score += 512;
3364  }
3365  }
3366 
3367  if (consider & FF_LOSS_EXCESS_RESOLUTION) {
3368  // Favour formats where chroma subsampling exactly matches. If all other
3369  // scoring is equal, we'd rather use the subsampling that most closely
3370  // matches the source.
3371  if (dst_desc->log2_chroma_w < src_desc->log2_chroma_w) {
3372  loss |= FF_LOSS_EXCESS_RESOLUTION;
3373  score -= 1 << (src_desc->log2_chroma_w - dst_desc->log2_chroma_w);
3374  }
3375 
3376  if (dst_desc->log2_chroma_h < src_desc->log2_chroma_h) {
3377  loss |= FF_LOSS_EXCESS_RESOLUTION;
3378  score -= 1 << (src_desc->log2_chroma_h - dst_desc->log2_chroma_h);
3379  }
3380 
3381  // don't favour 411 over 420, because 420 has much better support on the
3382  // decoder side.
3383  if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 2 &&
3384  dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 2) {
3385  score += 4;
3386  }
3387  }
3388 
3389  if(consider & FF_LOSS_COLORSPACE)
3390  switch(dst_color) {
3391  case FF_COLOR_RGB:
3392  if (src_color != FF_COLOR_RGB &&
3393  src_color != FF_COLOR_GRAY)
3394  loss |= FF_LOSS_COLORSPACE;
3395  break;
3396  case FF_COLOR_GRAY:
3397  if (src_color != FF_COLOR_GRAY)
3398  loss |= FF_LOSS_COLORSPACE;
3399  break;
3400  case FF_COLOR_YUV:
3401  if (src_color != FF_COLOR_YUV)
3402  loss |= FF_LOSS_COLORSPACE;
3403  break;
3404  case FF_COLOR_YUV_JPEG:
3405  if (src_color != FF_COLOR_YUV_JPEG &&
3406  src_color != FF_COLOR_YUV &&
3407  src_color != FF_COLOR_GRAY)
3408  loss |= FF_LOSS_COLORSPACE;
3409  break;
3410  default:
3411  /* fail safe test */
3412  if (src_color != dst_color)
3413  loss |= FF_LOSS_COLORSPACE;
3414  break;
3415  }
3416  if(loss & FF_LOSS_COLORSPACE)
3417  score -= (nb_components * 65536) >> FFMIN(dst_desc->comp[0].depth - 1, src_desc->comp[0].depth - 1);
3418 
3419  if (dst_color == FF_COLOR_GRAY &&
3420  src_color != FF_COLOR_GRAY && (consider & FF_LOSS_CHROMA)) {
3421  loss |= FF_LOSS_CHROMA;
3422  score -= 2 * 65536;
3423  }
3424  if (!pixdesc_has_alpha(dst_desc) && (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))) {
3425  loss |= FF_LOSS_ALPHA;
3426  score -= 65536;
3427  }
3428  if (dst_pix_fmt == AV_PIX_FMT_PAL8 && (consider & FF_LOSS_COLORQUANT) &&
3429  (src_pix_fmt != AV_PIX_FMT_PAL8 && (src_color != FF_COLOR_GRAY || (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))))) {
3430  loss |= FF_LOSS_COLORQUANT;
3431  score -= 65536;
3432  }
3433 
3434  *lossp = loss;
3435  return score;
3436 }
3437 
3438 int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
3439  enum AVPixelFormat src_pix_fmt,
3440  int has_alpha)
3441 {
3442  int loss;
3443  int ret = get_pix_fmt_score(dst_pix_fmt, src_pix_fmt, &loss, has_alpha ? ~0 : ~FF_LOSS_ALPHA);
3444  if (ret < 0)
3445  return ret;
3446  return loss;
3447 }
3448 
3449 enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
3450  enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
3451 {
3452  enum AVPixelFormat dst_pix_fmt;
3453  int loss1, loss2, loss_mask;
3454  const AVPixFmtDescriptor *desc1 = av_pix_fmt_desc_get(dst_pix_fmt1);
3455  const AVPixFmtDescriptor *desc2 = av_pix_fmt_desc_get(dst_pix_fmt2);
3456  int score1, score2;
3457 
3458  if (!desc1) {
3459  dst_pix_fmt = dst_pix_fmt2;
3460  } else if (!desc2) {
3461  dst_pix_fmt = dst_pix_fmt1;
3462  } else {
3463  loss_mask= loss_ptr?~*loss_ptr:~0; /* use loss mask if provided */
3464  if(!has_alpha)
3465  loss_mask &= ~FF_LOSS_ALPHA;
3466 
3467  score1 = get_pix_fmt_score(dst_pix_fmt1, src_pix_fmt, &loss1, loss_mask);
3468  score2 = get_pix_fmt_score(dst_pix_fmt2, src_pix_fmt, &loss2, loss_mask);
3469 
3470  if (score1 == score2) {
3472  dst_pix_fmt = av_get_padded_bits_per_pixel(desc2) < av_get_padded_bits_per_pixel(desc1) ? dst_pix_fmt2 : dst_pix_fmt1;
3473  } else {
3474  dst_pix_fmt = desc2->nb_components < desc1->nb_components ? dst_pix_fmt2 : dst_pix_fmt1;
3475  }
3476  } else {
3477  dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
3478  }
3479  }
3480 
3481  if (loss_ptr)
3482  *loss_ptr = av_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
3483  return dst_pix_fmt;
3484 }
3485 
3487 {
3488  return (unsigned) range < AVCOL_RANGE_NB ?
3490 }
3491 
3493 {
3494  int i;
3495 
3496  for (i = 0; i < FF_ARRAY_ELEMS(color_range_names); i++) {
3498  return i;
3499  }
3500 
3501  return AVERROR(EINVAL);
3502 }
3503 
3505 {
3506  return (unsigned) primaries < AVCOL_PRI_NB ?
3508 }
3509 
3511 {
3512  int i;
3513 
3514  for (i = 0; i < FF_ARRAY_ELEMS(color_primaries_names); i++) {
3515  if (!color_primaries_names[i])
3516  continue;
3517 
3519  return i;
3520  }
3521 
3522  return AVERROR(EINVAL);
3523 }
3524 
3526 {
3527  return (unsigned) transfer < AVCOL_TRC_NB ?
3529 }
3530 
3532 {
3533  int i;
3534 
3535  for (i = 0; i < FF_ARRAY_ELEMS(color_transfer_names); i++) {
3536  if (!color_transfer_names[i])
3537  continue;
3538 
3540  return i;
3541  }
3542 
3543  return AVERROR(EINVAL);
3544 }
3545 
3547 {
3548  return (unsigned) space < AVCOL_SPC_NB ?
3550 }
3551 
3553 {
3554  int i;
3555 
3556  for (i = 0; i < FF_ARRAY_ELEMS(color_space_names); i++) {
3557  if (!color_space_names[i])
3558  continue;
3559 
3561  return i;
3562  }
3563 
3564  return AVERROR(EINVAL);
3565 }
3566 
3567 const char *av_chroma_location_name(enum AVChromaLocation location)
3568 {
3569  return (unsigned) location < AVCHROMA_LOC_NB ?
3570  chroma_location_names[location] : NULL;
3571 }
3572 
3574 {
3575  int i;
3576 
3577  for (i = 0; i < FF_ARRAY_ELEMS(chroma_location_names); i++) {
3578  if (!chroma_location_names[i])
3579  continue;
3580 
3582  return i;
3583  }
3584 
3585  return AVERROR(EINVAL);
3586 }
3587 
3588 int av_chroma_location_enum_to_pos(int *xpos, int *ypos, enum AVChromaLocation pos)
3589 {
3590  if (pos <= AVCHROMA_LOC_UNSPECIFIED || pos >= AVCHROMA_LOC_NB)
3591  return AVERROR(EINVAL);
3592  pos--;
3593 
3594  *xpos = (pos&1) * 128;
3595  *ypos = ((pos>>1)^(pos<4)) * 128;
3596 
3597  return 0;
3598 }
3599 
3601 {
3602  int pos, xout, yout;
3603 
3604  for (pos = AVCHROMA_LOC_UNSPECIFIED + 1; pos < AVCHROMA_LOC_NB; pos++) {
3605  if (av_chroma_location_enum_to_pos(&xout, &yout, pos) == 0 && xout == xpos && yout == ypos)
3606  return pos;
3607  }
3608  return AVCHROMA_LOC_UNSPECIFIED;
3609 }
AVCOL_PRI_RESERVED
@ AVCOL_PRI_RESERVED
Definition: pixfmt.h:590
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:196
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:3225
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:154
AV_PIX_FMT_XV30LE
@ AV_PIX_FMT_XV30LE
packed XVYU 4:4:4, 32bpp, (msb)2X 10V 10Y 10U(lsb), little-endian, variant of Y410 where alpha channe...
Definition: pixfmt.h:415
AV_PIX_FMT_CUDA
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
Definition: pixfmt.h:260
AV_PIX_FMT_GRAY10BE
@ AV_PIX_FMT_GRAY10BE
Y , 10bpp, big-endian.
Definition: pixfmt.h:320
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
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:293
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:146
AVCOL_PRI_EBU3213
@ AVCOL_PRI_EBU3213
EBU Tech. 3213-E (nothing there) / one of JEDEC P22 group phosphors.
Definition: pixfmt.h:602
AV_PIX_FMT_P416BE
@ AV_PIX_FMT_P416BE
interleaved chroma YUV 4:4:4, 48bpp, big-endian
Definition: pixfmt.h:398
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:140
FF_LOSS_CHROMA
#define FF_LOSS_CHROMA
loss of chroma (e.g.
Definition: pixdesc.h:392
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:204
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:422
AVColorTransferCharacteristic
AVColorTransferCharacteristic
Color Transfer Characteristic.
Definition: pixfmt.h:611
comp
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
Definition: eamad.c:81
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:136
AV_PIX_FMT_GBRP16BE
@ AV_PIX_FMT_GBRP16BE
planar GBR 4:4:4 48bpp, big-endian
Definition: pixfmt.h:171
AVCOL_SPC_YCGCO_RE
@ AVCOL_SPC_YCGCO_RE
YCgCo-R, even addition of bits.
Definition: pixfmt.h:658
AV_PIX_FMT_GBRP10BE
@ AV_PIX_FMT_GBRP10BE
planar GBR 4:4:4 30bpp, big-endian
Definition: pixfmt.h:169
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:3170
AVCOL_TRC_LINEAR
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
Definition: pixfmt.h:620
AVCHROMA_LOC_BOTTOM
@ AVCHROMA_LOC_BOTTOM
Definition: pixfmt.h:743
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:274
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:252
AV_PIX_FMT_RGBF16LE
@ AV_PIX_FMT_RGBF16LE
IEEE-754 half precision packed RGB 16:16:16, 48bpp, RGBRGB..., little-endian.
Definition: pixfmt.h:452
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:195
mask
int mask
Definition: mediacodecdec_common.c:154
av_pix_fmt_descriptors
static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB]
Definition: pixdesc.c:203
av_color_space_from_name
int av_color_space_from_name(const char *name)
Definition: pixdesc.c:3552
AVCOL_TRC_NB
@ AVCOL_TRC_NB
Not part of ABI.
Definition: pixfmt.h:633
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:185
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:202
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:301
AV_PIX_FMT_GBRAPF32LE
@ AV_PIX_FMT_GBRAPF32LE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, little-endian.
Definition: pixfmt.h:344
av_color_range_from_name
int av_color_range_from_name(const char *name)
Definition: pixdesc.c:3492
w
uint8_t w
Definition: llviddspenc.c:38
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:717
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:387
AV_PIX_FMT_GBRPF32BE
@ AV_PIX_FMT_GBRPF32BE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, big-endian.
Definition: pixfmt.h:341
AV_PIX_FMT_DRM_PRIME
@ AV_PIX_FMT_DRM_PRIME
DRM-managed buffers exposed through PRIME buffer sharing.
Definition: pixfmt.h:351
AVComponentDescriptor::depth
int depth
Number of bits in the component.
Definition: pixdesc.h:57
AV_PIX_FMT_P412BE
@ AV_PIX_FMT_P412BE
interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, big-endian
Definition: pixfmt.h:429
AVPixFmtDescriptor::name
const char * name
Definition: pixdesc.h:70
AVCOL_SPC_NB
@ AVCOL_SPC_NB
Not part of ABI.
Definition: pixfmt.h:660
AVCOL_TRC_UNSPECIFIED
@ AVCOL_TRC_UNSPECIFIED
Definition: pixfmt.h:614
data
const char data[16]
Definition: mxf.c:149
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:308
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:82
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:3177
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:269
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:128
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:254
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:641
AVCOL_TRC_BT2020_12
@ AVCOL_TRC_BT2020_12
ITU-R BT2020 for 12-bit system.
Definition: pixfmt.h:627
AV_PIX_FMT_GBRP14BE
@ AV_PIX_FMT_GBRP14BE
planar GBR 4:4:4 42bpp, big-endian
Definition: pixfmt.h:281
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:76
AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:102
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:3122
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:106
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:3155
AVColorPrimaries
AVColorPrimaries
Chromaticity coordinates of the source primaries.
Definition: pixfmt.h:586
FF_COLOR_GRAY
#define FF_COLOR_GRAY
gray color space
Definition: pixdesc.c:3245
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:163
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:179
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:296
AV_PIX_FMT_GRAY10LE
@ AV_PIX_FMT_GRAY10LE
Y , 10bpp, little-endian.
Definition: pixfmt.h:321
AV_PIX_FMT_GRAYF32LE
@ AV_PIX_FMT_GRAYF32LE
IEEE-754 single precision Y, 32bpp, little-endian.
Definition: pixfmt.h:364
AV_PIX_FMT_GBRAP14BE
@ AV_PIX_FMT_GBRAP14BE
planar GBR 4:4:4:4 56bpp, big-endian
Definition: pixfmt.h:432
AVCOL_SPC_BT2020_CL
@ AVCOL_SPC_BT2020_CL
ITU-R BT2020 constant luminance system.
Definition: pixfmt.h:652
av_chroma_location_name
const char * av_chroma_location_name(enum AVChromaLocation location)
Definition: pixdesc.c:3567
AV_PIX_FMT_VULKAN
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition: pixfmt.h:379
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:114
AV_PIX_FMT_RGBAF16LE
@ AV_PIX_FMT_RGBAF16LE
IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., little-endian.
Definition: pixfmt.h:404
FF_LOSS_EXCESS_RESOLUTION
#define FF_LOSS_EXCESS_RESOLUTION
loss due to unneeded extra resolution
Definition: pixdesc.h:393
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:302
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:132
FF_LOSS_ALPHA
#define FF_LOSS_ALPHA
loss of alpha bits
Definition: pixdesc.h:390
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:294
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:303
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:466
FF_LOSS_EXCESS_DEPTH
#define FF_LOSS_EXCESS_DEPTH
loss due to unneeded extra color depth
Definition: pixdesc.h:394
planes
static const struct @466 planes[]
AV_PIX_FMT_GBRAP12LE
@ AV_PIX_FMT_GBRAP12LE
planar GBR 4:4:4:4 48bpp, little-endian
Definition: pixfmt.h:311
AV_PIX_FMT_GRAY16BE
@ AV_PIX_FMT_GRAY16BE
Y , 16bpp, big-endian.
Definition: pixfmt.h:104
primaries
enum AVColorPrimaries primaries
Definition: mediacodec_wrapper.c:2612
av_pix_fmt_count_planes
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:3210
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:646
av_chroma_location_from_name
int av_chroma_location_from_name(const char *name)
Definition: pixdesc.c:3573
AVCOL_SPC_RESERVED
@ AVCOL_SPC_RESERVED
reserved for future use by ITU-T and ISO/IEC just like 15-255 are
Definition: pixfmt.h:644
AV_PIX_FMT_RGB96BE
@ AV_PIX_FMT_RGB96BE
packed RGBA 32:32:32, 96bpp, RGBRGB..., big-endian
Definition: pixfmt.h:457
AVCOL_TRC_IEC61966_2_1
@ AVCOL_TRC_IEC61966_2_1
IEC 61966-2-1 (sRGB or sYCC)
Definition: pixfmt.h:625
AV_PIX_FMT_Y212BE
@ AV_PIX_FMT_Y212BE
packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits,...
Definition: pixfmt.h:411
av_color_space_name
const char * av_color_space_name(enum AVColorSpace space)
Definition: pixdesc.c:3546
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:212
AV_PIX_FMT_RGBA128BE
@ AV_PIX_FMT_RGBA128BE
packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., big-endian
Definition: pixfmt.h:454
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:268
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:339
AVCOL_RANGE_NB
@ AVCOL_RANGE_NB
Not part of ABI.
Definition: pixfmt.h:718
AVCOL_TRC_GAMMA28
@ AVCOL_TRC_GAMMA28
also ITU-R BT470BG
Definition: pixfmt.h:617
av_color_transfer_from_name
int av_color_transfer_from_name(const char *name)
Definition: pixdesc.c:3531
val
static double val(void *priv, double ch)
Definition: aeval.c:77
av_pix_fmt_get_chroma_sub_sample
int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor.
Definition: pixdesc.c:3198
chroma_location_names
static const char *const chroma_location_names[]
Definition: pixdesc.c:3067
AVCOL_TRC_LOG_SQRT
@ AVCOL_TRC_LOG_SQRT
"Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)"
Definition: pixfmt.h:622
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:191
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:161
AVCOL_TRC_GAMMA22
@ AVCOL_TRC_GAMMA22
also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
Definition: pixfmt.h:616
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:156
AV_PIX_FMT_VUYA
@ AV_PIX_FMT_VUYA
packed VUYA 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), VUYAVUYA...
Definition: pixfmt.h:401
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:276
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:283
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:271
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:278
AV_PIX_FMT_BGR8
@ AV_PIX_FMT_BGR8
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
Definition: pixfmt.h:90
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:292
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
AVCOL_PRI_RESERVED0
@ AVCOL_PRI_RESERVED0
Definition: pixfmt.h:587
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:86
AV_PIX_FMT_GBRAP16BE
@ AV_PIX_FMT_GBRAP16BE
planar GBRA 4:4:4:4 64bpp, big-endian
Definition: pixfmt.h:213
AV_PIX_FMT_RGBA128LE
@ AV_PIX_FMT_RGBA128LE
packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., little-endian
Definition: pixfmt.h:455
intreadwrite.h
AV_PIX_FMT_XV30BE
@ AV_PIX_FMT_XV30BE
packed XVYU 4:4:4, 32bpp, (msb)2X 10V 10Y 10U(lsb), big-endian, variant of Y410 where alpha channel i...
Definition: pixfmt.h:414
AV_PIX_FMT_DXVA2_VLD
@ AV_PIX_FMT_DXVA2_VLD
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer.
Definition: pixfmt.h:134
s
#define s(width, name)
Definition: cbs_vp9.c:198
AV_PIX_FMT_GBRP16LE
@ AV_PIX_FMT_GBRP16LE
planar GBR 4:4:4 48bpp, little-endian
Definition: pixfmt.h:172
AVCHROMA_LOC_TOP
@ AVCHROMA_LOC_TOP
Definition: pixfmt.h:741
av_chroma_location_enum_to_pos
int av_chroma_location_enum_to_pos(int *xpos, int *ypos, enum AVChromaLocation pos)
Converts AVChromaLocation to swscale x/y chroma position.
Definition: pixdesc.c:3588
AVCOL_PRI_NB
@ AVCOL_PRI_NB
Not part of ABI.
Definition: pixfmt.h:604
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:108
AVCOL_TRC_BT1361_ECG
@ AVCOL_TRC_BT1361_ECG
ITU-R BT1361 Extended Colour Gamut.
Definition: pixfmt.h:624
color_space_names
static const char *const color_space_names[]
Definition: pixdesc.c:3046
AV_PIX_FMT_P416LE
@ AV_PIX_FMT_P416LE
interleaved chroma YUV 4:4:4, 48bpp, little-endian
Definition: pixfmt.h:399
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:291
AV_PIX_FMT_P210LE
@ AV_PIX_FMT_P210LE
interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, little-endian
Definition: pixfmt.h:390
AV_PIX_FMT_BAYER_BGGR8
@ AV_PIX_FMT_BAYER_BGGR8
bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples
Definition: pixfmt.h:285
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:647
pix_fmt
static enum AVPixelFormat pix_fmt
Definition: demux_decode.c:41
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:200
AV_PIX_FMT_P016BE
@ AV_PIX_FMT_P016BE
like NV12, with 16bpp per component, big-endian
Definition: pixfmt.h:324
AV_PIX_FMT_RGB96LE
@ AV_PIX_FMT_RGB96LE
packed RGBA 32:32:32, 96bpp, RGBRGB..., little-endian
Definition: pixfmt.h:458
bits
uint8_t bits
Definition: vp3data.h:128
AV_PIX_FMT_GBRP12LE
@ AV_PIX_FMT_GBRP12LE
planar GBR 4:4:4 36bpp, little-endian
Definition: pixfmt.h:280
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:187
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:598
color_range_names
static const char *const color_range_names[]
Definition: pixdesc.c:3001
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:94
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:170
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:73
AVCOL_PRI_SMPTE240M
@ AVCOL_PRI_SMPTE240M
identical to above, also called "SMPTE C" even though it uses D65
Definition: pixfmt.h:595
AVCOL_SPC_IPT_C2
@ AVCOL_SPC_IPT_C2
SMPTE ST 2128, IPT-C2.
Definition: pixfmt.h:657
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:31
AVCOL_PRI_UNSPECIFIED
@ AVCOL_PRI_UNSPECIFIED
Definition: pixfmt.h:589
AV_PIX_FMT_RGBA
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:100
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:87
AVCOL_SPC_CHROMA_DERIVED_CL
@ AVCOL_SPC_CHROMA_DERIVED_CL
Chromaticity-derived constant luminance system.
Definition: pixfmt.h:655
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:593
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:162
AV_PIX_FMT_BAYER_RGGB8
@ AV_PIX_FMT_BAYER_RGGB8
bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples
Definition: pixfmt.h:286
AV_PIX_FMT_MEDIACODEC
@ AV_PIX_FMT_MEDIACODEC
hardware decoding through MediaCodec
Definition: pixfmt.h:316
AVCOL_PRI_SMPTE170M
@ AVCOL_PRI_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: pixfmt.h:594
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:184
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:295
av_color_range_name
const char * av_color_range_name(enum AVColorRange range)
Definition: pixdesc.c:3486
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:159
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:157
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:130
AVCOL_TRC_RESERVED0
@ AVCOL_TRC_RESERVED0
Definition: pixfmt.h:612
AV_PIX_FMT_RGB565LE
@ AV_PIX_FMT_RGB565LE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
Definition: pixfmt.h:113
AV_PIX_FMT_Y216LE
@ AV_PIX_FMT_Y216LE
packed YUV 4:2:2 like YUYV422, 32bpp, little-endian
Definition: pixfmt.h:461
AV_PIX_FMT_GBRAPF32BE
@ AV_PIX_FMT_GBRAPF32BE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, big-endian.
Definition: pixfmt.h:343
AV_PIX_FMT_GBRAP12BE
@ AV_PIX_FMT_GBRAP12BE
planar GBR 4:4:4:4 48bpp, big-endian
Definition: pixfmt.h:310
AV_PIX_FMT_P012LE
@ AV_PIX_FMT_P012LE
like NV12, with 12bpp per component, data in the high bits, zeros in the low bits,...
Definition: pixfmt.h:408
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:401
AVCHROMA_LOC_LEFT
@ AVCHROMA_LOC_LEFT
MPEG-2/4 4:2:0, H.264 default for 4:2:0.
Definition: pixfmt.h:738
AV_PIX_FMT_YUYV422
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:74
FF_LOSS_DEPTH
#define FF_LOSS_DEPTH
loss due to color depth change
Definition: pixdesc.h:388
AVCHROMA_LOC_TOPLEFT
@ AVCHROMA_LOC_TOPLEFT
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
Definition: pixfmt.h:740
AVCOL_TRC_IEC61966_2_4
@ AVCOL_TRC_IEC61966_2_4
IEC 61966-2-4.
Definition: pixfmt.h:623
AV_PIX_FMT_P210BE
@ AV_PIX_FMT_P210BE
interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, big-endian
Definition: pixfmt.h:389
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:110
AV_PIX_FMT_YA16LE
@ AV_PIX_FMT_YA16LE
16 bits gray, 16 bits alpha (little-endian)
Definition: pixfmt.h:210
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:85
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:83
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:367
AVCOL_PRI_BT709
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
Definition: pixfmt.h:588
AV_PIX_FMT_BGR565LE
@ AV_PIX_FMT_BGR565LE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
Definition: pixfmt.h:118
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:203
FF_COLOR_YUV_JPEG
#define FF_COLOR_YUV_JPEG
YUV color space.
Definition: pixdesc.c:3247
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:368
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:180
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:382
av_color_primaries_name
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
Definition: pixdesc.c:3504
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:188
AVCOL_TRC_BT2020_10
@ AVCOL_TRC_BT2020_10
ITU-R BT2020 for 10-bit system.
Definition: pixfmt.h:626
AV_PIX_FMT_RGB8
@ AV_PIX_FMT_RGB8
packed RGB 3:3:2, 8bpp, (msb)3R 3G 2B(lsb)
Definition: pixfmt.h:93
AV_PIX_FMT_BGR0
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:265
AVCOL_SPC_YCGCO
@ AVCOL_SPC_YCGCO
used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
Definition: pixfmt.h:649
AV_PIX_FMT_OPENCL
@ AV_PIX_FMT_OPENCL
Hardware surfaces for OpenCL.
Definition: pixfmt.h:358
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:91
AV_PIX_FMT_D3D12
@ AV_PIX_FMT_D3D12
Hardware surfaces for Direct3D 12.
Definition: pixfmt.h:440
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:298
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
AV_PIX_FMT_QSV
@ AV_PIX_FMT_QSV
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
Definition: pixfmt.h:247
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:119
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:176
av_chroma_location_pos_to_enum
enum AVChromaLocation av_chroma_location_pos_to_enum(int xpos, int ypos)
Converts swscale x/y chroma position to AVChromaLocation.
Definition: pixdesc.c:3600
pixdesc_has_alpha
#define pixdesc_has_alpha(pixdesc)
Definition: pixdesc.c:3250
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:101
AVCOL_RANGE_UNSPECIFIED
@ AVCOL_RANGE_UNSPECIFIED
Definition: pixfmt.h:683
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:270
AVCOL_PRI_BT2020
@ AVCOL_PRI_BT2020
ITU-R BT2020.
Definition: pixfmt.h:597
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:277
AV_PIX_FMT_BGR4_BYTE
@ AV_PIX_FMT_BGR4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
Definition: pixfmt.h:92
AV_WB32
#define AV_WB32(p, v)
Definition: intreadwrite.h:415
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:384
AV_PIX_FMT_P212LE
@ AV_PIX_FMT_P212LE
interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, little-endian
Definition: pixfmt.h:427
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:153
get_color_type
static int get_color_type(const AVPixFmtDescriptor *desc)
Definition: pixdesc.c:3254
color_transfer_names
static const char *const color_transfer_names[]
Definition: pixdesc.c:3024
AVCOL_TRC_SMPTE2084
@ AVCOL_TRC_SMPTE2084
SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.
Definition: pixfmt.h:628
AVCOL_PRI_SMPTE431
@ AVCOL_PRI_SMPTE431
SMPTE ST 431-2 (2011) / DCI P3.
Definition: pixfmt.h:600
AV_PIX_FMT_RGBF32BE
@ AV_PIX_FMT_RGBF32BE
IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., big-endian.
Definition: pixfmt.h:420
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:75
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:300
AVCOL_TRC_SMPTE240M
@ AVCOL_TRC_SMPTE240M
Definition: pixfmt.h:619
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:3438
AVCOL_PRI_FILM
@ AVCOL_PRI_FILM
colour filters using Illuminant C
Definition: pixfmt.h:596
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:3135
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
shift
static int shift(int a, int b)
Definition: bonk.c:261
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:83
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:289
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:267
AVCOL_SPC_YCGCO_RO
@ AVCOL_SPC_YCGCO_RO
YCgCo-R, odd addition of bits.
Definition: pixfmt.h:659
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:158
AVCOL_TRC_LOG
@ AVCOL_TRC_LOG
"Logarithmic transfer characteristic (100:1 range)"
Definition: pixfmt.h:621
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:137
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:425
AV_PIX_FMT_XV36BE
@ AV_PIX_FMT_XV36BE
packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, big-endian,...
Definition: pixfmt.h:417
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:273
AV_PIX_FMT_YA16BE
@ AV_PIX_FMT_YA16BE
16 bits gray, 16 bits alpha (big-endian)
Definition: pixfmt.h:209
AV_PIX_FMT_GRAY12LE
@ AV_PIX_FMT_GRAY12LE
Y , 12bpp, little-endian.
Definition: pixfmt.h:319
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:167
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:737
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:155
AV_PIX_FMT_RGBAF16BE
@ AV_PIX_FMT_RGBAF16BE
IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., big-endian.
Definition: pixfmt.h:403
range
enum AVColorRange range
Definition: mediacodec_wrapper.c:2594
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:198
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:139
FF_COLOR_RGB
#define FF_COLOR_RGB
RGB color space.
Definition: pixdesc.c:3244
AV_PIX_FMT_GBRP9LE
@ AV_PIX_FMT_GBRP9LE
planar GBR 4:4:4 27bpp, little-endian
Definition: pixfmt.h:168
AV_WL16
#define AV_WL16(p, v)
Definition: intreadwrite.h:408
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:174
AV_PIX_FMT_GBRAP10LE
@ AV_PIX_FMT_GBRAP10LE
planar GBR 4:4:4:4 40bpp, little-endian
Definition: pixfmt.h:314
AV_PIX_FMT_BGR565BE
@ AV_PIX_FMT_BGR565BE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
Definition: pixfmt.h:117
offset
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 offset
Definition: writing_filters.txt:86
av_pix_fmt_desc_get_id
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
Definition: pixdesc.c:3189
AV_PIX_FMT_RGB0
@ AV_PIX_FMT_RGB0
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
Definition: pixfmt.h:263
AV_PIX_FMT_D3D11
@ AV_PIX_FMT_D3D11
Hardware surfaces for Direct3D11.
Definition: pixfmt.h:336
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:36
AV_PIX_FMT_P012BE
@ AV_PIX_FMT_P012BE
like NV12, with 12bpp per component, data in the high bits, zeros in the low bits,...
Definition: pixfmt.h:409
AV_PIX_FMT_P410LE
@ AV_PIX_FMT_P410LE
interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, little-endian
Definition: pixfmt.h:393
AV_PIX_FMT_VAAPI
@ AV_PIX_FMT_VAAPI
Hardware acceleration through VA-API, data[3] contains a VASurfaceID.
Definition: pixfmt.h:126
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:182
AVCOL_SPC_CHROMA_DERIVED_NCL
@ AVCOL_SPC_CHROMA_DERIVED_NCL
Chromaticity-derived non-constant luminance system.
Definition: pixfmt.h:654
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:613
AVChromaLocation
AVChromaLocation
Location of chroma samples.
Definition: pixfmt.h:736
AV_PIX_FMT_AYUV
@ AV_PIX_FMT_AYUV
packed AYUV 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), AYUVAYUV...
Definition: pixfmt.h:442
AV_PIX_FMT_ARGB
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:99
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:205
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:183
AV_PIX_FMT_VDPAU
@ AV_PIX_FMT_VDPAU
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
Definition: pixfmt.h:194
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:648
AV_PIX_FMT_VIDEOTOOLBOX
@ AV_PIX_FMT_VIDEOTOOLBOX
hardware decoding through Videotoolbox
Definition: pixfmt.h:305
AV_PIX_FMT_UYVA
@ AV_PIX_FMT_UYVA
packed UYVA 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), UYVAUYVA...
Definition: pixfmt.h:444
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:369
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:177
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:115
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:109
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
AVCOL_SPC_BT2020_NCL
@ AVCOL_SPC_BT2020_NCL
ITU-R BT2020 non-constant luminance system.
Definition: pixfmt.h:651
transfer
enum AVColorTransferCharacteristic transfer
Definition: mediacodec_wrapper.c:2622
FF_COLOR_XYZ
#define FF_COLOR_XYZ
Definition: pixdesc.c:3248
AVColorSpace
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:640
AV_PIX_FMT_GRAY9BE
@ AV_PIX_FMT_GRAY9BE
Y , 9bpp, big-endian.
Definition: pixfmt.h:338
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:371
av_color_primaries_from_name
int av_color_primaries_from_name(const char *name)
Definition: pixdesc.c:3510
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:287
color_primaries_names
static const char *const color_primaries_names[AVCOL_PRI_NB]
Definition: pixdesc.c:3007
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:199
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:107
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:197
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:385
FF_COLOR_NA
#define FF_COLOR_NA
Definition: pixdesc.c:3243
AV_PIX_FMT_NV21
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
Definition: pixfmt.h:97
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:3296
AV_PIX_FMT_RGB4_BYTE
@ AV_PIX_FMT_RGB4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
Definition: pixfmt.h:95
AVCOL_SPC_UNSPECIFIED
@ AVCOL_SPC_UNSPECIFIED
Definition: pixfmt.h:643
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:133
FF_LOSS_COLORSPACE
#define FF_LOSS_COLORSPACE
loss due to color space conversion
Definition: pixdesc.h:389
FF_COLOR_YUV
#define FF_COLOR_YUV
YUV color space.
Definition: pixdesc.c:3246
AV_PIX_FMT_GBRPF32LE
@ AV_PIX_FMT_GBRPF32LE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, little-endian.
Definition: pixfmt.h:342
AV_PIX_FMT_NV42
@ AV_PIX_FMT_NV42
as above, but U and V bytes are swapped
Definition: pixfmt.h:372
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:700
AV_PIX_FMT_GBRAP16LE
@ AV_PIX_FMT_GBRAP16LE
planar GBRA 4:4:4:4 64bpp, little-endian
Definition: pixfmt.h:214
AV_PIX_FMT_PAL8
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
Definition: pixfmt.h:84
AV_PIX_FMT_GRAY12BE
@ AV_PIX_FMT_GRAY12BE
Y , 12bpp, big-endian.
Definition: pixfmt.h:318
AV_PIX_FMT_YVYU422
@ AV_PIX_FMT_YVYU422
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
Definition: pixfmt.h:207
AVCOL_PRI_BT470M
@ AVCOL_PRI_BT470M
also FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
Definition: pixfmt.h:591
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:264
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:96
AV_PIX_FMT_Y212LE
@ AV_PIX_FMT_Y212LE
packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits,...
Definition: pixfmt.h:412
get_pix_fmt_internal
static enum AVPixelFormat get_pix_fmt_internal(const char *name)
Definition: pixdesc.c:3077
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:290
AV_PIX_FMT_P410BE
@ AV_PIX_FMT_P410BE
interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, big-endian
Definition: pixfmt.h:392
AV_PIX_FMT_P016LE
@ AV_PIX_FMT_P016LE
like NV12, with 16bpp per component, little-endian
Definition: pixfmt.h:323
get_pix_fmt_depth
static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:3278
AV_PIX_FMT_GRAYF32BE
@ AV_PIX_FMT_GRAYF32BE
IEEE-754 single precision Y, 32bpp, big-endian.
Definition: pixfmt.h:363
pos
unsigned int pos
Definition: spdifenc.c:414
AV_PIX_FMT_RGBF16BE
@ AV_PIX_FMT_RGBF16BE
IEEE-754 half precision packed RGB 16:16:16, 48bpp, RGBRGB..., big-endian.
Definition: pixfmt.h:451
AV_PIX_FMT_GBRP12BE
@ AV_PIX_FMT_GBRP12BE
planar GBR 4:4:4 36bpp, big-endian
Definition: pixfmt.h:279
AV_PIX_FMT_UYVY422
@ AV_PIX_FMT_UYVY422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:88
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:275
av_get_pix_fmt
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
Definition: pixdesc.c:3102
steps
static const int16_t steps[16]
Definition: misc4.c:30
AV_PIX_FMT_RGBAF32BE
@ AV_PIX_FMT_RGBAF32BE
IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., big-endian.
Definition: pixfmt.h:423
AVCOL_TRC_ARIB_STD_B67
@ AVCOL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
Definition: pixfmt.h:632
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:3449
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:381
AV_PIX_FMT_FLAG_XYZ
#define AV_PIX_FMT_FLAG_XYZ
The pixel format contains XYZ-like data (as opposed to YUV/RGB/grayscale).
Definition: pixdesc.h:163
AVCHROMA_LOC_CENTER
@ AVCHROMA_LOC_CENTER
MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0.
Definition: pixfmt.h:739
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AVCOL_SPC_FCC
@ AVCOL_SPC_FCC
FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
Definition: pixfmt.h:645
AV_PIX_FMT_XV48LE
@ AV_PIX_FMT_XV48LE
packed XVYU 4:4:4, 64bpp, little-endian, variant of Y416 where alpha channel is left undefined
Definition: pixfmt.h:464
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:160
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:345
AVPixFmtDescriptor::comp
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:105
AV_PIX_FMT_FLAG_PLANAR
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.
Definition: pixdesc.h:132
AV_PIX_FMT_P216LE
@ AV_PIX_FMT_P216LE
interleaved chroma YUV 4:2:2, 32bpp, little-endian
Definition: pixfmt.h:396
AV_PIX_FMT_RGBF32LE
@ AV_PIX_FMT_RGBF32LE
IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., little-endian.
Definition: pixfmt.h:421
AV_PIX_FMT_V30XBE
@ AV_PIX_FMT_V30XBE
packed VYUX 4:4:4 like XV30, 32bpp, (msb)10V 10Y 10U 2X(lsb), big-endian
Definition: pixfmt.h:448
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:618
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:181
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:78
AV_PIX_FMT_RGB565BE
@ AV_PIX_FMT_RGB565BE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
Definition: pixfmt.h:112
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:129
X_NE
#define X_NE(be, le)
Definition: pixdesc.c:3099
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:165
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:131
AV_PIX_FMT_P212BE
@ AV_PIX_FMT_P212BE
interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, big-endian
Definition: pixfmt.h:426
desc
const char * desc
Definition: libsvtav1.c:79
AV_PIX_FMT_RGBAF32LE
@ AV_PIX_FMT_RGBAF32LE
IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., little-endian.
Definition: pixfmt.h:424
FF_LOSS_COLORQUANT
#define FF_LOSS_COLORQUANT
loss due to color quantization
Definition: pixdesc.h:391
AV_PIX_FMT_GRAY16LE
@ AV_PIX_FMT_GRAY16LE
Y , 16bpp, little-endian.
Definition: pixfmt.h:105
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:386
AV_PIX_FMT_V30XLE
@ AV_PIX_FMT_V30XLE
packed VYUX 4:4:4 like XV30, 32bpp, (msb)10V 10Y 10U 2X(lsb), little-endian
Definition: pixfmt.h:449
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:77
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:307
AV_PIX_FMT_XV48BE
@ AV_PIX_FMT_XV48BE
packed XVYU 4:4:4, 64bpp, big-endian, variant of Y416 where alpha channel is left undefined
Definition: pixfmt.h:463
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:186
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:615
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:120
AVCOL_PRI_SMPTE432
@ AVCOL_PRI_SMPTE432
SMPTE ST 432-1 (2010) / P3 D65 / Display P3.
Definition: pixfmt.h:601
FF_LOSS_RESOLUTION
#define FF_LOSS_RESOLUTION
loss due to resolution change
Definition: pixdesc.h:387
AV_PIX_FMT_P216BE
@ AV_PIX_FMT_P216BE
interleaved chroma YUV 4:2:2, 32bpp, big-endian
Definition: pixfmt.h:395
AV_PIX_FMT_P412LE
@ AV_PIX_FMT_P412LE
interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, little-endian
Definition: pixfmt.h:430
AV_PIX_FMT_GRAY14LE
@ AV_PIX_FMT_GRAY14LE
Y , 14bpp, little-endian.
Definition: pixfmt.h:361
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:106
AVCOL_SPC_SMPTE2085
@ AVCOL_SPC_SMPTE2085
SMPTE 2085, Y'D'zD'x.
Definition: pixfmt.h:653
AV_PIX_FMT_XV36LE
@ AV_PIX_FMT_XV36LE
packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, little-endian,...
Definition: pixfmt.h:418
AV_PIX_FMT_YUV411P
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:80
AV_PIX_FMT_GRAY14BE
@ AV_PIX_FMT_GRAY14BE
Y , 14bpp, big-endian.
Definition: pixfmt.h:360
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:189
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:299
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:164
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:190
AV_PIX_FMT_GBRP14LE
@ AV_PIX_FMT_GBRP14LE
planar GBR 4:4:4 42bpp, little-endian
Definition: pixfmt.h:282
AV_PIX_FMT_Y216BE
@ AV_PIX_FMT_Y216BE
packed YUV 4:2:2 like YUYV422, 32bpp, big-endian
Definition: pixfmt.h:460
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
AVCHROMA_LOC_NB
@ AVCHROMA_LOC_NB
Not part of ABI.
Definition: pixfmt.h:744
AV_PIX_FMT_0RGB
@ AV_PIX_FMT_0RGB
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
Definition: pixfmt.h:262
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:79
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:85
alias
Definition: mccdec.c:63
AV_PIX_FMT_GBRAP10BE
@ AV_PIX_FMT_GBRAP10BE
planar GBR 4:4:4:4 40bpp, big-endian
Definition: pixfmt.h:313
AVCOL_TRC_SMPTE428
@ AVCOL_TRC_SMPTE428
SMPTE ST 428-1.
Definition: pixfmt.h:630
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:192
AV_PIX_FMT_VUYX
@ AV_PIX_FMT_VUYX
packed VUYX 4:4:4:4, 32bpp, Variant of VUYA where alpha channel is left undefined
Definition: pixfmt.h:406
AV_PIX_FMT_VYU444
@ AV_PIX_FMT_VYU444
packed VYU 4:4:4, 24bpp (1 Cr & Cb sample per 1x1 Y), VYUVYU...
Definition: pixfmt.h:446
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:117
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:366
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:642
AVColorRange
AVColorRange
Visual content value range.
Definition: pixfmt.h:682
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:138
AVCOL_SPC_ICTCP
@ AVCOL_SPC_ICTCP
ITU-R BT.2100-0, ICtCp.
Definition: pixfmt.h:656
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:272
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:175
av_color_transfer_name
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
Definition: pixdesc.c:3525
AVCHROMA_LOC_BOTTOMLEFT
@ AVCHROMA_LOC_BOTTOMLEFT
Definition: pixfmt.h:742
skip
static void BS_FUNC() skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.
Definition: bitstream_template.h:375
AV_PIX_FMT_BAYER_GRBG8
@ AV_PIX_FMT_BAYER_GRBG8
bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples
Definition: pixfmt.h:288
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
src
#define src
Definition: vp8dsp.c:248
AV_PIX_FMT_GBRAP14LE
@ AV_PIX_FMT_GBRAP14LE
planar GBR 4:4:4:4 56bpp, little-endian
Definition: pixfmt.h:433
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:173
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:3090
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:89
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:145
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:178