Libav
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 Libav.
6  *
7  * Libav 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  * Libav 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 Libav; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include <stdio.h>
23 #include <string.h>
24 
25 #include "avstring.h"
26 #include "common.h"
27 #include "pixfmt.h"
28 #include "pixdesc.h"
29 #include "internal.h"
30 #include "intreadwrite.h"
31 #include "version.h"
32 
33 void av_read_image_line(uint16_t *dst,
34  const uint8_t *data[4], const int linesize[4],
35  const AVPixFmtDescriptor *desc,
36  int x, int y, int c, int w,
37  int read_pal_component)
38 {
39  AVComponentDescriptor comp = desc->comp[c];
40  int plane = comp.plane;
41  int depth = comp.depth_minus1 + 1;
42  int mask = (1 << depth) - 1;
43  int shift = comp.shift;
44  int step = comp.step_minus1 + 1;
45  int flags = desc->flags;
46 
47  if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
48  int skip = x * step + comp.offset_plus1 - 1;
49  const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
50  int shift = 8 - depth - (skip & 7);
51 
52  while (w--) {
53  int val = (*p >> shift) & mask;
54  if (read_pal_component)
55  val = data[1][4*val + c];
56  shift -= step;
57  p -= shift >> 3;
58  shift &= 7;
59  *dst++ = val;
60  }
61  } else {
62  const uint8_t *p = data[plane] + y * linesize[plane] +
63  x * step + comp.offset_plus1 - 1;
64  int is_8bit = shift + depth <= 8;
65 
66  if (is_8bit)
67  p += !!(flags & AV_PIX_FMT_FLAG_BE);
68 
69  while (w--) {
70  int val = is_8bit ? *p :
71  flags & AV_PIX_FMT_FLAG_BE ? AV_RB16(p) : AV_RL16(p);
72  val = (val >> shift) & mask;
73  if (read_pal_component)
74  val = data[1][4 * val + c];
75  p += step;
76  *dst++ = val;
77  }
78  }
79 }
80 
81 void av_write_image_line(const uint16_t *src,
82  uint8_t *data[4], const int linesize[4],
83  const AVPixFmtDescriptor *desc,
84  int x, int y, int c, int w)
85 {
86  AVComponentDescriptor comp = desc->comp[c];
87  int plane = comp.plane;
88  int depth = comp.depth_minus1 + 1;
89  int step = comp.step_minus1 + 1;
90  int flags = desc->flags;
91 
92  if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
93  int skip = x * step + comp.offset_plus1 - 1;
94  uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
95  int shift = 8 - depth - (skip & 7);
96 
97  while (w--) {
98  *p |= *src++ << shift;
99  shift -= step;
100  p -= shift >> 3;
101  shift &= 7;
102  }
103  } else {
104  int shift = comp.shift;
105  uint8_t *p = data[plane] + y * linesize[plane] +
106  x * step + comp.offset_plus1 - 1;
107 
108  if (shift + depth <= 8) {
109  p += !!(flags & AV_PIX_FMT_FLAG_BE);
110  while (w--) {
111  *p |= (*src++ << shift);
112  p += step;
113  }
114  } else {
115  while (w--) {
116  if (flags & AV_PIX_FMT_FLAG_BE) {
117  uint16_t val = AV_RB16(p) | (*src++ << shift);
118  AV_WB16(p, val);
119  } else {
120  uint16_t val = AV_RL16(p) | (*src++ << shift);
121  AV_WL16(p, val);
122  }
123  p += step;
124  }
125  }
126  }
127 }
128 
129 #if !FF_API_PIX_FMT_DESC
130 static
131 #endif
133  [AV_PIX_FMT_YUV420P] = {
134  .name = "yuv420p",
135  .nb_components = 3,
136  .log2_chroma_w = 1,
137  .log2_chroma_h = 1,
138  .comp = {
139  { 0, 0, 1, 0, 7 }, /* Y */
140  { 1, 0, 1, 0, 7 }, /* U */
141  { 2, 0, 1, 0, 7 }, /* V */
142  },
143  .flags = AV_PIX_FMT_FLAG_PLANAR,
144  },
145  [AV_PIX_FMT_YUYV422] = {
146  .name = "yuyv422",
147  .nb_components = 3,
148  .log2_chroma_w = 1,
149  .log2_chroma_h = 0,
150  .comp = {
151  { 0, 1, 1, 0, 7 }, /* Y */
152  { 0, 3, 2, 0, 7 }, /* U */
153  { 0, 3, 4, 0, 7 }, /* V */
154  },
155  },
156  [AV_PIX_FMT_YVYU422] = {
157  .name = "yvyu422",
158  .nb_components = 3,
159  .log2_chroma_w = 1,
160  .log2_chroma_h = 0,
161  .comp = {
162  { 0, 1, 1, 0, 7 }, /* Y */
163  { 0, 3, 2, 0, 7 }, /* V */
164  { 0, 3, 4, 0, 7 }, /* U */
165  },
166  },
167  [AV_PIX_FMT_RGB24] = {
168  .name = "rgb24",
169  .nb_components = 3,
170  .log2_chroma_w = 0,
171  .log2_chroma_h = 0,
172  .comp = {
173  { 0, 2, 1, 0, 7 }, /* R */
174  { 0, 2, 2, 0, 7 }, /* G */
175  { 0, 2, 3, 0, 7 }, /* B */
176  },
177  .flags = AV_PIX_FMT_FLAG_RGB,
178  },
179  [AV_PIX_FMT_BGR24] = {
180  .name = "bgr24",
181  .nb_components = 3,
182  .log2_chroma_w = 0,
183  .log2_chroma_h = 0,
184  .comp = {
185  { 0, 2, 1, 0, 7 }, /* B */
186  { 0, 2, 2, 0, 7 }, /* G */
187  { 0, 2, 3, 0, 7 }, /* R */
188  },
189  .flags = AV_PIX_FMT_FLAG_RGB,
190  },
191  [AV_PIX_FMT_YUV422P] = {
192  .name = "yuv422p",
193  .nb_components = 3,
194  .log2_chroma_w = 1,
195  .log2_chroma_h = 0,
196  .comp = {
197  { 0, 0, 1, 0, 7 }, /* Y */
198  { 1, 0, 1, 0, 7 }, /* U */
199  { 2, 0, 1, 0, 7 }, /* V */
200  },
201  .flags = AV_PIX_FMT_FLAG_PLANAR,
202  },
203  [AV_PIX_FMT_YUV444P] = {
204  .name = "yuv444p",
205  .nb_components = 3,
206  .log2_chroma_w = 0,
207  .log2_chroma_h = 0,
208  .comp = {
209  { 0, 0, 1, 0, 7 }, /* Y */
210  { 1, 0, 1, 0, 7 }, /* U */
211  { 2, 0, 1, 0, 7 }, /* V */
212  },
213  .flags = AV_PIX_FMT_FLAG_PLANAR,
214  },
215  [AV_PIX_FMT_YUV410P] = {
216  .name = "yuv410p",
217  .nb_components = 3,
218  .log2_chroma_w = 2,
219  .log2_chroma_h = 2,
220  .comp = {
221  { 0, 0, 1, 0, 7 }, /* Y */
222  { 1, 0, 1, 0, 7 }, /* U */
223  { 2, 0, 1, 0, 7 }, /* V */
224  },
225  .flags = AV_PIX_FMT_FLAG_PLANAR,
226  },
227  [AV_PIX_FMT_YUV411P] = {
228  .name = "yuv411p",
229  .nb_components = 3,
230  .log2_chroma_w = 2,
231  .log2_chroma_h = 0,
232  .comp = {
233  { 0, 0, 1, 0, 7 }, /* Y */
234  { 1, 0, 1, 0, 7 }, /* U */
235  { 2, 0, 1, 0, 7 }, /* V */
236  },
237  .flags = AV_PIX_FMT_FLAG_PLANAR,
238  },
239  [AV_PIX_FMT_GRAY8] = {
240  .name = "gray",
241  .nb_components = 1,
242  .log2_chroma_w = 0,
243  .log2_chroma_h = 0,
244  .comp = {
245  { 0, 0, 1, 0, 7 }, /* Y */
246  },
247  .flags = AV_PIX_FMT_FLAG_PSEUDOPAL,
248  .alias = "gray8,y8",
249  },
251  .name = "monow",
252  .nb_components = 1,
253  .log2_chroma_w = 0,
254  .log2_chroma_h = 0,
255  .comp = {
256  { 0, 0, 1, 0, 0 }, /* Y */
257  },
258  .flags = AV_PIX_FMT_FLAG_BITSTREAM,
259  },
261  .name = "monob",
262  .nb_components = 1,
263  .log2_chroma_w = 0,
264  .log2_chroma_h = 0,
265  .comp = {
266  { 0, 0, 1, 7, 0 }, /* Y */
267  },
268  .flags = AV_PIX_FMT_FLAG_BITSTREAM,
269  },
270  [AV_PIX_FMT_PAL8] = {
271  .name = "pal8",
272  .nb_components = 1,
273  .log2_chroma_w = 0,
274  .log2_chroma_h = 0,
275  .comp = {
276  { 0, 0, 1, 0, 7 },
277  },
278  .flags = AV_PIX_FMT_FLAG_PAL,
279  },
280  [AV_PIX_FMT_YUVJ420P] = {
281  .name = "yuvj420p",
282  .nb_components = 3,
283  .log2_chroma_w = 1,
284  .log2_chroma_h = 1,
285  .comp = {
286  { 0, 0, 1, 0, 7 }, /* Y */
287  { 1, 0, 1, 0, 7 }, /* U */
288  { 2, 0, 1, 0, 7 }, /* V */
289  },
290  .flags = AV_PIX_FMT_FLAG_PLANAR,
291  },
292  [AV_PIX_FMT_YUVJ422P] = {
293  .name = "yuvj422p",
294  .nb_components = 3,
295  .log2_chroma_w = 1,
296  .log2_chroma_h = 0,
297  .comp = {
298  { 0, 0, 1, 0, 7 }, /* Y */
299  { 1, 0, 1, 0, 7 }, /* U */
300  { 2, 0, 1, 0, 7 }, /* V */
301  },
302  .flags = AV_PIX_FMT_FLAG_PLANAR,
303  },
304  [AV_PIX_FMT_YUVJ444P] = {
305  .name = "yuvj444p",
306  .nb_components = 3,
307  .log2_chroma_w = 0,
308  .log2_chroma_h = 0,
309  .comp = {
310  {0, 0, 1, 0, 7}, /* Y */
311  {1, 0, 1, 0, 7}, /* U */
312  {2, 0, 1, 0, 7}, /* V */
313  },
314  .flags = AV_PIX_FMT_FLAG_PLANAR,
315  },
316 #if FF_API_XVMC
318  .name = "xvmcmc",
319  .flags = AV_PIX_FMT_FLAG_HWACCEL,
320  },
322  .name = "xvmcidct",
323  .flags = AV_PIX_FMT_FLAG_HWACCEL,
324  },
325 #endif /* FF_API_XVMC */
326  [AV_PIX_FMT_UYVY422] = {
327  .name = "uyvy422",
328  .nb_components = 3,
329  .log2_chroma_w = 1,
330  .log2_chroma_h = 0,
331  .comp = {
332  { 0, 1, 2, 0, 7 }, /* Y */
333  { 0, 3, 1, 0, 7 }, /* U */
334  { 0, 3, 3, 0, 7 }, /* V */
335  },
336  },
338  .name = "uyyvyy411",
339  .nb_components = 3,
340  .log2_chroma_w = 2,
341  .log2_chroma_h = 0,
342  .comp = {
343  { 0, 3, 2, 0, 7 }, /* Y */
344  { 0, 5, 1, 0, 7 }, /* U */
345  { 0, 5, 4, 0, 7 }, /* V */
346  },
347  },
348  [AV_PIX_FMT_BGR8] = {
349  .name = "bgr8",
350  .nb_components = 3,
351  .log2_chroma_w = 0,
352  .log2_chroma_h = 0,
353  .comp = {
354  { 0, 0, 1, 6, 1 }, /* B */
355  { 0, 0, 1, 3, 2 }, /* G */
356  { 0, 0, 1, 0, 2 }, /* R */
357  },
359  },
360  [AV_PIX_FMT_BGR4] = {
361  .name = "bgr4",
362  .nb_components = 3,
363  .log2_chroma_w = 0,
364  .log2_chroma_h = 0,
365  .comp = {
366  { 0, 3, 1, 0, 0 }, /* B */
367  { 0, 3, 2, 0, 1 }, /* G */
368  { 0, 3, 4, 0, 0 }, /* R */
369  },
371  },
373  .name = "bgr4_byte",
374  .nb_components = 3,
375  .log2_chroma_w = 0,
376  .log2_chroma_h = 0,
377  .comp = {
378  { 0, 0, 1, 3, 0 }, /* B */
379  { 0, 0, 1, 1, 1 }, /* G */
380  { 0, 0, 1, 0, 0 }, /* R */
381  },
383  },
384  [AV_PIX_FMT_RGB8] = {
385  .name = "rgb8",
386  .nb_components = 3,
387  .log2_chroma_w = 0,
388  .log2_chroma_h = 0,
389  .comp = {
390  { 0, 0, 1, 6, 1 }, /* R */
391  { 0, 0, 1, 3, 2 }, /* G */
392  { 0, 0, 1, 0, 2 }, /* B */
393  },
395  },
396  [AV_PIX_FMT_RGB4] = {
397  .name = "rgb4",
398  .nb_components = 3,
399  .log2_chroma_w = 0,
400  .log2_chroma_h = 0,
401  .comp = {
402  { 0, 3, 1, 0, 0 }, /* R */
403  { 0, 3, 2, 0, 1 }, /* G */
404  { 0, 3, 4, 0, 0 }, /* B */
405  },
407  },
409  .name = "rgb4_byte",
410  .nb_components = 3,
411  .log2_chroma_w = 0,
412  .log2_chroma_h = 0,
413  .comp = {
414  { 0, 0, 1, 3, 0 }, /* R */
415  { 0, 0, 1, 1, 1 }, /* G */
416  { 0, 0, 1, 0, 0 }, /* B */
417  },
419  },
420  [AV_PIX_FMT_NV12] = {
421  .name = "nv12",
422  .nb_components = 3,
423  .log2_chroma_w = 1,
424  .log2_chroma_h = 1,
425  .comp = {
426  { 0, 0, 1, 0, 7 }, /* Y */
427  { 1, 1, 1, 0, 7 }, /* U */
428  { 1, 1, 2, 0, 7 }, /* V */
429  },
430  .flags = AV_PIX_FMT_FLAG_PLANAR,
431  },
432  [AV_PIX_FMT_NV21] = {
433  .name = "nv21",
434  .nb_components = 3,
435  .log2_chroma_w = 1,
436  .log2_chroma_h = 1,
437  .comp = {
438  { 0, 0, 1, 0, 7 }, /* Y */
439  { 1, 1, 1, 0, 7 }, /* V */
440  { 1, 1, 2, 0, 7 }, /* U */
441  },
442  .flags = AV_PIX_FMT_FLAG_PLANAR,
443  },
444  [AV_PIX_FMT_ARGB] = {
445  .name = "argb",
446  .nb_components = 4,
447  .log2_chroma_w = 0,
448  .log2_chroma_h = 0,
449  .comp = {
450  { 0, 3, 1, 0, 7 }, /* A */
451  { 0, 3, 2, 0, 7 }, /* R */
452  { 0, 3, 3, 0, 7 }, /* G */
453  { 0, 3, 4, 0, 7 }, /* B */
454  },
456  },
457  [AV_PIX_FMT_RGBA] = {
458  .name = "rgba",
459  .nb_components = 4,
460  .log2_chroma_w = 0,
461  .log2_chroma_h = 0,
462  .comp = {
463  { 0, 3, 1, 0, 7 }, /* R */
464  { 0, 3, 2, 0, 7 }, /* G */
465  { 0, 3, 3, 0, 7 }, /* B */
466  { 0, 3, 4, 0, 7 }, /* A */
467  },
469  },
470  [AV_PIX_FMT_ABGR] = {
471  .name = "abgr",
472  .nb_components = 4,
473  .log2_chroma_w = 0,
474  .log2_chroma_h = 0,
475  .comp = {
476  { 0, 3, 1, 0, 7 }, /* A */
477  { 0, 3, 2, 0, 7 }, /* B */
478  { 0, 3, 3, 0, 7 }, /* G */
479  { 0, 3, 4, 0, 7 }, /* R */
480  },
482  },
483  [AV_PIX_FMT_BGRA] = {
484  .name = "bgra",
485  .nb_components = 4,
486  .log2_chroma_w = 0,
487  .log2_chroma_h = 0,
488  .comp = {
489  { 0, 3, 1, 0, 7 }, /* B */
490  { 0, 3, 2, 0, 7 }, /* G */
491  { 0, 3, 3, 0, 7 }, /* R */
492  { 0, 3, 4, 0, 7 }, /* A */
493  },
495  },
496  [AV_PIX_FMT_GRAY16BE] = {
497  .name = "gray16be",
498  .nb_components = 1,
499  .log2_chroma_w = 0,
500  .log2_chroma_h = 0,
501  .comp = {
502  { 0, 1, 1, 0, 15 }, /* Y */
503  },
504  .flags = AV_PIX_FMT_FLAG_BE,
505  .alias = "y16be",
506  },
507  [AV_PIX_FMT_GRAY16LE] = {
508  .name = "gray16le",
509  .nb_components = 1,
510  .log2_chroma_w = 0,
511  .log2_chroma_h = 0,
512  .comp = {
513  { 0, 1, 1, 0, 15 }, /* Y */
514  },
515  .alias = "y16le",
516  },
517  [AV_PIX_FMT_YUV440P] = {
518  .name = "yuv440p",
519  .nb_components = 3,
520  .log2_chroma_w = 0,
521  .log2_chroma_h = 1,
522  .comp = {
523  { 0, 0, 1, 0, 7 }, /* Y */
524  { 1, 0, 1, 0, 7 }, /* U */
525  { 2, 0, 1, 0, 7 }, /* V */
526  },
527  .flags = AV_PIX_FMT_FLAG_PLANAR,
528  },
529  [AV_PIX_FMT_YUVJ440P] = {
530  .name = "yuvj440p",
531  .nb_components = 3,
532  .log2_chroma_w = 0,
533  .log2_chroma_h = 1,
534  .comp = {
535  { 0, 0, 1, 0, 7 }, /* Y */
536  { 1, 0, 1, 0, 7 }, /* U */
537  { 2, 0, 1, 0, 7 }, /* V */
538  },
539  .flags = AV_PIX_FMT_FLAG_PLANAR,
540  },
541  [AV_PIX_FMT_YUVA420P] = {
542  .name = "yuva420p",
543  .nb_components = 4,
544  .log2_chroma_w = 1,
545  .log2_chroma_h = 1,
546  .comp = {
547  { 0, 0, 1, 0, 7 }, /* Y */
548  { 1, 0, 1, 0, 7 }, /* U */
549  { 2, 0, 1, 0, 7 }, /* V */
550  { 3, 0, 1, 0, 7 }, /* A */
551  },
553  },
554  [AV_PIX_FMT_YUVA422P] = {
555  .name = "yuva422p",
556  .nb_components = 4,
557  .log2_chroma_w = 1,
558  .log2_chroma_h = 0,
559  .comp = {
560  { 0, 0, 1, 0, 7 }, /* Y */
561  { 1, 0, 1, 0, 7 }, /* U */
562  { 2, 0, 1, 0, 7 }, /* V */
563  { 3, 0, 1, 0, 7 }, /* A */
564  },
566  },
567  [AV_PIX_FMT_YUVA444P] = {
568  .name = "yuva444p",
569  .nb_components = 4,
570  .log2_chroma_w = 0,
571  .log2_chroma_h = 0,
572  .comp = {
573  { 0, 0, 1, 0, 7 }, /* Y */
574  { 1, 0, 1, 0, 7 }, /* U */
575  { 2, 0, 1, 0, 7 }, /* V */
576  { 3, 0, 1, 0, 7 }, /* A */
577  },
579  },
581  .name = "yuva420p9be",
582  .nb_components = 4,
583  .log2_chroma_w = 1,
584  .log2_chroma_h = 1,
585  .comp = {
586  { 0, 1, 1, 0, 8 }, /* Y */
587  { 1, 1, 1, 0, 8 }, /* U */
588  { 2, 1, 1, 0, 8 }, /* V */
589  { 3, 1, 1, 0, 8 }, /* A */
590  },
592  },
594  .name = "yuva420p9le",
595  .nb_components = 4,
596  .log2_chroma_w = 1,
597  .log2_chroma_h = 1,
598  .comp = {
599  { 0, 1, 1, 0, 8 }, /* Y */
600  { 1, 1, 1, 0, 8 }, /* U */
601  { 2, 1, 1, 0, 8 }, /* V */
602  { 3, 1, 1, 0, 8 }, /* A */
603  },
605  },
607  .name = "yuva422p9be",
608  .nb_components = 4,
609  .log2_chroma_w = 1,
610  .log2_chroma_h = 0,
611  .comp = {
612  { 0, 1, 1, 0, 8 }, /* Y */
613  { 1, 1, 1, 0, 8 }, /* U */
614  { 2, 1, 1, 0, 8 }, /* V */
615  { 3, 1, 1, 0, 8 }, /* A */
616  },
618  },
620  .name = "yuva422p9le",
621  .nb_components = 4,
622  .log2_chroma_w = 1,
623  .log2_chroma_h = 0,
624  .comp = {
625  { 0, 1, 1, 0, 8 }, /* Y */
626  { 1, 1, 1, 0, 8 }, /* U */
627  { 2, 1, 1, 0, 8 }, /* V */
628  { 3, 1, 1, 0, 8 }, /* A */
629  },
631  },
633  .name = "yuva444p9be",
634  .nb_components = 4,
635  .log2_chroma_w = 0,
636  .log2_chroma_h = 0,
637  .comp = {
638  { 0, 1, 1, 0, 8 }, /* Y */
639  { 1, 1, 1, 0, 8 }, /* U */
640  { 2, 1, 1, 0, 8 }, /* V */
641  { 3, 1, 1, 0, 8 }, /* A */
642  },
644  },
646  .name = "yuva444p9le",
647  .nb_components = 4,
648  .log2_chroma_w = 0,
649  .log2_chroma_h = 0,
650  .comp = {
651  { 0, 1, 1, 0, 8 }, /* Y */
652  { 1, 1, 1, 0, 8 }, /* U */
653  { 2, 1, 1, 0, 8 }, /* V */
654  { 3, 1, 1, 0, 8 }, /* A */
655  },
657  },
659  .name = "yuva420p10be",
660  .nb_components = 4,
661  .log2_chroma_w = 1,
662  .log2_chroma_h = 1,
663  .comp = {
664  { 0, 1, 1, 0, 9 }, /* Y */
665  { 1, 1, 1, 0, 9 }, /* U */
666  { 2, 1, 1, 0, 9 }, /* V */
667  { 3, 1, 1, 0, 9 }, /* A */
668  },
670  },
672  .name = "yuva420p10le",
673  .nb_components = 4,
674  .log2_chroma_w = 1,
675  .log2_chroma_h = 1,
676  .comp = {
677  { 0, 1, 1, 0, 9 }, /* Y */
678  { 1, 1, 1, 0, 9 }, /* U */
679  { 2, 1, 1, 0, 9 }, /* V */
680  { 3, 1, 1, 0, 9 }, /* A */
681  },
683  },
685  .name = "yuva422p10be",
686  .nb_components = 4,
687  .log2_chroma_w = 1,
688  .log2_chroma_h = 0,
689  .comp = {
690  { 0, 1, 1, 0, 9 }, /* Y */
691  { 1, 1, 1, 0, 9 }, /* U */
692  { 2, 1, 1, 0, 9 }, /* V */
693  { 3, 1, 1, 0, 9 }, /* A */
694  },
696  },
698  .name = "yuva422p10le",
699  .nb_components = 4,
700  .log2_chroma_w = 1,
701  .log2_chroma_h = 0,
702  .comp = {
703  { 0, 1, 1, 0, 9 }, /* Y */
704  { 1, 1, 1, 0, 9 }, /* U */
705  { 2, 1, 1, 0, 9 }, /* V */
706  { 3, 1, 1, 0, 9 }, /* A */
707  },
709  },
711  .name = "yuva444p10be",
712  .nb_components = 4,
713  .log2_chroma_w = 0,
714  .log2_chroma_h = 0,
715  .comp = {
716  { 0, 1, 1, 0, 9 }, /* Y */
717  { 1, 1, 1, 0, 9 }, /* U */
718  { 2, 1, 1, 0, 9 }, /* V */
719  { 3, 1, 1, 0, 9 }, /* A */
720  },
722  },
724  .name = "yuva444p10le",
725  .nb_components = 4,
726  .log2_chroma_w = 0,
727  .log2_chroma_h = 0,
728  .comp = {
729  { 0, 1, 1, 0, 9 }, /* Y */
730  { 1, 1, 1, 0, 9 }, /* U */
731  { 2, 1, 1, 0, 9 }, /* V */
732  { 3, 1, 1, 0, 9 }, /* A */
733  },
735  },
737  .name = "yuva420p16be",
738  .nb_components = 4,
739  .log2_chroma_w = 1,
740  .log2_chroma_h = 1,
741  .comp = {
742  { 0, 1, 1, 0, 15 }, /* Y */
743  { 1, 1, 1, 0, 15 }, /* U */
744  { 2, 1, 1, 0, 15 }, /* V */
745  { 3, 1, 1, 0, 15 }, /* A */
746  },
748  },
750  .name = "yuva420p16le",
751  .nb_components = 4,
752  .log2_chroma_w = 1,
753  .log2_chroma_h = 1,
754  .comp = {
755  { 0, 1, 1, 0, 15 }, /* Y */
756  { 1, 1, 1, 0, 15 }, /* U */
757  { 2, 1, 1, 0, 15 }, /* V */
758  { 3, 1, 1, 0, 15 }, /* A */
759  },
761  },
763  .name = "yuva422p16be",
764  .nb_components = 4,
765  .log2_chroma_w = 1,
766  .log2_chroma_h = 0,
767  .comp = {
768  { 0, 1, 1, 0, 15 }, /* Y */
769  { 1, 1, 1, 0, 15 }, /* U */
770  { 2, 1, 1, 0, 15 }, /* V */
771  { 3, 1, 1, 0, 15 }, /* A */
772  },
774  },
776  .name = "yuva422p16le",
777  .nb_components = 4,
778  .log2_chroma_w = 1,
779  .log2_chroma_h = 0,
780  .comp = {
781  { 0, 1, 1, 0, 15 }, /* Y */
782  { 1, 1, 1, 0, 15 }, /* U */
783  { 2, 1, 1, 0, 15 }, /* V */
784  { 3, 1, 1, 0, 15 }, /* A */
785  },
787  },
789  .name = "yuva444p16be",
790  .nb_components = 4,
791  .log2_chroma_w = 0,
792  .log2_chroma_h = 0,
793  .comp = {
794  { 0, 1, 1, 0, 15 }, /* Y */
795  { 1, 1, 1, 0, 15 }, /* U */
796  { 2, 1, 1, 0, 15 }, /* V */
797  { 3, 1, 1, 0, 15 }, /* A */
798  },
800  },
802  .name = "yuva444p16le",
803  .nb_components = 4,
804  .log2_chroma_w = 0,
805  .log2_chroma_h = 0,
806  .comp = {
807  { 0, 1, 1, 0, 15 }, /* Y */
808  { 1, 1, 1, 0, 15 }, /* U */
809  { 2, 1, 1, 0, 15 }, /* V */
810  { 3, 1, 1, 0, 15 }, /* A */
811  },
813  },
814 #if FF_API_VDPAU
816  .name = "vdpau_h264",
817  .log2_chroma_w = 1,
818  .log2_chroma_h = 1,
819  .flags = AV_PIX_FMT_FLAG_HWACCEL,
820  },
822  .name = "vdpau_mpeg1",
823  .log2_chroma_w = 1,
824  .log2_chroma_h = 1,
825  .flags = AV_PIX_FMT_FLAG_HWACCEL,
826  },
828  .name = "vdpau_mpeg2",
829  .log2_chroma_w = 1,
830  .log2_chroma_h = 1,
831  .flags = AV_PIX_FMT_FLAG_HWACCEL,
832  },
834  .name = "vdpau_wmv3",
835  .log2_chroma_w = 1,
836  .log2_chroma_h = 1,
837  .flags = AV_PIX_FMT_FLAG_HWACCEL,
838  },
840  .name = "vdpau_vc1",
841  .log2_chroma_w = 1,
842  .log2_chroma_h = 1,
843  .flags = AV_PIX_FMT_FLAG_HWACCEL,
844  },
846  .name = "vdpau_mpeg4",
847  .log2_chroma_w = 1,
848  .log2_chroma_h = 1,
849  .flags = AV_PIX_FMT_FLAG_HWACCEL,
850  },
851 #endif
852  [AV_PIX_FMT_RGB48BE] = {
853  .name = "rgb48be",
854  .nb_components = 3,
855  .log2_chroma_w = 0,
856  .log2_chroma_h = 0,
857  .comp = {
858  { 0, 5, 1, 0, 15 }, /* R */
859  { 0, 5, 3, 0, 15 }, /* G */
860  { 0, 5, 5, 0, 15 }, /* B */
861  },
863  },
864  [AV_PIX_FMT_RGB48LE] = {
865  .name = "rgb48le",
866  .nb_components = 3,
867  .log2_chroma_w = 0,
868  .log2_chroma_h = 0,
869  .comp = {
870  { 0, 5, 1, 0, 15 }, /* R */
871  { 0, 5, 3, 0, 15 }, /* G */
872  { 0, 5, 5, 0, 15 }, /* B */
873  },
874  .flags = AV_PIX_FMT_FLAG_RGB,
875  },
876  [AV_PIX_FMT_RGBA64BE] = {
877  .name = "rgba64be",
878  .nb_components = 4,
879  .log2_chroma_w = 0,
880  .log2_chroma_h = 0,
881  .comp = {
882  { 0, 7, 1, 0, 15 }, /* R */
883  { 0, 7, 3, 0, 15 }, /* G */
884  { 0, 7, 5, 0, 15 }, /* B */
885  { 0, 7, 7, 0, 15 }, /* A */
886  },
888  },
889  [AV_PIX_FMT_RGBA64LE] = {
890  .name = "rgba64le",
891  .nb_components = 4,
892  .log2_chroma_w = 0,
893  .log2_chroma_h = 0,
894  .comp = {
895  { 0, 7, 1, 0, 15 }, /* R */
896  { 0, 7, 3, 0, 15 }, /* G */
897  { 0, 7, 5, 0, 15 }, /* B */
898  { 0, 7, 7, 0, 15 }, /* A */
899  },
901  },
902  [AV_PIX_FMT_RGB565BE] = {
903  .name = "rgb565be",
904  .nb_components = 3,
905  .log2_chroma_w = 0,
906  .log2_chroma_h = 0,
907  .comp = {
908  { 0, 1, 0, 3, 4 }, /* R */
909  { 0, 1, 1, 5, 5 }, /* G */
910  { 0, 1, 1, 0, 4 }, /* B */
911  },
913  },
914  [AV_PIX_FMT_RGB565LE] = {
915  .name = "rgb565le",
916  .nb_components = 3,
917  .log2_chroma_w = 0,
918  .log2_chroma_h = 0,
919  .comp = {
920  { 0, 1, 2, 3, 4 }, /* R */
921  { 0, 1, 1, 5, 5 }, /* G */
922  { 0, 1, 1, 0, 4 }, /* B */
923  },
924  .flags = AV_PIX_FMT_FLAG_RGB,
925  },
926  [AV_PIX_FMT_RGB555BE] = {
927  .name = "rgb555be",
928  .nb_components = 3,
929  .log2_chroma_w = 0,
930  .log2_chroma_h = 0,
931  .comp = {
932  { 0, 1, 0, 2, 4 }, /* R */
933  { 0, 1, 1, 5, 4 }, /* G */
934  { 0, 1, 1, 0, 4 }, /* B */
935  },
937  },
938  [AV_PIX_FMT_RGB555LE] = {
939  .name = "rgb555le",
940  .nb_components = 3,
941  .log2_chroma_w = 0,
942  .log2_chroma_h = 0,
943  .comp = {
944  { 0, 1, 2, 2, 4 }, /* R */
945  { 0, 1, 1, 5, 4 }, /* G */
946  { 0, 1, 1, 0, 4 }, /* B */
947  },
948  .flags = AV_PIX_FMT_FLAG_RGB,
949  },
950  [AV_PIX_FMT_RGB444BE] = {
951  .name = "rgb444be",
952  .nb_components = 3,
953  .log2_chroma_w = 0,
954  .log2_chroma_h = 0,
955  .comp = {
956  { 0, 1, 0, 0, 3 }, /* R */
957  { 0, 1, 1, 4, 3 }, /* G */
958  { 0, 1, 1, 0, 3 }, /* B */
959  },
961  },
962  [AV_PIX_FMT_RGB444LE] = {
963  .name = "rgb444le",
964  .nb_components = 3,
965  .log2_chroma_w = 0,
966  .log2_chroma_h = 0,
967  .comp = {
968  { 0, 1, 2, 0, 3 }, /* R */
969  { 0, 1, 1, 4, 3 }, /* G */
970  { 0, 1, 1, 0, 3 }, /* B */
971  },
972  .flags = AV_PIX_FMT_FLAG_RGB,
973  },
974  [AV_PIX_FMT_BGR48BE] = {
975  .name = "bgr48be",
976  .nb_components = 3,
977  .log2_chroma_w = 0,
978  .log2_chroma_h = 0,
979  .comp = {
980  { 0, 5, 1, 0, 15 }, /* B */
981  { 0, 5, 3, 0, 15 }, /* G */
982  { 0, 5, 5, 0, 15 }, /* R */
983  },
985  },
986  [AV_PIX_FMT_BGR48LE] = {
987  .name = "bgr48le",
988  .nb_components = 3,
989  .log2_chroma_w = 0,
990  .log2_chroma_h = 0,
991  .comp = {
992  { 0, 5, 1, 0, 15 }, /* B */
993  { 0, 5, 3, 0, 15 }, /* G */
994  { 0, 5, 5, 0, 15 }, /* R */
995  },
996  .flags = AV_PIX_FMT_FLAG_RGB,
997  },
998  [AV_PIX_FMT_BGRA64BE] = {
999  .name = "bgra64be",
1000  .nb_components = 4,
1001  .log2_chroma_w = 0,
1002  .log2_chroma_h = 0,
1003  .comp = {
1004  { 0, 5, 1, 0, 15 }, /* B */
1005  { 0, 5, 3, 0, 15 }, /* G */
1006  { 0, 5, 5, 0, 15 }, /* R */
1007  { 0, 5, 7, 0, 15 }, /* A */
1008  },
1010  },
1011  [AV_PIX_FMT_BGRA64LE] = {
1012  .name = "bgra64le",
1013  .nb_components = 4,
1014  .log2_chroma_w = 0,
1015  .log2_chroma_h = 0,
1016  .comp = {
1017  { 0, 5, 1, 0, 15 }, /* B */
1018  { 0, 5, 3, 0, 15 }, /* G */
1019  { 0, 5, 5, 0, 15 }, /* R */
1020  { 0, 5, 7, 0, 15 }, /* A */
1021  },
1023  },
1024  [AV_PIX_FMT_BGR565BE] = {
1025  .name = "bgr565be",
1026  .nb_components = 3,
1027  .log2_chroma_w = 0,
1028  .log2_chroma_h = 0,
1029  .comp = {
1030  { 0, 1, 0, 3, 4 }, /* B */
1031  { 0, 1, 1, 5, 5 }, /* G */
1032  { 0, 1, 1, 0, 4 }, /* R */
1033  },
1035  },
1036  [AV_PIX_FMT_BGR565LE] = {
1037  .name = "bgr565le",
1038  .nb_components = 3,
1039  .log2_chroma_w = 0,
1040  .log2_chroma_h = 0,
1041  .comp = {
1042  { 0, 1, 2, 3, 4 }, /* B */
1043  { 0, 1, 1, 5, 5 }, /* G */
1044  { 0, 1, 1, 0, 4 }, /* R */
1045  },
1046  .flags = AV_PIX_FMT_FLAG_RGB,
1047  },
1048  [AV_PIX_FMT_BGR555BE] = {
1049  .name = "bgr555be",
1050  .nb_components = 3,
1051  .log2_chroma_w = 0,
1052  .log2_chroma_h = 0,
1053  .comp = {
1054  { 0, 1, 0, 2, 4 }, /* B */
1055  { 0, 1, 1, 5, 4 }, /* G */
1056  { 0, 1, 1, 0, 4 }, /* R */
1057  },
1059  },
1060  [AV_PIX_FMT_BGR555LE] = {
1061  .name = "bgr555le",
1062  .nb_components = 3,
1063  .log2_chroma_w = 0,
1064  .log2_chroma_h = 0,
1065  .comp = {
1066  { 0, 1, 2, 2, 4 }, /* B */
1067  { 0, 1, 1, 5, 4 }, /* G */
1068  { 0, 1, 1, 0, 4 }, /* R */
1069  },
1070  .flags = AV_PIX_FMT_FLAG_RGB,
1071  },
1072  [AV_PIX_FMT_BGR444BE] = {
1073  .name = "bgr444be",
1074  .nb_components = 3,
1075  .log2_chroma_w = 0,
1076  .log2_chroma_h = 0,
1077  .comp = {
1078  { 0, 1, 0, 0, 3 }, /* B */
1079  { 0, 1, 1, 4, 3 }, /* G */
1080  { 0, 1, 1, 0, 3 }, /* R */
1081  },
1083  },
1084  [AV_PIX_FMT_BGR444LE] = {
1085  .name = "bgr444le",
1086  .nb_components = 3,
1087  .log2_chroma_w = 0,
1088  .log2_chroma_h = 0,
1089  .comp = {
1090  { 0, 1, 2, 0, 3 }, /* B */
1091  { 0, 1, 1, 4, 3 }, /* G */
1092  { 0, 1, 1, 0, 3 }, /* R */
1093  },
1094  .flags = AV_PIX_FMT_FLAG_RGB,
1095  },
1096  [AV_PIX_FMT_VAAPI_MOCO] = {
1097  .name = "vaapi_moco",
1098  .log2_chroma_w = 1,
1099  .log2_chroma_h = 1,
1100  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1101  },
1102  [AV_PIX_FMT_VAAPI_IDCT] = {
1103  .name = "vaapi_idct",
1104  .log2_chroma_w = 1,
1105  .log2_chroma_h = 1,
1106  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1107  },
1108  [AV_PIX_FMT_VAAPI_VLD] = {
1109  .name = "vaapi_vld",
1110  .log2_chroma_w = 1,
1111  .log2_chroma_h = 1,
1112  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1113  },
1114  [AV_PIX_FMT_VDA_VLD] = {
1115  .name = "vda_vld",
1116  .log2_chroma_w = 1,
1117  .log2_chroma_h = 1,
1118  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1119  },
1120  [AV_PIX_FMT_YUV420P9LE] = {
1121  .name = "yuv420p9le",
1122  .nb_components = 3,
1123  .log2_chroma_w = 1,
1124  .log2_chroma_h = 1,
1125  .comp = {
1126  { 0, 1, 1, 0, 8 }, /* Y */
1127  { 1, 1, 1, 0, 8 }, /* U */
1128  { 2, 1, 1, 0, 8 }, /* V */
1129  },
1130  .flags = AV_PIX_FMT_FLAG_PLANAR,
1131  },
1132  [AV_PIX_FMT_YUV420P9BE] = {
1133  .name = "yuv420p9be",
1134  .nb_components = 3,
1135  .log2_chroma_w = 1,
1136  .log2_chroma_h = 1,
1137  .comp = {
1138  { 0, 1, 1, 0, 8 }, /* Y */
1139  { 1, 1, 1, 0, 8 }, /* U */
1140  { 2, 1, 1, 0, 8 }, /* V */
1141  },
1143  },
1145  .name = "yuv420p10le",
1146  .nb_components = 3,
1147  .log2_chroma_w = 1,
1148  .log2_chroma_h = 1,
1149  .comp = {
1150  { 0, 1, 1, 0, 9 }, /* Y */
1151  { 1, 1, 1, 0, 9 }, /* U */
1152  { 2, 1, 1, 0, 9 }, /* V */
1153  },
1154  .flags = AV_PIX_FMT_FLAG_PLANAR,
1155  },
1157  .name = "yuv420p10be",
1158  .nb_components = 3,
1159  .log2_chroma_w = 1,
1160  .log2_chroma_h = 1,
1161  .comp = {
1162  { 0, 1, 1, 0, 9 }, /* Y */
1163  { 1, 1, 1, 0, 9 }, /* U */
1164  { 2, 1, 1, 0, 9 }, /* V */
1165  },
1167  },
1169  .name = "yuv420p16le",
1170  .nb_components = 3,
1171  .log2_chroma_w = 1,
1172  .log2_chroma_h = 1,
1173  .comp = {
1174  { 0, 1, 1, 0, 15 }, /* Y */
1175  { 1, 1, 1, 0, 15 }, /* U */
1176  { 2, 1, 1, 0, 15 }, /* V */
1177  },
1178  .flags = AV_PIX_FMT_FLAG_PLANAR,
1179  },
1181  .name = "yuv420p16be",
1182  .nb_components = 3,
1183  .log2_chroma_w = 1,
1184  .log2_chroma_h = 1,
1185  .comp = {
1186  { 0, 1, 1, 0, 15 }, /* Y */
1187  { 1, 1, 1, 0, 15 }, /* U */
1188  { 2, 1, 1, 0, 15 }, /* V */
1189  },
1191  },
1192  [AV_PIX_FMT_YUV422P9LE] = {
1193  .name = "yuv422p9le",
1194  .nb_components = 3,
1195  .log2_chroma_w = 1,
1196  .log2_chroma_h = 0,
1197  .comp = {
1198  { 0, 1, 1, 0, 8 }, /* Y */
1199  { 1, 1, 1, 0, 8 }, /* U */
1200  { 2, 1, 1, 0, 8 }, /* V */
1201  },
1202  .flags = AV_PIX_FMT_FLAG_PLANAR,
1203  },
1204  [AV_PIX_FMT_YUV422P9BE] = {
1205  .name = "yuv422p9be",
1206  .nb_components = 3,
1207  .log2_chroma_w = 1,
1208  .log2_chroma_h = 0,
1209  .comp = {
1210  { 0, 1, 1, 0, 8 }, /* Y */
1211  { 1, 1, 1, 0, 8 }, /* U */
1212  { 2, 1, 1, 0, 8 }, /* V */
1213  },
1215  },
1217  .name = "yuv422p10le",
1218  .nb_components = 3,
1219  .log2_chroma_w = 1,
1220  .log2_chroma_h = 0,
1221  .comp = {
1222  { 0, 1, 1, 0, 9 }, /* Y */
1223  { 1, 1, 1, 0, 9 }, /* U */
1224  { 2, 1, 1, 0, 9 }, /* V */
1225  },
1226  .flags = AV_PIX_FMT_FLAG_PLANAR,
1227  },
1229  .name = "yuv422p10be",
1230  .nb_components = 3,
1231  .log2_chroma_w = 1,
1232  .log2_chroma_h = 0,
1233  .comp = {
1234  { 0, 1, 1, 0, 9 }, /* Y */
1235  { 1, 1, 1, 0, 9 }, /* U */
1236  { 2, 1, 1, 0, 9 }, /* V */
1237  },
1239  },
1241  .name = "yuv422p16le",
1242  .nb_components = 3,
1243  .log2_chroma_w = 1,
1244  .log2_chroma_h = 0,
1245  .comp = {
1246  { 0, 1, 1, 0, 15 }, /* Y */
1247  { 1, 1, 1, 0, 15 }, /* U */
1248  { 2, 1, 1, 0, 15 }, /* V */
1249  },
1250  .flags = AV_PIX_FMT_FLAG_PLANAR,
1251  },
1253  .name = "yuv422p16be",
1254  .nb_components = 3,
1255  .log2_chroma_w = 1,
1256  .log2_chroma_h = 0,
1257  .comp = {
1258  { 0, 1, 1, 0, 15 }, /* Y */
1259  { 1, 1, 1, 0, 15 }, /* U */
1260  { 2, 1, 1, 0, 15 }, /* V */
1261  },
1263  },
1265  .name = "yuv444p16le",
1266  .nb_components = 3,
1267  .log2_chroma_w = 0,
1268  .log2_chroma_h = 0,
1269  .comp = {
1270  { 0, 1, 1, 0, 15 }, /* Y */
1271  { 1, 1, 1, 0, 15 }, /* U */
1272  { 2, 1, 1, 0, 15 }, /* V */
1273  },
1274  .flags = AV_PIX_FMT_FLAG_PLANAR,
1275  },
1277  .name = "yuv444p16be",
1278  .nb_components = 3,
1279  .log2_chroma_w = 0,
1280  .log2_chroma_h = 0,
1281  .comp = {
1282  { 0, 1, 1, 0, 15 }, /* Y */
1283  { 1, 1, 1, 0, 15 }, /* U */
1284  { 2, 1, 1, 0, 15 }, /* V */
1285  },
1287  },
1289  .name = "yuv444p10le",
1290  .nb_components = 3,
1291  .log2_chroma_w = 0,
1292  .log2_chroma_h = 0,
1293  .comp = {
1294  { 0, 1, 1, 0, 9 }, /* Y */
1295  { 1, 1, 1, 0, 9 }, /* U */
1296  { 2, 1, 1, 0, 9 }, /* V */
1297  },
1298  .flags = AV_PIX_FMT_FLAG_PLANAR,
1299  },
1301  .name = "yuv444p10be",
1302  .nb_components = 3,
1303  .log2_chroma_w = 0,
1304  .log2_chroma_h = 0,
1305  .comp = {
1306  { 0, 1, 1, 0, 9 }, /* Y */
1307  { 1, 1, 1, 0, 9 }, /* U */
1308  { 2, 1, 1, 0, 9 }, /* V */
1309  },
1311  },
1312  [AV_PIX_FMT_YUV444P9LE] = {
1313  .name = "yuv444p9le",
1314  .nb_components = 3,
1315  .log2_chroma_w = 0,
1316  .log2_chroma_h = 0,
1317  .comp = {
1318  { 0, 1, 1, 0, 8 }, /* Y */
1319  { 1, 1, 1, 0, 8 }, /* U */
1320  { 2, 1, 1, 0, 8 }, /* V */
1321  },
1322  .flags = AV_PIX_FMT_FLAG_PLANAR,
1323  },
1324  [AV_PIX_FMT_YUV444P9BE] = {
1325  .name = "yuv444p9be",
1326  .nb_components = 3,
1327  .log2_chroma_w = 0,
1328  .log2_chroma_h = 0,
1329  .comp = {
1330  { 0, 1, 1, 0, 8 }, /* Y */
1331  { 1, 1, 1, 0, 8 }, /* U */
1332  { 2, 1, 1, 0, 8 }, /* V */
1333  },
1335  },
1336  [AV_PIX_FMT_DXVA2_VLD] = {
1337  .name = "dxva2_vld",
1338  .log2_chroma_w = 1,
1339  .log2_chroma_h = 1,
1340  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1341  },
1342  [AV_PIX_FMT_YA8] = {
1343  .name = "ya8",
1344  .nb_components = 2,
1345  .comp = {
1346  { 0, 1, 1, 0, 7 }, /* Y */
1347  { 0, 1, 2, 0, 7 }, /* A */
1348  },
1349  .flags = AV_PIX_FMT_FLAG_ALPHA,
1350  .alias = "gray8a",
1351  },
1352  [AV_PIX_FMT_YA16LE] = {
1353  .name = "ya16le",
1354  .nb_components = 2,
1355  .comp = {
1356  { 0, 3, 1, 0, 15 }, /* Y */
1357  { 0, 3, 3, 0, 15 }, /* A */
1358  },
1359  .flags = AV_PIX_FMT_FLAG_ALPHA,
1360  },
1361  [AV_PIX_FMT_YA16BE] = {
1362  .name = "ya16be",
1363  .nb_components = 2,
1364  .comp = {
1365  { 0, 3, 1, 0, 15 }, /* Y */
1366  { 0, 3, 3, 0, 15 }, /* A */
1367  },
1369  },
1370  [AV_PIX_FMT_GBRP] = {
1371  .name = "gbrp",
1372  .nb_components = 3,
1373  .log2_chroma_w = 0,
1374  .log2_chroma_h = 0,
1375  .comp = {
1376  { 0, 0, 1, 0, 7 }, /* G */
1377  { 1, 0, 1, 0, 7 }, /* B */
1378  { 2, 0, 1, 0, 7 }, /* R */
1379  },
1381  },
1382  [AV_PIX_FMT_GBRP9LE] = {
1383  .name = "gbrp9le",
1384  .nb_components = 3,
1385  .log2_chroma_w = 0,
1386  .log2_chroma_h = 0,
1387  .comp = {
1388  { 0, 1, 1, 0, 8 }, /* G */
1389  { 1, 1, 1, 0, 8 }, /* B */
1390  { 2, 1, 1, 0, 8 }, /* R */
1391  },
1393  },
1394  [AV_PIX_FMT_GBRP9BE] = {
1395  .name = "gbrp9be",
1396  .nb_components = 3,
1397  .log2_chroma_w = 0,
1398  .log2_chroma_h = 0,
1399  .comp = {
1400  { 0, 1, 1, 0, 8 }, /* G */
1401  { 1, 1, 1, 0, 8 }, /* B */
1402  { 2, 1, 1, 0, 8 }, /* R */
1403  },
1405  },
1406  [AV_PIX_FMT_GBRP10LE] = {
1407  .name = "gbrp10le",
1408  .nb_components = 3,
1409  .log2_chroma_w = 0,
1410  .log2_chroma_h = 0,
1411  .comp = {
1412  { 0, 1, 1, 0, 9 }, /* G */
1413  { 1, 1, 1, 0, 9 }, /* B */
1414  { 2, 1, 1, 0, 9 }, /* R */
1415  },
1417  },
1418  [AV_PIX_FMT_GBRP10BE] = {
1419  .name = "gbrp10be",
1420  .nb_components = 3,
1421  .log2_chroma_w = 0,
1422  .log2_chroma_h = 0,
1423  .comp = {
1424  { 0, 1, 1, 0, 9 }, /* G */
1425  { 1, 1, 1, 0, 9 }, /* B */
1426  { 2, 1, 1, 0, 9 }, /* R */
1427  },
1429  },
1430  [AV_PIX_FMT_GBRP16LE] = {
1431  .name = "gbrp16le",
1432  .nb_components = 3,
1433  .log2_chroma_w = 0,
1434  .log2_chroma_h = 0,
1435  .comp = {
1436  { 0, 1, 1, 0, 15 }, /* G */
1437  { 1, 1, 1, 0, 15 }, /* B */
1438  { 2, 1, 1, 0, 15 }, /* R */
1439  },
1441  },
1442  [AV_PIX_FMT_GBRP16BE] = {
1443  .name = "gbrp16be",
1444  .nb_components = 3,
1445  .log2_chroma_w = 0,
1446  .log2_chroma_h = 0,
1447  .comp = {
1448  { 0, 1, 1, 0, 15 }, /* G */
1449  { 1, 1, 1, 0, 15 }, /* B */
1450  { 2, 1, 1, 0, 15 }, /* R */
1451  },
1453  },
1454  [AV_PIX_FMT_VDPAU] = {
1455  .name = "vdpau",
1456  .log2_chroma_w = 1,
1457  .log2_chroma_h = 1,
1458  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1459  },
1460  [AV_PIX_FMT_XYZ12LE] = {
1461  .name = "xyz12le",
1462  .nb_components = 3,
1463  .log2_chroma_w = 0,
1464  .log2_chroma_h = 0,
1465  .comp = {
1466  { 0, 5, 1, 4, 11 }, /* X */
1467  { 0, 5, 3, 4, 11 }, /* Y */
1468  { 0, 5, 5, 4, 11 }, /* Z */
1469  },
1470  /*.flags = -- not used*/
1471  },
1472  [AV_PIX_FMT_XYZ12BE] = {
1473  .name = "xyz12be",
1474  .nb_components = 3,
1475  .log2_chroma_w = 0,
1476  .log2_chroma_h = 0,
1477  .comp = {
1478  { 0, 5, 1, 4, 11 }, /* X */
1479  { 0, 5, 3, 4, 11 }, /* Y */
1480  { 0, 5, 5, 4, 11 }, /* Z */
1481  },
1482  .flags = AV_PIX_FMT_FLAG_BE,
1483  },
1484  [AV_PIX_FMT_NV16] = {
1485  .name = "nv16",
1486  .nb_components = 3,
1487  .log2_chroma_w = 1,
1488  .log2_chroma_h = 0,
1489  .comp = {
1490  { 0, 0, 1, 0, 7 }, /* Y */
1491  { 1, 1, 1, 0, 7 }, /* U */
1492  { 1, 1, 2, 0, 7 }, /* V */
1493  },
1494  .flags = AV_PIX_FMT_FLAG_PLANAR,
1495  },
1496  [AV_PIX_FMT_NV20LE] = {
1497  .name = "nv20le",
1498  .nb_components = 3,
1499  .log2_chroma_w = 1,
1500  .log2_chroma_h = 0,
1501  .comp = {
1502  { 0, 1, 1, 0, 9 }, /* Y */
1503  { 1, 3, 1, 0, 9 }, /* U */
1504  { 1, 3, 3, 0, 9 }, /* V */
1505  },
1506  .flags = AV_PIX_FMT_FLAG_PLANAR,
1507  },
1508  [AV_PIX_FMT_NV20BE] = {
1509  .name = "nv20be",
1510  .nb_components = 3,
1511  .log2_chroma_w = 1,
1512  .log2_chroma_h = 0,
1513  .comp = {
1514  { 0, 1, 1, 0, 9 }, /* Y */
1515  { 1, 3, 1, 0, 9 }, /* U */
1516  { 1, 3, 3, 0, 9 }, /* V */
1517  },
1519  },
1520  [AV_PIX_FMT_VDA] = {
1521  .name = "vda",
1522  .flags = AV_PIX_FMT_FLAG_HWACCEL,
1523  },
1524 };
1525 
1527 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
1528 {
1529  enum AVPixelFormat pix_fmt;
1530 
1531  for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
1532  if (av_pix_fmt_descriptors[pix_fmt].name &&
1533  (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
1534  av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias)))
1535  return pix_fmt;
1536 
1537  return AV_PIX_FMT_NONE;
1538 }
1539 
1541 {
1542  return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
1543  av_pix_fmt_descriptors[pix_fmt].name : NULL;
1544 }
1545 
1546 #if HAVE_BIGENDIAN
1547 # define X_NE(be, le) be
1548 #else
1549 # define X_NE(be, le) le
1550 #endif
1551 
1553 {
1554  enum AVPixelFormat pix_fmt;
1555 
1556  if (!strcmp(name, "rgb32"))
1557  name = X_NE("argb", "bgra");
1558  else if (!strcmp(name, "bgr32"))
1559  name = X_NE("abgr", "rgba");
1560 
1561  pix_fmt = get_pix_fmt_internal(name);
1562  if (pix_fmt == AV_PIX_FMT_NONE) {
1563  char name2[32];
1564 
1565  snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
1566  pix_fmt = get_pix_fmt_internal(name2);
1567  }
1568  return pix_fmt;
1569 }
1570 
1572 {
1573  int c, bits = 0;
1574  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
1575 
1576  for (c = 0; c < pixdesc->nb_components; c++) {
1577  int s = c == 1 || c == 2 ? 0 : log2_pixels;
1578  bits += (pixdesc->comp[c].depth_minus1 + 1) << s;
1579  }
1580 
1581  return bits >> log2_pixels;
1582 }
1583 
1584 char *av_get_pix_fmt_string(char *buf, int buf_size,
1585  enum AVPixelFormat pix_fmt)
1586 {
1587  /* print header */
1588  if (pix_fmt < 0) {
1589  snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
1590  } else {
1591  const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
1592  snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
1593  pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
1594  }
1595 
1596  return buf;
1597 }
1598 
1600 {
1601  if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
1602  return NULL;
1603  return &av_pix_fmt_descriptors[pix_fmt];
1604 }
1605 
1607 {
1608  if (!prev)
1609  return &av_pix_fmt_descriptors[0];
1610  if (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1)
1611  return prev + 1;
1612  return NULL;
1613 }
1614 
1616 {
1617  if (desc < av_pix_fmt_descriptors ||
1618  desc >= av_pix_fmt_descriptors + FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
1619  return AV_PIX_FMT_NONE;
1620 
1621  return desc - av_pix_fmt_descriptors;
1622 }
1624 
1626  int *h_shift, int *v_shift)
1627 {
1628  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
1629  if (!desc)
1630  return AVERROR(ENOSYS);
1631  *h_shift = desc->log2_chroma_w;
1632  *v_shift = desc->log2_chroma_h;
1633 
1634  return 0;
1635 }
1636 
1638 {
1639  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
1640  int i, planes[4] = { 0 }, ret = 0;
1641 
1642  if (!desc)
1643  return AVERROR(EINVAL);
1644 
1645  for (i = 0; i < desc->nb_components; i++)
1646  planes[desc->comp[i].plane] = 1;
1647  for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
1648  ret += planes[i];
1649  return ret;
1650 }
1651 
1652 
1654 {
1655 #define PIX_FMT_SWAP_ENDIANNESS(fmt) \
1656  case AV_PIX_FMT_ ## fmt ## BE: return AV_PIX_FMT_ ## fmt ## LE; \
1657  case AV_PIX_FMT_ ## fmt ## LE: return AV_PIX_FMT_ ## fmt ## BE
1658 
1659  switch (pix_fmt) {
1660  PIX_FMT_SWAP_ENDIANNESS(GRAY16);
1662  PIX_FMT_SWAP_ENDIANNESS(RGB48);
1663  PIX_FMT_SWAP_ENDIANNESS(RGB565);
1664  PIX_FMT_SWAP_ENDIANNESS(RGB555);
1665  PIX_FMT_SWAP_ENDIANNESS(RGB444);
1666  PIX_FMT_SWAP_ENDIANNESS(BGR48);
1667  PIX_FMT_SWAP_ENDIANNESS(BGR565);
1668  PIX_FMT_SWAP_ENDIANNESS(BGR555);
1669  PIX_FMT_SWAP_ENDIANNESS(BGR444);
1670 
1671  PIX_FMT_SWAP_ENDIANNESS(YUV420P9);
1672  PIX_FMT_SWAP_ENDIANNESS(YUV422P9);
1673  PIX_FMT_SWAP_ENDIANNESS(YUV444P9);
1674  PIX_FMT_SWAP_ENDIANNESS(YUV420P10);
1675  PIX_FMT_SWAP_ENDIANNESS(YUV422P10);
1676  PIX_FMT_SWAP_ENDIANNESS(YUV444P10);
1677  PIX_FMT_SWAP_ENDIANNESS(YUV420P16);
1678  PIX_FMT_SWAP_ENDIANNESS(YUV422P16);
1679  PIX_FMT_SWAP_ENDIANNESS(YUV444P16);
1680 
1681  PIX_FMT_SWAP_ENDIANNESS(GBRP9);
1682  PIX_FMT_SWAP_ENDIANNESS(GBRP10);
1683  PIX_FMT_SWAP_ENDIANNESS(GBRP16);
1684  PIX_FMT_SWAP_ENDIANNESS(YUVA420P9);
1685  PIX_FMT_SWAP_ENDIANNESS(YUVA422P9);
1686  PIX_FMT_SWAP_ENDIANNESS(YUVA444P9);
1687  PIX_FMT_SWAP_ENDIANNESS(YUVA420P10);
1688  PIX_FMT_SWAP_ENDIANNESS(YUVA422P10);
1689  PIX_FMT_SWAP_ENDIANNESS(YUVA444P10);
1690  PIX_FMT_SWAP_ENDIANNESS(YUVA420P16);
1691  PIX_FMT_SWAP_ENDIANNESS(YUVA422P16);
1692  PIX_FMT_SWAP_ENDIANNESS(YUVA444P16);
1693 
1694  PIX_FMT_SWAP_ENDIANNESS(XYZ12);
1696  PIX_FMT_SWAP_ENDIANNESS(RGBA64);
1697  PIX_FMT_SWAP_ENDIANNESS(BGRA64);
1698  default:
1699  return AV_PIX_FMT_NONE;
1700  }
1701 #undef PIX_FMT_SWAP_ENDIANNESS
1702 }
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:70
planar GBR 4:4:4 48bpp, big-endian
Definition: pixfmt.h:168
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
Definition: pixfmt.h:177
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
Definition: pixfmt.h:116
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:1599
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:95
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
Definition: pixfmt.h:190
16bit gray, 16bit alpha (big-endian)
Definition: pixfmt.h:206
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:134
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:67
MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstre...
Definition: pixfmt.h:136
MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstr...
Definition: pixfmt.h:107
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:1637
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:98
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
Definition: pixfmt.h:172
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:1571
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:66
#define AV_RL16(x)
Definition: intreadwrite.h:220
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 an header if pix_fm...
Definition: pixdesc.c:1584
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:133
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:97
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:129
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:183
WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstrea...
Definition: pixfmt.h:109
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
Definition: pixfmt.h:120
planar GBR 4:4:4 48bpp, little-endian
Definition: pixfmt.h:169
const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB]
The array of all the pixel format descriptors.
Definition: pixdesc.c:132
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:159
enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
Utility function to swap the endianness of a pixel format.
Definition: pixdesc.c:1653
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:80
Y , 16bpp, big-endian.
Definition: pixfmt.h:100
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
Definition: pixfmt.h:86
uint16_t shift
Number of least significant bits that must be shifted away to get the value.
Definition: pixdesc.h:52
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:152
interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian ...
Definition: pixfmt.h:195
hardware decoding through VDA
Definition: pixfmt.h:162
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
Definition: pixfmt.h:202
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:112
16bit gray, 16bit alpha (little-endian)
Definition: pixfmt.h:207
HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state str...
Definition: pixfmt.h:126
#define AV_RB16(x)
Definition: intreadwrite.h:208
uint8_t bits
Definition: crc.c:251
const char * name
Definition: pixdesc.h:70
uint8_t
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:156
#define AV_PIX_FMT_FLAG_BE
Pixel format is big-endian.
Definition: pixdesc.h:108
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:81
const char * name
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
Definition: pixdesc.h:112
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:154
const char data[16]
Definition: mxf.c:70
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:150
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:199
pixel format definitions
static int flags
Definition: log.c:44
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:191
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 ...
Definition: pixfmt.h:117
packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 ...
Definition: pixfmt.h:123
#define AV_PIX_FMT_FLAG_PSEUDOPAL
The pixel format is "pseudo-paletted".
Definition: pixdesc.h:134
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:69
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
Definition: pixfmt.h:88
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:198
uint16_t depth_minus1
Number of bits in the component minus 1.
Definition: pixdesc.h:57
packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
Definition: pixfmt.h:85
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:72
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:89
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
Definition: pixfmt.h:181
static const uint16_t mask[17]
Definition: lzw.c:38
packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in ...
Definition: pixfmt.h:87
8bit gray, 8bit alpha
Definition: pixfmt.h:144
#define AVERROR(e)
Definition: error.h:43
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:104
#define AV_WB16(p, d)
Definition: intreadwrite.h:213
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:130
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:163
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:237
Libavutil version macros.
planar GBR 4:4:4 30bpp, little-endian
Definition: pixfmt.h:167
XVideo Motion Acceleration via common packet passing.
Definition: pixfmt.h:81
AVPixelFormat
Pixel format.
Definition: pixfmt.h:63
HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_r...
Definition: pixfmt.h:125
common internal API header
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Definition: pixfmt.h:188
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:157
#define AV_WL16(p, d)
Definition: intreadwrite.h:225
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
Definition: pixdesc.c:1615
uint8_t nb_components
The number of components each pixel has, (1-4)
Definition: pixdesc.h:71
interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian ...
Definition: pixfmt.h:194
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:171
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
Definition: pixfmt.h:184
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian ...
Definition: pixfmt.h:173
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
Definition: pixfmt.h:178
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:97
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:113
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:193
#define FF_ARRAY_ELEMS(a)
Definition: common.h:61
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:179
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
Definition: pixfmt.h:186
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:84
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 ...
Definition: pixfmt.h:118
planar GBR 4:4:4 30bpp, big-endian
Definition: pixfmt.h:166
enum AVPixelFormat pix_fmt
Definition: movenc.c:843
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:192
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:189
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:65
H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstre...
Definition: pixfmt.h:106
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
Definition: pixfmt.h:91
8 bit with PIX_FMT_RGB32 palette
Definition: pixfmt.h:76
NULL
Definition: eval.c:55
packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 ...
Definition: pixfmt.h:143
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
Definition: pixdesc.h:120
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
Definition: pixfmt.h:209
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
VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstrea...
Definition: pixfmt.h:110
HW acceleration through VDA, data[3] contains a CVPixelBufferRef.
Definition: pixfmt.h:204
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:68
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
Definition: pixfmt.h:78
HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the b...
Definition: pixfmt.h:127
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:161
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:200
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.
Definition: pixdesc.h:124
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:185
uint16_t step_minus1
Number of elements between 2 horizontally consecutive pixels minus 1.
Definition: pixdesc.h:40
static int step
Definition: avplay.c:247
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:151
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
Definition: pixfmt.h:89
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Definition: pixfmt.h:182
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
Definition: pixfmt.h:74
packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in ...
Definition: pixfmt.h:90
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:197
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
Definition: pixfmt.h:79
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:33
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition: pixfmt.h:92
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
Definition: pixdesc.h:116
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
Definition: pixfmt.h:187
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:153
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range ...
Definition: pixfmt.h:103
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:102
packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 ...
Definition: pixfmt.h:122
packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 ...
Definition: pixfmt.h:141
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:155
#define X_NE(be, le)
Definition: pixdesc.c:1549
uint16_t plane
Which of the 4 planes contains the component.
Definition: pixdesc.h:34
#define FF_DISABLE_DEPRECATION_WARNINGS
Definition: internal.h:76
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
Definition: pixfmt.h:175
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:132
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
Definition: pixfmt.h:176
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:131
FF_ENABLE_DEPRECATION_WARNINGS 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:1625
packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 ...
Definition: pixfmt.h:140
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
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:71
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:158
MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstr...
Definition: pixfmt.h:108
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
Definition: pixfmt.h:121
planar GBR 4:4:4 27bpp, little-endian
Definition: pixfmt.h:165
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
Definition: pixdesc.h:128
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:96
static FF_DISABLE_DEPRECATION_WARNINGS enum AVPixelFormat get_pix_fmt_internal(const char *name)
Definition: pixdesc.c:1527
Y , 16bpp, little-endian.
Definition: pixfmt.h:101
#define FF_ENABLE_DEPRECATION_WARNINGS
Definition: internal.h:77
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
Definition: pixfmt.h:180
uint16_t offset_plus1
Number of elements before the component of the first pixel plus 1.
Definition: pixdesc.h:46
packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 ...
Definition: pixfmt.h:142
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
Definition: pixfmt.h:77
static void comp(unsigned char *dst, int dst_stride, unsigned char *src, int src_stride, int add)
Definition: eamad.c:83
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
Definition: pixfmt.h:115
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:160
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
Definition: pixfmt.h:75
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
Definition: pixdesc.c:1552
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
planar GBR 4:4:4 27bpp, big-endian
Definition: pixfmt.h:164
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:1540
common internal and external API header
Y , 8bpp.
Definition: pixfmt.h:73
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
Definition: pixdesc.h:138
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
Definition: pixfmt.h:174
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:170
for(j=16;j >0;--j)
as above, but U and V bytes are swapped
Definition: pixfmt.h:93
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer. ...
Definition: pixfmt.h:138
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.
Definition: pixdesc.c:1606
#define PIX_FMT_SWAP_ENDIANNESS(fmt)