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