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_line(uint16_t *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 {
41  int plane = comp.plane;
42  int depth = comp.depth_minus1 + 1;
43  int mask = (1 << depth) - 1;
44  int shift = comp.shift;
45  int step = comp.step_minus1 + 1;
46  int flags = desc->flags;
47 
48  if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
49  int skip = x * step + comp.offset_plus1 - 1;
50  const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
51  int shift = 8 - depth - (skip & 7);
52 
53  while (w--) {
54  int val = (*p >> shift) & mask;
55  if (read_pal_component)
56  val = data[1][4*val + c];
57  shift -= step;
58  p -= shift >> 3;
59  shift &= 7;
60  *dst++ = val;
61  }
62  } else {
63  const uint8_t *p = data[plane] + y * linesize[plane] +
64  x * step + comp.offset_plus1 - 1;
65  int is_8bit = shift + depth <= 8;
66 
67  if (is_8bit)
68  p += !!(flags & AV_PIX_FMT_FLAG_BE);
69 
70  while (w--) {
71  int val = is_8bit ? *p :
72  flags & AV_PIX_FMT_FLAG_BE ? AV_RB16(p) : AV_RL16(p);
73  val = (val >> shift) & mask;
74  if (read_pal_component)
75  val = data[1][4 * val + c];
76  p += step;
77  *dst++ = val;
78  }
79  }
80 }
81 
82 void av_write_image_line(const uint16_t *src,
83  uint8_t *data[4], const int linesize[4],
84  const AVPixFmtDescriptor *desc,
85  int x, int y, int c, int w)
86 {
88  int plane = comp.plane;
89  int depth = comp.depth_minus1 + 1;
90  int step = comp.step_minus1 + 1;
91  int flags = desc->flags;
92 
93  if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
94  int skip = x * step + comp.offset_plus1 - 1;
95  uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
96  int shift = 8 - depth - (skip & 7);
97 
98  while (w--) {
99  *p |= *src++ << shift;
100  shift -= step;
101  p -= shift >> 3;
102  shift &= 7;
103  }
104  } else {
105  int shift = comp.shift;
106  uint8_t *p = data[plane] + y * linesize[plane] +
107  x * step + comp.offset_plus1 - 1;
108 
109  if (shift + depth <= 8) {
110  p += !!(flags & AV_PIX_FMT_FLAG_BE);
111  while (w--) {
112  *p |= (*src++ << shift);
113  p += step;
114  }
115  } else {
116  while (w--) {
117  if (flags & AV_PIX_FMT_FLAG_BE) {
118  uint16_t val = AV_RB16(p) | (*src++ << shift);
119  AV_WB16(p, val);
120  } else {
121  uint16_t val = AV_RL16(p) | (*src++ << shift);
122  AV_WL16(p, val);
123  }
124  p += step;
125  }
126  }
127  }
128 }
129 
130 #if !FF_API_PIX_FMT_DESC
131 static
132 #endif
134  [AV_PIX_FMT_YUV420P] = {
135  .name = "yuv420p",
136  .nb_components = 3,
137  .log2_chroma_w = 1,
138  .log2_chroma_h = 1,
139  .comp = {
140  { 0, 0, 1, 0, 7 }, /* Y */
141  { 1, 0, 1, 0, 7 }, /* U */
142  { 2, 0, 1, 0, 7 }, /* V */
143  },
144  .flags = AV_PIX_FMT_FLAG_PLANAR,
145  },
146  [AV_PIX_FMT_YUYV422] = {
147  .name = "yuyv422",
148  .nb_components = 3,
149  .log2_chroma_w = 1,
150  .log2_chroma_h = 0,
151  .comp = {
152  { 0, 1, 1, 0, 7 }, /* Y */
153  { 0, 3, 2, 0, 7 }, /* U */
154  { 0, 3, 4, 0, 7 }, /* V */
155  },
156  },
157  [AV_PIX_FMT_YVYU422] = {
158  .name = "yvyu422",
159  .nb_components = 3,
160  .log2_chroma_w = 1,
161  .log2_chroma_h = 0,
162  .comp = {
163  { 0, 1, 1, 0, 7 }, /* Y */
164  { 0, 3, 2, 0, 7 }, /* V */
165  { 0, 3, 4, 0, 7 }, /* U */
166  },
167  },
168  [AV_PIX_FMT_RGB24] = {
169  .name = "rgb24",
170  .nb_components = 3,
171  .log2_chroma_w = 0,
172  .log2_chroma_h = 0,
173  .comp = {
174  { 0, 2, 1, 0, 7 }, /* R */
175  { 0, 2, 2, 0, 7 }, /* G */
176  { 0, 2, 3, 0, 7 }, /* B */
177  },
178  .flags = AV_PIX_FMT_FLAG_RGB,
179  },
180  [AV_PIX_FMT_BGR24] = {
181  .name = "bgr24",
182  .nb_components = 3,
183  .log2_chroma_w = 0,
184  .log2_chroma_h = 0,
185  .comp = {
186  { 0, 2, 3, 0, 7 }, /* R */
187  { 0, 2, 2, 0, 7 }, /* G */
188  { 0, 2, 1, 0, 7 }, /* B */
189  },
190  .flags = AV_PIX_FMT_FLAG_RGB,
191  },
192  [AV_PIX_FMT_YUV422P] = {
193  .name = "yuv422p",
194  .nb_components = 3,
195  .log2_chroma_w = 1,
196  .log2_chroma_h = 0,
197  .comp = {
198  { 0, 0, 1, 0, 7 }, /* Y */
199  { 1, 0, 1, 0, 7 }, /* U */
200  { 2, 0, 1, 0, 7 }, /* V */
201  },
202  .flags = AV_PIX_FMT_FLAG_PLANAR,
203  },
204  [AV_PIX_FMT_YUV444P] = {
205  .name = "yuv444p",
206  .nb_components = 3,
207  .log2_chroma_w = 0,
208  .log2_chroma_h = 0,
209  .comp = {
210  { 0, 0, 1, 0, 7 }, /* Y */
211  { 1, 0, 1, 0, 7 }, /* U */
212  { 2, 0, 1, 0, 7 }, /* V */
213  },
214  .flags = AV_PIX_FMT_FLAG_PLANAR,
215  },
216  [AV_PIX_FMT_YUV410P] = {
217  .name = "yuv410p",
218  .nb_components = 3,
219  .log2_chroma_w = 2,
220  .log2_chroma_h = 2,
221  .comp = {
222  { 0, 0, 1, 0, 7 }, /* Y */
223  { 1, 0, 1, 0, 7 }, /* U */
224  { 2, 0, 1, 0, 7 }, /* V */
225  },
226  .flags = AV_PIX_FMT_FLAG_PLANAR,
227  },
228  [AV_PIX_FMT_YUV411P] = {
229  .name = "yuv411p",
230  .nb_components = 3,
231  .log2_chroma_w = 2,
232  .log2_chroma_h = 0,
233  .comp = {
234  { 0, 0, 1, 0, 7 }, /* Y */
235  { 1, 0, 1, 0, 7 }, /* U */
236  { 2, 0, 1, 0, 7 }, /* V */
237  },
238  .flags = AV_PIX_FMT_FLAG_PLANAR,
239  },
240  [AV_PIX_FMT_YUVJ411P] = {
241  .name = "yuvj411p",
242  .nb_components = 3,
243  .log2_chroma_w = 2,
244  .log2_chroma_h = 0,
245  .comp = {
246  { 0, 0, 1, 0, 7 }, /* Y */
247  { 1, 0, 1, 0, 7 }, /* U */
248  { 2, 0, 1, 0, 7 }, /* V */
249  },
250  .flags = AV_PIX_FMT_FLAG_PLANAR,
251  },
252  [AV_PIX_FMT_GRAY8] = {
253  .name = "gray",
254  .nb_components = 1,
255  .log2_chroma_w = 0,
256  .log2_chroma_h = 0,
257  .comp = {
258  { 0, 0, 1, 0, 7 }, /* Y */
259  },
260  .flags = AV_PIX_FMT_FLAG_PSEUDOPAL,
261  .alias = "gray8,y8",
262  },
264  .name = "monow",
265  .nb_components = 1,
266  .log2_chroma_w = 0,
267  .log2_chroma_h = 0,
268  .comp = {
269  { 0, 0, 1, 0, 0 }, /* Y */
270  },
271  .flags = AV_PIX_FMT_FLAG_BITSTREAM,
272  },
274  .name = "monob",
275  .nb_components = 1,
276  .log2_chroma_w = 0,
277  .log2_chroma_h = 0,
278  .comp = {
279  { 0, 0, 1, 7, 0 }, /* Y */
280  },
281  .flags = AV_PIX_FMT_FLAG_BITSTREAM,
282  },
283  [AV_PIX_FMT_PAL8] = {
284  .name = "pal8",
285  .nb_components = 1,
286  .log2_chroma_w = 0,
287  .log2_chroma_h = 0,
288  .comp = {
289  { 0, 0, 1, 0, 7 },
290  },
291  .flags = AV_PIX_FMT_FLAG_PAL,
292  },
293  [AV_PIX_FMT_YUVJ420P] = {
294  .name = "yuvj420p",
295  .nb_components = 3,
296  .log2_chroma_w = 1,
297  .log2_chroma_h = 1,
298  .comp = {
299  { 0, 0, 1, 0, 7 }, /* Y */
300  { 1, 0, 1, 0, 7 }, /* U */
301  { 2, 0, 1, 0, 7 }, /* V */
302  },
303  .flags = AV_PIX_FMT_FLAG_PLANAR,
304  },
305  [AV_PIX_FMT_YUVJ422P] = {
306  .name = "yuvj422p",
307  .nb_components = 3,
308  .log2_chroma_w = 1,
309  .log2_chroma_h = 0,
310  .comp = {
311  { 0, 0, 1, 0, 7 }, /* Y */
312  { 1, 0, 1, 0, 7 }, /* U */
313  { 2, 0, 1, 0, 7 }, /* V */
314  },
315  .flags = AV_PIX_FMT_FLAG_PLANAR,
316  },
317  [AV_PIX_FMT_YUVJ444P] = {
318  .name = "yuvj444p",
319  .nb_components = 3,
320  .log2_chroma_w = 0,
321  .log2_chroma_h = 0,
322  .comp = {
323  { 0, 0, 1, 0, 7 }, /* Y */
324  { 1, 0, 1, 0, 7 }, /* U */
325  { 2, 0, 1, 0, 7 }, /* V */
326  },
327  .flags = AV_PIX_FMT_FLAG_PLANAR,
328  },
329 #if FF_API_XVMC
331  .name = "xvmcmc",
332  .flags = AV_PIX_FMT_FLAG_HWACCEL,
333  },
335  .name = "xvmcidct",
336  .flags = AV_PIX_FMT_FLAG_HWACCEL,
337  },
338 #endif /* FF_API_XVMC */
339 #if !FF_API_XVMC
340  [AV_PIX_FMT_XVMC] = {
341  .name = "xvmc",
342  .flags = AV_PIX_FMT_FLAG_HWACCEL,
343  },
344 #endif /* !FF_API_XVMC */
345  [AV_PIX_FMT_UYVY422] = {
346  .name = "uyvy422",
347  .nb_components = 3,
348  .log2_chroma_w = 1,
349  .log2_chroma_h = 0,
350  .comp = {
351  { 0, 1, 2, 0, 7 }, /* Y */
352  { 0, 3, 1, 0, 7 }, /* U */
353  { 0, 3, 3, 0, 7 }, /* V */
354  },
355  },
357  .name = "uyyvyy411",
358  .nb_components = 3,
359  .log2_chroma_w = 2,
360  .log2_chroma_h = 0,
361  .comp = {
362  { 0, 3, 2, 0, 7 }, /* Y */
363  { 0, 5, 1, 0, 7 }, /* U */
364  { 0, 5, 4, 0, 7 }, /* V */
365  },
366  },
367  [AV_PIX_FMT_BGR8] = {
368  .name = "bgr8",
369  .nb_components = 3,
370  .log2_chroma_w = 0,
371  .log2_chroma_h = 0,
372  .comp = {
373  { 0, 0, 1, 0, 2 }, /* R */
374  { 0, 0, 1, 3, 2 }, /* G */
375  { 0, 0, 1, 6, 1 }, /* B */
376  },
378  },
379  [AV_PIX_FMT_BGR4] = {
380  .name = "bgr4",
381  .nb_components = 3,
382  .log2_chroma_w = 0,
383  .log2_chroma_h = 0,
384  .comp = {
385  { 0, 3, 4, 0, 0 }, /* R */
386  { 0, 3, 2, 0, 1 }, /* G */
387  { 0, 3, 1, 0, 0 }, /* B */
388  },
390  },
392  .name = "bgr4_byte",
393  .nb_components = 3,
394  .log2_chroma_w = 0,
395  .log2_chroma_h = 0,
396  .comp = {
397  { 0, 0, 1, 0, 0 }, /* R */
398  { 0, 0, 1, 1, 1 }, /* G */
399  { 0, 0, 1, 3, 0 }, /* B */
400  },
402  },
403  [AV_PIX_FMT_RGB8] = {
404  .name = "rgb8",
405  .nb_components = 3,
406  .log2_chroma_w = 0,
407  .log2_chroma_h = 0,
408  .comp = {
409  { 0, 0, 1, 6, 1 }, /* R */
410  { 0, 0, 1, 3, 2 }, /* G */
411  { 0, 0, 1, 0, 2 }, /* B */
412  },
414  },
415  [AV_PIX_FMT_RGB4] = {
416  .name = "rgb4",
417  .nb_components = 3,
418  .log2_chroma_w = 0,
419  .log2_chroma_h = 0,
420  .comp = {
421  { 0, 3, 1, 0, 0 }, /* R */
422  { 0, 3, 2, 0, 1 }, /* G */
423  { 0, 3, 4, 0, 0 }, /* B */
424  },
426  },
428  .name = "rgb4_byte",
429  .nb_components = 3,
430  .log2_chroma_w = 0,
431  .log2_chroma_h = 0,
432  .comp = {
433  { 0, 0, 1, 3, 0 }, /* R */
434  { 0, 0, 1, 1, 1 }, /* G */
435  { 0, 0, 1, 0, 0 }, /* B */
436  },
438  },
439  [AV_PIX_FMT_NV12] = {
440  .name = "nv12",
441  .nb_components = 3,
442  .log2_chroma_w = 1,
443  .log2_chroma_h = 1,
444  .comp = {
445  { 0, 0, 1, 0, 7 }, /* Y */
446  { 1, 1, 1, 0, 7 }, /* U */
447  { 1, 1, 2, 0, 7 }, /* V */
448  },
449  .flags = AV_PIX_FMT_FLAG_PLANAR,
450  },
451  [AV_PIX_FMT_NV21] = {
452  .name = "nv21",
453  .nb_components = 3,
454  .log2_chroma_w = 1,
455  .log2_chroma_h = 1,
456  .comp = {
457  { 0, 0, 1, 0, 7 }, /* Y */
458  { 1, 1, 2, 0, 7 }, /* U */
459  { 1, 1, 1, 0, 7 }, /* V */
460  },
461  .flags = AV_PIX_FMT_FLAG_PLANAR,
462  },
463  [AV_PIX_FMT_ARGB] = {
464  .name = "argb",
465  .nb_components = 4,
466  .log2_chroma_w = 0,
467  .log2_chroma_h = 0,
468  .comp = {
469  { 0, 3, 2, 0, 7 }, /* R */
470  { 0, 3, 3, 0, 7 }, /* G */
471  { 0, 3, 4, 0, 7 }, /* B */
472  { 0, 3, 1, 0, 7 }, /* A */
473  },
475  },
476  [AV_PIX_FMT_RGBA] = {
477  .name = "rgba",
478  .nb_components = 4,
479  .log2_chroma_w = 0,
480  .log2_chroma_h = 0,
481  .comp = {
482  { 0, 3, 1, 0, 7 }, /* R */
483  { 0, 3, 2, 0, 7 }, /* G */
484  { 0, 3, 3, 0, 7 }, /* B */
485  { 0, 3, 4, 0, 7 }, /* A */
486  },
488  },
489  [AV_PIX_FMT_ABGR] = {
490  .name = "abgr",
491  .nb_components = 4,
492  .log2_chroma_w = 0,
493  .log2_chroma_h = 0,
494  .comp = {
495  { 0, 3, 4, 0, 7 }, /* R */
496  { 0, 3, 3, 0, 7 }, /* G */
497  { 0, 3, 2, 0, 7 }, /* B */
498  { 0, 3, 1, 0, 7 }, /* A */
499  },
501  },
502  [AV_PIX_FMT_BGRA] = {
503  .name = "bgra",
504  .nb_components = 4,
505  .log2_chroma_w = 0,
506  .log2_chroma_h = 0,
507  .comp = {
508  { 0, 3, 3, 0, 7 }, /* R */
509  { 0, 3, 2, 0, 7 }, /* G */
510  { 0, 3, 1, 0, 7 }, /* B */
511  { 0, 3, 4, 0, 7 }, /* A */
512  },
514  },
515  [AV_PIX_FMT_0RGB] = {
516  .name = "0rgb",
517  .nb_components= 3,
518  .log2_chroma_w= 0,
519  .log2_chroma_h= 0,
520  .comp = {
521  { 0, 3, 2, 0, 7 }, /* R */
522  { 0, 3, 3, 0, 7 }, /* G */
523  { 0, 3, 4, 0, 7 }, /* B */
524  },
525  .flags = AV_PIX_FMT_FLAG_RGB,
526  },
527  [AV_PIX_FMT_RGB0] = {
528  .name = "rgb0",
529  .nb_components= 3,
530  .log2_chroma_w= 0,
531  .log2_chroma_h= 0,
532  .comp = {
533  { 0, 3, 1, 0, 7 }, /* R */
534  { 0, 3, 2, 0, 7 }, /* G */
535  { 0, 3, 3, 0, 7 }, /* B */
536  },
537  .flags = AV_PIX_FMT_FLAG_RGB,
538  },
539  [AV_PIX_FMT_0BGR] = {
540  .name = "0bgr",
541  .nb_components= 3,
542  .log2_chroma_w= 0,
543  .log2_chroma_h= 0,
544  .comp = {
545  { 0, 3, 4, 0, 7 }, /* R */
546  { 0, 3, 3, 0, 7 }, /* G */
547  { 0, 3, 2, 0, 7 }, /* B */
548  },
549  .flags = AV_PIX_FMT_FLAG_RGB,
550  },
551  [AV_PIX_FMT_BGR0] = {
552  .name = "bgr0",
553  .nb_components= 3,
554  .log2_chroma_w= 0,
555  .log2_chroma_h= 0,
556  .comp = {
557  { 0, 3, 3, 0, 7 }, /* R */
558  { 0, 3, 2, 0, 7 }, /* G */
559  { 0, 3, 1, 0, 7 }, /* B */
560  },
561  .flags = AV_PIX_FMT_FLAG_RGB,
562  },
563  [AV_PIX_FMT_GRAY16BE] = {
564  .name = "gray16be",
565  .nb_components = 1,
566  .log2_chroma_w = 0,
567  .log2_chroma_h = 0,
568  .comp = {
569  { 0, 1, 1, 0, 15 }, /* Y */
570  },
571  .flags = AV_PIX_FMT_FLAG_BE,
572  .alias = "y16be",
573  },
574  [AV_PIX_FMT_GRAY16LE] = {
575  .name = "gray16le",
576  .nb_components = 1,
577  .log2_chroma_w = 0,
578  .log2_chroma_h = 0,
579  .comp = {
580  { 0, 1, 1, 0, 15 }, /* Y */
581  },
582  .alias = "y16le",
583  },
584  [AV_PIX_FMT_YUV440P] = {
585  .name = "yuv440p",
586  .nb_components = 3,
587  .log2_chroma_w = 0,
588  .log2_chroma_h = 1,
589  .comp = {
590  { 0, 0, 1, 0, 7 }, /* Y */
591  { 1, 0, 1, 0, 7 }, /* U */
592  { 2, 0, 1, 0, 7 }, /* V */
593  },
594  .flags = AV_PIX_FMT_FLAG_PLANAR,
595  },
596  [AV_PIX_FMT_YUVJ440P] = {
597  .name = "yuvj440p",
598  .nb_components = 3,
599  .log2_chroma_w = 0,
600  .log2_chroma_h = 1,
601  .comp = {
602  { 0, 0, 1, 0, 7 }, /* Y */
603  { 1, 0, 1, 0, 7 }, /* U */
604  { 2, 0, 1, 0, 7 }, /* V */
605  },
606  .flags = AV_PIX_FMT_FLAG_PLANAR,
607  },
609  .name = "yuv440p10le",
610  .nb_components = 3,
611  .log2_chroma_w = 0,
612  .log2_chroma_h = 1,
613  .comp = {
614  { 0, 1, 1, 0, 9 }, /* Y */
615  { 1, 1, 1, 0, 9 }, /* U */
616  { 2, 1, 1, 0, 9 }, /* V */
617  },
618  .flags = AV_PIX_FMT_FLAG_PLANAR,
619  },
621  .name = "yuv440p10be",
622  .nb_components = 3,
623  .log2_chroma_w = 0,
624  .log2_chroma_h = 1,
625  .comp = {
626  { 0, 1, 1, 0, 9 }, /* Y */
627  { 1, 1, 1, 0, 9 }, /* U */
628  { 2, 1, 1, 0, 9 }, /* V */
629  },
631  },
633  .name = "yuv440p12le",
634  .nb_components = 3,
635  .log2_chroma_w = 0,
636  .log2_chroma_h = 1,
637  .comp = {
638  { 0, 1, 1, 0, 11 }, /* Y */
639  { 1, 1, 1, 0, 11 }, /* U */
640  { 2, 1, 1, 0, 11 }, /* V */
641  },
642  .flags = AV_PIX_FMT_FLAG_PLANAR,
643  },
645  .name = "yuv440p12be",
646  .nb_components = 3,
647  .log2_chroma_w = 0,
648  .log2_chroma_h = 1,
649  .comp = {
650  { 0, 1, 1, 0, 11 }, /* Y */
651  { 1, 1, 1, 0, 11 }, /* U */
652  { 2, 1, 1, 0, 11 }, /* V */
653  },
655  },
656  [AV_PIX_FMT_YUVA420P] = {
657  .name = "yuva420p",
658  .nb_components = 4,
659  .log2_chroma_w = 1,
660  .log2_chroma_h = 1,
661  .comp = {
662  { 0, 0, 1, 0, 7 }, /* Y */
663  { 1, 0, 1, 0, 7 }, /* U */
664  { 2, 0, 1, 0, 7 }, /* V */
665  { 3, 0, 1, 0, 7 }, /* A */
666  },
668  },
669  [AV_PIX_FMT_YUVA422P] = {
670  .name = "yuva422p",
671  .nb_components = 4,
672  .log2_chroma_w = 1,
673  .log2_chroma_h = 0,
674  .comp = {
675  { 0, 0, 1, 0, 7 }, /* Y */
676  { 1, 0, 1, 0, 7 }, /* U */
677  { 2, 0, 1, 0, 7 }, /* V */
678  { 3, 0, 1, 0, 7 }, /* A */
679  },
681  },
682  [AV_PIX_FMT_YUVA444P] = {
683  .name = "yuva444p",
684  .nb_components = 4,
685  .log2_chroma_w = 0,
686  .log2_chroma_h = 0,
687  .comp = {
688  { 0, 0, 1, 0, 7 }, /* Y */
689  { 1, 0, 1, 0, 7 }, /* U */
690  { 2, 0, 1, 0, 7 }, /* V */
691  { 3, 0, 1, 0, 7 }, /* A */
692  },
694  },
696  .name = "yuva420p9be",
697  .nb_components = 4,
698  .log2_chroma_w = 1,
699  .log2_chroma_h = 1,
700  .comp = {
701  { 0, 1, 1, 0, 8 }, /* Y */
702  { 1, 1, 1, 0, 8 }, /* U */
703  { 2, 1, 1, 0, 8 }, /* V */
704  { 3, 1, 1, 0, 8 }, /* A */
705  },
707  },
709  .name = "yuva420p9le",
710  .nb_components = 4,
711  .log2_chroma_w = 1,
712  .log2_chroma_h = 1,
713  .comp = {
714  { 0, 1, 1, 0, 8 }, /* Y */
715  { 1, 1, 1, 0, 8 }, /* U */
716  { 2, 1, 1, 0, 8 }, /* V */
717  { 3, 1, 1, 0, 8 }, /* A */
718  },
720  },
722  .name = "yuva422p9be",
723  .nb_components = 4,
724  .log2_chroma_w = 1,
725  .log2_chroma_h = 0,
726  .comp = {
727  { 0, 1, 1, 0, 8 }, /* Y */
728  { 1, 1, 1, 0, 8 }, /* U */
729  { 2, 1, 1, 0, 8 }, /* V */
730  { 3, 1, 1, 0, 8 }, /* A */
731  },
733  },
735  .name = "yuva422p9le",
736  .nb_components = 4,
737  .log2_chroma_w = 1,
738  .log2_chroma_h = 0,
739  .comp = {
740  { 0, 1, 1, 0, 8 }, /* Y */
741  { 1, 1, 1, 0, 8 }, /* U */
742  { 2, 1, 1, 0, 8 }, /* V */
743  { 3, 1, 1, 0, 8 }, /* A */
744  },
746  },
748  .name = "yuva444p9be",
749  .nb_components = 4,
750  .log2_chroma_w = 0,
751  .log2_chroma_h = 0,
752  .comp = {
753  { 0, 1, 1, 0, 8 }, /* Y */
754  { 1, 1, 1, 0, 8 }, /* U */
755  { 2, 1, 1, 0, 8 }, /* V */
756  { 3, 1, 1, 0, 8 }, /* A */
757  },
759  },
761  .name = "yuva444p9le",
762  .nb_components = 4,
763  .log2_chroma_w = 0,
764  .log2_chroma_h = 0,
765  .comp = {
766  { 0, 1, 1, 0, 8 }, /* Y */
767  { 1, 1, 1, 0, 8 }, /* U */
768  { 2, 1, 1, 0, 8 }, /* V */
769  { 3, 1, 1, 0, 8 }, /* A */
770  },
772  },
774  .name = "yuva420p10be",
775  .nb_components = 4,
776  .log2_chroma_w = 1,
777  .log2_chroma_h = 1,
778  .comp = {
779  { 0, 1, 1, 0, 9 }, /* Y */
780  { 1, 1, 1, 0, 9 }, /* U */
781  { 2, 1, 1, 0, 9 }, /* V */
782  { 3, 1, 1, 0, 9 }, /* A */
783  },
785  },
787  .name = "yuva420p10le",
788  .nb_components = 4,
789  .log2_chroma_w = 1,
790  .log2_chroma_h = 1,
791  .comp = {
792  { 0, 1, 1, 0, 9 }, /* Y */
793  { 1, 1, 1, 0, 9 }, /* U */
794  { 2, 1, 1, 0, 9 }, /* V */
795  { 3, 1, 1, 0, 9 }, /* A */
796  },
798  },
800  .name = "yuva422p10be",
801  .nb_components = 4,
802  .log2_chroma_w = 1,
803  .log2_chroma_h = 0,
804  .comp = {
805  { 0, 1, 1, 0, 9 }, /* Y */
806  { 1, 1, 1, 0, 9 }, /* U */
807  { 2, 1, 1, 0, 9 }, /* V */
808  { 3, 1, 1, 0, 9 }, /* A */
809  },
811  },
813  .name = "yuva422p10le",
814  .nb_components = 4,
815  .log2_chroma_w = 1,
816  .log2_chroma_h = 0,
817  .comp = {
818  { 0, 1, 1, 0, 9 }, /* Y */
819  { 1, 1, 1, 0, 9 }, /* U */
820  { 2, 1, 1, 0, 9 }, /* V */
821  { 3, 1, 1, 0, 9 }, /* A */
822  },
824  },
826  .name = "yuva444p10be",
827  .nb_components = 4,
828  .log2_chroma_w = 0,
829  .log2_chroma_h = 0,
830  .comp = {
831  { 0, 1, 1, 0, 9 }, /* Y */
832  { 1, 1, 1, 0, 9 }, /* U */
833  { 2, 1, 1, 0, 9 }, /* V */
834  { 3, 1, 1, 0, 9 }, /* A */
835  },
837  },
839  .name = "yuva444p10le",
840  .nb_components = 4,
841  .log2_chroma_w = 0,
842  .log2_chroma_h = 0,
843  .comp = {
844  { 0, 1, 1, 0, 9 }, /* Y */
845  { 1, 1, 1, 0, 9 }, /* U */
846  { 2, 1, 1, 0, 9 }, /* V */
847  { 3, 1, 1, 0, 9 }, /* A */
848  },
850  },
852  .name = "yuva420p16be",
853  .nb_components = 4,
854  .log2_chroma_w = 1,
855  .log2_chroma_h = 1,
856  .comp = {
857  { 0, 1, 1, 0, 15 }, /* Y */
858  { 1, 1, 1, 0, 15 }, /* U */
859  { 2, 1, 1, 0, 15 }, /* V */
860  { 3, 1, 1, 0, 15 }, /* A */
861  },
863  },
865  .name = "yuva420p16le",
866  .nb_components = 4,
867  .log2_chroma_w = 1,
868  .log2_chroma_h = 1,
869  .comp = {
870  { 0, 1, 1, 0, 15 }, /* Y */
871  { 1, 1, 1, 0, 15 }, /* U */
872  { 2, 1, 1, 0, 15 }, /* V */
873  { 3, 1, 1, 0, 15 }, /* A */
874  },
876  },
878  .name = "yuva422p16be",
879  .nb_components = 4,
880  .log2_chroma_w = 1,
881  .log2_chroma_h = 0,
882  .comp = {
883  { 0, 1, 1, 0, 15 }, /* Y */
884  { 1, 1, 1, 0, 15 }, /* U */
885  { 2, 1, 1, 0, 15 }, /* V */
886  { 3, 1, 1, 0, 15 }, /* A */
887  },
889  },
891  .name = "yuva422p16le",
892  .nb_components = 4,
893  .log2_chroma_w = 1,
894  .log2_chroma_h = 0,
895  .comp = {
896  { 0, 1, 1, 0, 15 }, /* Y */
897  { 1, 1, 1, 0, 15 }, /* U */
898  { 2, 1, 1, 0, 15 }, /* V */
899  { 3, 1, 1, 0, 15 }, /* A */
900  },
902  },
904  .name = "yuva444p16be",
905  .nb_components = 4,
906  .log2_chroma_w = 0,
907  .log2_chroma_h = 0,
908  .comp = {
909  { 0, 1, 1, 0, 15 }, /* Y */
910  { 1, 1, 1, 0, 15 }, /* U */
911  { 2, 1, 1, 0, 15 }, /* V */
912  { 3, 1, 1, 0, 15 }, /* A */
913  },
915  },
917  .name = "yuva444p16le",
918  .nb_components = 4,
919  .log2_chroma_w = 0,
920  .log2_chroma_h = 0,
921  .comp = {
922  { 0, 1, 1, 0, 15 }, /* Y */
923  { 1, 1, 1, 0, 15 }, /* U */
924  { 2, 1, 1, 0, 15 }, /* V */
925  { 3, 1, 1, 0, 15 }, /* A */
926  },
928  },
929 #if FF_API_VDPAU
931  .name = "vdpau_h264",
932  .log2_chroma_w = 1,
933  .log2_chroma_h = 1,
934  .flags = AV_PIX_FMT_FLAG_HWACCEL,
935  },
937  .name = "vdpau_mpeg1",
938  .log2_chroma_w = 1,
939  .log2_chroma_h = 1,
940  .flags = AV_PIX_FMT_FLAG_HWACCEL,
941  },
943  .name = "vdpau_mpeg2",
944  .log2_chroma_w = 1,
945  .log2_chroma_h = 1,
946  .flags = AV_PIX_FMT_FLAG_HWACCEL,
947  },
949  .name = "vdpau_wmv3",
950  .log2_chroma_w = 1,
951  .log2_chroma_h = 1,
952  .flags = AV_PIX_FMT_FLAG_HWACCEL,
953  },
955  .name = "vdpau_vc1",
956  .log2_chroma_w = 1,
957  .log2_chroma_h = 1,
958  .flags = AV_PIX_FMT_FLAG_HWACCEL,
959  },
961  .name = "vdpau_mpeg4",
962  .log2_chroma_w = 1,
963  .log2_chroma_h = 1,
964  .flags = AV_PIX_FMT_FLAG_HWACCEL,
965  },
966 #endif
967  [AV_PIX_FMT_RGB48BE] = {
968  .name = "rgb48be",
969  .nb_components = 3,
970  .log2_chroma_w = 0,
971  .log2_chroma_h = 0,
972  .comp = {
973  { 0, 5, 1, 0, 15 }, /* R */
974  { 0, 5, 3, 0, 15 }, /* G */
975  { 0, 5, 5, 0, 15 }, /* B */
976  },
978  },
979  [AV_PIX_FMT_RGB48LE] = {
980  .name = "rgb48le",
981  .nb_components = 3,
982  .log2_chroma_w = 0,
983  .log2_chroma_h = 0,
984  .comp = {
985  { 0, 5, 1, 0, 15 }, /* R */
986  { 0, 5, 3, 0, 15 }, /* G */
987  { 0, 5, 5, 0, 15 }, /* B */
988  },
989  .flags = AV_PIX_FMT_FLAG_RGB,
990  },
991  [AV_PIX_FMT_RGBA64BE] = {
992  .name = "rgba64be",
993  .nb_components = 4,
994  .log2_chroma_w = 0,
995  .log2_chroma_h = 0,
996  .comp = {
997  { 0, 7, 1, 0, 15 }, /* R */
998  { 0, 7, 3, 0, 15 }, /* G */
999  { 0, 7, 5, 0, 15 }, /* B */
1000  { 0, 7, 7, 0, 15 }, /* A */
1001  },
1003  },
1004  [AV_PIX_FMT_RGBA64LE] = {
1005  .name = "rgba64le",
1006  .nb_components = 4,
1007  .log2_chroma_w = 0,
1008  .log2_chroma_h = 0,
1009  .comp = {
1010  { 0, 7, 1, 0, 15 }, /* R */
1011  { 0, 7, 3, 0, 15 }, /* G */
1012  { 0, 7, 5, 0, 15 }, /* B */
1013  { 0, 7, 7, 0, 15 }, /* A */
1014  },
1016  },
1017  [AV_PIX_FMT_RGB565BE] = {
1018  .name = "rgb565be",
1019  .nb_components = 3,
1020  .log2_chroma_w = 0,
1021  .log2_chroma_h = 0,
1022  .comp = {
1023  { 0, 1, 0, 3, 4 }, /* R */
1024  { 0, 1, 1, 5, 5 }, /* G */
1025  { 0, 1, 1, 0, 4 }, /* B */
1026  },
1028  },
1029  [AV_PIX_FMT_RGB565LE] = {
1030  .name = "rgb565le",
1031  .nb_components = 3,
1032  .log2_chroma_w = 0,
1033  .log2_chroma_h = 0,
1034  .comp = {
1035  { 0, 1, 2, 3, 4 }, /* R */
1036  { 0, 1, 1, 5, 5 }, /* G */
1037  { 0, 1, 1, 0, 4 }, /* B */
1038  },
1039  .flags = AV_PIX_FMT_FLAG_RGB,
1040  },
1041  [AV_PIX_FMT_RGB555BE] = {
1042  .name = "rgb555be",
1043  .nb_components = 3,
1044  .log2_chroma_w = 0,
1045  .log2_chroma_h = 0,
1046  .comp = {
1047  { 0, 1, 0, 2, 4 }, /* R */
1048  { 0, 1, 1, 5, 4 }, /* G */
1049  { 0, 1, 1, 0, 4 }, /* B */
1050  },
1052  },
1053  [AV_PIX_FMT_RGB555LE] = {
1054  .name = "rgb555le",
1055  .nb_components = 3,
1056  .log2_chroma_w = 0,
1057  .log2_chroma_h = 0,
1058  .comp = {
1059  { 0, 1, 2, 2, 4 }, /* R */
1060  { 0, 1, 1, 5, 4 }, /* G */
1061  { 0, 1, 1, 0, 4 }, /* B */
1062  },
1063  .flags = AV_PIX_FMT_FLAG_RGB,
1064  },
1065  [AV_PIX_FMT_RGB444BE] = {
1066  .name = "rgb444be",
1067  .nb_components = 3,
1068  .log2_chroma_w = 0,
1069  .log2_chroma_h = 0,
1070  .comp = {
1071  { 0, 1, 0, 0, 3 }, /* R */
1072  { 0, 1, 1, 4, 3 }, /* G */
1073  { 0, 1, 1, 0, 3 }, /* B */
1074  },
1076  },
1077  [AV_PIX_FMT_RGB444LE] = {
1078  .name = "rgb444le",
1079  .nb_components = 3,
1080  .log2_chroma_w = 0,
1081  .log2_chroma_h = 0,
1082  .comp = {
1083  { 0, 1, 2, 0, 3 }, /* R */
1084  { 0, 1, 1, 4, 3 }, /* G */
1085  { 0, 1, 1, 0, 3 }, /* B */
1086  },
1087  .flags = AV_PIX_FMT_FLAG_RGB,
1088  },
1089  [AV_PIX_FMT_BGR48BE] = {
1090  .name = "bgr48be",
1091  .nb_components = 3,
1092  .log2_chroma_w = 0,
1093  .log2_chroma_h = 0,
1094  .comp = {
1095  { 0, 5, 5, 0, 15 }, /* R */
1096  { 0, 5, 3, 0, 15 }, /* G */
1097  { 0, 5, 1, 0, 15 }, /* B */
1098  },
1100  },
1101  [AV_PIX_FMT_BGR48LE] = {
1102  .name = "bgr48le",
1103  .nb_components = 3,
1104  .log2_chroma_w = 0,
1105  .log2_chroma_h = 0,
1106  .comp = {
1107  { 0, 5, 5, 0, 15 }, /* R */
1108  { 0, 5, 3, 0, 15 }, /* G */
1109  { 0, 5, 1, 0, 15 }, /* B */
1110  },
1111  .flags = AV_PIX_FMT_FLAG_RGB,
1112  },
1113  [AV_PIX_FMT_BGRA64BE] = {
1114  .name = "bgra64be",
1115  .nb_components = 4,
1116  .log2_chroma_w = 0,
1117  .log2_chroma_h = 0,
1118  .comp = {
1119  { 0, 7, 5, 0, 15 }, /* R */
1120  { 0, 7, 3, 0, 15 }, /* G */
1121  { 0, 7, 1, 0, 15 }, /* B */
1122  { 0, 7, 7, 0, 15 }, /* A */
1123  },
1125  },
1126  [AV_PIX_FMT_BGRA64LE] = {
1127  .name = "bgra64le",
1128  .nb_components = 4,
1129  .log2_chroma_w = 0,
1130  .log2_chroma_h = 0,
1131  .comp = {
1132  { 0, 7, 5, 0, 15 }, /* R */
1133  { 0, 7, 3, 0, 15 }, /* G */
1134  { 0, 7, 1, 0, 15 }, /* B */
1135  { 0, 7, 7, 0, 15 }, /* A */
1136  },
1138  },
1139  [AV_PIX_FMT_BGR565BE] = {
1140  .name = "bgr565be",
1141  .nb_components = 3,
1142  .log2_chroma_w = 0,
1143  .log2_chroma_h = 0,
1144  .comp = {
1145  { 0, 1, 1, 0, 4 }, /* R */
1146  { 0, 1, 1, 5, 5 }, /* G */
1147  { 0, 1, 0, 3, 4 }, /* B */
1148  },
1150  },
1151  [AV_PIX_FMT_BGR565LE] = {
1152  .name = "bgr565le",
1153  .nb_components = 3,
1154  .log2_chroma_w = 0,
1155  .log2_chroma_h = 0,
1156  .comp = {
1157  { 0, 1, 1, 0, 4 }, /* R */
1158  { 0, 1, 1, 5, 5 }, /* G */
1159  { 0, 1, 2, 3, 4 }, /* B */
1160  },
1161  .flags = AV_PIX_FMT_FLAG_RGB,
1162  },
1163  [AV_PIX_FMT_BGR555BE] = {
1164  .name = "bgr555be",
1165  .nb_components = 3,
1166  .log2_chroma_w = 0,
1167  .log2_chroma_h = 0,
1168  .comp = {
1169  { 0, 1, 1, 0, 4 }, /* R */
1170  { 0, 1, 1, 5, 4 }, /* G */
1171  { 0, 1, 0, 2, 4 }, /* B */
1172  },
1174  },
1175  [AV_PIX_FMT_BGR555LE] = {
1176  .name = "bgr555le",
1177  .nb_components = 3,
1178  .log2_chroma_w = 0,
1179  .log2_chroma_h = 0,
1180  .comp = {
1181  { 0, 1, 1, 0, 4 }, /* R */
1182  { 0, 1, 1, 5, 4 }, /* G */
1183  { 0, 1, 2, 2, 4 }, /* B */
1184  },
1185  .flags = AV_PIX_FMT_FLAG_RGB,
1186  },
1187  [AV_PIX_FMT_BGR444BE] = {
1188  .name = "bgr444be",
1189  .nb_components = 3,
1190  .log2_chroma_w = 0,
1191  .log2_chroma_h = 0,
1192  .comp = {
1193  { 0, 1, 1, 0, 3 }, /* R */
1194  { 0, 1, 1, 4, 3 }, /* G */
1195  { 0, 1, 0, 0, 3 }, /* B */
1196  },
1198  },
1199  [AV_PIX_FMT_BGR444LE] = {
1200  .name = "bgr444le",
1201  .nb_components = 3,
1202  .log2_chroma_w = 0,
1203  .log2_chroma_h = 0,
1204  .comp = {
1205  { 0, 1, 1, 0, 3 }, /* R */
1206  { 0, 1, 1, 4, 3 }, /* G */
1207  { 0, 1, 2, 0, 3 }, /* B */
1208  },
1209  .flags = AV_PIX_FMT_FLAG_RGB,
1210  },
1211 #if FF_API_VAAPI
1212  [AV_PIX_FMT_VAAPI_MOCO] = {
1213  .name = "vaapi_moco",
1214  .log2_chroma_w = 1,
1215  .log2_chroma_h = 1,
1216  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1217  },
1218  [AV_PIX_FMT_VAAPI_IDCT] = {
1219  .name = "vaapi_idct",
1220  .log2_chroma_w = 1,
1221  .log2_chroma_h = 1,
1222  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1223  },
1224  [AV_PIX_FMT_VAAPI_VLD] = {
1225  .name = "vaapi_vld",
1226  .log2_chroma_w = 1,
1227  .log2_chroma_h = 1,
1228  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1229  },
1230 #else
1231  [AV_PIX_FMT_VAAPI] = {
1232  .name = "vaapi",
1233  .log2_chroma_w = 1,
1234  .log2_chroma_h = 1,
1235  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1236  },
1237 #endif
1238  [AV_PIX_FMT_YUV420P9LE] = {
1239  .name = "yuv420p9le",
1240  .nb_components = 3,
1241  .log2_chroma_w = 1,
1242  .log2_chroma_h = 1,
1243  .comp = {
1244  { 0, 1, 1, 0, 8 }, /* Y */
1245  { 1, 1, 1, 0, 8 }, /* U */
1246  { 2, 1, 1, 0, 8 }, /* V */
1247  },
1248  .flags = AV_PIX_FMT_FLAG_PLANAR,
1249  },
1250  [AV_PIX_FMT_YUV420P9BE] = {
1251  .name = "yuv420p9be",
1252  .nb_components = 3,
1253  .log2_chroma_w = 1,
1254  .log2_chroma_h = 1,
1255  .comp = {
1256  { 0, 1, 1, 0, 8 }, /* Y */
1257  { 1, 1, 1, 0, 8 }, /* U */
1258  { 2, 1, 1, 0, 8 }, /* V */
1259  },
1261  },
1263  .name = "yuv420p10le",
1264  .nb_components = 3,
1265  .log2_chroma_w = 1,
1266  .log2_chroma_h = 1,
1267  .comp = {
1268  { 0, 1, 1, 0, 9 }, /* Y */
1269  { 1, 1, 1, 0, 9 }, /* U */
1270  { 2, 1, 1, 0, 9 }, /* V */
1271  },
1272  .flags = AV_PIX_FMT_FLAG_PLANAR,
1273  },
1275  .name = "yuv420p10be",
1276  .nb_components = 3,
1277  .log2_chroma_w = 1,
1278  .log2_chroma_h = 1,
1279  .comp = {
1280  { 0, 1, 1, 0, 9 }, /* Y */
1281  { 1, 1, 1, 0, 9 }, /* U */
1282  { 2, 1, 1, 0, 9 }, /* V */
1283  },
1285  },
1287  .name = "yuv420p12le",
1288  .nb_components = 3,
1289  .log2_chroma_w = 1,
1290  .log2_chroma_h = 1,
1291  .comp = {
1292  { 0, 1, 1, 0, 11 }, /* Y */
1293  { 1, 1, 1, 0, 11 }, /* U */
1294  { 2, 1, 1, 0, 11 }, /* V */
1295  },
1296  .flags = AV_PIX_FMT_FLAG_PLANAR,
1297  },
1299  .name = "yuv420p12be",
1300  .nb_components = 3,
1301  .log2_chroma_w = 1,
1302  .log2_chroma_h = 1,
1303  .comp = {
1304  { 0, 1, 1, 0, 11 }, /* Y */
1305  { 1, 1, 1, 0, 11 }, /* U */
1306  { 2, 1, 1, 0, 11 }, /* V */
1307  },
1309  },
1311  .name = "yuv420p14le",
1312  .nb_components = 3,
1313  .log2_chroma_w = 1,
1314  .log2_chroma_h = 1,
1315  .comp = {
1316  { 0, 1, 1, 0, 13 }, /* Y */
1317  { 1, 1, 1, 0, 13 }, /* U */
1318  { 2, 1, 1, 0, 13 }, /* V */
1319  },
1320  .flags = AV_PIX_FMT_FLAG_PLANAR,
1321  },
1323  .name = "yuv420p14be",
1324  .nb_components = 3,
1325  .log2_chroma_w = 1,
1326  .log2_chroma_h = 1,
1327  .comp = {
1328  { 0, 1, 1, 0, 13 }, /* Y */
1329  { 1, 1, 1, 0, 13 }, /* U */
1330  { 2, 1, 1, 0, 13 }, /* V */
1331  },
1333  },
1335  .name = "yuv420p16le",
1336  .nb_components = 3,
1337  .log2_chroma_w = 1,
1338  .log2_chroma_h = 1,
1339  .comp = {
1340  { 0, 1, 1, 0, 15 }, /* Y */
1341  { 1, 1, 1, 0, 15 }, /* U */
1342  { 2, 1, 1, 0, 15 }, /* V */
1343  },
1344  .flags = AV_PIX_FMT_FLAG_PLANAR,
1345  },
1347  .name = "yuv420p16be",
1348  .nb_components = 3,
1349  .log2_chroma_w = 1,
1350  .log2_chroma_h = 1,
1351  .comp = {
1352  { 0, 1, 1, 0, 15 }, /* Y */
1353  { 1, 1, 1, 0, 15 }, /* U */
1354  { 2, 1, 1, 0, 15 }, /* V */
1355  },
1357  },
1358  [AV_PIX_FMT_YUV422P9LE] = {
1359  .name = "yuv422p9le",
1360  .nb_components = 3,
1361  .log2_chroma_w = 1,
1362  .log2_chroma_h = 0,
1363  .comp = {
1364  { 0, 1, 1, 0, 8 }, /* Y */
1365  { 1, 1, 1, 0, 8 }, /* U */
1366  { 2, 1, 1, 0, 8 }, /* V */
1367  },
1368  .flags = AV_PIX_FMT_FLAG_PLANAR,
1369  },
1370  [AV_PIX_FMT_YUV422P9BE] = {
1371  .name = "yuv422p9be",
1372  .nb_components = 3,
1373  .log2_chroma_w = 1,
1374  .log2_chroma_h = 0,
1375  .comp = {
1376  { 0, 1, 1, 0, 8 }, /* Y */
1377  { 1, 1, 1, 0, 8 }, /* U */
1378  { 2, 1, 1, 0, 8 }, /* V */
1379  },
1381  },
1383  .name = "yuv422p10le",
1384  .nb_components = 3,
1385  .log2_chroma_w = 1,
1386  .log2_chroma_h = 0,
1387  .comp = {
1388  { 0, 1, 1, 0, 9 }, /* Y */
1389  { 1, 1, 1, 0, 9 }, /* U */
1390  { 2, 1, 1, 0, 9 }, /* V */
1391  },
1392  .flags = AV_PIX_FMT_FLAG_PLANAR,
1393  },
1395  .name = "yuv422p10be",
1396  .nb_components = 3,
1397  .log2_chroma_w = 1,
1398  .log2_chroma_h = 0,
1399  .comp = {
1400  { 0, 1, 1, 0, 9 }, /* Y */
1401  { 1, 1, 1, 0, 9 }, /* U */
1402  { 2, 1, 1, 0, 9 }, /* V */
1403  },
1405  },
1407  .name = "yuv422p12le",
1408  .nb_components = 3,
1409  .log2_chroma_w = 1,
1410  .log2_chroma_h = 0,
1411  .comp = {
1412  { 0, 1, 1, 0, 11 }, /* Y */
1413  { 1, 1, 1, 0, 11 }, /* U */
1414  { 2, 1, 1, 0, 11 }, /* V */
1415  },
1416  .flags = AV_PIX_FMT_FLAG_PLANAR,
1417  },
1419  .name = "yuv422p12be",
1420  .nb_components = 3,
1421  .log2_chroma_w = 1,
1422  .log2_chroma_h = 0,
1423  .comp = {
1424  { 0, 1, 1, 0, 11 }, /* Y */
1425  { 1, 1, 1, 0, 11 }, /* U */
1426  { 2, 1, 1, 0, 11 }, /* V */
1427  },
1429  },
1431  .name = "yuv422p14le",
1432  .nb_components = 3,
1433  .log2_chroma_w = 1,
1434  .log2_chroma_h = 0,
1435  .comp = {
1436  { 0, 1, 1, 0, 13 }, /* Y */
1437  { 1, 1, 1, 0, 13 }, /* U */
1438  { 2, 1, 1, 0, 13 }, /* V */
1439  },
1440  .flags = AV_PIX_FMT_FLAG_PLANAR,
1441  },
1443  .name = "yuv422p14be",
1444  .nb_components = 3,
1445  .log2_chroma_w = 1,
1446  .log2_chroma_h = 0,
1447  .comp = {
1448  { 0, 1, 1, 0, 13 }, /* Y */
1449  { 1, 1, 1, 0, 13 }, /* U */
1450  { 2, 1, 1, 0, 13 }, /* V */
1451  },
1453  },
1455  .name = "yuv422p16le",
1456  .nb_components = 3,
1457  .log2_chroma_w = 1,
1458  .log2_chroma_h = 0,
1459  .comp = {
1460  { 0, 1, 1, 0, 15 }, /* Y */
1461  { 1, 1, 1, 0, 15 }, /* U */
1462  { 2, 1, 1, 0, 15 }, /* V */
1463  },
1464  .flags = AV_PIX_FMT_FLAG_PLANAR,
1465  },
1467  .name = "yuv422p16be",
1468  .nb_components = 3,
1469  .log2_chroma_w = 1,
1470  .log2_chroma_h = 0,
1471  .comp = {
1472  { 0, 1, 1, 0, 15 }, /* Y */
1473  { 1, 1, 1, 0, 15 }, /* U */
1474  { 2, 1, 1, 0, 15 }, /* V */
1475  },
1477  },
1479  .name = "yuv444p16le",
1480  .nb_components = 3,
1481  .log2_chroma_w = 0,
1482  .log2_chroma_h = 0,
1483  .comp = {
1484  { 0, 1, 1, 0, 15 }, /* Y */
1485  { 1, 1, 1, 0, 15 }, /* U */
1486  { 2, 1, 1, 0, 15 }, /* V */
1487  },
1488  .flags = AV_PIX_FMT_FLAG_PLANAR,
1489  },
1491  .name = "yuv444p16be",
1492  .nb_components = 3,
1493  .log2_chroma_w = 0,
1494  .log2_chroma_h = 0,
1495  .comp = {
1496  { 0, 1, 1, 0, 15 }, /* Y */
1497  { 1, 1, 1, 0, 15 }, /* U */
1498  { 2, 1, 1, 0, 15 }, /* V */
1499  },
1501  },
1503  .name = "yuv444p10le",
1504  .nb_components = 3,
1505  .log2_chroma_w = 0,
1506  .log2_chroma_h = 0,
1507  .comp = {
1508  { 0, 1, 1, 0, 9 }, /* Y */
1509  { 1, 1, 1, 0, 9 }, /* U */
1510  { 2, 1, 1, 0, 9 }, /* V */
1511  },
1512  .flags = AV_PIX_FMT_FLAG_PLANAR,
1513  },
1515  .name = "yuv444p10be",
1516  .nb_components = 3,
1517  .log2_chroma_w = 0,
1518  .log2_chroma_h = 0,
1519  .comp = {
1520  { 0, 1, 1, 0, 9 }, /* Y */
1521  { 1, 1, 1, 0, 9 }, /* U */
1522  { 2, 1, 1, 0, 9 }, /* V */
1523  },
1525  },
1526  [AV_PIX_FMT_YUV444P9LE] = {
1527  .name = "yuv444p9le",
1528  .nb_components = 3,
1529  .log2_chroma_w = 0,
1530  .log2_chroma_h = 0,
1531  .comp = {
1532  { 0, 1, 1, 0, 8 }, /* Y */
1533  { 1, 1, 1, 0, 8 }, /* U */
1534  { 2, 1, 1, 0, 8 }, /* V */
1535  },
1536  .flags = AV_PIX_FMT_FLAG_PLANAR,
1537  },
1538  [AV_PIX_FMT_YUV444P9BE] = {
1539  .name = "yuv444p9be",
1540  .nb_components = 3,
1541  .log2_chroma_w = 0,
1542  .log2_chroma_h = 0,
1543  .comp = {
1544  { 0, 1, 1, 0, 8 }, /* Y */
1545  { 1, 1, 1, 0, 8 }, /* U */
1546  { 2, 1, 1, 0, 8 }, /* V */
1547  },
1549  },
1551  .name = "yuv444p12le",
1552  .nb_components = 3,
1553  .log2_chroma_w = 0,
1554  .log2_chroma_h = 0,
1555  .comp = {
1556  { 0, 1, 1, 0, 11 }, /* Y */
1557  { 1, 1, 1, 0, 11 }, /* U */
1558  { 2, 1, 1, 0, 11 }, /* V */
1559  },
1560  .flags = AV_PIX_FMT_FLAG_PLANAR,
1561  },
1563  .name = "yuv444p12be",
1564  .nb_components = 3,
1565  .log2_chroma_w = 0,
1566  .log2_chroma_h = 0,
1567  .comp = {
1568  { 0, 1, 1, 0, 11 }, /* Y */
1569  { 1, 1, 1, 0, 11 }, /* U */
1570  { 2, 1, 1, 0, 11 }, /* V */
1571  },
1573  },
1575  .name = "yuv444p14le",
1576  .nb_components = 3,
1577  .log2_chroma_w = 0,
1578  .log2_chroma_h = 0,
1579  .comp = {
1580  { 0, 1, 1, 0, 13 }, /* Y */
1581  { 1, 1, 1, 0, 13 }, /* U */
1582  { 2, 1, 1, 0, 13 }, /* V */
1583  },
1584  .flags = AV_PIX_FMT_FLAG_PLANAR,
1585  },
1587  .name = "yuv444p14be",
1588  .nb_components = 3,
1589  .log2_chroma_w = 0,
1590  .log2_chroma_h = 0,
1591  .comp = {
1592  { 0, 1, 1, 0, 13 }, /* Y */
1593  { 1, 1, 1, 0, 13 }, /* U */
1594  { 2, 1, 1, 0, 13 }, /* V */
1595  },
1597  },
1599  .name = "d3d11va_vld",
1600  .log2_chroma_w = 1,
1601  .log2_chroma_h = 1,
1602  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1603  },
1604  [AV_PIX_FMT_DXVA2_VLD] = {
1605  .name = "dxva2_vld",
1606  .log2_chroma_w = 1,
1607  .log2_chroma_h = 1,
1608  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1609  },
1610  [AV_PIX_FMT_VDA_VLD] = {
1611  .name = "vda_vld",
1612  .log2_chroma_w = 1,
1613  .log2_chroma_h = 1,
1614  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1615  },
1616  [AV_PIX_FMT_YA8] = {
1617  .name = "ya8",
1618  .nb_components = 2,
1619  .comp = {
1620  { 0, 1, 1, 0, 7 }, /* Y */
1621  { 0, 1, 2, 0, 7 }, /* A */
1622  },
1623  .flags = AV_PIX_FMT_FLAG_ALPHA,
1624  .alias = "gray8a",
1625  },
1626  [AV_PIX_FMT_YA16LE] = {
1627  .name = "ya16le",
1628  .nb_components = 2,
1629  .comp = {
1630  { 0, 3, 1, 0, 15 }, /* Y */
1631  { 0, 3, 3, 0, 15 }, /* A */
1632  },
1633  .flags = AV_PIX_FMT_FLAG_ALPHA,
1634  },
1635  [AV_PIX_FMT_YA16BE] = {
1636  .name = "ya16be",
1637  .nb_components = 2,
1638  .comp = {
1639  { 0, 3, 1, 0, 15 }, /* Y */
1640  { 0, 3, 3, 0, 15 }, /* A */
1641  },
1643  },
1645  .name = "videotoolbox_vld",
1646  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1647  },
1648  [AV_PIX_FMT_GBRP] = {
1649  .name = "gbrp",
1650  .nb_components = 3,
1651  .log2_chroma_w = 0,
1652  .log2_chroma_h = 0,
1653  .comp = {
1654  { 2, 0, 1, 0, 7 }, /* R */
1655  { 0, 0, 1, 0, 7 }, /* G */
1656  { 1, 0, 1, 0, 7 }, /* B */
1657  },
1659  },
1660  [AV_PIX_FMT_GBRP9LE] = {
1661  .name = "gbrp9le",
1662  .nb_components = 3,
1663  .log2_chroma_w = 0,
1664  .log2_chroma_h = 0,
1665  .comp = {
1666  { 2, 1, 1, 0, 8 }, /* R */
1667  { 0, 1, 1, 0, 8 }, /* G */
1668  { 1, 1, 1, 0, 8 }, /* B */
1669  },
1671  },
1672  [AV_PIX_FMT_GBRP9BE] = {
1673  .name = "gbrp9be",
1674  .nb_components = 3,
1675  .log2_chroma_w = 0,
1676  .log2_chroma_h = 0,
1677  .comp = {
1678  { 2, 1, 1, 0, 8 }, /* R */
1679  { 0, 1, 1, 0, 8 }, /* G */
1680  { 1, 1, 1, 0, 8 }, /* B */
1681  },
1683  },
1684  [AV_PIX_FMT_GBRP10LE] = {
1685  .name = "gbrp10le",
1686  .nb_components = 3,
1687  .log2_chroma_w = 0,
1688  .log2_chroma_h = 0,
1689  .comp = {
1690  { 2, 1, 1, 0, 9 }, /* R */
1691  { 0, 1, 1, 0, 9 }, /* G */
1692  { 1, 1, 1, 0, 9 }, /* B */
1693  },
1695  },
1696  [AV_PIX_FMT_GBRP10BE] = {
1697  .name = "gbrp10be",
1698  .nb_components = 3,
1699  .log2_chroma_w = 0,
1700  .log2_chroma_h = 0,
1701  .comp = {
1702  { 2, 1, 1, 0, 9 }, /* R */
1703  { 0, 1, 1, 0, 9 }, /* G */
1704  { 1, 1, 1, 0, 9 }, /* B */
1705  },
1707  },
1708  [AV_PIX_FMT_GBRP12LE] = {
1709  .name = "gbrp12le",
1710  .nb_components = 3,
1711  .log2_chroma_w = 0,
1712  .log2_chroma_h = 0,
1713  .comp = {
1714  { 2, 1, 1, 0, 11 }, /* R */
1715  { 0, 1, 1, 0, 11 }, /* G */
1716  { 1, 1, 1, 0, 11 }, /* B */
1717  },
1719  },
1720  [AV_PIX_FMT_GBRP12BE] = {
1721  .name = "gbrp12be",
1722  .nb_components = 3,
1723  .log2_chroma_w = 0,
1724  .log2_chroma_h = 0,
1725  .comp = {
1726  { 2, 1, 1, 0, 11 }, /* R */
1727  { 0, 1, 1, 0, 11 }, /* G */
1728  { 1, 1, 1, 0, 11 }, /* B */
1729  },
1731  },
1732  [AV_PIX_FMT_GBRP14LE] = {
1733  .name = "gbrp14le",
1734  .nb_components = 3,
1735  .log2_chroma_w = 0,
1736  .log2_chroma_h = 0,
1737  .comp = {
1738  { 2, 1, 1, 0, 13 }, /* R */
1739  { 0, 1, 1, 0, 13 }, /* G */
1740  { 1, 1, 1, 0, 13 }, /* B */
1741  },
1743  },
1744  [AV_PIX_FMT_GBRP14BE] = {
1745  .name = "gbrp14be",
1746  .nb_components = 3,
1747  .log2_chroma_w = 0,
1748  .log2_chroma_h = 0,
1749  .comp = {
1750  { 2, 1, 1, 0, 13 }, /* R */
1751  { 0, 1, 1, 0, 13 }, /* G */
1752  { 1, 1, 1, 0, 13 }, /* B */
1753  },
1755  },
1756  [AV_PIX_FMT_GBRP16LE] = {
1757  .name = "gbrp16le",
1758  .nb_components = 3,
1759  .log2_chroma_w = 0,
1760  .log2_chroma_h = 0,
1761  .comp = {
1762  { 2, 1, 1, 0, 15 }, /* R */
1763  { 0, 1, 1, 0, 15 }, /* G */
1764  { 1, 1, 1, 0, 15 }, /* B */
1765  },
1767  },
1768  [AV_PIX_FMT_GBRP16BE] = {
1769  .name = "gbrp16be",
1770  .nb_components = 3,
1771  .log2_chroma_w = 0,
1772  .log2_chroma_h = 0,
1773  .comp = {
1774  { 2, 1, 1, 0, 15 }, /* R */
1775  { 0, 1, 1, 0, 15 }, /* G */
1776  { 1, 1, 1, 0, 15 }, /* B */
1777  },
1779  },
1780  [AV_PIX_FMT_GBRAP] = {
1781  .name = "gbrap",
1782  .nb_components = 4,
1783  .log2_chroma_w = 0,
1784  .log2_chroma_h = 0,
1785  .comp = {
1786  { 2, 0, 1, 0, 7 }, /* R */
1787  { 0, 0, 1, 0, 7 }, /* G */
1788  { 1, 0, 1, 0, 7 }, /* B */
1789  { 3, 0, 1, 0, 7 }, /* A */
1790  },
1793  },
1794  [AV_PIX_FMT_GBRAP16LE] = {
1795  .name = "gbrap16le",
1796  .nb_components = 4,
1797  .log2_chroma_w = 0,
1798  .log2_chroma_h = 0,
1799  .comp = {
1800  { 2, 1, 1, 0, 15 }, /* R */
1801  { 0, 1, 1, 0, 15 }, /* G */
1802  { 1, 1, 1, 0, 15 }, /* B */
1803  { 3, 1, 1, 0, 15 }, /* A */
1804  },
1807  },
1808  [AV_PIX_FMT_GBRAP16BE] = {
1809  .name = "gbrap16be",
1810  .nb_components = 4,
1811  .log2_chroma_w = 0,
1812  .log2_chroma_h = 0,
1813  .comp = {
1814  { 2, 1, 1, 0, 15 }, /* R */
1815  { 0, 1, 1, 0, 15 }, /* G */
1816  { 1, 1, 1, 0, 15 }, /* B */
1817  { 3, 1, 1, 0, 15 }, /* A */
1818  },
1821  },
1822  [AV_PIX_FMT_VDPAU] = {
1823  .name = "vdpau",
1824  .log2_chroma_w = 1,
1825  .log2_chroma_h = 1,
1826  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1827  },
1828  [AV_PIX_FMT_XYZ12LE] = {
1829  .name = "xyz12le",
1830  .nb_components = 3,
1831  .log2_chroma_w = 0,
1832  .log2_chroma_h = 0,
1833  .comp = {
1834  { 0, 5, 1, 4, 11 }, /* X */
1835  { 0, 5, 3, 4, 11 }, /* Y */
1836  { 0, 5, 5, 4, 11 }, /* Z */
1837  },
1838  /*.flags = -- not used*/
1839  },
1840  [AV_PIX_FMT_XYZ12BE] = {
1841  .name = "xyz12be",
1842  .nb_components = 3,
1843  .log2_chroma_w = 0,
1844  .log2_chroma_h = 0,
1845  .comp = {
1846  { 0, 5, 1, 4, 11 }, /* X */
1847  { 0, 5, 3, 4, 11 }, /* Y */
1848  { 0, 5, 5, 4, 11 }, /* Z */
1849  },
1850  .flags = AV_PIX_FMT_FLAG_BE,
1851  },
1852 
1853 #define BAYER8_DESC_COMMON \
1854  .nb_components= 3, \
1855  .log2_chroma_w= 0, \
1856  .log2_chroma_h= 0, \
1857  .comp = { \
1858  {0,0,0,0,1}, \
1859  {0,0,0,0,3}, \
1860  {0,0,0,0,1}, \
1861  }, \
1862 
1863 #define BAYER16_DESC_COMMON \
1864  .nb_components= 3, \
1865  .log2_chroma_w= 0, \
1866  .log2_chroma_h= 0, \
1867  .comp = { \
1868  {0,1,0,0, 3}, \
1869  {0,1,0,0, 7}, \
1870  {0,1,0,0, 3}, \
1871  }, \
1872 
1874  .name = "bayer_bggr8",
1876  .flags = AV_PIX_FMT_FLAG_RGB,
1877  },
1879  .name = "bayer_bggr16le",
1881  .flags = AV_PIX_FMT_FLAG_RGB,
1882  },
1884  .name = "bayer_bggr16be",
1887  },
1889  .name = "bayer_rggb8",
1891  .flags = AV_PIX_FMT_FLAG_RGB,
1892  },
1894  .name = "bayer_rggb16le",
1896  .flags = AV_PIX_FMT_FLAG_RGB,
1897  },
1899  .name = "bayer_rggb16be",
1902  },
1904  .name = "bayer_gbrg8",
1906  .flags = AV_PIX_FMT_FLAG_RGB,
1907  },
1909  .name = "bayer_gbrg16le",
1911  .flags = AV_PIX_FMT_FLAG_RGB,
1912  },
1914  .name = "bayer_gbrg16be",
1917  },
1919  .name = "bayer_grbg8",
1921  .flags = AV_PIX_FMT_FLAG_RGB,
1922  },
1924  .name = "bayer_grbg16le",
1926  .flags = AV_PIX_FMT_FLAG_RGB,
1927  },
1929  .name = "bayer_grbg16be",
1932  },
1933  [AV_PIX_FMT_NV16] = {
1934  .name = "nv16",
1935  .nb_components = 3,
1936  .log2_chroma_w = 1,
1937  .log2_chroma_h = 0,
1938  .comp = {
1939  { 0, 0, 1, 0, 7 }, /* Y */
1940  { 1, 1, 1, 0, 7 }, /* U */
1941  { 1, 1, 2, 0, 7 }, /* V */
1942  },
1943  .flags = AV_PIX_FMT_FLAG_PLANAR,
1944  },
1945  [AV_PIX_FMT_NV20LE] = {
1946  .name = "nv20le",
1947  .nb_components = 3,
1948  .log2_chroma_w = 1,
1949  .log2_chroma_h = 0,
1950  .comp = {
1951  { 0, 1, 1, 0, 9 }, /* Y */
1952  { 1, 3, 1, 0, 9 }, /* U */
1953  { 1, 3, 3, 0, 9 }, /* V */
1954  },
1955  .flags = AV_PIX_FMT_FLAG_PLANAR,
1956  },
1957  [AV_PIX_FMT_NV20BE] = {
1958  .name = "nv20be",
1959  .nb_components = 3,
1960  .log2_chroma_w = 1,
1961  .log2_chroma_h = 0,
1962  .comp = {
1963  { 0, 1, 1, 0, 9 }, /* Y */
1964  { 1, 3, 1, 0, 9 }, /* U */
1965  { 1, 3, 3, 0, 9 }, /* V */
1966  },
1968  },
1969  [AV_PIX_FMT_VDA] = {
1970  .name = "vda",
1971  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1972  },
1973  [AV_PIX_FMT_QSV] = {
1974  .name = "qsv",
1975  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1976  },
1977  [AV_PIX_FMT_MMAL] = {
1978  .name = "mmal",
1979  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1980  },
1981  [AV_PIX_FMT_AYUV64LE] = {
1982  .name = "ayuv64le",
1983  .nb_components = 4,
1984  .log2_chroma_w = 0,
1985  .log2_chroma_h = 0,
1986  .comp = {
1987  { 0, 7, 3, 0, 15 }, /* Y */
1988  { 0, 7, 5, 0, 15 }, /* U */
1989  { 0, 7, 7, 0, 15 }, /* V */
1990  { 0, 7, 1, 0, 15 }, /* A */
1991  },
1992  .flags = AV_PIX_FMT_FLAG_ALPHA,
1993  },
1994  [AV_PIX_FMT_AYUV64BE] = {
1995  .name = "ayuv64be",
1996  .nb_components = 4,
1997  .log2_chroma_w = 0,
1998  .log2_chroma_h = 0,
1999  .comp = {
2000  { 0, 7, 3, 0, 15 }, /* Y */
2001  { 0, 7, 5, 0, 15 }, /* U */
2002  { 0, 7, 7, 0, 15 }, /* V */
2003  { 0, 7, 1, 0, 15 }, /* A */
2004  },
2006  },
2007 };
2008 
2009 static const char *color_range_names[AVCOL_RANGE_NB] = {
2010  "unknown", "tv", "pc",
2011 };
2012 
2013 static const char *color_primaries_names[AVCOL_PRI_NB] = {
2014  "reserved", "bt709", "unknown", "reserved", "bt470m",
2015  "bt470bg", "smpte170m", "smpte240m", "film", "bt2020",
2016 };
2017 
2018 static const char *color_transfer_names[AVCOL_TRC_NB] = {
2019  "reserved", "bt709", "unknown", "reserved", "bt470m",
2020  "bt470bg", "smpte170m", "smpte240m", "linear", "log100",
2021  "log316", "iec61966-2-4", "bt1361e", "iec61966-2-1",
2022  "bt2020-10", "bt2020-20",
2023 };
2024 
2025 static const char *color_space_names[AVCOL_SPC_NB] = {
2026  "gbr", "bt709", "unknown", "reserved", "fcc",
2027  "bt470bg", "smpte170m", "smpte240m", "ycgco",
2028  "bt2020nc", "bt2020c",
2029 };
2030 
2032  "unspecified", "left", "center", "topleft",
2033  "top", "bottomleft", "bottom",
2034 };
2035 
2037 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
2038 {
2039  enum AVPixelFormat pix_fmt;
2040 
2041  for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
2042  if (av_pix_fmt_descriptors[pix_fmt].name &&
2043  (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
2044  av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias)))
2045  return pix_fmt;
2046 
2047  return AV_PIX_FMT_NONE;
2048 }
2049 
2051 {
2052  return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
2053  av_pix_fmt_descriptors[pix_fmt].name : NULL;
2054 }
2055 
2056 #if HAVE_BIGENDIAN
2057 # define X_NE(be, le) be
2058 #else
2059 # define X_NE(be, le) le
2060 #endif
2061 
2063 {
2064  enum AVPixelFormat pix_fmt;
2065 
2066  if (!strcmp(name, "rgb32"))
2067  name = X_NE("argb", "bgra");
2068  else if (!strcmp(name, "bgr32"))
2069  name = X_NE("abgr", "rgba");
2070 
2071  pix_fmt = get_pix_fmt_internal(name);
2072  if (pix_fmt == AV_PIX_FMT_NONE) {
2073  char name2[32];
2074 
2075  snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
2076  pix_fmt = get_pix_fmt_internal(name2);
2077  }
2078  return pix_fmt;
2079 }
2080 
2082 {
2083  int c, bits = 0;
2084  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2085 
2086  for (c = 0; c < pixdesc->nb_components; c++) {
2087  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2088  bits += (pixdesc->comp[c].depth_minus1 + 1) << s;
2089  }
2090 
2091  return bits >> log2_pixels;
2092 }
2093 
2095 {
2096  int c, bits = 0;
2097  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2098  int steps[4] = {0};
2099 
2100  for (c = 0; c < pixdesc->nb_components; c++) {
2101  const AVComponentDescriptor *comp = &pixdesc->comp[c];
2102  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2103  steps[comp->plane] = (comp->step_minus1 + 1) << s;
2104  }
2105  for (c = 0; c < 4; c++)
2106  bits += steps[c];
2107 
2108  if(!(pixdesc->flags & AV_PIX_FMT_FLAG_BITSTREAM))
2109  bits *= 8;
2110 
2111  return bits >> log2_pixels;
2112 }
2113 
2114 char *av_get_pix_fmt_string(char *buf, int buf_size,
2115  enum AVPixelFormat pix_fmt)
2116 {
2117  /* print header */
2118  if (pix_fmt < 0) {
2119  snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
2120  } else {
2121  const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
2122  snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
2123  pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
2124  }
2125 
2126  return buf;
2127 }
2128 
2130 {
2131  if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
2132  return NULL;
2133  return &av_pix_fmt_descriptors[pix_fmt];
2134 }
2135 
2137 {
2138  if (!prev)
2139  return &av_pix_fmt_descriptors[0];
2140  while (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1) {
2141  prev++;
2142  if (prev->name)
2143  return prev;
2144  }
2145  return NULL;
2146 }
2147 
2149 {
2150  if (desc < av_pix_fmt_descriptors ||
2151  desc >= av_pix_fmt_descriptors + FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
2152  return AV_PIX_FMT_NONE;
2153 
2154  return desc - av_pix_fmt_descriptors;
2155 }
2156 
2158  int *h_shift, int *v_shift)
2159 {
2160  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2161  if (!desc)
2162  return AVERROR(ENOSYS);
2163  *h_shift = desc->log2_chroma_w;
2164  *v_shift = desc->log2_chroma_h;
2165 
2166  return 0;
2167 }
2168 
2170 {
2171  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2172  int i, planes[4] = { 0 }, ret = 0;
2173 
2174  if (!desc)
2175  return AVERROR(EINVAL);
2176 
2177  for (i = 0; i < desc->nb_components; i++)
2178  planes[desc->comp[i].plane] = 1;
2179  for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
2180  ret += planes[i];
2181  return ret;
2182 }
2183 
2185  int i, j;
2186 
2187  for (i=0; i<FF_ARRAY_ELEMS(av_pix_fmt_descriptors); i++) {
2188  const AVPixFmtDescriptor *d = &av_pix_fmt_descriptors[i];
2189  uint8_t fill[4][8+6+3] = {{0}};
2190  uint8_t *data[4] = {fill[0], fill[1], fill[2], fill[3]};
2191  int linesize[4] = {0,0,0,0};
2192  uint16_t tmp[2];
2193 
2194  if (!d->name && !d->nb_components && !d->log2_chroma_w && !d->log2_chroma_h && !d->flags)
2195  continue;
2196 // av_log(NULL, AV_LOG_DEBUG, "Checking: %s\n", d->name);
2197  av_assert0(d->log2_chroma_w <= 3);
2198  av_assert0(d->log2_chroma_h <= 3);
2199  av_assert0(d->nb_components <= 4);
2200  av_assert0(d->name && d->name[0]);
2201  av_assert0((d->nb_components==4 || d->nb_components==2) == !!(d->flags & AV_PIX_FMT_FLAG_ALPHA));
2202  av_assert2(av_get_pix_fmt(d->name) == i);
2203 
2204  for (j=0; j<FF_ARRAY_ELEMS(d->comp); j++) {
2205  const AVComponentDescriptor *c = &d->comp[j];
2206  if(j>=d->nb_components) {
2207  av_assert0(!c->plane && !c->step_minus1 && !c->offset_plus1 && !c->shift && !c->depth_minus1);
2208  continue;
2209  }
2210  if (d->flags & AV_PIX_FMT_FLAG_BITSTREAM) {
2212  } else {
2213  av_assert0(8*(c->step_minus1+1) >= c->depth_minus1+1);
2214  }
2215  if (!strncmp(d->name, "bayer_", 6))
2216  continue;
2217  av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0);
2218  av_assert0(tmp[0] == 0 && tmp[1] == 0);
2219  tmp[0] = tmp[1] = (1<<(c->depth_minus1 + 1)) - 1;
2220  av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2);
2221  }
2222  }
2223 }
2225 
2226 
2228 {
2229  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2230  char name[16];
2231  int i;
2232 
2233  if (!desc || strlen(desc->name) < 2)
2234  return AV_PIX_FMT_NONE;
2235  av_strlcpy(name, desc->name, sizeof(name));
2236  i = strlen(name) - 2;
2237  if (strcmp(name + i, "be") && strcmp(name + i, "le"))
2238  return AV_PIX_FMT_NONE;
2239 
2240  name[i] ^= 'b' ^ 'l';
2241 
2242  return get_pix_fmt_internal(name);
2243 }
2244 
2245 #define FF_COLOR_NA -1
2246 #define FF_COLOR_RGB 0 /**< RGB color space */
2247 #define FF_COLOR_GRAY 1 /**< gray color space */
2248 #define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
2249 #define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
2250 
2251 #define pixdesc_has_alpha(pixdesc) \
2252  ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
2253 
2254 
2255 static int get_color_type(const AVPixFmtDescriptor *desc) {
2256  if (desc->flags & AV_PIX_FMT_FLAG_PAL)
2257  return FF_COLOR_RGB;
2258 
2259  if(desc->nb_components == 1 || desc->nb_components == 2)
2260  return FF_COLOR_GRAY;
2261 
2262  if(desc->name && !strncmp(desc->name, "yuvj", 4))
2263  return FF_COLOR_YUV_JPEG;
2264 
2265  if(desc->flags & AV_PIX_FMT_FLAG_RGB)
2266  return FF_COLOR_RGB;
2267 
2268  if(desc->nb_components == 0)
2269  return FF_COLOR_NA;
2270 
2271  return FF_COLOR_YUV;
2272 }
2273 
2274 static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
2275 {
2276  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2277  int i;
2278 
2279  if (!desc || !desc->nb_components) {
2280  *min = *max = 0;
2281  return AVERROR(EINVAL);
2282  }
2283 
2284  *min = INT_MAX, *max = -INT_MAX;
2285  for (i = 0; i < desc->nb_components; i++) {
2286  *min = FFMIN(desc->comp[i].depth_minus1+1, *min);
2287  *max = FFMAX(desc->comp[i].depth_minus1+1, *max);
2288  }
2289  return 0;
2290 }
2291 
2292 static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
2293  enum AVPixelFormat src_pix_fmt,
2294  unsigned *lossp, unsigned consider)
2295 {
2296  const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
2297  const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
2298  int src_color, dst_color;
2299  int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
2300  int ret, loss, i, nb_components;
2301  int score = INT_MAX - 1;
2302 
2303  if (dst_pix_fmt >= AV_PIX_FMT_NB || dst_pix_fmt <= AV_PIX_FMT_NONE)
2304  return ~0;
2305 
2306  /* compute loss */
2307  *lossp = loss = 0;
2308 
2309  if (dst_pix_fmt == src_pix_fmt)
2310  return INT_MAX;
2311 
2312  if ((ret = get_pix_fmt_depth(&src_min_depth, &src_max_depth, src_pix_fmt)) < 0)
2313  return ret;
2314  if ((ret = get_pix_fmt_depth(&dst_min_depth, &dst_max_depth, dst_pix_fmt)) < 0)
2315  return ret;
2316 
2317  src_color = get_color_type(src_desc);
2318  dst_color = get_color_type(dst_desc);
2319  if (dst_pix_fmt == AV_PIX_FMT_PAL8)
2320  nb_components = FFMIN(src_desc->nb_components, 4);
2321  else
2322  nb_components = FFMIN(src_desc->nb_components, dst_desc->nb_components);
2323 
2324  for (i = 0; i < nb_components; i++) {
2325  int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : dst_desc->comp[i].depth_minus1;
2326  if (src_desc->comp[i].depth_minus1 > depth_minus1 && (consider & FF_LOSS_DEPTH)) {
2327  loss |= FF_LOSS_DEPTH;
2328  score -= 65536 >> depth_minus1;
2329  }
2330  }
2331 
2332  if (consider & FF_LOSS_RESOLUTION) {
2333  if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w) {
2334  loss |= FF_LOSS_RESOLUTION;
2335  score -= 256 << dst_desc->log2_chroma_w;
2336  }
2337  if (dst_desc->log2_chroma_h > src_desc->log2_chroma_h) {
2338  loss |= FF_LOSS_RESOLUTION;
2339  score -= 256 << dst_desc->log2_chroma_h;
2340  }
2341  // don't favor 422 over 420 if downsampling is needed, because 420 has much better support on the decoder side
2342  if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 0 &&
2343  dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 0 ) {
2344  score += 512;
2345  }
2346  }
2347 
2348  if(consider & FF_LOSS_COLORSPACE)
2349  switch(dst_color) {
2350  case FF_COLOR_RGB:
2351  if (src_color != FF_COLOR_RGB &&
2352  src_color != FF_COLOR_GRAY)
2353  loss |= FF_LOSS_COLORSPACE;
2354  break;
2355  case FF_COLOR_GRAY:
2356  if (src_color != FF_COLOR_GRAY)
2357  loss |= FF_LOSS_COLORSPACE;
2358  break;
2359  case FF_COLOR_YUV:
2360  if (src_color != FF_COLOR_YUV)
2361  loss |= FF_LOSS_COLORSPACE;
2362  break;
2363  case FF_COLOR_YUV_JPEG:
2364  if (src_color != FF_COLOR_YUV_JPEG &&
2365  src_color != FF_COLOR_YUV &&
2366  src_color != FF_COLOR_GRAY)
2367  loss |= FF_LOSS_COLORSPACE;
2368  break;
2369  default:
2370  /* fail safe test */
2371  if (src_color != dst_color)
2372  loss |= FF_LOSS_COLORSPACE;
2373  break;
2374  }
2375  if(loss & FF_LOSS_COLORSPACE)
2376  score -= (nb_components * 65536) >> FFMIN(dst_desc->comp[0].depth_minus1, src_desc->comp[0].depth_minus1);
2377 
2378  if (dst_color == FF_COLOR_GRAY &&
2379  src_color != FF_COLOR_GRAY && (consider & FF_LOSS_CHROMA)) {
2380  loss |= FF_LOSS_CHROMA;
2381  score -= 2 * 65536;
2382  }
2383  if (!pixdesc_has_alpha(dst_desc) && (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))) {
2384  loss |= FF_LOSS_ALPHA;
2385  score -= 65536;
2386  }
2387  if (dst_pix_fmt == AV_PIX_FMT_PAL8 && (consider & FF_LOSS_COLORQUANT) &&
2388  (src_pix_fmt != AV_PIX_FMT_PAL8 && (src_color != FF_COLOR_GRAY || (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))))) {
2389  loss |= FF_LOSS_COLORQUANT;
2390  score -= 65536;
2391  }
2392 
2393  *lossp = loss;
2394  return score;
2395 }
2396 
2397 int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
2398  enum AVPixelFormat src_pix_fmt,
2399  int has_alpha)
2400 {
2401  int loss;
2402  int ret = get_pix_fmt_score(dst_pix_fmt, src_pix_fmt, &loss, has_alpha ? ~0 : ~FF_LOSS_ALPHA);
2403  if (ret < 0)
2404  return ret;
2405  return loss;
2406 }
2407 
2408 enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
2409  enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
2410 {
2411  enum AVPixelFormat dst_pix_fmt;
2412  int loss1, loss2, loss_mask;
2413  const AVPixFmtDescriptor *desc1 = av_pix_fmt_desc_get(dst_pix_fmt1);
2414  const AVPixFmtDescriptor *desc2 = av_pix_fmt_desc_get(dst_pix_fmt2);
2415  int score1, score2;
2416 
2417  loss_mask= loss_ptr?~*loss_ptr:~0; /* use loss mask if provided */
2418  if(!has_alpha)
2419  loss_mask &= ~FF_LOSS_ALPHA;
2420 
2421  score1 = get_pix_fmt_score(dst_pix_fmt1, src_pix_fmt, &loss1, loss_mask);
2422  score2 = get_pix_fmt_score(dst_pix_fmt2, src_pix_fmt, &loss2, loss_mask);
2423 
2424  if (score1 == score2) {
2426  dst_pix_fmt = av_get_padded_bits_per_pixel(desc2) < av_get_padded_bits_per_pixel(desc1) ? dst_pix_fmt2 : dst_pix_fmt1;
2427  } else {
2428  dst_pix_fmt = desc2->nb_components < desc1->nb_components ? dst_pix_fmt2 : dst_pix_fmt1;
2429  }
2430  } else {
2431  dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
2432  }
2433 
2434  if (loss_ptr)
2435  *loss_ptr = av_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
2436  return dst_pix_fmt;
2437 }
2438 
2439 const char *av_color_range_name(enum AVColorRange range)
2440 {
2441  return (unsigned) range < AVCOL_RANGE_NB ?
2442  color_range_names[range] : NULL;
2443 }
2444 
2445 const char *av_color_primaries_name(enum AVColorPrimaries primaries)
2446 {
2447  return (unsigned) primaries < AVCOL_PRI_NB ?
2448  color_primaries_names[primaries] : NULL;
2449 }
2450 
2452 {
2453  return (unsigned) transfer < AVCOL_TRC_NB ?
2454  color_transfer_names[transfer] : NULL;
2455 }
2456 
2457 const char *av_color_space_name(enum AVColorSpace space)
2458 {
2459  return (unsigned) space < AVCOL_SPC_NB ?
2460  color_space_names[space] : NULL;
2461 }
2462 
2463 const char *av_chroma_location_name(enum AVChromaLocation location)
2464 {
2465  return (unsigned) location < AVCHROMA_LOC_NB ?
2466  chroma_location_names[location] : NULL;
2467 }
2468 
2469 #ifdef TEST
2470 
2471 int main(void){
2472  int i;
2473  int err=0;
2474  int skip = 0;
2475 
2476  for (i=0; i<AV_PIX_FMT_NB*2; i++) {
2477  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(i);
2478  if(!desc || !desc->name) {
2479  skip ++;
2480  continue;
2481  }
2482  if (skip) {
2483  av_log(NULL, AV_LOG_INFO, "%3d unused pixel format values\n", skip);
2484  skip = 0;
2485  }
2486  av_log(NULL, AV_LOG_INFO, "pix fmt %s avg_bpp:%d colortype:%d\n", desc->name, av_get_padded_bits_per_pixel(desc), get_color_type(desc));
2487  if ((!(desc->flags & AV_PIX_FMT_FLAG_ALPHA)) != (desc->nb_components != 2 && desc->nb_components != 4)) {
2488  av_log(NULL, AV_LOG_ERROR, "Alpha flag mismatch\n");
2489  err = 1;
2490  }
2491  }
2492  return err;
2493 }
2494 
2495 #endif
2496 
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
Definition: pixdesc.h:115
int plane
Definition: avisynth_c.h:291
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:83
#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:127
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:178
const char const char void * val
Definition: avisynth_c.h:634
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
Definition: pixfmt.h:319
const char * s
Definition: avisynth_c.h:631
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:293
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:286
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2129
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:101
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:290
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:171
8bit gray, 8bit alpha
Definition: pixfmt.h:155
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:274
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:68
static const char * color_range_names[AVCOL_RANGE_NB]
Definition: pixdesc.c:2009
MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstr...
Definition: pixfmt.h:107
#define FF_LOSS_ALPHA
loss of alpha bits
Definition: pixdesc.h:326
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2169
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:65
packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in ...
Definition: pixfmt.h:86
hardware decoding through Videotoolbox
Definition: pixfmt.h:326
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:174
#define FF_LOSS_CHROMA
loss of chroma (e.g.
Definition: pixdesc.h:328
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:2081
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:2114
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:291
bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */
Definition: pixfmt.h:306
bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */
Definition: pixfmt.h:307
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:188
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:273
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined ...
Definition: pixfmt.h:117
bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */
Definition: pixfmt.h:314
HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the b...
Definition: pixfmt.h:129
static const char * color_primaries_names[AVCOL_PRI_NB]
Definition: pixdesc.c:2013
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:215
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
Definition: pixfmt.h:120
planar GBR 4:4:4 36bpp, little-endian
Definition: pixfmt.h:296
The following 12 formats have the disadvantage of needing 1 format for each bit depth.
Definition: pixfmt.h:168
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, X=unused/undefined
Definition: pixfmt.h:152
const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB]
The array of all the pixel format descriptors.
Definition: pixdesc.c:133
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
Definition: pixfmt.h:278
bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */
Definition: pixfmt.h:304
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
planar GBR 4:4:4 36bpp, big-endian
Definition: pixfmt.h:295
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:140
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
Definition: bytestream.h:87
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:80
AVColorTransferCharacteristic
Color Transfer Characteristic.
Definition: pixfmt.h:494
static const char * chroma_location_names[AVCHROMA_LOC_NB]
Definition: pixdesc.c:2031
packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in ...
Definition: pixfmt.h:89
const char * av_color_space_name(enum AVColorSpace space)
Definition: pixdesc.c:2457
uint16_t shift
Number of least significant bits that must be shifted away to get the value.
Definition: pixdesc.h:52
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
Definition: pixfmt.h:115
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
Definition: pixfmt.h:87
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian ...
Definition: pixfmt.h:205
#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:300
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
Definition: pixfmt.h:216
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:103
uint8_t bits
Definition: crc.c:295
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:100
uint8_t
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
Definition: pixdesc.h:156
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
Definition: avassert.h:63
#define BAYER16_DESC_COMMON
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
Definition: pixfmt.h:277
8 bit with AV_PIX_FMT_RGB32 palette
Definition: pixfmt.h:74
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:112
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:517
bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */
Definition: pixfmt.h:312
const char * av_color_range_name(enum AVColorRange range)
Definition: pixdesc.c:2439
bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */
Definition: pixfmt.h:313
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:271
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, X=unused/undefined ...
Definition: pixfmt.h:151
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:292
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)
Write the values from src to the pixel format component c of an image line.
Definition: pixdesc.c:82
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
Definition: pixfmt.h:114
static const char * color_transfer_names[AVCOL_TRC_NB]
Definition: pixdesc.c:2018
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:96
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:217
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
Definition: pixfmt.h:320
planar GBR 4:4:4 48bpp, big-endian
Definition: pixfmt.h:193
FF_ENABLE_DEPRECATION_WARNINGS enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
Utility function to swap the endianness of a pixel format.
Definition: pixdesc.c:2227
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
Definition: pixfmt.h:102
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:76
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Definition: pixfmt.h:220
MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstr...
Definition: pixfmt.h:106
Not part of ABI.
Definition: pixfmt.h:541
WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstrea...
Definition: pixfmt.h:108
AVColorRange
MPEG vs JPEG YUV range.
Definition: pixfmt.h:537
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
Definition: pixfmt.h:322
AVColorPrimaries
Chromaticity coordinates of the source primaries.
Definition: pixfmt.h:476
#define AV_WB16(p, v)
Definition: intreadwrite.h:405
bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */
Definition: pixfmt.h:308
#define av_log(a,...)
const char * name
Definition: pixdesc.h:70
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:169
planar GBR 4:4:4 27bpp, big-endian
Definition: pixfmt.h:189
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:177
const char * av_chroma_location_name(enum AVChromaLocation location)
Definition: pixdesc.c:2463
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:281
uint16_t depth_minus1
Number of bits in the component minus 1.
Definition: pixdesc.h:57
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
16bit gray, 16bit alpha (big-endian)
Definition: pixfmt.h:246
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:89
static const uint16_t mask[17]
Definition: lzw.c:38
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:145
#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:131
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:2157
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:97
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:2094
Not part of ABI.
Definition: pixfmt.h:488
#define FF_LOSS_DEPTH
loss due to color depth change
Definition: pixdesc.h:324
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
Definition: pixfmt.h:208
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:173
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition: pixfmt.h:91
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
Definition: pixdesc.h:123
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:289
XVideo Motion Acceleration via common packet passing.
Definition: pixfmt.h:79
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:342
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:143
Libavutil version macros.
HW acceleration through VDA, data[3] contains a CVPixelBufferRef.
Definition: pixfmt.h:244
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
Definition: pixfmt.h:209
#define FFMAX(a, b)
Definition: common.h:79
static const char * color_space_names[AVCOL_SPC_NB]
Definition: pixdesc.c:2025
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:94
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:161
int depth
Definition: v4l.c:62
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:95
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
Definition: pixdesc.c:2445
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
Definition: pixfmt.h:210
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:67
common internal API header
as above, but U and V bytes are swapped
Definition: pixfmt.h:92
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
Definition: pixdesc.c:2148
uint8_t nb_components
The number of components each pixel has, (1-4)
Definition: pixdesc.h:71
#define BAYER8_DESC_COMMON
#define FFMIN(a, b)
Definition: common.h:81
float y
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
Definition: pixfmt.h:90
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:75
#define FF_COLOR_YUV_JPEG
YUV color space.
Definition: pixdesc.c:2249
#define AV_PIX_FMT_FLAG_PSEUDOPAL
The pixel format is "pseudo-paletted".
Definition: pixdesc.h:141
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Definition: pixfmt.h:214
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
Definition: pixfmt.h:242
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
Definition: pixfmt.h:206
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:66
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:284
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:226
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:170
interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian ...
Definition: pixfmt.h:229
static int get_color_type(const AVPixFmtDescriptor *desc)
Definition: pixdesc.c:2255
#define pixdesc_has_alpha(pixdesc)
Definition: pixdesc.c:2251
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:179
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:160
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
Definition: pixfmt.h:119
#define FF_ARRAY_ELEMS(a)
HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state str...
Definition: pixfmt.h:128
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
Definition: pixfmt.h:85
#define AV_LOG_INFO
Standard information.
Definition: log.h:187
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:141
AVS_Value src
Definition: avisynth_c.h:482
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:280
uint8_t flags
Definition: pixdesc.h:90
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */
Definition: pixfmt.h:311
planar GBR 4:4:4 30bpp, big-endian
Definition: pixfmt.h:191
bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */
Definition: pixfmt.h:315
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
Definition: pixfmt.h:218
static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt, unsigned *lossp, unsigned consider)
Definition: pixdesc.c:2292
#define FF_COLOR_YUV
YUV color space.
Definition: pixdesc.c:2248
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:64
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
Definition: pixfmt.h:321
planar GBR 4:4:4 42bpp, little-endian
Definition: pixfmt.h:298
void * buf
Definition: avisynth_c.h:553
MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstre...
Definition: pixfmt.h:147
H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstre...
Definition: pixfmt.h:105
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:69
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
Definition: pixfmt.h:219
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:221
Y , 16bpp, big-endian.
Definition: pixfmt.h:99
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
Definition: pixfmt.h:223
Not part of ABI.
Definition: pixfmt.h:511
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:285
uint16_t step_minus1
Number of elements between 2 horizontally consecutive pixels minus 1.
Definition: pixdesc.h:40
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:2397
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
Definition: pixfmt.h:261
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:279
planar GBR 4:4:4 42bpp, big-endian
Definition: pixfmt.h:297
static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2274
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
Definition: pixfmt.h:204
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined ...
Definition: pixfmt.h:122
#define snprintf
Definition: snprintf.h:34
bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */
Definition: pixfmt.h:309
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
Definition: pixdesc.h:119
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer. ...
Definition: pixfmt.h:149
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)
Read a line from an image, and write the values of the pixel format component c to dst...
Definition: pixdesc.c:34
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
Definition: pixfmt.h:213
static int flags
Definition: cpu.c:47
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian , X=unused/undefined
Definition: pixfmt.h:116
bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */
Definition: pixfmt.h:310
#define FF_COLOR_RGB
RGB color space.
Definition: pixdesc.c:2246
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, X=unused/undefined
Definition: pixfmt.h:154
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:175
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:144
VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstrea...
Definition: pixfmt.h:109
#define X_NE(be, le)
Definition: pixdesc.c:2059
#define FF_LOSS_COLORSPACE
loss due to color space conversion
Definition: pixdesc.h:325
#define AV_PIX_FMT_XVMC
Definition: pixfmt.h:81
hardware decoding through VDA
Definition: pixfmt.h:180
uint16_t plane
Which of the 4 planes contains the component.
Definition: pixdesc.h:34
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
Definition: pixfmt.h:73
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:63
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:288
Y , 8bpp.
Definition: pixfmt.h:71
#define FF_DISABLE_DEPRECATION_WARNINGS
Definition: internal.h:79
common internal and external API header
if(ret< 0)
Definition: vf_mcdeint.c:280
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
Definition: pixfmt.h:72
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:299
planar GBR 4:4:4 27bpp, little-endian
Definition: pixfmt.h:190
static double c[64]
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
Definition: pixdesc.c:2451
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:111
#define AV_WL16(p, v)
Definition: intreadwrite.h:412
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:142
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:77
bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */
Definition: pixfmt.h:305
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
Definition: pixfmt.h:88
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:70
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:227
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:2408
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:211
#define AV_PIX_FMT_FLAG_BE
Pixel format is big-endian.
Definition: pixdesc.h:111
#define FF_LOSS_RESOLUTION
loss due to resolution change
Definition: pixdesc.h:323
static FF_DISABLE_DEPRECATION_WARNINGS enum AVPixelFormat get_pix_fmt_internal(const char *name)
Definition: pixdesc.c:2037
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:225
packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
Definition: pixfmt.h:324
#define FF_ENABLE_DEPRECATION_WARNINGS
Definition: internal.h:80
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:294
uint16_t offset_plus1
Number of elements before the component of the first pixel plus 1.
Definition: pixdesc.h:46
Y , 16bpp, little-endian.
Definition: pixfmt.h:100
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:302
Not part of ABI.
Definition: pixfmt.h:567
16bit gray, 16bit alpha (little-endian)
Definition: pixfmt.h:247
#define FF_COLOR_NA
Definition: pixdesc.c:2245
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
Definition: pixfmt.h:212
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian , X=unused/undefined
Definition: pixfmt.h:121
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
Definition: pixfmt.h:328
static void comp(unsigned char *dst, int dst_stride, unsigned char *src, int src_stride, int add)
Definition: eamad.c:83
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:101
#define FF_LOSS_COLORQUANT
loss due to color quantization
Definition: pixdesc.h:327
AVChromaLocation
Location of chroma samples.
Definition: pixfmt.h:559
HW decoding through Direct3D11, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer...
Definition: pixfmt.h:268
planar GBR 4:4:4 48bpp, little-endian
Definition: pixfmt.h:194
void ff_check_pixfmt_descriptors(void)
Definition: pixdesc.c:2184
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, X=unused/undefined ...
Definition: pixfmt.h:153
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
Definition: pixdesc.c:2062
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:2050
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
Definition: pixfmt.h:207
int main(int argc, char **argv)
Definition: main.c:22
interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian ...
Definition: pixfmt.h:228
HW acceleration though MMAL, data[3] contains a pointer to the MMAL_BUFFER_HEADER_T structure...
Definition: pixfmt.h:266
planar GBRA 4:4:4:4 64bpp, little-endian
Definition: pixfmt.h:301
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
Definition: pixfmt.h:276
packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
Definition: pixfmt.h:84
float min
AVPixelFormat
Pixel format.
Definition: pixfmt.h:61
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.
Definition: pixdesc.h:127
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:283
Not part of ABI.
Definition: pixfmt.h:529
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:176
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:287
planar GBR 4:4:4 30bpp, little-endian
Definition: pixfmt.h:192
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:272
packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
Definition: pixfmt.h:323
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.
Definition: pixdesc.c:2136
const char * name
Definition: opengl_enc.c:103
#define FF_COLOR_GRAY
gray color space
Definition: pixdesc.c:2247
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:172