FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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  },
2271 };
2272 #if FF_API_PLUS1_MINUS1
2274 #endif
2275 
2276 static const char * const color_range_names[] = {
2277  [AVCOL_RANGE_UNSPECIFIED] = "unknown",
2278  [AVCOL_RANGE_MPEG] = "tv",
2279  [AVCOL_RANGE_JPEG] = "pc",
2280 };
2281 
2282 static const char * const color_primaries_names[AVCOL_PRI_NB] = {
2283  [AVCOL_PRI_RESERVED0] = "reserved",
2284  [AVCOL_PRI_BT709] = "bt709",
2285  [AVCOL_PRI_UNSPECIFIED] = "unknown",
2286  [AVCOL_PRI_RESERVED] = "reserved",
2287  [AVCOL_PRI_BT470M] = "bt470m",
2288  [AVCOL_PRI_BT470BG] = "bt470bg",
2289  [AVCOL_PRI_SMPTE170M] = "smpte170m",
2290  [AVCOL_PRI_SMPTE240M] = "smpte240m",
2291  [AVCOL_PRI_FILM] = "film",
2292  [AVCOL_PRI_BT2020] = "bt2020",
2293  [AVCOL_PRI_SMPTE428] = "smpte428",
2294  [AVCOL_PRI_SMPTE431] = "smpte431",
2295  [AVCOL_PRI_SMPTE432] = "smpte432",
2296  [AVCOL_PRI_JEDEC_P22] = "jedec-p22",
2297 };
2298 
2299 static const char * const color_transfer_names[] = {
2300  [AVCOL_TRC_RESERVED0] = "reserved",
2301  [AVCOL_TRC_BT709] = "bt709",
2302  [AVCOL_TRC_UNSPECIFIED] = "unknown",
2303  [AVCOL_TRC_RESERVED] = "reserved",
2304  [AVCOL_TRC_GAMMA22] = "bt470m",
2305  [AVCOL_TRC_GAMMA28] = "bt470bg",
2306  [AVCOL_TRC_SMPTE170M] = "smpte170m",
2307  [AVCOL_TRC_SMPTE240M] = "smpte240m",
2308  [AVCOL_TRC_LINEAR] = "linear",
2309  [AVCOL_TRC_LOG] = "log100",
2310  [AVCOL_TRC_LOG_SQRT] = "log316",
2311  [AVCOL_TRC_IEC61966_2_4] = "iec61966-2-4",
2312  [AVCOL_TRC_BT1361_ECG] = "bt1361e",
2313  [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1",
2314  [AVCOL_TRC_BT2020_10] = "bt2020-10",
2315  [AVCOL_TRC_BT2020_12] = "bt2020-12",
2316  [AVCOL_TRC_SMPTE2084] = "smpte2084",
2317  [AVCOL_TRC_SMPTE428] = "smpte428",
2318  [AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
2319 };
2320 
2321 static const char * const color_space_names[] = {
2322  [AVCOL_SPC_RGB] = "gbr",
2323  [AVCOL_SPC_BT709] = "bt709",
2324  [AVCOL_SPC_UNSPECIFIED] = "unknown",
2325  [AVCOL_SPC_RESERVED] = "reserved",
2326  [AVCOL_SPC_FCC] = "fcc",
2327  [AVCOL_SPC_BT470BG] = "bt470bg",
2328  [AVCOL_SPC_SMPTE170M] = "smpte170m",
2329  [AVCOL_SPC_SMPTE240M] = "smpte240m",
2330  [AVCOL_SPC_YCGCO] = "ycgco",
2331  [AVCOL_SPC_BT2020_NCL] = "bt2020nc",
2332  [AVCOL_SPC_BT2020_CL] = "bt2020c",
2333  [AVCOL_SPC_SMPTE2085] = "smpte2085",
2334  [AVCOL_SPC_CHROMA_DERIVED_NCL] = "chroma-derived-nc",
2335  [AVCOL_SPC_CHROMA_DERIVED_CL] = "chroma-derived-c",
2336  [AVCOL_SPC_ICTCP] = "ictcp",
2337 };
2338 
2339 static const char * const chroma_location_names[] = {
2340  [AVCHROMA_LOC_UNSPECIFIED] = "unspecified",
2341  [AVCHROMA_LOC_LEFT] = "left",
2342  [AVCHROMA_LOC_CENTER] = "center",
2343  [AVCHROMA_LOC_TOPLEFT] = "topleft",
2344  [AVCHROMA_LOC_TOP] = "top",
2345  [AVCHROMA_LOC_BOTTOMLEFT] = "bottomleft",
2346  [AVCHROMA_LOC_BOTTOM] = "bottom",
2347 };
2348 
2349 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
2350 {
2351  enum AVPixelFormat pix_fmt;
2352 
2353  for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
2354  if (av_pix_fmt_descriptors[pix_fmt].name &&
2355  (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
2356  av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias)))
2357  return pix_fmt;
2358 
2359  return AV_PIX_FMT_NONE;
2360 }
2361 
2363 {
2364  return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
2365  av_pix_fmt_descriptors[pix_fmt].name : NULL;
2366 }
2367 
2368 #if HAVE_BIGENDIAN
2369 # define X_NE(be, le) be
2370 #else
2371 # define X_NE(be, le) le
2372 #endif
2373 
2375 {
2376  enum AVPixelFormat pix_fmt;
2377 
2378  if (!strcmp(name, "rgb32"))
2379  name = X_NE("argb", "bgra");
2380  else if (!strcmp(name, "bgr32"))
2381  name = X_NE("abgr", "rgba");
2382 
2383  pix_fmt = get_pix_fmt_internal(name);
2384  if (pix_fmt == AV_PIX_FMT_NONE) {
2385  char name2[32];
2386 
2387  snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
2388  pix_fmt = get_pix_fmt_internal(name2);
2389  }
2390 
2391 #if FF_API_VAAPI
2392  if (pix_fmt == AV_PIX_FMT_NONE && !strcmp(name, "vaapi"))
2393  pix_fmt = AV_PIX_FMT_VAAPI;
2394 #endif
2395  return pix_fmt;
2396 }
2397 
2399 {
2400  int c, bits = 0;
2401  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2402 
2403  for (c = 0; c < pixdesc->nb_components; c++) {
2404  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2405  bits += pixdesc->comp[c].depth << s;
2406  }
2407 
2408  return bits >> log2_pixels;
2409 }
2410 
2412 {
2413  int c, bits = 0;
2414  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2415  int steps[4] = {0};
2416 
2417  for (c = 0; c < pixdesc->nb_components; c++) {
2418  const AVComponentDescriptor *comp = &pixdesc->comp[c];
2419  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2420  steps[comp->plane] = comp->step << s;
2421  }
2422  for (c = 0; c < 4; c++)
2423  bits += steps[c];
2424 
2425  if(!(pixdesc->flags & AV_PIX_FMT_FLAG_BITSTREAM))
2426  bits *= 8;
2427 
2428  return bits >> log2_pixels;
2429 }
2430 
2431 char *av_get_pix_fmt_string(char *buf, int buf_size,
2432  enum AVPixelFormat pix_fmt)
2433 {
2434  /* print header */
2435  if (pix_fmt < 0) {
2436  snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
2437  } else {
2438  const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
2439  snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
2440  pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
2441  }
2442 
2443  return buf;
2444 }
2445 
2447 {
2448  if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
2449  return NULL;
2450  return &av_pix_fmt_descriptors[pix_fmt];
2451 }
2452 
2454 {
2455  if (!prev)
2456  return &av_pix_fmt_descriptors[0];
2457  while (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1) {
2458  prev++;
2459  if (prev->name)
2460  return prev;
2461  }
2462  return NULL;
2463 }
2464 
2466 {
2467  if (desc < av_pix_fmt_descriptors ||
2468  desc >= av_pix_fmt_descriptors + FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
2469  return AV_PIX_FMT_NONE;
2470 
2471  return desc - av_pix_fmt_descriptors;
2472 }
2473 
2475  int *h_shift, int *v_shift)
2476 {
2477  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2478  if (!desc)
2479  return AVERROR(ENOSYS);
2480  *h_shift = desc->log2_chroma_w;
2481  *v_shift = desc->log2_chroma_h;
2482 
2483  return 0;
2484 }
2485 
2487 {
2488  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2489  int i, planes[4] = { 0 }, ret = 0;
2490 
2491  if (!desc)
2492  return AVERROR(EINVAL);
2493 
2494  for (i = 0; i < desc->nb_components; i++)
2495  planes[desc->comp[i].plane] = 1;
2496  for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
2497  ret += planes[i];
2498  return ret;
2499 }
2500 
2502  int i, j;
2503 
2504  for (i=0; i<FF_ARRAY_ELEMS(av_pix_fmt_descriptors); i++) {
2505  const AVPixFmtDescriptor *d = &av_pix_fmt_descriptors[i];
2506  uint8_t fill[4][8+6+3] = {{0}};
2507  uint8_t *data[4] = {fill[0], fill[1], fill[2], fill[3]};
2508  int linesize[4] = {0,0,0,0};
2509  uint16_t tmp[2];
2510 
2511  if (!d->name && !d->nb_components && !d->log2_chroma_w && !d->log2_chroma_h && !d->flags)
2512  continue;
2513 // av_log(NULL, AV_LOG_DEBUG, "Checking: %s\n", d->name);
2514  av_assert0(d->log2_chroma_w <= 3);
2515  av_assert0(d->log2_chroma_h <= 3);
2516  av_assert0(d->nb_components <= 4);
2517  av_assert0(d->name && d->name[0]);
2518  av_assert2(av_get_pix_fmt(d->name) == i);
2519 
2520  for (j=0; j<FF_ARRAY_ELEMS(d->comp); j++) {
2521  const AVComponentDescriptor *c = &d->comp[j];
2522  if(j>=d->nb_components) {
2523  av_assert0(!c->plane && !c->step && !c->offset && !c->shift && !c->depth);
2524  continue;
2525  }
2526  if (d->flags & AV_PIX_FMT_FLAG_BITSTREAM) {
2527  av_assert0(c->step >= c->depth);
2528  } else {
2529  av_assert0(8*c->step >= c->depth);
2530  }
2531  if (d->flags & AV_PIX_FMT_FLAG_BAYER)
2532  continue;
2533  av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0);
2534  av_assert0(tmp[0] == 0 && tmp[1] == 0);
2535  tmp[0] = tmp[1] = (1<<c->depth) - 1;
2536  av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2);
2537  }
2538  }
2539 }
2540 
2541 
2543 {
2544  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2545  char name[16];
2546  int i;
2547 
2548  if (!desc || strlen(desc->name) < 2)
2549  return AV_PIX_FMT_NONE;
2550  av_strlcpy(name, desc->name, sizeof(name));
2551  i = strlen(name) - 2;
2552  if (strcmp(name + i, "be") && strcmp(name + i, "le"))
2553  return AV_PIX_FMT_NONE;
2554 
2555  name[i] ^= 'b' ^ 'l';
2556 
2557  return get_pix_fmt_internal(name);
2558 }
2559 
2560 #define FF_COLOR_NA -1
2561 #define FF_COLOR_RGB 0 /**< RGB color space */
2562 #define FF_COLOR_GRAY 1 /**< gray color space */
2563 #define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
2564 #define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
2565 #define FF_COLOR_XYZ 4
2566 
2567 #define pixdesc_has_alpha(pixdesc) \
2568  ((pixdesc)->flags & AV_PIX_FMT_FLAG_ALPHA)
2569 
2570 
2572  if (desc->flags & AV_PIX_FMT_FLAG_PAL)
2573  return FF_COLOR_RGB;
2574 
2575  if(desc->nb_components == 1 || desc->nb_components == 2)
2576  return FF_COLOR_GRAY;
2577 
2578  if(desc->name && !strncmp(desc->name, "yuvj", 4))
2579  return FF_COLOR_YUV_JPEG;
2580 
2581  if(desc->name && !strncmp(desc->name, "xyz", 3))
2582  return FF_COLOR_XYZ;
2583 
2584  if(desc->flags & AV_PIX_FMT_FLAG_RGB)
2585  return FF_COLOR_RGB;
2586 
2587  if(desc->nb_components == 0)
2588  return FF_COLOR_NA;
2589 
2590  return FF_COLOR_YUV;
2591 }
2592 
2593 static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
2594 {
2595  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2596  int i;
2597 
2598  if (!desc || !desc->nb_components) {
2599  *min = *max = 0;
2600  return AVERROR(EINVAL);
2601  }
2602 
2603  *min = INT_MAX, *max = -INT_MAX;
2604  for (i = 0; i < desc->nb_components; i++) {
2605  *min = FFMIN(desc->comp[i].depth, *min);
2606  *max = FFMAX(desc->comp[i].depth, *max);
2607  }
2608  return 0;
2609 }
2610 
2611 static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
2612  enum AVPixelFormat src_pix_fmt,
2613  unsigned *lossp, unsigned consider)
2614 {
2615  const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
2616  const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
2617  int src_color, dst_color;
2618  int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
2619  int ret, loss, i, nb_components;
2620  int score = INT_MAX - 1;
2621 
2622  if (!src_desc || !dst_desc)
2623  return -4;
2624 
2625  if ((src_desc->flags & AV_PIX_FMT_FLAG_HWACCEL) ||
2626  (dst_desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
2627  if (dst_pix_fmt == src_pix_fmt)
2628  return -1;
2629  else
2630  return -2;
2631  }
2632 
2633  /* compute loss */
2634  *lossp = loss = 0;
2635 
2636  if (dst_pix_fmt == src_pix_fmt)
2637  return INT_MAX;
2638 
2639  if ((ret = get_pix_fmt_depth(&src_min_depth, &src_max_depth, src_pix_fmt)) < 0)
2640  return -3;
2641  if ((ret = get_pix_fmt_depth(&dst_min_depth, &dst_max_depth, dst_pix_fmt)) < 0)
2642  return -3;
2643 
2644  src_color = get_color_type(src_desc);
2645  dst_color = get_color_type(dst_desc);
2646  if (dst_pix_fmt == AV_PIX_FMT_PAL8)
2647  nb_components = FFMIN(src_desc->nb_components, 4);
2648  else
2649  nb_components = FFMIN(src_desc->nb_components, dst_desc->nb_components);
2650 
2651  for (i = 0; i < nb_components; i++) {
2652  int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : (dst_desc->comp[i].depth - 1);
2653  if (src_desc->comp[i].depth - 1 > depth_minus1 && (consider & FF_LOSS_DEPTH)) {
2654  loss |= FF_LOSS_DEPTH;
2655  score -= 65536 >> depth_minus1;
2656  }
2657  }
2658 
2659  if (consider & FF_LOSS_RESOLUTION) {
2660  if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w) {
2661  loss |= FF_LOSS_RESOLUTION;
2662  score -= 256 << dst_desc->log2_chroma_w;
2663  }
2664  if (dst_desc->log2_chroma_h > src_desc->log2_chroma_h) {
2665  loss |= FF_LOSS_RESOLUTION;
2666  score -= 256 << dst_desc->log2_chroma_h;
2667  }
2668  // don't favor 422 over 420 if downsampling is needed, because 420 has much better support on the decoder side
2669  if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 0 &&
2670  dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 0 ) {
2671  score += 512;
2672  }
2673  }
2674 
2675  if(consider & FF_LOSS_COLORSPACE)
2676  switch(dst_color) {
2677  case FF_COLOR_RGB:
2678  if (src_color != FF_COLOR_RGB &&
2679  src_color != FF_COLOR_GRAY)
2680  loss |= FF_LOSS_COLORSPACE;
2681  break;
2682  case FF_COLOR_GRAY:
2683  if (src_color != FF_COLOR_GRAY)
2684  loss |= FF_LOSS_COLORSPACE;
2685  break;
2686  case FF_COLOR_YUV:
2687  if (src_color != FF_COLOR_YUV)
2688  loss |= FF_LOSS_COLORSPACE;
2689  break;
2690  case FF_COLOR_YUV_JPEG:
2691  if (src_color != FF_COLOR_YUV_JPEG &&
2692  src_color != FF_COLOR_YUV &&
2693  src_color != FF_COLOR_GRAY)
2694  loss |= FF_LOSS_COLORSPACE;
2695  break;
2696  default:
2697  /* fail safe test */
2698  if (src_color != dst_color)
2699  loss |= FF_LOSS_COLORSPACE;
2700  break;
2701  }
2702  if(loss & FF_LOSS_COLORSPACE)
2703  score -= (nb_components * 65536) >> FFMIN(dst_desc->comp[0].depth - 1, src_desc->comp[0].depth - 1);
2704 
2705  if (dst_color == FF_COLOR_GRAY &&
2706  src_color != FF_COLOR_GRAY && (consider & FF_LOSS_CHROMA)) {
2707  loss |= FF_LOSS_CHROMA;
2708  score -= 2 * 65536;
2709  }
2710  if (!pixdesc_has_alpha(dst_desc) && (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))) {
2711  loss |= FF_LOSS_ALPHA;
2712  score -= 65536;
2713  }
2714  if (dst_pix_fmt == AV_PIX_FMT_PAL8 && (consider & FF_LOSS_COLORQUANT) &&
2715  (src_pix_fmt != AV_PIX_FMT_PAL8 && (src_color != FF_COLOR_GRAY || (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))))) {
2716  loss |= FF_LOSS_COLORQUANT;
2717  score -= 65536;
2718  }
2719 
2720  *lossp = loss;
2721  return score;
2722 }
2723 
2724 int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
2725  enum AVPixelFormat src_pix_fmt,
2726  int has_alpha)
2727 {
2728  int loss;
2729  int ret = get_pix_fmt_score(dst_pix_fmt, src_pix_fmt, &loss, has_alpha ? ~0 : ~FF_LOSS_ALPHA);
2730  if (ret < 0)
2731  return ret;
2732  return loss;
2733 }
2734 
2735 enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
2736  enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
2737 {
2738  enum AVPixelFormat dst_pix_fmt;
2739  int loss1, loss2, loss_mask;
2740  const AVPixFmtDescriptor *desc1 = av_pix_fmt_desc_get(dst_pix_fmt1);
2741  const AVPixFmtDescriptor *desc2 = av_pix_fmt_desc_get(dst_pix_fmt2);
2742  int score1, score2;
2743 
2744  if (!desc1) {
2745  dst_pix_fmt = dst_pix_fmt2;
2746  } else if (!desc2) {
2747  dst_pix_fmt = dst_pix_fmt1;
2748  } else {
2749  loss_mask= loss_ptr?~*loss_ptr:~0; /* use loss mask if provided */
2750  if(!has_alpha)
2751  loss_mask &= ~FF_LOSS_ALPHA;
2752 
2753  score1 = get_pix_fmt_score(dst_pix_fmt1, src_pix_fmt, &loss1, loss_mask);
2754  score2 = get_pix_fmt_score(dst_pix_fmt2, src_pix_fmt, &loss2, loss_mask);
2755 
2756  if (score1 == score2) {
2758  dst_pix_fmt = av_get_padded_bits_per_pixel(desc2) < av_get_padded_bits_per_pixel(desc1) ? dst_pix_fmt2 : dst_pix_fmt1;
2759  } else {
2760  dst_pix_fmt = desc2->nb_components < desc1->nb_components ? dst_pix_fmt2 : dst_pix_fmt1;
2761  }
2762  } else {
2763  dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
2764  }
2765  }
2766 
2767  if (loss_ptr)
2768  *loss_ptr = av_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
2769  return dst_pix_fmt;
2770 }
2771 
2772 const char *av_color_range_name(enum AVColorRange range)
2773 {
2774  return (unsigned) range < AVCOL_RANGE_NB ?
2775  color_range_names[range] : NULL;
2776 }
2777 
2779 {
2780  int i;
2781 
2782  for (i = 0; i < FF_ARRAY_ELEMS(color_range_names); i++) {
2783  size_t len = strlen(color_range_names[i]);
2784  if (!strncmp(color_range_names[i], name, len))
2785  return i;
2786  }
2787 
2788  return AVERROR(EINVAL);
2789 }
2790 
2791 const char *av_color_primaries_name(enum AVColorPrimaries primaries)
2792 {
2793  return (unsigned) primaries < AVCOL_PRI_NB ?
2794  color_primaries_names[primaries] : NULL;
2795 }
2796 
2798 {
2799  int i;
2800 
2801  for (i = 0; i < FF_ARRAY_ELEMS(color_primaries_names); i++) {
2802  size_t len;
2803 
2804  if (!color_primaries_names[i])
2805  continue;
2806 
2807  len = strlen(color_primaries_names[i]);
2808  if (!strncmp(color_primaries_names[i], name, len))
2809  return i;
2810  }
2811 
2812  return AVERROR(EINVAL);
2813 }
2814 
2816 {
2817  return (unsigned) transfer < AVCOL_TRC_NB ?
2818  color_transfer_names[transfer] : NULL;
2819 }
2820 
2822 {
2823  int i;
2824 
2825  for (i = 0; i < FF_ARRAY_ELEMS(color_transfer_names); i++) {
2826  size_t len;
2827 
2828  if (!color_transfer_names[i])
2829  continue;
2830 
2831  len = strlen(color_transfer_names[i]);
2832  if (!strncmp(color_transfer_names[i], name, len))
2833  return i;
2834  }
2835 
2836  return AVERROR(EINVAL);
2837 }
2838 
2839 const char *av_color_space_name(enum AVColorSpace space)
2840 {
2841  return (unsigned) space < AVCOL_SPC_NB ?
2842  color_space_names[space] : NULL;
2843 }
2844 
2846 {
2847  int i;
2848 
2849  for (i = 0; i < FF_ARRAY_ELEMS(color_space_names); i++) {
2850  size_t len;
2851 
2852  if (!color_space_names[i])
2853  continue;
2854 
2855  len = strlen(color_space_names[i]);
2856  if (!strncmp(color_space_names[i], name, len))
2857  return i;
2858  }
2859 
2860  return AVERROR(EINVAL);
2861 }
2862 
2863 const char *av_chroma_location_name(enum AVChromaLocation location)
2864 {
2865  return (unsigned) location < AVCHROMA_LOC_NB ?
2866  chroma_location_names[location] : NULL;
2867 }
2868 
2870 {
2871  int i;
2872 
2873  for (i = 0; i < FF_ARRAY_ELEMS(chroma_location_names); i++) {
2874  size_t len;
2875 
2876  if (!chroma_location_names[i])
2877  continue;
2878 
2879  len = strlen(chroma_location_names[i]);
2880  if (!strncmp(chroma_location_names[i], name, len))
2881  return i;
2882  }
2883 
2884  return AVERROR(EINVAL);
2885 }
#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:473
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
Definition: pixfmt.h:488
int plane
Definition: avisynth_c.h:422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:81
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:771
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:469
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2446
MPEG-2/4 4:2:0, H.264 default for 4:2:0.
Definition: pixfmt.h:533
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:101
"Linear transfer characteristics"
Definition: pixfmt.h:466
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
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2486
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
JEDEC P22 phosphors.
Definition: pixfmt.h:449
const char * desc
Definition: nvenc.c:65
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:2398
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 ...
Definition: pixfmt.h:492
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:2431
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:448
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:493
static const char *const chroma_location_names[]
Definition: pixdesc.c:2339
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:447
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:2542
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
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
Definition: pixfmt.h:487
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:457
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:494
const char * av_color_space_name(enum AVColorSpace space)
Definition: pixdesc.c:2839
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
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:2778
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:486
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:2772
#define AV_PIX_FMT_FLAG_FLOAT
The pixel format contains IEEE-754 floating point values.
Definition: pixdesc.h:188
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:495
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:462
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:513
Y , 10bpp, little-endian.
Definition: pixfmt.h:298
AVColorRange
MPEG vs JPEG YUV range.
Definition: pixfmt.h:509
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:433
#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:2821
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:2863
also FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
Definition: pixfmt.h:438
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:176
16 bits gray, 16 bits alpha (big-endian)
Definition: pixfmt.h:212
ITU-R BT1361 Extended Colour Gamut.
Definition: pixfmt.h:470
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 AVERROR(e)
Definition: error.h:43
#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:2321
int av_chroma_location_from_name(const char *name)
Definition: pixdesc.c:2869
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:2474
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:2411
Not part of ABI.
Definition: pixfmt.h:450
#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:435
#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:445
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:343
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:134
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:2791
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:2299
common internal API header
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
Definition: pixdesc.h:106
as above, but U and V bytes are swapped
Definition: pixfmt.h:90
static const struct @304 planes[]
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:2465
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:474
#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:443
uint8_t w
Definition: llviddspenc.c:38
#define FF_COLOR_YUV_JPEG
YUV color space.
Definition: pixdesc.c:2564
ITU-R BT2020 non-constant luminance system.
Definition: pixfmt.h:497
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
Definition: pixfmt.h:535
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
Definition: pixfmt.h:440
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:2565
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
Definition: pixfmt.h:210
#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:2571
#define pixdesc_has_alpha(pixdesc)
Definition: pixdesc.c:2567
#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:491
#define FF_ARRAY_ELEMS(a)
the normal 2^n-1 "JPEG" YUV ranges
Definition: pixfmt.h:512
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:459
ITU-R BT.2100-0, ICtCp.
Definition: pixfmt.h:502
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:464
functionally identical to above
Definition: pixfmt.h:442
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:501
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:2797
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:2611
#define FF_COLOR_YUV
YUV color space.
Definition: pixdesc.c:2563
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:690
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:500
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
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:2349
DRM-managed buffers exposed through PRIME buffer sharing.
Definition: pixfmt.h:328
Not part of ABI.
Definition: pixfmt.h:479
"Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)"
Definition: pixfmt.h:468
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:2724
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
Definition: pixfmt.h:222
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:2593
SMPTE ST 428-1.
Definition: pixfmt.h:476
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:596
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:2561
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:511
static FF_ENABLE_DEPRECATION_WARNINGS const char *const color_range_names[]
Definition: pixdesc.c:2276
ITU-R BT2020 constant luminance system.
Definition: pixfmt.h:498
#define X_NE(be, le)
Definition: pixdesc.c:2371
#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:471
#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
static double c[64]
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
Definition: pixdesc.c:2815
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:463
#define AV_WL16(p, v)
Definition: intreadwrite.h:412
SMPTE 2085, Y'D'zD'x.
Definition: pixfmt.h:499
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:2282
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:2735
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:478
#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:539
16 bits gray, 16 bits alpha (little-endian)
Definition: pixfmt.h:213
#define FF_COLOR_NA
Definition: pixdesc.c:2560
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:472
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: pixfmt.h:441
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:343
ITU-R BT2020.
Definition: pixfmt.h:444
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:531
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:2501
MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0.
Definition: pixfmt.h:534
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:2374
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:2362
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
Definition: pixfmt.h:181
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:2845
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:503
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
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:2453
const char * name
Definition: opengl_enc.c:103
"Logarithmic transfer characteristic (100:1 range)"
Definition: pixfmt.h:467
#define FF_COLOR_GRAY
gray color space
Definition: pixdesc.c:2562
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