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  [AV_PIX_FMT_VAAPI_MOCO] = {
1212  .name = "vaapi_moco",
1213  .log2_chroma_w = 1,
1214  .log2_chroma_h = 1,
1215  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1216  },
1217  [AV_PIX_FMT_VAAPI_IDCT] = {
1218  .name = "vaapi_idct",
1219  .log2_chroma_w = 1,
1220  .log2_chroma_h = 1,
1221  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1222  },
1223  [AV_PIX_FMT_VAAPI_VLD] = {
1224  .name = "vaapi_vld",
1225  .log2_chroma_w = 1,
1226  .log2_chroma_h = 1,
1227  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1228  },
1229  [AV_PIX_FMT_YUV420P9LE] = {
1230  .name = "yuv420p9le",
1231  .nb_components = 3,
1232  .log2_chroma_w = 1,
1233  .log2_chroma_h = 1,
1234  .comp = {
1235  { 0, 1, 1, 0, 8 }, /* Y */
1236  { 1, 1, 1, 0, 8 }, /* U */
1237  { 2, 1, 1, 0, 8 }, /* V */
1238  },
1239  .flags = AV_PIX_FMT_FLAG_PLANAR,
1240  },
1241  [AV_PIX_FMT_YUV420P9BE] = {
1242  .name = "yuv420p9be",
1243  .nb_components = 3,
1244  .log2_chroma_w = 1,
1245  .log2_chroma_h = 1,
1246  .comp = {
1247  { 0, 1, 1, 0, 8 }, /* Y */
1248  { 1, 1, 1, 0, 8 }, /* U */
1249  { 2, 1, 1, 0, 8 }, /* V */
1250  },
1252  },
1254  .name = "yuv420p10le",
1255  .nb_components = 3,
1256  .log2_chroma_w = 1,
1257  .log2_chroma_h = 1,
1258  .comp = {
1259  { 0, 1, 1, 0, 9 }, /* Y */
1260  { 1, 1, 1, 0, 9 }, /* U */
1261  { 2, 1, 1, 0, 9 }, /* V */
1262  },
1263  .flags = AV_PIX_FMT_FLAG_PLANAR,
1264  },
1266  .name = "yuv420p10be",
1267  .nb_components = 3,
1268  .log2_chroma_w = 1,
1269  .log2_chroma_h = 1,
1270  .comp = {
1271  { 0, 1, 1, 0, 9 }, /* Y */
1272  { 1, 1, 1, 0, 9 }, /* U */
1273  { 2, 1, 1, 0, 9 }, /* V */
1274  },
1276  },
1278  .name = "yuv420p12le",
1279  .nb_components = 3,
1280  .log2_chroma_w = 1,
1281  .log2_chroma_h = 1,
1282  .comp = {
1283  { 0, 1, 1, 0, 11 }, /* Y */
1284  { 1, 1, 1, 0, 11 }, /* U */
1285  { 2, 1, 1, 0, 11 }, /* V */
1286  },
1287  .flags = AV_PIX_FMT_FLAG_PLANAR,
1288  },
1290  .name = "yuv420p12be",
1291  .nb_components = 3,
1292  .log2_chroma_w = 1,
1293  .log2_chroma_h = 1,
1294  .comp = {
1295  { 0, 1, 1, 0, 11 }, /* Y */
1296  { 1, 1, 1, 0, 11 }, /* U */
1297  { 2, 1, 1, 0, 11 }, /* V */
1298  },
1300  },
1302  .name = "yuv420p14le",
1303  .nb_components = 3,
1304  .log2_chroma_w = 1,
1305  .log2_chroma_h = 1,
1306  .comp = {
1307  { 0, 1, 1, 0, 13 }, /* Y */
1308  { 1, 1, 1, 0, 13 }, /* U */
1309  { 2, 1, 1, 0, 13 }, /* V */
1310  },
1311  .flags = AV_PIX_FMT_FLAG_PLANAR,
1312  },
1314  .name = "yuv420p14be",
1315  .nb_components = 3,
1316  .log2_chroma_w = 1,
1317  .log2_chroma_h = 1,
1318  .comp = {
1319  { 0, 1, 1, 0, 13 }, /* Y */
1320  { 1, 1, 1, 0, 13 }, /* U */
1321  { 2, 1, 1, 0, 13 }, /* V */
1322  },
1324  },
1326  .name = "yuv420p16le",
1327  .nb_components = 3,
1328  .log2_chroma_w = 1,
1329  .log2_chroma_h = 1,
1330  .comp = {
1331  { 0, 1, 1, 0, 15 }, /* Y */
1332  { 1, 1, 1, 0, 15 }, /* U */
1333  { 2, 1, 1, 0, 15 }, /* V */
1334  },
1335  .flags = AV_PIX_FMT_FLAG_PLANAR,
1336  },
1338  .name = "yuv420p16be",
1339  .nb_components = 3,
1340  .log2_chroma_w = 1,
1341  .log2_chroma_h = 1,
1342  .comp = {
1343  { 0, 1, 1, 0, 15 }, /* Y */
1344  { 1, 1, 1, 0, 15 }, /* U */
1345  { 2, 1, 1, 0, 15 }, /* V */
1346  },
1348  },
1349  [AV_PIX_FMT_YUV422P9LE] = {
1350  .name = "yuv422p9le",
1351  .nb_components = 3,
1352  .log2_chroma_w = 1,
1353  .log2_chroma_h = 0,
1354  .comp = {
1355  { 0, 1, 1, 0, 8 }, /* Y */
1356  { 1, 1, 1, 0, 8 }, /* U */
1357  { 2, 1, 1, 0, 8 }, /* V */
1358  },
1359  .flags = AV_PIX_FMT_FLAG_PLANAR,
1360  },
1361  [AV_PIX_FMT_YUV422P9BE] = {
1362  .name = "yuv422p9be",
1363  .nb_components = 3,
1364  .log2_chroma_w = 1,
1365  .log2_chroma_h = 0,
1366  .comp = {
1367  { 0, 1, 1, 0, 8 }, /* Y */
1368  { 1, 1, 1, 0, 8 }, /* U */
1369  { 2, 1, 1, 0, 8 }, /* V */
1370  },
1372  },
1374  .name = "yuv422p10le",
1375  .nb_components = 3,
1376  .log2_chroma_w = 1,
1377  .log2_chroma_h = 0,
1378  .comp = {
1379  { 0, 1, 1, 0, 9 }, /* Y */
1380  { 1, 1, 1, 0, 9 }, /* U */
1381  { 2, 1, 1, 0, 9 }, /* V */
1382  },
1383  .flags = AV_PIX_FMT_FLAG_PLANAR,
1384  },
1386  .name = "yuv422p10be",
1387  .nb_components = 3,
1388  .log2_chroma_w = 1,
1389  .log2_chroma_h = 0,
1390  .comp = {
1391  { 0, 1, 1, 0, 9 }, /* Y */
1392  { 1, 1, 1, 0, 9 }, /* U */
1393  { 2, 1, 1, 0, 9 }, /* V */
1394  },
1396  },
1398  .name = "yuv422p12le",
1399  .nb_components = 3,
1400  .log2_chroma_w = 1,
1401  .log2_chroma_h = 0,
1402  .comp = {
1403  { 0, 1, 1, 0, 11 }, /* Y */
1404  { 1, 1, 1, 0, 11 }, /* U */
1405  { 2, 1, 1, 0, 11 }, /* V */
1406  },
1407  .flags = AV_PIX_FMT_FLAG_PLANAR,
1408  },
1410  .name = "yuv422p12be",
1411  .nb_components = 3,
1412  .log2_chroma_w = 1,
1413  .log2_chroma_h = 0,
1414  .comp = {
1415  { 0, 1, 1, 0, 11 }, /* Y */
1416  { 1, 1, 1, 0, 11 }, /* U */
1417  { 2, 1, 1, 0, 11 }, /* V */
1418  },
1420  },
1422  .name = "yuv422p14le",
1423  .nb_components = 3,
1424  .log2_chroma_w = 1,
1425  .log2_chroma_h = 0,
1426  .comp = {
1427  { 0, 1, 1, 0, 13 }, /* Y */
1428  { 1, 1, 1, 0, 13 }, /* U */
1429  { 2, 1, 1, 0, 13 }, /* V */
1430  },
1431  .flags = AV_PIX_FMT_FLAG_PLANAR,
1432  },
1434  .name = "yuv422p14be",
1435  .nb_components = 3,
1436  .log2_chroma_w = 1,
1437  .log2_chroma_h = 0,
1438  .comp = {
1439  { 0, 1, 1, 0, 13 }, /* Y */
1440  { 1, 1, 1, 0, 13 }, /* U */
1441  { 2, 1, 1, 0, 13 }, /* V */
1442  },
1444  },
1446  .name = "yuv422p16le",
1447  .nb_components = 3,
1448  .log2_chroma_w = 1,
1449  .log2_chroma_h = 0,
1450  .comp = {
1451  { 0, 1, 1, 0, 15 }, /* Y */
1452  { 1, 1, 1, 0, 15 }, /* U */
1453  { 2, 1, 1, 0, 15 }, /* V */
1454  },
1455  .flags = AV_PIX_FMT_FLAG_PLANAR,
1456  },
1458  .name = "yuv422p16be",
1459  .nb_components = 3,
1460  .log2_chroma_w = 1,
1461  .log2_chroma_h = 0,
1462  .comp = {
1463  { 0, 1, 1, 0, 15 }, /* Y */
1464  { 1, 1, 1, 0, 15 }, /* U */
1465  { 2, 1, 1, 0, 15 }, /* V */
1466  },
1468  },
1470  .name = "yuv444p16le",
1471  .nb_components = 3,
1472  .log2_chroma_w = 0,
1473  .log2_chroma_h = 0,
1474  .comp = {
1475  { 0, 1, 1, 0, 15 }, /* Y */
1476  { 1, 1, 1, 0, 15 }, /* U */
1477  { 2, 1, 1, 0, 15 }, /* V */
1478  },
1479  .flags = AV_PIX_FMT_FLAG_PLANAR,
1480  },
1482  .name = "yuv444p16be",
1483  .nb_components = 3,
1484  .log2_chroma_w = 0,
1485  .log2_chroma_h = 0,
1486  .comp = {
1487  { 0, 1, 1, 0, 15 }, /* Y */
1488  { 1, 1, 1, 0, 15 }, /* U */
1489  { 2, 1, 1, 0, 15 }, /* V */
1490  },
1492  },
1494  .name = "yuv444p10le",
1495  .nb_components = 3,
1496  .log2_chroma_w = 0,
1497  .log2_chroma_h = 0,
1498  .comp = {
1499  { 0, 1, 1, 0, 9 }, /* Y */
1500  { 1, 1, 1, 0, 9 }, /* U */
1501  { 2, 1, 1, 0, 9 }, /* V */
1502  },
1503  .flags = AV_PIX_FMT_FLAG_PLANAR,
1504  },
1506  .name = "yuv444p10be",
1507  .nb_components = 3,
1508  .log2_chroma_w = 0,
1509  .log2_chroma_h = 0,
1510  .comp = {
1511  { 0, 1, 1, 0, 9 }, /* Y */
1512  { 1, 1, 1, 0, 9 }, /* U */
1513  { 2, 1, 1, 0, 9 }, /* V */
1514  },
1516  },
1517  [AV_PIX_FMT_YUV444P9LE] = {
1518  .name = "yuv444p9le",
1519  .nb_components = 3,
1520  .log2_chroma_w = 0,
1521  .log2_chroma_h = 0,
1522  .comp = {
1523  { 0, 1, 1, 0, 8 }, /* Y */
1524  { 1, 1, 1, 0, 8 }, /* U */
1525  { 2, 1, 1, 0, 8 }, /* V */
1526  },
1527  .flags = AV_PIX_FMT_FLAG_PLANAR,
1528  },
1529  [AV_PIX_FMT_YUV444P9BE] = {
1530  .name = "yuv444p9be",
1531  .nb_components = 3,
1532  .log2_chroma_w = 0,
1533  .log2_chroma_h = 0,
1534  .comp = {
1535  { 0, 1, 1, 0, 8 }, /* Y */
1536  { 1, 1, 1, 0, 8 }, /* U */
1537  { 2, 1, 1, 0, 8 }, /* V */
1538  },
1540  },
1542  .name = "yuv444p12le",
1543  .nb_components = 3,
1544  .log2_chroma_w = 0,
1545  .log2_chroma_h = 0,
1546  .comp = {
1547  { 0, 1, 1, 0, 11 }, /* Y */
1548  { 1, 1, 1, 0, 11 }, /* U */
1549  { 2, 1, 1, 0, 11 }, /* V */
1550  },
1551  .flags = AV_PIX_FMT_FLAG_PLANAR,
1552  },
1554  .name = "yuv444p12be",
1555  .nb_components = 3,
1556  .log2_chroma_w = 0,
1557  .log2_chroma_h = 0,
1558  .comp = {
1559  { 0, 1, 1, 0, 11 }, /* Y */
1560  { 1, 1, 1, 0, 11 }, /* U */
1561  { 2, 1, 1, 0, 11 }, /* V */
1562  },
1564  },
1566  .name = "yuv444p14le",
1567  .nb_components = 3,
1568  .log2_chroma_w = 0,
1569  .log2_chroma_h = 0,
1570  .comp = {
1571  { 0, 1, 1, 0, 13 }, /* Y */
1572  { 1, 1, 1, 0, 13 }, /* U */
1573  { 2, 1, 1, 0, 13 }, /* V */
1574  },
1575  .flags = AV_PIX_FMT_FLAG_PLANAR,
1576  },
1578  .name = "yuv444p14be",
1579  .nb_components = 3,
1580  .log2_chroma_w = 0,
1581  .log2_chroma_h = 0,
1582  .comp = {
1583  { 0, 1, 1, 0, 13 }, /* Y */
1584  { 1, 1, 1, 0, 13 }, /* U */
1585  { 2, 1, 1, 0, 13 }, /* V */
1586  },
1588  },
1590  .name = "d3d11va_vld",
1591  .log2_chroma_w = 1,
1592  .log2_chroma_h = 1,
1593  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1594  },
1595  [AV_PIX_FMT_DXVA2_VLD] = {
1596  .name = "dxva2_vld",
1597  .log2_chroma_w = 1,
1598  .log2_chroma_h = 1,
1599  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1600  },
1601  [AV_PIX_FMT_VDA_VLD] = {
1602  .name = "vda_vld",
1603  .log2_chroma_w = 1,
1604  .log2_chroma_h = 1,
1605  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1606  },
1607  [AV_PIX_FMT_YA8] = {
1608  .name = "ya8",
1609  .nb_components = 2,
1610  .comp = {
1611  { 0, 1, 1, 0, 7 }, /* Y */
1612  { 0, 1, 2, 0, 7 }, /* A */
1613  },
1614  .flags = AV_PIX_FMT_FLAG_ALPHA,
1615  .alias = "gray8a",
1616  },
1617  [AV_PIX_FMT_YA16LE] = {
1618  .name = "ya16le",
1619  .nb_components = 2,
1620  .comp = {
1621  { 0, 3, 1, 0, 15 }, /* Y */
1622  { 0, 3, 3, 0, 15 }, /* A */
1623  },
1624  .flags = AV_PIX_FMT_FLAG_ALPHA,
1625  },
1626  [AV_PIX_FMT_YA16BE] = {
1627  .name = "ya16be",
1628  .nb_components = 2,
1629  .comp = {
1630  { 0, 3, 1, 0, 15 }, /* Y */
1631  { 0, 3, 3, 0, 15 }, /* A */
1632  },
1634  },
1635  [AV_PIX_FMT_GBRP] = {
1636  .name = "gbrp",
1637  .nb_components = 3,
1638  .log2_chroma_w = 0,
1639  .log2_chroma_h = 0,
1640  .comp = {
1641  { 2, 0, 1, 0, 7 }, /* R */
1642  { 0, 0, 1, 0, 7 }, /* G */
1643  { 1, 0, 1, 0, 7 }, /* B */
1644  },
1646  },
1647  [AV_PIX_FMT_GBRP9LE] = {
1648  .name = "gbrp9le",
1649  .nb_components = 3,
1650  .log2_chroma_w = 0,
1651  .log2_chroma_h = 0,
1652  .comp = {
1653  { 2, 1, 1, 0, 8 }, /* R */
1654  { 0, 1, 1, 0, 8 }, /* G */
1655  { 1, 1, 1, 0, 8 }, /* B */
1656  },
1658  },
1659  [AV_PIX_FMT_GBRP9BE] = {
1660  .name = "gbrp9be",
1661  .nb_components = 3,
1662  .log2_chroma_w = 0,
1663  .log2_chroma_h = 0,
1664  .comp = {
1665  { 2, 1, 1, 0, 8 }, /* R */
1666  { 0, 1, 1, 0, 8 }, /* G */
1667  { 1, 1, 1, 0, 8 }, /* B */
1668  },
1670  },
1671  [AV_PIX_FMT_GBRP10LE] = {
1672  .name = "gbrp10le",
1673  .nb_components = 3,
1674  .log2_chroma_w = 0,
1675  .log2_chroma_h = 0,
1676  .comp = {
1677  { 2, 1, 1, 0, 9 }, /* R */
1678  { 0, 1, 1, 0, 9 }, /* G */
1679  { 1, 1, 1, 0, 9 }, /* B */
1680  },
1682  },
1683  [AV_PIX_FMT_GBRP10BE] = {
1684  .name = "gbrp10be",
1685  .nb_components = 3,
1686  .log2_chroma_w = 0,
1687  .log2_chroma_h = 0,
1688  .comp = {
1689  { 2, 1, 1, 0, 9 }, /* R */
1690  { 0, 1, 1, 0, 9 }, /* G */
1691  { 1, 1, 1, 0, 9 }, /* B */
1692  },
1694  },
1695  [AV_PIX_FMT_GBRP12LE] = {
1696  .name = "gbrp12le",
1697  .nb_components = 3,
1698  .log2_chroma_w = 0,
1699  .log2_chroma_h = 0,
1700  .comp = {
1701  { 2, 1, 1, 0, 11 }, /* R */
1702  { 0, 1, 1, 0, 11 }, /* G */
1703  { 1, 1, 1, 0, 11 }, /* B */
1704  },
1706  },
1707  [AV_PIX_FMT_GBRP12BE] = {
1708  .name = "gbrp12be",
1709  .nb_components = 3,
1710  .log2_chroma_w = 0,
1711  .log2_chroma_h = 0,
1712  .comp = {
1713  { 2, 1, 1, 0, 11 }, /* R */
1714  { 0, 1, 1, 0, 11 }, /* G */
1715  { 1, 1, 1, 0, 11 }, /* B */
1716  },
1718  },
1719  [AV_PIX_FMT_GBRP14LE] = {
1720  .name = "gbrp14le",
1721  .nb_components = 3,
1722  .log2_chroma_w = 0,
1723  .log2_chroma_h = 0,
1724  .comp = {
1725  { 2, 1, 1, 0, 13 }, /* R */
1726  { 0, 1, 1, 0, 13 }, /* G */
1727  { 1, 1, 1, 0, 13 }, /* B */
1728  },
1730  },
1731  [AV_PIX_FMT_GBRP14BE] = {
1732  .name = "gbrp14be",
1733  .nb_components = 3,
1734  .log2_chroma_w = 0,
1735  .log2_chroma_h = 0,
1736  .comp = {
1737  { 2, 1, 1, 0, 13 }, /* R */
1738  { 0, 1, 1, 0, 13 }, /* G */
1739  { 1, 1, 1, 0, 13 }, /* B */
1740  },
1742  },
1743  [AV_PIX_FMT_GBRP16LE] = {
1744  .name = "gbrp16le",
1745  .nb_components = 3,
1746  .log2_chroma_w = 0,
1747  .log2_chroma_h = 0,
1748  .comp = {
1749  { 2, 1, 1, 0, 15 }, /* R */
1750  { 0, 1, 1, 0, 15 }, /* G */
1751  { 1, 1, 1, 0, 15 }, /* B */
1752  },
1754  },
1755  [AV_PIX_FMT_GBRP16BE] = {
1756  .name = "gbrp16be",
1757  .nb_components = 3,
1758  .log2_chroma_w = 0,
1759  .log2_chroma_h = 0,
1760  .comp = {
1761  { 2, 1, 1, 0, 15 }, /* R */
1762  { 0, 1, 1, 0, 15 }, /* G */
1763  { 1, 1, 1, 0, 15 }, /* B */
1764  },
1766  },
1767  [AV_PIX_FMT_GBRAP] = {
1768  .name = "gbrap",
1769  .nb_components = 4,
1770  .log2_chroma_w = 0,
1771  .log2_chroma_h = 0,
1772  .comp = {
1773  { 2, 0, 1, 0, 7 }, /* R */
1774  { 0, 0, 1, 0, 7 }, /* G */
1775  { 1, 0, 1, 0, 7 }, /* B */
1776  { 3, 0, 1, 0, 7 }, /* A */
1777  },
1780  },
1781  [AV_PIX_FMT_GBRAP16LE] = {
1782  .name = "gbrap16le",
1783  .nb_components = 4,
1784  .log2_chroma_w = 0,
1785  .log2_chroma_h = 0,
1786  .comp = {
1787  { 2, 1, 1, 0, 15 }, /* R */
1788  { 0, 1, 1, 0, 15 }, /* G */
1789  { 1, 1, 1, 0, 15 }, /* B */
1790  { 3, 1, 1, 0, 15 }, /* A */
1791  },
1794  },
1795  [AV_PIX_FMT_GBRAP16BE] = {
1796  .name = "gbrap16be",
1797  .nb_components = 4,
1798  .log2_chroma_w = 0,
1799  .log2_chroma_h = 0,
1800  .comp = {
1801  { 2, 1, 1, 0, 15 }, /* R */
1802  { 0, 1, 1, 0, 15 }, /* G */
1803  { 1, 1, 1, 0, 15 }, /* B */
1804  { 3, 1, 1, 0, 15 }, /* A */
1805  },
1808  },
1809  [AV_PIX_FMT_VDPAU] = {
1810  .name = "vdpau",
1811  .log2_chroma_w = 1,
1812  .log2_chroma_h = 1,
1813  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1814  },
1815  [AV_PIX_FMT_XYZ12LE] = {
1816  .name = "xyz12le",
1817  .nb_components = 3,
1818  .log2_chroma_w = 0,
1819  .log2_chroma_h = 0,
1820  .comp = {
1821  { 0, 5, 1, 4, 11 }, /* X */
1822  { 0, 5, 3, 4, 11 }, /* Y */
1823  { 0, 5, 5, 4, 11 }, /* Z */
1824  },
1825  /*.flags = -- not used*/
1826  },
1827  [AV_PIX_FMT_XYZ12BE] = {
1828  .name = "xyz12be",
1829  .nb_components = 3,
1830  .log2_chroma_w = 0,
1831  .log2_chroma_h = 0,
1832  .comp = {
1833  { 0, 5, 1, 4, 11 }, /* X */
1834  { 0, 5, 3, 4, 11 }, /* Y */
1835  { 0, 5, 5, 4, 11 }, /* Z */
1836  },
1837  .flags = AV_PIX_FMT_FLAG_BE,
1838  },
1839 
1840 #define BAYER8_DESC_COMMON \
1841  .nb_components= 3, \
1842  .log2_chroma_w= 0, \
1843  .log2_chroma_h= 0, \
1844  .comp = { \
1845  {0,0,0,0,1}, \
1846  {0,0,0,0,3}, \
1847  {0,0,0,0,1}, \
1848  }, \
1849 
1850 #define BAYER16_DESC_COMMON \
1851  .nb_components= 3, \
1852  .log2_chroma_w= 0, \
1853  .log2_chroma_h= 0, \
1854  .comp = { \
1855  {0,1,0,0, 3}, \
1856  {0,1,0,0, 7}, \
1857  {0,1,0,0, 3}, \
1858  }, \
1859 
1861  .name = "bayer_bggr8",
1863  .flags = AV_PIX_FMT_FLAG_RGB,
1864  },
1866  .name = "bayer_bggr16le",
1868  .flags = AV_PIX_FMT_FLAG_RGB,
1869  },
1871  .name = "bayer_bggr16be",
1874  },
1876  .name = "bayer_rggb8",
1878  .flags = AV_PIX_FMT_FLAG_RGB,
1879  },
1881  .name = "bayer_rggb16le",
1883  .flags = AV_PIX_FMT_FLAG_RGB,
1884  },
1886  .name = "bayer_rggb16be",
1889  },
1891  .name = "bayer_gbrg8",
1893  .flags = AV_PIX_FMT_FLAG_RGB,
1894  },
1896  .name = "bayer_gbrg16le",
1898  .flags = AV_PIX_FMT_FLAG_RGB,
1899  },
1901  .name = "bayer_gbrg16be",
1904  },
1906  .name = "bayer_grbg8",
1908  .flags = AV_PIX_FMT_FLAG_RGB,
1909  },
1911  .name = "bayer_grbg16le",
1913  .flags = AV_PIX_FMT_FLAG_RGB,
1914  },
1916  .name = "bayer_grbg16be",
1919  },
1920  [AV_PIX_FMT_NV16] = {
1921  .name = "nv16",
1922  .nb_components = 3,
1923  .log2_chroma_w = 1,
1924  .log2_chroma_h = 0,
1925  .comp = {
1926  { 0, 0, 1, 0, 7 }, /* Y */
1927  { 1, 1, 1, 0, 7 }, /* U */
1928  { 1, 1, 2, 0, 7 }, /* V */
1929  },
1930  .flags = AV_PIX_FMT_FLAG_PLANAR,
1931  },
1932  [AV_PIX_FMT_NV20LE] = {
1933  .name = "nv20le",
1934  .nb_components = 3,
1935  .log2_chroma_w = 1,
1936  .log2_chroma_h = 0,
1937  .comp = {
1938  { 0, 1, 1, 0, 9 }, /* Y */
1939  { 1, 3, 1, 0, 9 }, /* U */
1940  { 1, 3, 3, 0, 9 }, /* V */
1941  },
1942  .flags = AV_PIX_FMT_FLAG_PLANAR,
1943  },
1944  [AV_PIX_FMT_NV20BE] = {
1945  .name = "nv20be",
1946  .nb_components = 3,
1947  .log2_chroma_w = 1,
1948  .log2_chroma_h = 0,
1949  .comp = {
1950  { 0, 1, 1, 0, 9 }, /* Y */
1951  { 1, 3, 1, 0, 9 }, /* U */
1952  { 1, 3, 3, 0, 9 }, /* V */
1953  },
1955  },
1956  [AV_PIX_FMT_VDA] = {
1957  .name = "vda",
1958  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1959  },
1960  [AV_PIX_FMT_QSV] = {
1961  .name = "qsv",
1962  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1963  },
1964  [AV_PIX_FMT_MMAL] = {
1965  .name = "mmal",
1966  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1967  },
1968 };
1969 
1970 static const char *color_range_names[AVCOL_RANGE_NB] = {
1971  "unknown", "tv", "pc",
1972 };
1973 
1974 static const char *color_primaries_names[AVCOL_PRI_NB] = {
1975  "reserved", "bt709", "unknown", "reserved", "bt470m",
1976  "bt470bg", "smpte170m", "smpte240m", "film", "bt2020",
1977 };
1978 
1979 static const char *color_transfer_names[AVCOL_TRC_NB] = {
1980  "reserved", "bt709", "unknown", "reserved", "bt470m",
1981  "bt470bg", "smpte170m", "smpte240m", "linear", "log100",
1982  "log316", "iec61966-2-4", "bt1361e", "iec61966-2-1",
1983  "bt2020-10", "bt2020-20",
1984 };
1985 
1986 static const char *color_space_names[AVCOL_SPC_NB] = {
1987  "gbr", "bt709", "unknown", "reserved", "fcc",
1988  "bt470bg", "smpte170m", "smpte240m", "ycgco",
1989  "bt2020nc", "bt2020c",
1990 };
1991 
1993  "unspecified", "left", "center", "topleft",
1994  "top", "bottomleft", "bottom",
1995 };
1996 
1998 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
1999 {
2000  enum AVPixelFormat pix_fmt;
2001 
2002  for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
2003  if (av_pix_fmt_descriptors[pix_fmt].name &&
2004  (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
2005  av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias)))
2006  return pix_fmt;
2007 
2008  return AV_PIX_FMT_NONE;
2009 }
2010 
2012 {
2013  return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
2014  av_pix_fmt_descriptors[pix_fmt].name : NULL;
2015 }
2016 
2017 #if HAVE_BIGENDIAN
2018 # define X_NE(be, le) be
2019 #else
2020 # define X_NE(be, le) le
2021 #endif
2022 
2024 {
2025  enum AVPixelFormat pix_fmt;
2026 
2027  if (!strcmp(name, "rgb32"))
2028  name = X_NE("argb", "bgra");
2029  else if (!strcmp(name, "bgr32"))
2030  name = X_NE("abgr", "rgba");
2031 
2032  pix_fmt = get_pix_fmt_internal(name);
2033  if (pix_fmt == AV_PIX_FMT_NONE) {
2034  char name2[32];
2035 
2036  snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
2037  pix_fmt = get_pix_fmt_internal(name2);
2038  }
2039  return pix_fmt;
2040 }
2041 
2043 {
2044  int c, bits = 0;
2045  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2046 
2047  for (c = 0; c < pixdesc->nb_components; c++) {
2048  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2049  bits += (pixdesc->comp[c].depth_minus1 + 1) << s;
2050  }
2051 
2052  return bits >> log2_pixels;
2053 }
2054 
2056 {
2057  int c, bits = 0;
2058  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
2059  int steps[4] = {0};
2060 
2061  for (c = 0; c < pixdesc->nb_components; c++) {
2062  const AVComponentDescriptor *comp = &pixdesc->comp[c];
2063  int s = c == 1 || c == 2 ? 0 : log2_pixels;
2064  steps[comp->plane] = (comp->step_minus1 + 1) << s;
2065  }
2066  for (c = 0; c < 4; c++)
2067  bits += steps[c];
2068 
2069  if(!(pixdesc->flags & AV_PIX_FMT_FLAG_BITSTREAM))
2070  bits *= 8;
2071 
2072  return bits >> log2_pixels;
2073 }
2074 
2075 char *av_get_pix_fmt_string(char *buf, int buf_size,
2076  enum AVPixelFormat pix_fmt)
2077 {
2078  /* print header */
2079  if (pix_fmt < 0) {
2080  snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
2081  } else {
2082  const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
2083  snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
2084  pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
2085  }
2086 
2087  return buf;
2088 }
2089 
2091 {
2092  if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
2093  return NULL;
2094  return &av_pix_fmt_descriptors[pix_fmt];
2095 }
2096 
2098 {
2099  if (!prev)
2100  return &av_pix_fmt_descriptors[0];
2101  while (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1) {
2102  prev++;
2103  if (prev->name)
2104  return prev;
2105  }
2106  return NULL;
2107 }
2108 
2110 {
2111  if (desc < av_pix_fmt_descriptors ||
2112  desc >= av_pix_fmt_descriptors + FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
2113  return AV_PIX_FMT_NONE;
2114 
2115  return desc - av_pix_fmt_descriptors;
2116 }
2117 
2119  int *h_shift, int *v_shift)
2120 {
2121  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2122  if (!desc)
2123  return AVERROR(ENOSYS);
2124  *h_shift = desc->log2_chroma_w;
2125  *v_shift = desc->log2_chroma_h;
2126 
2127  return 0;
2128 }
2129 
2131 {
2132  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2133  int i, planes[4] = { 0 }, ret = 0;
2134 
2135  if (!desc)
2136  return AVERROR(EINVAL);
2137 
2138  for (i = 0; i < desc->nb_components; i++)
2139  planes[desc->comp[i].plane] = 1;
2140  for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
2141  ret += planes[i];
2142  return ret;
2143 }
2144 
2146  int i, j;
2147 
2148  for (i=0; i<FF_ARRAY_ELEMS(av_pix_fmt_descriptors); i++) {
2149  const AVPixFmtDescriptor *d = &av_pix_fmt_descriptors[i];
2150  uint8_t fill[4][8+6+3] = {{0}};
2151  uint8_t *data[4] = {fill[0], fill[1], fill[2], fill[3]};
2152  int linesize[4] = {0,0,0,0};
2153  uint16_t tmp[2];
2154 
2155  if (!d->name && !d->nb_components && !d->log2_chroma_w && !d->log2_chroma_h && !d->flags)
2156  continue;
2157 // av_log(NULL, AV_LOG_DEBUG, "Checking: %s\n", d->name);
2158  av_assert0(d->log2_chroma_w <= 3);
2159  av_assert0(d->log2_chroma_h <= 3);
2160  av_assert0(d->nb_components <= 4);
2161  av_assert0(d->name && d->name[0]);
2162  av_assert0((d->nb_components==4 || d->nb_components==2) == !!(d->flags & AV_PIX_FMT_FLAG_ALPHA));
2163  av_assert2(av_get_pix_fmt(d->name) == i);
2164 
2165  for (j=0; j<FF_ARRAY_ELEMS(d->comp); j++) {
2166  const AVComponentDescriptor *c = &d->comp[j];
2167  if(j>=d->nb_components) {
2168  av_assert0(!c->plane && !c->step_minus1 && !c->offset_plus1 && !c->shift && !c->depth_minus1);
2169  continue;
2170  }
2171  if (d->flags & AV_PIX_FMT_FLAG_BITSTREAM) {
2173  } else {
2174  av_assert0(8*(c->step_minus1+1) >= c->depth_minus1+1);
2175  }
2176  if (!strncmp(d->name, "bayer_", 6))
2177  continue;
2178  av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0);
2179  av_assert0(tmp[0] == 0 && tmp[1] == 0);
2180  tmp[0] = tmp[1] = (1<<(c->depth_minus1 + 1)) - 1;
2181  av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2);
2182  }
2183  }
2184 }
2186 
2187 
2189 {
2190  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2191  char name[16];
2192  int i;
2193 
2194  if (!desc || strlen(desc->name) < 2)
2195  return AV_PIX_FMT_NONE;
2196  av_strlcpy(name, desc->name, sizeof(name));
2197  i = strlen(name) - 2;
2198  if (strcmp(name + i, "be") && strcmp(name + i, "le"))
2199  return AV_PIX_FMT_NONE;
2200 
2201  name[i] ^= 'b' ^ 'l';
2202 
2203  return get_pix_fmt_internal(name);
2204 }
2205 
2206 #define FF_COLOR_NA -1
2207 #define FF_COLOR_RGB 0 /**< RGB color space */
2208 #define FF_COLOR_GRAY 1 /**< gray color space */
2209 #define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
2210 #define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
2211 
2212 #define pixdesc_has_alpha(pixdesc) \
2213  ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
2214 
2215 
2216 static int get_color_type(const AVPixFmtDescriptor *desc) {
2217  if (desc->flags & AV_PIX_FMT_FLAG_PAL)
2218  return FF_COLOR_RGB;
2219 
2220  if(desc->nb_components == 1 || desc->nb_components == 2)
2221  return FF_COLOR_GRAY;
2222 
2223  if(desc->name && !strncmp(desc->name, "yuvj", 4))
2224  return FF_COLOR_YUV_JPEG;
2225 
2226  if(desc->flags & AV_PIX_FMT_FLAG_RGB)
2227  return FF_COLOR_RGB;
2228 
2229  if(desc->nb_components == 0)
2230  return FF_COLOR_NA;
2231 
2232  return FF_COLOR_YUV;
2233 }
2234 
2235 static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
2236 {
2237  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
2238  int i;
2239 
2240  if (!desc || !desc->nb_components) {
2241  *min = *max = 0;
2242  return AVERROR(EINVAL);
2243  }
2244 
2245  *min = INT_MAX, *max = -INT_MAX;
2246  for (i = 0; i < desc->nb_components; i++) {
2247  *min = FFMIN(desc->comp[i].depth_minus1+1, *min);
2248  *max = FFMAX(desc->comp[i].depth_minus1+1, *max);
2249  }
2250  return 0;
2251 }
2252 
2253 static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
2254  enum AVPixelFormat src_pix_fmt,
2255  unsigned *lossp, unsigned consider)
2256 {
2257  const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
2258  const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
2259  int src_color, dst_color;
2260  int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
2261  int ret, loss, i, nb_components;
2262  int score = INT_MAX - 1;
2263 
2264  if (dst_pix_fmt >= AV_PIX_FMT_NB || dst_pix_fmt <= AV_PIX_FMT_NONE)
2265  return ~0;
2266 
2267  /* compute loss */
2268  *lossp = loss = 0;
2269 
2270  if (dst_pix_fmt == src_pix_fmt)
2271  return INT_MAX;
2272 
2273  if ((ret = get_pix_fmt_depth(&src_min_depth, &src_max_depth, src_pix_fmt)) < 0)
2274  return ret;
2275  if ((ret = get_pix_fmt_depth(&dst_min_depth, &dst_max_depth, dst_pix_fmt)) < 0)
2276  return ret;
2277 
2278  src_color = get_color_type(src_desc);
2279  dst_color = get_color_type(dst_desc);
2280  if (dst_pix_fmt == AV_PIX_FMT_PAL8)
2281  nb_components = FFMIN(src_desc->nb_components, 4);
2282  else
2283  nb_components = FFMIN(src_desc->nb_components, dst_desc->nb_components);
2284 
2285  for (i = 0; i < nb_components; i++) {
2286  int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : dst_desc->comp[i].depth_minus1;
2287  if (src_desc->comp[i].depth_minus1 > depth_minus1 && (consider & FF_LOSS_DEPTH)) {
2288  loss |= FF_LOSS_DEPTH;
2289  score -= 65536 >> depth_minus1;
2290  }
2291  }
2292 
2293  if (consider & FF_LOSS_RESOLUTION) {
2294  if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w) {
2295  loss |= FF_LOSS_RESOLUTION;
2296  score -= 256 << dst_desc->log2_chroma_w;
2297  }
2298  if (dst_desc->log2_chroma_h > src_desc->log2_chroma_h) {
2299  loss |= FF_LOSS_RESOLUTION;
2300  score -= 256 << dst_desc->log2_chroma_h;
2301  }
2302  // don't favor 422 over 420 if downsampling is needed, because 420 has much better support on the decoder side
2303  if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 0 &&
2304  dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 0 ) {
2305  score += 512;
2306  }
2307  }
2308 
2309  if(consider & FF_LOSS_COLORSPACE)
2310  switch(dst_color) {
2311  case FF_COLOR_RGB:
2312  if (src_color != FF_COLOR_RGB &&
2313  src_color != FF_COLOR_GRAY)
2314  loss |= FF_LOSS_COLORSPACE;
2315  break;
2316  case FF_COLOR_GRAY:
2317  if (src_color != FF_COLOR_GRAY)
2318  loss |= FF_LOSS_COLORSPACE;
2319  break;
2320  case FF_COLOR_YUV:
2321  if (src_color != FF_COLOR_YUV)
2322  loss |= FF_LOSS_COLORSPACE;
2323  break;
2324  case FF_COLOR_YUV_JPEG:
2325  if (src_color != FF_COLOR_YUV_JPEG &&
2326  src_color != FF_COLOR_YUV &&
2327  src_color != FF_COLOR_GRAY)
2328  loss |= FF_LOSS_COLORSPACE;
2329  break;
2330  default:
2331  /* fail safe test */
2332  if (src_color != dst_color)
2333  loss |= FF_LOSS_COLORSPACE;
2334  break;
2335  }
2336  if(loss & FF_LOSS_COLORSPACE)
2337  score -= (nb_components * 65536) >> FFMIN(dst_desc->comp[0].depth_minus1, src_desc->comp[0].depth_minus1);
2338 
2339  if (dst_color == FF_COLOR_GRAY &&
2340  src_color != FF_COLOR_GRAY && (consider & FF_LOSS_CHROMA)) {
2341  loss |= FF_LOSS_CHROMA;
2342  score -= 2 * 65536;
2343  }
2344  if (!pixdesc_has_alpha(dst_desc) && (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))) {
2345  loss |= FF_LOSS_ALPHA;
2346  score -= 65536;
2347  }
2348  if (dst_pix_fmt == AV_PIX_FMT_PAL8 && (consider & FF_LOSS_COLORQUANT) &&
2349  (src_pix_fmt != AV_PIX_FMT_PAL8 && (src_color != FF_COLOR_GRAY || (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))))) {
2350  loss |= FF_LOSS_COLORQUANT;
2351  score -= 65536;
2352  }
2353 
2354  *lossp = loss;
2355  return score;
2356 }
2357 
2358 int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
2359  enum AVPixelFormat src_pix_fmt,
2360  int has_alpha)
2361 {
2362  int loss;
2363  int ret = get_pix_fmt_score(dst_pix_fmt, src_pix_fmt, &loss, has_alpha ? ~0 : ~FF_LOSS_ALPHA);
2364  if (ret < 0)
2365  return ret;
2366  return loss;
2367 }
2368 
2369 enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
2370  enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
2371 {
2372  enum AVPixelFormat dst_pix_fmt;
2373  int loss1, loss2, loss_mask;
2374  const AVPixFmtDescriptor *desc1 = av_pix_fmt_desc_get(dst_pix_fmt1);
2375  const AVPixFmtDescriptor *desc2 = av_pix_fmt_desc_get(dst_pix_fmt2);
2376  int score1, score2;
2377 
2378  loss_mask= loss_ptr?~*loss_ptr:~0; /* use loss mask if provided */
2379  if(!has_alpha)
2380  loss_mask &= ~FF_LOSS_ALPHA;
2381 
2382  score1 = get_pix_fmt_score(dst_pix_fmt1, src_pix_fmt, &loss1, loss_mask);
2383  score2 = get_pix_fmt_score(dst_pix_fmt2, src_pix_fmt, &loss2, loss_mask);
2384 
2385  if (score1 == score2) {
2387  dst_pix_fmt = av_get_padded_bits_per_pixel(desc2) < av_get_padded_bits_per_pixel(desc1) ? dst_pix_fmt2 : dst_pix_fmt1;
2388  } else {
2389  dst_pix_fmt = desc2->nb_components < desc1->nb_components ? dst_pix_fmt2 : dst_pix_fmt1;
2390  }
2391  } else {
2392  dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
2393  }
2394 
2395  if (loss_ptr)
2396  *loss_ptr = av_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
2397  return dst_pix_fmt;
2398 }
2399 
2400 const char *av_color_range_name(enum AVColorRange range)
2401 {
2402  return (unsigned) range < AVCOL_RANGE_NB ?
2403  color_range_names[range] : NULL;
2404 }
2405 
2406 const char *av_color_primaries_name(enum AVColorPrimaries primaries)
2407 {
2408  return (unsigned) primaries < AVCOL_PRI_NB ?
2409  color_primaries_names[primaries] : NULL;
2410 }
2411 
2413 {
2414  return (unsigned) transfer < AVCOL_TRC_NB ?
2415  color_transfer_names[transfer] : NULL;
2416 }
2417 
2418 const char *av_color_space_name(enum AVColorSpace space)
2419 {
2420  return (unsigned) space < AVCOL_SPC_NB ?
2421  color_space_names[space] : NULL;
2422 }
2423 
2424 const char *av_chroma_location_name(enum AVChromaLocation location)
2425 {
2426  return (unsigned) location < AVCHROMA_LOC_NB ?
2427  chroma_location_names[location] : NULL;
2428 }
2429 
2430 #ifdef TEST
2431 
2432 int main(void){
2433  int i;
2434  int err=0;
2435  int skip = 0;
2436 
2437  for (i=0; i<AV_PIX_FMT_NB*2; i++) {
2438  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(i);
2439  if(!desc || !desc->name) {
2440  skip ++;
2441  continue;
2442  }
2443  if (skip) {
2444  av_log(NULL, AV_LOG_INFO, "%3d unused pixel format values\n", skip);
2445  skip = 0;
2446  }
2447  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));
2448  if ((!(desc->flags & AV_PIX_FMT_FLAG_ALPHA)) != (desc->nb_components != 2 && desc->nb_components != 4)) {
2449  av_log(NULL, AV_LOG_ERROR, "Alpha flag mismatch\n");
2450  err = 1;
2451  }
2452  }
2453  return err;
2454 }
2455 
2456 #endif
2457 
#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:124
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:634
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
Definition: pixfmt.h:307
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:281
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:274
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2090
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:278
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:159
8bit gray, 8bit 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:262
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:1970
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:2130
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
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: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:2042
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:2075
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:279
bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */
Definition: pixfmt.h:294
bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */
Definition: pixfmt.h:295
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:176
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:261
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:302
HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the b...
Definition: pixfmt.h:126
static const char * color_primaries_names[AVCOL_PRI_NB]
Definition: pixdesc.c:1974
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:203
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:284
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
#define FF_ARRAY_ELEMS(a)
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:266
bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */
Definition: pixfmt.h:292
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:85
planar GBR 4:4:4 36bpp, big-endian
Definition: pixfmt.h:283
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:128
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
Definition: bytestream.h:85
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:477
static const char * chroma_location_names[AVCHROMA_LOC_NB]
Definition: pixdesc.c:1992
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:2418
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:193
#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:288
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
Definition: pixfmt.h:204
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:103
if()
Definition: avfilter.c:975
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:265
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:500
bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */
Definition: pixfmt.h:300
const char * av_color_range_name(enum AVColorRange range)
Definition: pixdesc.c:2400
bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */
Definition: pixfmt.h:301
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:259
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:280
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:1979
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:205
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
Definition: pixfmt.h:308
planar GBR 4:4:4 48bpp, big-endian
Definition: pixfmt.h:181
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:2188
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:208
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:524
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:520
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
Definition: pixfmt.h:310
AVColorPrimaries
Chromaticity coordinates of the source primaries.
Definition: pixfmt.h:459
#define AV_WB16(p, v)
Definition: intreadwrite.h:405
bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */
Definition: pixfmt.h:296
#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:157
planar GBR 4:4:4 27bpp, big-endian
Definition: pixfmt.h:177
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:2424
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:269
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:234
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:133
#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:2118
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:2055
Not part of ABI.
Definition: pixfmt.h:471
#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:196
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: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:277
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:131
Libavutil version macros.
HW acceleration through VDA, data[3] contains a CVPixelBufferRef.
Definition: pixfmt.h:232
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
Definition: pixfmt.h:197
#define FFMAX(a, b)
Definition: common.h:64
static const char * color_space_names[AVCOL_SPC_NB]
Definition: pixdesc.c:1986
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:149
int depth
Definition: v4l.c:61
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:95
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
Definition: pixdesc.c:2406
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
Definition: pixfmt.h:198
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:2109
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:66
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
ret
Definition: avfilter.c:974
#define FF_COLOR_YUV_JPEG
YUV color space.
Definition: pixdesc.c:2210
#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:202
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
Definition: pixfmt.h:230
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
Definition: pixfmt.h:194
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:272
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:214
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:217
static int get_color_type(const AVPixFmtDescriptor *desc)
Definition: pixdesc.c:2216
#define pixdesc_has_alpha(pixdesc)
Definition: pixdesc.c:2212
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
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
Definition: pixfmt.h:119
HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state str...
Definition: pixfmt.h:125
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:129
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:268
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:299
planar GBR 4:4:4 30bpp, big-endian
Definition: pixfmt.h:179
bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */
Definition: pixfmt.h:303
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
Definition: pixfmt.h:206
static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt, unsigned *lossp, unsigned consider)
Definition: pixdesc.c:2253
#define FF_COLOR_YUV
YUV color space.
Definition: pixdesc.c:2209
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:309
planar GBR 4:4:4 42bpp, little-endian
Definition: pixfmt.h:286
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:135
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:207
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:209
Y , 16bpp, big-endian.
Definition: pixfmt.h:99
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
Definition: pixfmt.h:211
Not part of ABI.
Definition: pixfmt.h:494
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:273
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:2358
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
Definition: pixfmt.h:249
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:267
planar GBR 4:4:4 42bpp, big-endian
Definition: pixfmt.h:285
static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2235
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
Definition: pixfmt.h:192
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:297
#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:137
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:201
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:298
#define FF_COLOR_RGB
RGB color space.
Definition: pixdesc.c:2207
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:132
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:2020
#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:168
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:276
Y , 8bpp.
Definition: pixfmt.h:71
#define FF_DISABLE_DEPRECATION_WARNINGS
Definition: internal.h:79
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:72
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:287
planar GBR 4:4:4 27bpp, little-endian
Definition: pixfmt.h:178
static double c[64]
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
Definition: pixdesc.c:2412
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:130
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:293
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:215
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:2369
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:199
#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:1998
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:213
#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:282
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:290
Not part of ABI.
Definition: pixfmt.h:550
16bit gray, 16bit alpha (little-endian)
Definition: pixfmt.h:235
#define FF_COLOR_NA
Definition: pixdesc.c:2206
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
Definition: pixfmt.h:200
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:312
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:542
HW decoding through Direct3D11, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer...
Definition: pixfmt.h:256
planar GBR 4:4:4 48bpp, little-endian
Definition: pixfmt.h:182
void ff_check_pixfmt_descriptors(void)
Definition: pixdesc.c:2145
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:2023
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:2011
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
Definition: pixfmt.h:195
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:216
HW acceleration though MMAL, data[3] contains a pointer to the MMAL_BUFFER_HEADER_T structure...
Definition: pixfmt.h:254
planar GBRA 4:4:4:4 64bpp, little-endian
Definition: pixfmt.h:289
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
Definition: pixfmt.h:264
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:271
Not part of ABI.
Definition: pixfmt.h:512
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:275
planar GBR 4:4:4 30bpp, little-endian
Definition: pixfmt.h:180
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:260
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.
Definition: pixdesc.c:2097
const char * name
Definition: opengl_enc.c:103
#define FF_COLOR_GRAY
gray color space
Definition: pixdesc.c:2208
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:160