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