pixdesc.c
Go to the documentation of this file.
1 /*
2  * pixel format descriptor
3  * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include <stdio.h>
23 #include <string.h>
24 
25 #include "avassert.h"
26 #include "common.h"
27 #include "pixfmt.h"
28 #include "pixdesc.h"
29 
30 #include "intreadwrite.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 {
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 & PIX_FMT_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 & PIX_FMT_BE);
67 
68  while (w--) {
69  int val = is_8bit ? *p :
70  flags & PIX_FMT_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 {
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 & PIX_FMT_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 & PIX_FMT_BE);
109  while (w--) {
110  *p |= (*src++ << shift);
111  p += step;
112  }
113  } else {
114  while (w--) {
115  if (flags & PIX_FMT_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 = PIX_FMT_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 = PIX_FMT_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, 3, 0, 7 }, /* R */
174  { 0, 2, 2, 0, 7 }, /* G */
175  { 0, 2, 1, 0, 7 }, /* B */
176  },
177  .flags = PIX_FMT_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 = PIX_FMT_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 = PIX_FMT_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 = PIX_FMT_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 = PIX_FMT_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 = PIX_FMT_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 = PIX_FMT_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 = PIX_FMT_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 = PIX_FMT_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 = PIX_FMT_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 = PIX_FMT_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 = PIX_FMT_PLANAR,
302  },
304  .name = "xvmcmc",
305  .flags = PIX_FMT_HWACCEL,
306  },
308  .name = "xvmcidct",
309  .flags = PIX_FMT_HWACCEL,
310  },
311  [AV_PIX_FMT_UYVY422] = {
312  .name = "uyvy422",
313  .nb_components = 3,
314  .log2_chroma_w = 1,
315  .log2_chroma_h = 0,
316  .comp = {
317  { 0, 1, 2, 0, 7 }, /* Y */
318  { 0, 3, 1, 0, 7 }, /* U */
319  { 0, 3, 3, 0, 7 }, /* V */
320  },
321  },
323  .name = "uyyvyy411",
324  .nb_components = 3,
325  .log2_chroma_w = 2,
326  .log2_chroma_h = 0,
327  .comp = {
328  { 0, 3, 2, 0, 7 }, /* Y */
329  { 0, 5, 1, 0, 7 }, /* U */
330  { 0, 5, 4, 0, 7 }, /* V */
331  },
332  },
333  [AV_PIX_FMT_BGR8] = {
334  .name = "bgr8",
335  .nb_components = 3,
336  .log2_chroma_w = 0,
337  .log2_chroma_h = 0,
338  .comp = {
339  { 0, 0, 1, 0, 2 }, /* R */
340  { 0, 0, 1, 3, 2 }, /* G */
341  { 0, 0, 1, 6, 1 }, /* B */
342  },
343  .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,
344  },
345  [AV_PIX_FMT_BGR4] = {
346  .name = "bgr4",
347  .nb_components = 3,
348  .log2_chroma_w = 0,
349  .log2_chroma_h = 0,
350  .comp = {
351  { 0, 3, 4, 0, 0 }, /* R */
352  { 0, 3, 2, 0, 1 }, /* G */
353  { 0, 3, 1, 0, 0 }, /* B */
354  },
355  .flags = PIX_FMT_BITSTREAM | PIX_FMT_RGB,
356  },
358  .name = "bgr4_byte",
359  .nb_components = 3,
360  .log2_chroma_w = 0,
361  .log2_chroma_h = 0,
362  .comp = {
363  { 0, 0, 1, 0, 0 }, /* R */
364  { 0, 0, 1, 1, 1 }, /* G */
365  { 0, 0, 1, 3, 0 }, /* B */
366  },
367  .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,
368  },
369  [AV_PIX_FMT_RGB8] = {
370  .name = "rgb8",
371  .nb_components = 3,
372  .log2_chroma_w = 0,
373  .log2_chroma_h = 0,
374  .comp = {
375  { 0, 0, 1, 6, 1 }, /* R */
376  { 0, 0, 1, 3, 2 }, /* G */
377  { 0, 0, 1, 0, 2 }, /* B */
378  },
379  .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,
380  },
381  [AV_PIX_FMT_RGB4] = {
382  .name = "rgb4",
383  .nb_components = 3,
384  .log2_chroma_w = 0,
385  .log2_chroma_h = 0,
386  .comp = {
387  { 0, 3, 1, 0, 0 }, /* R */
388  { 0, 3, 2, 0, 1 }, /* G */
389  { 0, 3, 4, 0, 0 }, /* B */
390  },
391  .flags = PIX_FMT_BITSTREAM | PIX_FMT_RGB,
392  },
394  .name = "rgb4_byte",
395  .nb_components = 3,
396  .log2_chroma_w = 0,
397  .log2_chroma_h = 0,
398  .comp = {
399  { 0, 0, 1, 3, 0 }, /* R */
400  { 0, 0, 1, 1, 1 }, /* G */
401  { 0, 0, 1, 0, 0 }, /* B */
402  },
403  .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,
404  },
405  [AV_PIX_FMT_NV12] = {
406  .name = "nv12",
407  .nb_components = 3,
408  .log2_chroma_w = 1,
409  .log2_chroma_h = 1,
410  .comp = {
411  { 0, 0, 1, 0, 7 }, /* Y */
412  { 1, 1, 1, 0, 7 }, /* U */
413  { 1, 1, 2, 0, 7 }, /* V */
414  },
415  .flags = PIX_FMT_PLANAR,
416  },
417  [AV_PIX_FMT_NV21] = {
418  .name = "nv21",
419  .nb_components = 3,
420  .log2_chroma_w = 1,
421  .log2_chroma_h = 1,
422  .comp = {
423  { 0, 0, 1, 0, 7 }, /* Y */
424  { 1, 1, 2, 0, 7 }, /* U */
425  { 1, 1, 1, 0, 7 }, /* V */
426  },
427  .flags = PIX_FMT_PLANAR,
428  },
429  [AV_PIX_FMT_ARGB] = {
430  .name = "argb",
431  .nb_components = 4,
432  .log2_chroma_w = 0,
433  .log2_chroma_h = 0,
434  .comp = {
435  { 0, 3, 2, 0, 7 }, /* R */
436  { 0, 3, 3, 0, 7 }, /* G */
437  { 0, 3, 4, 0, 7 }, /* B */
438  { 0, 3, 1, 0, 7 }, /* A */
439  },
440  .flags = PIX_FMT_RGB | PIX_FMT_ALPHA,
441  },
442  [AV_PIX_FMT_RGBA] = {
443  .name = "rgba",
444  .nb_components = 4,
445  .log2_chroma_w = 0,
446  .log2_chroma_h = 0,
447  .comp = {
448  { 0, 3, 1, 0, 7 }, /* R */
449  { 0, 3, 2, 0, 7 }, /* G */
450  { 0, 3, 3, 0, 7 }, /* B */
451  { 0, 3, 4, 0, 7 }, /* A */
452  },
453  .flags = PIX_FMT_RGB | PIX_FMT_ALPHA,
454  },
455  [AV_PIX_FMT_ABGR] = {
456  .name = "abgr",
457  .nb_components = 4,
458  .log2_chroma_w = 0,
459  .log2_chroma_h = 0,
460  .comp = {
461  { 0, 3, 4, 0, 7 }, /* R */
462  { 0, 3, 3, 0, 7 }, /* G */
463  { 0, 3, 2, 0, 7 }, /* B */
464  { 0, 3, 1, 0, 7 }, /* A */
465  },
466  .flags = PIX_FMT_RGB | PIX_FMT_ALPHA,
467  },
468  [AV_PIX_FMT_BGRA] = {
469  .name = "bgra",
470  .nb_components = 4,
471  .log2_chroma_w = 0,
472  .log2_chroma_h = 0,
473  .comp = {
474  { 0, 3, 3, 0, 7 }, /* R */
475  { 0, 3, 2, 0, 7 }, /* G */
476  { 0, 3, 1, 0, 7 }, /* B */
477  { 0, 3, 4, 0, 7 }, /* A */
478  },
479  .flags = PIX_FMT_RGB | PIX_FMT_ALPHA,
480  },
481  [AV_PIX_FMT_0RGB] = {
482  .name = "0rgb",
483  .nb_components= 3,
484  .log2_chroma_w= 0,
485  .log2_chroma_h= 0,
486  .comp = {
487  { 0, 3, 2, 0, 7 }, /* R */
488  { 0, 3, 3, 0, 7 }, /* G */
489  { 0, 3, 4, 0, 7 }, /* B */
490  },
491  .flags = PIX_FMT_RGB,
492  },
493  [AV_PIX_FMT_RGB0] = {
494  .name = "rgb0",
495  .nb_components= 3,
496  .log2_chroma_w= 0,
497  .log2_chroma_h= 0,
498  .comp = {
499  { 0, 3, 1, 0, 7 }, /* R */
500  { 0, 3, 2, 0, 7 }, /* G */
501  { 0, 3, 3, 0, 7 }, /* B */
502  },
503  .flags = PIX_FMT_RGB,
504  },
505  [AV_PIX_FMT_0BGR] = {
506  .name = "0bgr",
507  .nb_components= 3,
508  .log2_chroma_w= 0,
509  .log2_chroma_h= 0,
510  .comp = {
511  { 0, 3, 4, 0, 7 }, /* R */
512  { 0, 3, 3, 0, 7 }, /* G */
513  { 0, 3, 2, 0, 7 }, /* B */
514  },
515  .flags = PIX_FMT_RGB,
516  },
517  [AV_PIX_FMT_BGR0] = {
518  .name = "bgr0",
519  .nb_components= 3,
520  .log2_chroma_w= 0,
521  .log2_chroma_h= 0,
522  .comp = {
523  { 0, 3, 3, 0, 7 }, /* R */
524  { 0, 3, 2, 0, 7 }, /* G */
525  { 0, 3, 1, 0, 7 }, /* B */
526  },
527  .flags = PIX_FMT_RGB,
528  },
529  [AV_PIX_FMT_GRAY16BE] = {
530  .name = "gray16be",
531  .nb_components = 1,
532  .log2_chroma_w = 0,
533  .log2_chroma_h = 0,
534  .comp = {
535  { 0, 1, 1, 0, 15 }, /* Y */
536  },
537  .flags = PIX_FMT_BE,
538  },
539  [AV_PIX_FMT_GRAY16LE] = {
540  .name = "gray16le",
541  .nb_components = 1,
542  .log2_chroma_w = 0,
543  .log2_chroma_h = 0,
544  .comp = {
545  { 0, 1, 1, 0, 15 }, /* Y */
546  },
547  },
548  [AV_PIX_FMT_YUV440P] = {
549  .name = "yuv440p",
550  .nb_components = 3,
551  .log2_chroma_w = 0,
552  .log2_chroma_h = 1,
553  .comp = {
554  { 0, 0, 1, 0, 7 }, /* Y */
555  { 1, 0, 1, 0, 7 }, /* U */
556  { 2, 0, 1, 0, 7 }, /* V */
557  },
558  .flags = PIX_FMT_PLANAR,
559  },
560  [AV_PIX_FMT_YUVJ440P] = {
561  .name = "yuvj440p",
562  .nb_components = 3,
563  .log2_chroma_w = 0,
564  .log2_chroma_h = 1,
565  .comp = {
566  { 0, 0, 1, 0, 7 }, /* Y */
567  { 1, 0, 1, 0, 7 }, /* U */
568  { 2, 0, 1, 0, 7 }, /* V */
569  },
570  .flags = PIX_FMT_PLANAR,
571  },
572  [AV_PIX_FMT_YUVA420P] = {
573  .name = "yuva420p",
574  .nb_components = 4,
575  .log2_chroma_w = 1,
576  .log2_chroma_h = 1,
577  .comp = {
578  { 0, 0, 1, 0, 7 }, /* Y */
579  { 1, 0, 1, 0, 7 }, /* U */
580  { 2, 0, 1, 0, 7 }, /* V */
581  { 3, 0, 1, 0, 7 }, /* A */
582  },
583  .flags = PIX_FMT_PLANAR | PIX_FMT_ALPHA,
584  },
585  [AV_PIX_FMT_YUVA422P] = {
586  .name = "yuva422p",
587  .nb_components = 4,
588  .log2_chroma_w = 1,
589  .log2_chroma_h = 0,
590  .comp = {
591  { 0, 0, 1, 0, 7 }, /* Y */
592  { 1, 0, 1, 0, 7 }, /* U */
593  { 2, 0, 1, 0, 7 }, /* V */
594  { 3, 0, 1, 0, 7 }, /* A */
595  },
596  .flags = PIX_FMT_PLANAR | PIX_FMT_ALPHA,
597  },
598  [AV_PIX_FMT_YUVA444P] = {
599  .name = "yuva444p",
600  .nb_components = 4,
601  .log2_chroma_w = 0,
602  .log2_chroma_h = 0,
603  .comp = {
604  { 0, 0, 1, 0, 7 }, /* Y */
605  { 1, 0, 1, 0, 7 }, /* U */
606  { 2, 0, 1, 0, 7 }, /* V */
607  { 3, 0, 1, 0, 7 }, /* A */
608  },
609  .flags = PIX_FMT_PLANAR | PIX_FMT_ALPHA,
610  },
612  .name = "yuva420p9be",
613  .nb_components = 4,
614  .log2_chroma_w = 1,
615  .log2_chroma_h = 1,
616  .comp = {
617  { 0, 1, 1, 0, 8 }, /* Y */
618  { 1, 1, 1, 0, 8 }, /* U */
619  { 2, 1, 1, 0, 8 }, /* V */
620  { 3, 1, 1, 0, 8 }, /* A */
621  },
623  },
625  .name = "yuva420p9le",
626  .nb_components = 4,
627  .log2_chroma_w = 1,
628  .log2_chroma_h = 1,
629  .comp = {
630  { 0, 1, 1, 0, 8 }, /* Y */
631  { 1, 1, 1, 0, 8 }, /* U */
632  { 2, 1, 1, 0, 8 }, /* V */
633  { 3, 1, 1, 0, 8 }, /* A */
634  },
635  .flags = PIX_FMT_PLANAR | PIX_FMT_ALPHA,
636  },
638  .name = "yuva422p9be",
639  .nb_components = 4,
640  .log2_chroma_w = 1,
641  .log2_chroma_h = 0,
642  .comp = {
643  { 0, 1, 1, 0, 8 }, /* Y */
644  { 1, 1, 1, 0, 8 }, /* U */
645  { 2, 1, 1, 0, 8 }, /* V */
646  { 3, 1, 1, 0, 8 }, /* A */
647  },
649  },
651  .name = "yuva422p9le",
652  .nb_components = 4,
653  .log2_chroma_w = 1,
654  .log2_chroma_h = 0,
655  .comp = {
656  { 0, 1, 1, 0, 8 }, /* Y */
657  { 1, 1, 1, 0, 8 }, /* U */
658  { 2, 1, 1, 0, 8 }, /* V */
659  { 3, 1, 1, 0, 8 }, /* A */
660  },
661  .flags = PIX_FMT_PLANAR | PIX_FMT_ALPHA,
662  },
664  .name = "yuva444p9be",
665  .nb_components = 4,
666  .log2_chroma_w = 0,
667  .log2_chroma_h = 0,
668  .comp = {
669  { 0, 1, 1, 0, 8 }, /* Y */
670  { 1, 1, 1, 0, 8 }, /* U */
671  { 2, 1, 1, 0, 8 }, /* V */
672  { 3, 1, 1, 0, 8 }, /* A */
673  },
675  },
677  .name = "yuva444p9le",
678  .nb_components = 4,
679  .log2_chroma_w = 0,
680  .log2_chroma_h = 0,
681  .comp = {
682  { 0, 1, 1, 0, 8 }, /* Y */
683  { 1, 1, 1, 0, 8 }, /* U */
684  { 2, 1, 1, 0, 8 }, /* V */
685  { 3, 1, 1, 0, 8 }, /* A */
686  },
687  .flags = PIX_FMT_PLANAR | PIX_FMT_ALPHA,
688  },
690  .name = "yuva420p10be",
691  .nb_components = 4,
692  .log2_chroma_w = 1,
693  .log2_chroma_h = 1,
694  .comp = {
695  { 0, 1, 1, 0, 9 }, /* Y */
696  { 1, 1, 1, 0, 9 }, /* U */
697  { 2, 1, 1, 0, 9 }, /* V */
698  { 3, 1, 1, 0, 9 }, /* A */
699  },
701  },
703  .name = "yuva420p10le",
704  .nb_components = 4,
705  .log2_chroma_w = 1,
706  .log2_chroma_h = 1,
707  .comp = {
708  { 0, 1, 1, 0, 9 }, /* Y */
709  { 1, 1, 1, 0, 9 }, /* U */
710  { 2, 1, 1, 0, 9 }, /* V */
711  { 3, 1, 1, 0, 9 }, /* A */
712  },
713  .flags = PIX_FMT_PLANAR | PIX_FMT_ALPHA,
714  },
716  .name = "yuva422p10be",
717  .nb_components = 4,
718  .log2_chroma_w = 1,
719  .log2_chroma_h = 0,
720  .comp = {
721  { 0, 1, 1, 0, 9 }, /* Y */
722  { 1, 1, 1, 0, 9 }, /* U */
723  { 2, 1, 1, 0, 9 }, /* V */
724  { 3, 1, 1, 0, 9 }, /* A */
725  },
727  },
729  .name = "yuva422p10le",
730  .nb_components = 4,
731  .log2_chroma_w = 1,
732  .log2_chroma_h = 0,
733  .comp = {
734  { 0, 1, 1, 0, 9 }, /* Y */
735  { 1, 1, 1, 0, 9 }, /* U */
736  { 2, 1, 1, 0, 9 }, /* V */
737  { 3, 1, 1, 0, 9 }, /* A */
738  },
739  .flags = PIX_FMT_PLANAR | PIX_FMT_ALPHA,
740  },
742  .name = "yuva444p10be",
743  .nb_components = 4,
744  .log2_chroma_w = 0,
745  .log2_chroma_h = 0,
746  .comp = {
747  { 0, 1, 1, 0, 9 }, /* Y */
748  { 1, 1, 1, 0, 9 }, /* U */
749  { 2, 1, 1, 0, 9 }, /* V */
750  { 3, 1, 1, 0, 9 }, /* A */
751  },
753  },
755  .name = "yuva444p10le",
756  .nb_components = 4,
757  .log2_chroma_w = 0,
758  .log2_chroma_h = 0,
759  .comp = {
760  { 0, 1, 1, 0, 9 }, /* Y */
761  { 1, 1, 1, 0, 9 }, /* U */
762  { 2, 1, 1, 0, 9 }, /* V */
763  { 3, 1, 1, 0, 9 }, /* A */
764  },
765  .flags = PIX_FMT_PLANAR | PIX_FMT_ALPHA,
766  },
768  .name = "yuva420p16be",
769  .nb_components = 4,
770  .log2_chroma_w = 1,
771  .log2_chroma_h = 1,
772  .comp = {
773  { 0, 1, 1, 0, 15 }, /* Y */
774  { 1, 1, 1, 0, 15 }, /* U */
775  { 2, 1, 1, 0, 15 }, /* V */
776  { 3, 1, 1, 0, 15 }, /* A */
777  },
779  },
781  .name = "yuva420p16le",
782  .nb_components = 4,
783  .log2_chroma_w = 1,
784  .log2_chroma_h = 1,
785  .comp = {
786  { 0, 1, 1, 0, 15 }, /* Y */
787  { 1, 1, 1, 0, 15 }, /* U */
788  { 2, 1, 1, 0, 15 }, /* V */
789  { 3, 1, 1, 0, 15 }, /* A */
790  },
791  .flags = PIX_FMT_PLANAR | PIX_FMT_ALPHA,
792  },
794  .name = "yuva422p16be",
795  .nb_components = 4,
796  .log2_chroma_w = 1,
797  .log2_chroma_h = 0,
798  .comp = {
799  { 0, 1, 1, 0, 15 }, /* Y */
800  { 1, 1, 1, 0, 15 }, /* U */
801  { 2, 1, 1, 0, 15 }, /* V */
802  { 3, 1, 1, 0, 15 }, /* A */
803  },
805  },
807  .name = "yuva422p16le",
808  .nb_components = 4,
809  .log2_chroma_w = 1,
810  .log2_chroma_h = 0,
811  .comp = {
812  { 0, 1, 1, 0, 15 }, /* Y */
813  { 1, 1, 1, 0, 15 }, /* U */
814  { 2, 1, 1, 0, 15 }, /* V */
815  { 3, 1, 1, 0, 15 }, /* A */
816  },
817  .flags = PIX_FMT_PLANAR | PIX_FMT_ALPHA,
818  },
820  .name = "yuva444p16be",
821  .nb_components = 4,
822  .log2_chroma_w = 0,
823  .log2_chroma_h = 0,
824  .comp = {
825  { 0, 1, 1, 0, 15 }, /* Y */
826  { 1, 1, 1, 0, 15 }, /* U */
827  { 2, 1, 1, 0, 15 }, /* V */
828  { 3, 1, 1, 0, 15 }, /* A */
829  },
831  },
833  .name = "yuva444p16le",
834  .nb_components = 4,
835  .log2_chroma_w = 0,
836  .log2_chroma_h = 0,
837  .comp = {
838  { 0, 1, 1, 0, 15 }, /* Y */
839  { 1, 1, 1, 0, 15 }, /* U */
840  { 2, 1, 1, 0, 15 }, /* V */
841  { 3, 1, 1, 0, 15 }, /* A */
842  },
843  .flags = PIX_FMT_PLANAR | PIX_FMT_ALPHA,
844  },
846  .name = "vdpau_h264",
847  .log2_chroma_w = 1,
848  .log2_chroma_h = 1,
849  .flags = PIX_FMT_HWACCEL,
850  },
852  .name = "vdpau_mpeg1",
853  .log2_chroma_w = 1,
854  .log2_chroma_h = 1,
855  .flags = PIX_FMT_HWACCEL,
856  },
858  .name = "vdpau_mpeg2",
859  .log2_chroma_w = 1,
860  .log2_chroma_h = 1,
861  .flags = PIX_FMT_HWACCEL,
862  },
864  .name = "vdpau_wmv3",
865  .log2_chroma_w = 1,
866  .log2_chroma_h = 1,
867  .flags = PIX_FMT_HWACCEL,
868  },
870  .name = "vdpau_vc1",
871  .log2_chroma_w = 1,
872  .log2_chroma_h = 1,
873  .flags = PIX_FMT_HWACCEL,
874  },
876  .name = "vdpau_mpeg4",
877  .log2_chroma_w = 1,
878  .log2_chroma_h = 1,
879  .flags = PIX_FMT_HWACCEL,
880  },
881  [AV_PIX_FMT_RGB48BE] = {
882  .name = "rgb48be",
883  .nb_components = 3,
884  .log2_chroma_w = 0,
885  .log2_chroma_h = 0,
886  .comp = {
887  { 0, 5, 1, 0, 15 }, /* R */
888  { 0, 5, 3, 0, 15 }, /* G */
889  { 0, 5, 5, 0, 15 }, /* B */
890  },
891  .flags = PIX_FMT_RGB | PIX_FMT_BE,
892  },
893  [AV_PIX_FMT_RGB48LE] = {
894  .name = "rgb48le",
895  .nb_components = 3,
896  .log2_chroma_w = 0,
897  .log2_chroma_h = 0,
898  .comp = {
899  { 0, 5, 1, 0, 15 }, /* R */
900  { 0, 5, 3, 0, 15 }, /* G */
901  { 0, 5, 5, 0, 15 }, /* B */
902  },
903  .flags = PIX_FMT_RGB,
904  },
905  [AV_PIX_FMT_RGBA64BE] = {
906  .name = "rgba64be",
907  .nb_components= 4,
908  .log2_chroma_w= 0,
909  .log2_chroma_h= 0,
910  .comp = {
911  { 0, 7, 1, 0, 15 }, /* R */
912  { 0, 7, 3, 0, 15 }, /* G */
913  { 0, 7, 5, 0, 15 }, /* B */
914  { 0, 7, 7, 0, 15 }, /* A */
915  },
916  .flags = PIX_FMT_RGB | PIX_FMT_BE | PIX_FMT_ALPHA,
917  },
918  [AV_PIX_FMT_RGBA64LE] = {
919  .name = "rgba64le",
920  .nb_components= 4,
921  .log2_chroma_w= 0,
922  .log2_chroma_h= 0,
923  .comp = {
924  { 0, 7, 1, 0, 15 }, /* R */
925  { 0, 7, 3, 0, 15 }, /* G */
926  { 0, 7, 5, 0, 15 }, /* B */
927  { 0, 7, 7, 0, 15 }, /* A */
928  },
929  .flags = PIX_FMT_RGB | PIX_FMT_ALPHA,
930  },
931  [AV_PIX_FMT_RGB565BE] = {
932  .name = "rgb565be",
933  .nb_components = 3,
934  .log2_chroma_w = 0,
935  .log2_chroma_h = 0,
936  .comp = {
937  { 0, 1, 0, 3, 4 }, /* R */
938  { 0, 1, 1, 5, 5 }, /* G */
939  { 0, 1, 1, 0, 4 }, /* B */
940  },
941  .flags = PIX_FMT_BE | PIX_FMT_RGB,
942  },
943  [AV_PIX_FMT_RGB565LE] = {
944  .name = "rgb565le",
945  .nb_components = 3,
946  .log2_chroma_w = 0,
947  .log2_chroma_h = 0,
948  .comp = {
949  { 0, 1, 2, 3, 4 }, /* R */
950  { 0, 1, 1, 5, 5 }, /* G */
951  { 0, 1, 1, 0, 4 }, /* B */
952  },
953  .flags = PIX_FMT_RGB,
954  },
955  [AV_PIX_FMT_RGB555BE] = {
956  .name = "rgb555be",
957  .nb_components = 3,
958  .log2_chroma_w = 0,
959  .log2_chroma_h = 0,
960  .comp = {
961  { 0, 1, 0, 2, 4 }, /* R */
962  { 0, 1, 1, 5, 4 }, /* G */
963  { 0, 1, 1, 0, 4 }, /* B */
964  },
965  .flags = PIX_FMT_BE | PIX_FMT_RGB,
966  },
967  [AV_PIX_FMT_RGB555LE] = {
968  .name = "rgb555le",
969  .nb_components = 3,
970  .log2_chroma_w = 0,
971  .log2_chroma_h = 0,
972  .comp = {
973  { 0, 1, 2, 2, 4 }, /* R */
974  { 0, 1, 1, 5, 4 }, /* G */
975  { 0, 1, 1, 0, 4 }, /* B */
976  },
977  .flags = PIX_FMT_RGB,
978  },
979  [AV_PIX_FMT_RGB444BE] = {
980  .name = "rgb444be",
981  .nb_components = 3,
982  .log2_chroma_w = 0,
983  .log2_chroma_h = 0,
984  .comp = {
985  { 0, 1, 0, 0, 3 }, /* R */
986  { 0, 1, 1, 4, 3 }, /* G */
987  { 0, 1, 1, 0, 3 }, /* B */
988  },
989  .flags = PIX_FMT_BE | PIX_FMT_RGB,
990  },
991  [AV_PIX_FMT_RGB444LE] = {
992  .name = "rgb444le",
993  .nb_components = 3,
994  .log2_chroma_w = 0,
995  .log2_chroma_h = 0,
996  .comp = {
997  { 0, 1, 2, 0, 3 }, /* R */
998  { 0, 1, 1, 4, 3 }, /* G */
999  { 0, 1, 1, 0, 3 }, /* B */
1000  },
1001  .flags = PIX_FMT_RGB,
1002  },
1003  [AV_PIX_FMT_BGR48BE] = {
1004  .name = "bgr48be",
1005  .nb_components = 3,
1006  .log2_chroma_w = 0,
1007  .log2_chroma_h = 0,
1008  .comp = {
1009  { 0, 5, 5, 0, 15 }, /* R */
1010  { 0, 5, 3, 0, 15 }, /* G */
1011  { 0, 5, 1, 0, 15 }, /* B */
1012  },
1013  .flags = PIX_FMT_BE | PIX_FMT_RGB,
1014  },
1015  [AV_PIX_FMT_BGR48LE] = {
1016  .name = "bgr48le",
1017  .nb_components = 3,
1018  .log2_chroma_w = 0,
1019  .log2_chroma_h = 0,
1020  .comp = {
1021  { 0, 5, 5, 0, 15 }, /* R */
1022  { 0, 5, 3, 0, 15 }, /* G */
1023  { 0, 5, 1, 0, 15 }, /* B */
1024  },
1025  .flags = PIX_FMT_RGB,
1026  },
1027  [AV_PIX_FMT_BGRA64BE] = {
1028  .name = "bgra64be",
1029  .nb_components= 4,
1030  .log2_chroma_w= 0,
1031  .log2_chroma_h= 0,
1032  .comp = {
1033  { 0, 7, 5, 0, 15 }, /* R */
1034  { 0, 7, 3, 0, 15 }, /* G */
1035  { 0, 7, 1, 0, 15 }, /* B */
1036  { 0, 7, 7, 0, 15 }, /* A */
1037  },
1038  .flags = PIX_FMT_BE | PIX_FMT_RGB | PIX_FMT_ALPHA,
1039  },
1040  [AV_PIX_FMT_BGRA64LE] = {
1041  .name = "bgra64le",
1042  .nb_components= 4,
1043  .log2_chroma_w= 0,
1044  .log2_chroma_h= 0,
1045  .comp = {
1046  { 0, 7, 5, 0, 15 }, /* R */
1047  { 0, 7, 3, 0, 15 }, /* G */
1048  { 0, 7, 1, 0, 15 }, /* B */
1049  { 0, 7, 7, 0, 15 }, /* A */
1050  },
1051  .flags = PIX_FMT_RGB | PIX_FMT_ALPHA,
1052  },
1053  [AV_PIX_FMT_BGR565BE] = {
1054  .name = "bgr565be",
1055  .nb_components = 3,
1056  .log2_chroma_w = 0,
1057  .log2_chroma_h = 0,
1058  .comp = {
1059  { 0, 1, 1, 0, 4 }, /* R */
1060  { 0, 1, 1, 5, 5 }, /* G */
1061  { 0, 1, 0, 3, 4 }, /* B */
1062  },
1063  .flags = PIX_FMT_BE | PIX_FMT_RGB,
1064  },
1065  [AV_PIX_FMT_BGR565LE] = {
1066  .name = "bgr565le",
1067  .nb_components = 3,
1068  .log2_chroma_w = 0,
1069  .log2_chroma_h = 0,
1070  .comp = {
1071  { 0, 1, 1, 0, 4 }, /* R */
1072  { 0, 1, 1, 5, 5 }, /* G */
1073  { 0, 1, 2, 3, 4 }, /* B */
1074  },
1075  .flags = PIX_FMT_RGB,
1076  },
1077  [AV_PIX_FMT_BGR555BE] = {
1078  .name = "bgr555be",
1079  .nb_components = 3,
1080  .log2_chroma_w = 0,
1081  .log2_chroma_h = 0,
1082  .comp = {
1083  { 0, 1, 1, 0, 4 }, /* R */
1084  { 0, 1, 1, 5, 4 }, /* G */
1085  { 0, 1, 0, 2, 4 }, /* B */
1086  },
1087  .flags = PIX_FMT_BE | PIX_FMT_RGB,
1088  },
1089  [AV_PIX_FMT_BGR555LE] = {
1090  .name = "bgr555le",
1091  .nb_components = 3,
1092  .log2_chroma_w = 0,
1093  .log2_chroma_h = 0,
1094  .comp = {
1095  { 0, 1, 1, 0, 4 }, /* R */
1096  { 0, 1, 1, 5, 4 }, /* G */
1097  { 0, 1, 2, 2, 4 }, /* B */
1098  },
1099  .flags = PIX_FMT_RGB,
1100  },
1101  [AV_PIX_FMT_BGR444BE] = {
1102  .name = "bgr444be",
1103  .nb_components = 3,
1104  .log2_chroma_w = 0,
1105  .log2_chroma_h = 0,
1106  .comp = {
1107  { 0, 1, 1, 0, 3 }, /* R */
1108  { 0, 1, 1, 4, 3 }, /* G */
1109  { 0, 1, 0, 0, 3 }, /* B */
1110  },
1111  .flags = PIX_FMT_BE | PIX_FMT_RGB,
1112  },
1113  [AV_PIX_FMT_BGR444LE] = {
1114  .name = "bgr444le",
1115  .nb_components = 3,
1116  .log2_chroma_w = 0,
1117  .log2_chroma_h = 0,
1118  .comp = {
1119  { 0, 1, 1, 0, 3 }, /* R */
1120  { 0, 1, 1, 4, 3 }, /* G */
1121  { 0, 1, 2, 0, 3 }, /* B */
1122  },
1123  .flags = PIX_FMT_RGB,
1124  },
1125  [AV_PIX_FMT_VAAPI_MOCO] = {
1126  .name = "vaapi_moco",
1127  .log2_chroma_w = 1,
1128  .log2_chroma_h = 1,
1129  .flags = PIX_FMT_HWACCEL,
1130  },
1131  [AV_PIX_FMT_VAAPI_IDCT] = {
1132  .name = "vaapi_idct",
1133  .log2_chroma_w = 1,
1134  .log2_chroma_h = 1,
1135  .flags = PIX_FMT_HWACCEL,
1136  },
1137  [AV_PIX_FMT_VAAPI_VLD] = {
1138  .name = "vaapi_vld",
1139  .log2_chroma_w = 1,
1140  .log2_chroma_h = 1,
1141  .flags = PIX_FMT_HWACCEL,
1142  },
1143  [AV_PIX_FMT_YUV420P9LE] = {
1144  .name = "yuv420p9le",
1145  .nb_components = 3,
1146  .log2_chroma_w = 1,
1147  .log2_chroma_h = 1,
1148  .comp = {
1149  { 0, 1, 1, 0, 8 }, /* Y */
1150  { 1, 1, 1, 0, 8 }, /* U */
1151  { 2, 1, 1, 0, 8 }, /* V */
1152  },
1153  .flags = PIX_FMT_PLANAR,
1154  },
1155  [AV_PIX_FMT_YUV420P9BE] = {
1156  .name = "yuv420p9be",
1157  .nb_components = 3,
1158  .log2_chroma_w = 1,
1159  .log2_chroma_h = 1,
1160  .comp = {
1161  { 0, 1, 1, 0, 8 }, /* Y */
1162  { 1, 1, 1, 0, 8 }, /* U */
1163  { 2, 1, 1, 0, 8 }, /* V */
1164  },
1165  .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
1166  },
1168  .name = "yuv420p10le",
1169  .nb_components = 3,
1170  .log2_chroma_w = 1,
1171  .log2_chroma_h = 1,
1172  .comp = {
1173  { 0, 1, 1, 0, 9 }, /* Y */
1174  { 1, 1, 1, 0, 9 }, /* U */
1175  { 2, 1, 1, 0, 9 }, /* V */
1176  },
1177  .flags = PIX_FMT_PLANAR,
1178  },
1180  .name = "yuv420p10be",
1181  .nb_components = 3,
1182  .log2_chroma_w = 1,
1183  .log2_chroma_h = 1,
1184  .comp = {
1185  { 0, 1, 1, 0, 9 }, /* Y */
1186  { 1, 1, 1, 0, 9 }, /* U */
1187  { 2, 1, 1, 0, 9 }, /* V */
1188  },
1189  .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
1190  },
1192  .name = "yuv420p12le",
1193  .nb_components = 3,
1194  .log2_chroma_w = 1,
1195  .log2_chroma_h = 1,
1196  .comp = {
1197  { 0, 1, 1, 0, 11 }, /* Y */
1198  { 1, 1, 1, 0, 11 }, /* U */
1199  { 2, 1, 1, 0, 11 }, /* V */
1200  },
1201  .flags = PIX_FMT_PLANAR,
1202  },
1204  .name = "yuv420p12be",
1205  .nb_components = 3,
1206  .log2_chroma_w = 1,
1207  .log2_chroma_h = 1,
1208  .comp = {
1209  { 0, 1, 1, 0, 11 }, /* Y */
1210  { 1, 1, 1, 0, 11 }, /* U */
1211  { 2, 1, 1, 0, 11 }, /* V */
1212  },
1213  .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
1214  },
1216  .name = "yuv420p14le",
1217  .nb_components = 3,
1218  .log2_chroma_w = 1,
1219  .log2_chroma_h = 1,
1220  .comp = {
1221  { 0, 1, 1, 0, 13 }, /* Y */
1222  { 1, 1, 1, 0, 13 }, /* U */
1223  { 2, 1, 1, 0, 13 }, /* V */
1224  },
1225  .flags = PIX_FMT_PLANAR,
1226  },
1228  .name = "yuv420p14be",
1229  .nb_components = 3,
1230  .log2_chroma_w = 1,
1231  .log2_chroma_h = 1,
1232  .comp = {
1233  { 0, 1, 1, 0, 13 }, /* Y */
1234  { 1, 1, 1, 0, 13 }, /* U */
1235  { 2, 1, 1, 0, 13 }, /* V */
1236  },
1237  .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
1238  },
1240  .name = "yuv420p16le",
1241  .nb_components = 3,
1242  .log2_chroma_w = 1,
1243  .log2_chroma_h = 1,
1244  .comp = {
1245  { 0, 1, 1, 0, 15 }, /* Y */
1246  { 1, 1, 1, 0, 15 }, /* U */
1247  { 2, 1, 1, 0, 15 }, /* V */
1248  },
1249  .flags = PIX_FMT_PLANAR,
1250  },
1252  .name = "yuv420p16be",
1253  .nb_components = 3,
1254  .log2_chroma_w = 1,
1255  .log2_chroma_h = 1,
1256  .comp = {
1257  { 0, 1, 1, 0, 15 }, /* Y */
1258  { 1, 1, 1, 0, 15 }, /* U */
1259  { 2, 1, 1, 0, 15 }, /* V */
1260  },
1261  .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
1262  },
1263  [AV_PIX_FMT_YUV422P9LE] = {
1264  .name = "yuv422p9le",
1265  .nb_components = 3,
1266  .log2_chroma_w = 1,
1267  .log2_chroma_h = 0,
1268  .comp = {
1269  { 0, 1, 1, 0, 8 }, /* Y */
1270  { 1, 1, 1, 0, 8 }, /* U */
1271  { 2, 1, 1, 0, 8 }, /* V */
1272  },
1273  .flags = PIX_FMT_PLANAR,
1274  },
1275  [AV_PIX_FMT_YUV422P9BE] = {
1276  .name = "yuv422p9be",
1277  .nb_components = 3,
1278  .log2_chroma_w = 1,
1279  .log2_chroma_h = 0,
1280  .comp = {
1281  { 0, 1, 1, 0, 8 }, /* Y */
1282  { 1, 1, 1, 0, 8 }, /* U */
1283  { 2, 1, 1, 0, 8 }, /* V */
1284  },
1285  .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
1286  },
1288  .name = "yuv422p10le",
1289  .nb_components = 3,
1290  .log2_chroma_w = 1,
1291  .log2_chroma_h = 0,
1292  .comp = {
1293  { 0, 1, 1, 0, 9 }, /* Y */
1294  { 1, 1, 1, 0, 9 }, /* U */
1295  { 2, 1, 1, 0, 9 }, /* V */
1296  },
1297  .flags = PIX_FMT_PLANAR,
1298  },
1300  .name = "yuv422p10be",
1301  .nb_components = 3,
1302  .log2_chroma_w = 1,
1303  .log2_chroma_h = 0,
1304  .comp = {
1305  { 0, 1, 1, 0, 9 }, /* Y */
1306  { 1, 1, 1, 0, 9 }, /* U */
1307  { 2, 1, 1, 0, 9 }, /* V */
1308  },
1309  .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
1310  },
1312  .name = "yuv422p12le",
1313  .nb_components = 3,
1314  .log2_chroma_w = 1,
1315  .log2_chroma_h = 0,
1316  .comp = {
1317  { 0, 1, 1, 0, 11 }, /* Y */
1318  { 1, 1, 1, 0, 11 }, /* U */
1319  { 2, 1, 1, 0, 11 }, /* V */
1320  },
1321  .flags = PIX_FMT_PLANAR,
1322  },
1324  .name = "yuv422p12be",
1325  .nb_components = 3,
1326  .log2_chroma_w = 1,
1327  .log2_chroma_h = 0,
1328  .comp = {
1329  { 0, 1, 1, 0, 11 }, /* Y */
1330  { 1, 1, 1, 0, 11 }, /* U */
1331  { 2, 1, 1, 0, 11 }, /* V */
1332  },
1333  .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
1334  },
1336  .name = "yuv422p14le",
1337  .nb_components = 3,
1338  .log2_chroma_w = 1,
1339  .log2_chroma_h = 0,
1340  .comp = {
1341  { 0, 1, 1, 0, 13 }, /* Y */
1342  { 1, 1, 1, 0, 13 }, /* U */
1343  { 2, 1, 1, 0, 13 }, /* V */
1344  },
1345  .flags = PIX_FMT_PLANAR,
1346  },
1348  .name = "yuv422p14be",
1349  .nb_components = 3,
1350  .log2_chroma_w = 1,
1351  .log2_chroma_h = 0,
1352  .comp = {
1353  { 0, 1, 1, 0, 13 }, /* Y */
1354  { 1, 1, 1, 0, 13 }, /* U */
1355  { 2, 1, 1, 0, 13 }, /* V */
1356  },
1357  .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
1358  },
1360  .name = "yuv422p16le",
1361  .nb_components = 3,
1362  .log2_chroma_w = 1,
1363  .log2_chroma_h = 0,
1364  .comp = {
1365  { 0, 1, 1, 0, 15 }, /* Y */
1366  { 1, 1, 1, 0, 15 }, /* U */
1367  { 2, 1, 1, 0, 15 }, /* V */
1368  },
1369  .flags = PIX_FMT_PLANAR,
1370  },
1372  .name = "yuv422p16be",
1373  .nb_components = 3,
1374  .log2_chroma_w = 1,
1375  .log2_chroma_h = 0,
1376  .comp = {
1377  { 0, 1, 1, 0, 15 }, /* Y */
1378  { 1, 1, 1, 0, 15 }, /* U */
1379  { 2, 1, 1, 0, 15 }, /* V */
1380  },
1381  .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
1382  },
1384  .name = "yuv444p16le",
1385  .nb_components = 3,
1386  .log2_chroma_w = 0,
1387  .log2_chroma_h = 0,
1388  .comp = {
1389  { 0, 1, 1, 0, 15 }, /* Y */
1390  { 1, 1, 1, 0, 15 }, /* U */
1391  { 2, 1, 1, 0, 15 }, /* V */
1392  },
1393  .flags = PIX_FMT_PLANAR,
1394  },
1396  .name = "yuv444p16be",
1397  .nb_components = 3,
1398  .log2_chroma_w = 0,
1399  .log2_chroma_h = 0,
1400  .comp = {
1401  { 0, 1, 1, 0, 15 }, /* Y */
1402  { 1, 1, 1, 0, 15 }, /* U */
1403  { 2, 1, 1, 0, 15 }, /* V */
1404  },
1405  .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
1406  },
1408  .name = "yuv444p10le",
1409  .nb_components = 3,
1410  .log2_chroma_w = 0,
1411  .log2_chroma_h = 0,
1412  .comp = {
1413  { 0, 1, 1, 0, 9 }, /* Y */
1414  { 1, 1, 1, 0, 9 }, /* U */
1415  { 2, 1, 1, 0, 9 }, /* V */
1416  },
1417  .flags = PIX_FMT_PLANAR,
1418  },
1420  .name = "yuv444p10be",
1421  .nb_components = 3,
1422  .log2_chroma_w = 0,
1423  .log2_chroma_h = 0,
1424  .comp = {
1425  { 0, 1, 1, 0, 9 }, /* Y */
1426  { 1, 1, 1, 0, 9 }, /* U */
1427  { 2, 1, 1, 0, 9 }, /* V */
1428  },
1429  .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
1430  },
1431  [AV_PIX_FMT_YUV444P9LE] = {
1432  .name = "yuv444p9le",
1433  .nb_components = 3,
1434  .log2_chroma_w = 0,
1435  .log2_chroma_h = 0,
1436  .comp = {
1437  { 0, 1, 1, 0, 8 }, /* Y */
1438  { 1, 1, 1, 0, 8 }, /* U */
1439  { 2, 1, 1, 0, 8 }, /* V */
1440  },
1441  .flags = PIX_FMT_PLANAR,
1442  },
1443  [AV_PIX_FMT_YUV444P9BE] = {
1444  .name = "yuv444p9be",
1445  .nb_components = 3,
1446  .log2_chroma_w = 0,
1447  .log2_chroma_h = 0,
1448  .comp = {
1449  { 0, 1, 1, 0, 8 }, /* Y */
1450  { 1, 1, 1, 0, 8 }, /* U */
1451  { 2, 1, 1, 0, 8 }, /* V */
1452  },
1453  .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
1454  },
1456  .name = "yuv444p12le",
1457  .nb_components = 3,
1458  .log2_chroma_w = 0,
1459  .log2_chroma_h = 0,
1460  .comp = {
1461  { 0, 1, 1, 0, 11 }, /* Y */
1462  { 1, 1, 1, 0, 11 }, /* U */
1463  { 2, 1, 1, 0, 11 }, /* V */
1464  },
1465  .flags = PIX_FMT_PLANAR,
1466  },
1468  .name = "yuv444p12be",
1469  .nb_components = 3,
1470  .log2_chroma_w = 0,
1471  .log2_chroma_h = 0,
1472  .comp = {
1473  { 0, 1, 1, 0, 11 }, /* Y */
1474  { 1, 1, 1, 0, 11 }, /* U */
1475  { 2, 1, 1, 0, 11 }, /* V */
1476  },
1477  .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
1478  },
1480  .name = "yuv444p14le",
1481  .nb_components = 3,
1482  .log2_chroma_w = 0,
1483  .log2_chroma_h = 0,
1484  .comp = {
1485  { 0, 1, 1, 0, 13 }, /* Y */
1486  { 1, 1, 1, 0, 13 }, /* U */
1487  { 2, 1, 1, 0, 13 }, /* V */
1488  },
1489  .flags = PIX_FMT_PLANAR,
1490  },
1492  .name = "yuv444p14be",
1493  .nb_components = 3,
1494  .log2_chroma_w = 0,
1495  .log2_chroma_h = 0,
1496  .comp = {
1497  { 0, 1, 1, 0, 13 }, /* Y */
1498  { 1, 1, 1, 0, 13 }, /* U */
1499  { 2, 1, 1, 0, 13 }, /* V */
1500  },
1501  .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
1502  },
1503  [AV_PIX_FMT_DXVA2_VLD] = {
1504  .name = "dxva2_vld",
1505  .log2_chroma_w = 1,
1506  .log2_chroma_h = 1,
1507  .flags = PIX_FMT_HWACCEL,
1508  },
1509  [AV_PIX_FMT_VDA_VLD] = {
1510  .name = "vda_vld",
1511  .log2_chroma_w = 1,
1512  .log2_chroma_h = 1,
1513  .flags = PIX_FMT_HWACCEL,
1514  },
1515  [AV_PIX_FMT_GRAY8A] = {
1516  .name = "gray8a",
1517  .nb_components = 2,
1518  .comp = {
1519  { 0, 1, 1, 0, 7 }, /* Y */
1520  { 0, 1, 2, 0, 7 }, /* A */
1521  },
1522  .flags = PIX_FMT_ALPHA,
1523  },
1524  [AV_PIX_FMT_GBRP] = {
1525  .name = "gbrp",
1526  .nb_components = 3,
1527  .log2_chroma_w = 0,
1528  .log2_chroma_h = 0,
1529  .comp = {
1530  { 2, 0, 1, 0, 7 }, /* R */
1531  { 0, 0, 1, 0, 7 }, /* G */
1532  { 1, 0, 1, 0, 7 }, /* B */
1533  },
1534  .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
1535  },
1536  [AV_PIX_FMT_GBRP9LE] = {
1537  .name = "gbrp9le",
1538  .nb_components = 3,
1539  .log2_chroma_w = 0,
1540  .log2_chroma_h = 0,
1541  .comp = {
1542  { 2, 1, 1, 0, 8 }, /* R */
1543  { 0, 1, 1, 0, 8 }, /* G */
1544  { 1, 1, 1, 0, 8 }, /* B */
1545  },
1546  .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
1547  },
1548  [AV_PIX_FMT_GBRP9BE] = {
1549  .name = "gbrp9be",
1550  .nb_components = 3,
1551  .log2_chroma_w = 0,
1552  .log2_chroma_h = 0,
1553  .comp = {
1554  { 2, 1, 1, 0, 8 }, /* R */
1555  { 0, 1, 1, 0, 8 }, /* G */
1556  { 1, 1, 1, 0, 8 }, /* B */
1557  },
1558  .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB,
1559  },
1560  [AV_PIX_FMT_GBRP10LE] = {
1561  .name = "gbrp10le",
1562  .nb_components = 3,
1563  .log2_chroma_w = 0,
1564  .log2_chroma_h = 0,
1565  .comp = {
1566  { 2, 1, 1, 0, 9 }, /* R */
1567  { 0, 1, 1, 0, 9 }, /* G */
1568  { 1, 1, 1, 0, 9 }, /* B */
1569  },
1570  .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
1571  },
1572  [AV_PIX_FMT_GBRP10BE] = {
1573  .name = "gbrp10be",
1574  .nb_components = 3,
1575  .log2_chroma_w = 0,
1576  .log2_chroma_h = 0,
1577  .comp = {
1578  { 2, 1, 1, 0, 9 }, /* R */
1579  { 0, 1, 1, 0, 9 }, /* G */
1580  { 1, 1, 1, 0, 9 }, /* B */
1581  },
1582  .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB,
1583  },
1584  [AV_PIX_FMT_GBRP12LE] = {
1585  .name = "gbrp12le",
1586  .nb_components = 3,
1587  .log2_chroma_w = 0,
1588  .log2_chroma_h = 0,
1589  .comp = {
1590  { 2, 1, 1, 0, 11 }, /* R */
1591  { 0, 1, 1, 0, 11 }, /* G */
1592  { 1, 1, 1, 0, 11 }, /* B */
1593  },
1594  .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
1595  },
1596  [AV_PIX_FMT_GBRP12BE] = {
1597  .name = "gbrp12be",
1598  .nb_components = 3,
1599  .log2_chroma_w = 0,
1600  .log2_chroma_h = 0,
1601  .comp = {
1602  { 2, 1, 1, 0, 11 }, /* R */
1603  { 0, 1, 1, 0, 11 }, /* G */
1604  { 1, 1, 1, 0, 11 }, /* B */
1605  },
1606  .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB,
1607  },
1608  [AV_PIX_FMT_GBRP14LE] = {
1609  .name = "gbrp14le",
1610  .nb_components = 3,
1611  .log2_chroma_w = 0,
1612  .log2_chroma_h = 0,
1613  .comp = {
1614  { 2, 1, 1, 0, 13 }, /* R */
1615  { 0, 1, 1, 0, 13 }, /* G */
1616  { 1, 1, 1, 0, 13 }, /* B */
1617  },
1618  .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
1619  },
1620  [AV_PIX_FMT_GBRP14BE] = {
1621  .name = "gbrp14be",
1622  .nb_components = 3,
1623  .log2_chroma_w = 0,
1624  .log2_chroma_h = 0,
1625  .comp = {
1626  { 2, 1, 1, 0, 13 }, /* R */
1627  { 0, 1, 1, 0, 13 }, /* G */
1628  { 1, 1, 1, 0, 13 }, /* B */
1629  },
1630  .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB,
1631  },
1632  [AV_PIX_FMT_GBRP16LE] = {
1633  .name = "gbrp16le",
1634  .nb_components = 3,
1635  .log2_chroma_w = 0,
1636  .log2_chroma_h = 0,
1637  .comp = {
1638  { 2, 1, 1, 0, 15 }, /* R */
1639  { 0, 1, 1, 0, 15 }, /* G */
1640  { 1, 1, 1, 0, 15 }, /* B */
1641  },
1642  .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
1643  },
1644  [AV_PIX_FMT_GBRP16BE] = {
1645  .name = "gbrp16be",
1646  .nb_components = 3,
1647  .log2_chroma_w = 0,
1648  .log2_chroma_h = 0,
1649  .comp = {
1650  { 2, 1, 1, 0, 15 }, /* R */
1651  { 0, 1, 1, 0, 15 }, /* G */
1652  { 1, 1, 1, 0, 15 }, /* B */
1653  },
1654  .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB,
1655  },
1656  [AV_PIX_FMT_VDPAU] = {
1657  .name = "vdpau",
1658  .log2_chroma_w = 1,
1659  .log2_chroma_h = 1,
1660  .flags = PIX_FMT_HWACCEL,
1661  },
1662  [AV_PIX_FMT_XYZ12LE] = {
1663  .name = "xyz12le",
1664  .nb_components = 3,
1665  .log2_chroma_w = 0,
1666  .log2_chroma_h = 0,
1667  .comp = {
1668  { 0, 5, 1, 4, 11 }, /* X */
1669  { 0, 5, 3, 4, 11 }, /* Y */
1670  { 0, 5, 5, 4, 11 }, /* Z */
1671  },
1672  /*.flags = -- not used*/
1673  },
1674  [AV_PIX_FMT_XYZ12BE] = {
1675  .name = "xyz12be",
1676  .nb_components = 3,
1677  .log2_chroma_w = 0,
1678  .log2_chroma_h = 0,
1679  .comp = {
1680  { 0, 5, 1, 4, 11 }, /* X */
1681  { 0, 5, 3, 4, 11 }, /* Y */
1682  { 0, 5, 5, 4, 11 }, /* Z */
1683  },
1684  .flags = PIX_FMT_BE,
1685  },
1686 };
1687 
1688 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
1689 {
1690  enum AVPixelFormat pix_fmt;
1691 
1692  for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
1693  if (av_pix_fmt_descriptors[pix_fmt].name &&
1694  !strcmp(av_pix_fmt_descriptors[pix_fmt].name, name))
1695  return pix_fmt;
1696 
1697  return AV_PIX_FMT_NONE;
1698 }
1699 
1701 {
1702  return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
1703  av_pix_fmt_descriptors[pix_fmt].name : NULL;
1704 }
1705 
1706 #if HAVE_BIGENDIAN
1707 # define X_NE(be, le) be
1708 #else
1709 # define X_NE(be, le) le
1710 #endif
1711 
1713 {
1714  enum AVPixelFormat pix_fmt;
1715 
1716  if (!strcmp(name, "rgb32"))
1717  name = X_NE("argb", "bgra");
1718  else if (!strcmp(name, "bgr32"))
1719  name = X_NE("abgr", "rgba");
1720 
1721  pix_fmt = get_pix_fmt_internal(name);
1722  if (pix_fmt == AV_PIX_FMT_NONE) {
1723  char name2[32];
1724 
1725  snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
1726  pix_fmt = get_pix_fmt_internal(name2);
1727  }
1728  return pix_fmt;
1729 }
1730 
1732 {
1733  int c, bits = 0;
1734  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
1735 
1736  for (c = 0; c < pixdesc->nb_components; c++) {
1737  int s = c == 1 || c == 2 ? 0 : log2_pixels;
1738  bits += (pixdesc->comp[c].depth_minus1 + 1) << s;
1739  }
1740 
1741  return bits >> log2_pixels;
1742 }
1743 
1745 {
1746  int c, bits = 0;
1747  int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
1748  int steps[4] = {0};
1749 
1750  for (c = 0; c < pixdesc->nb_components; c++) {
1751  const AVComponentDescriptor *comp = &pixdesc->comp[c];
1752  int s = c == 1 || c == 2 ? 0 : log2_pixels;
1753  steps[comp->plane] = (comp->step_minus1 + 1) << s;
1754  }
1755  for (c = 0; c < 4; c++)
1756  bits += steps[c];
1757 
1758  if(!(pixdesc->flags & PIX_FMT_BITSTREAM))
1759  bits *= 8;
1760 
1761  return bits >> log2_pixels;
1762 }
1763 
1764 char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt)
1765 {
1766  /* print header */
1767  if (pix_fmt < 0) {
1768  snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
1769  } else {
1770  const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
1771  snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
1772  pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
1773  }
1774 
1775  return buf;
1776 }
1777 
1779 {
1780  if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
1781  return NULL;
1782  return &av_pix_fmt_descriptors[pix_fmt];
1783 }
1784 
1786 {
1787  if (!prev)
1788  return &av_pix_fmt_descriptors[0];
1789  while (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1) {
1790  prev++;
1791  if (prev->name)
1792  return prev;
1793  }
1794  return NULL;
1795 }
1796 
1798 {
1799  if (desc < av_pix_fmt_descriptors ||
1800  desc >= av_pix_fmt_descriptors + FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
1801  return AV_PIX_FMT_NONE;
1802 
1803  return desc - av_pix_fmt_descriptors;
1804 }
1805 
1807  int *h_shift, int *v_shift)
1808 {
1809  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
1810  if (!desc)
1811  return AVERROR(ENOSYS);
1812  *h_shift = desc->log2_chroma_w;
1813  *v_shift = desc->log2_chroma_h;
1814 
1815  return 0;
1816 }
1817 
1819 {
1820  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
1821  int i, planes[4] = { 0 }, ret = 0;
1822 
1823  if (!desc)
1824  return AVERROR(EINVAL);
1825 
1826  for (i = 0; i < desc->nb_components; i++)
1827  planes[desc->comp[i].plane] = 1;
1828  for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
1829  ret += planes[i];
1830  return ret;
1831 }
1832 
1834  int i, j;
1835 
1836  for (i=0; i<FF_ARRAY_ELEMS(av_pix_fmt_descriptors); i++) {
1837  const AVPixFmtDescriptor *d = &av_pix_fmt_descriptors[i];
1838  uint8_t fill[4][8+6+3] = {{0}};
1839  uint8_t *data[4] = {fill[0], fill[1], fill[2], fill[3]};
1840  int linesize[4] = {0,0,0,0};
1841  uint16_t tmp[2];
1842 
1843  if (!d->name && !d->nb_components && !d->log2_chroma_w && !d->log2_chroma_h && !d->flags)
1844  continue;
1845 // av_log(NULL, AV_LOG_DEBUG, "Checking: %s\n", d->name);
1846  av_assert0(d->log2_chroma_w <= 3);
1847  av_assert0(d->log2_chroma_h <= 3);
1848  av_assert0(d->nb_components <= 4);
1849  av_assert0(d->name && d->name[0]);
1850  av_assert0((d->nb_components==4 || d->nb_components==2) == !!(d->flags & PIX_FMT_ALPHA));
1851  av_assert2(av_get_pix_fmt(d->name) == i);
1852 
1853  for (j=0; j<FF_ARRAY_ELEMS(d->comp); j++) {
1854  const AVComponentDescriptor *c = &d->comp[j];
1855  if(j>=d->nb_components) {
1856  av_assert0(!c->plane && !c->step_minus1 && !c->offset_plus1 && !c->shift && !c->depth_minus1);
1857  continue;
1858  }
1859  if (d->flags & PIX_FMT_BITSTREAM) {
1861  } else {
1862  av_assert0(8*(c->step_minus1+1) >= c->depth_minus1+1);
1863  }
1864  av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0);
1865  av_assert0(tmp[0] == 0 && tmp[1] == 0);
1866  tmp[0] = tmp[1] = (1<<(c->depth_minus1 + 1)) - 1;
1867  av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2);
1868  }
1869  }
1870 }
const char * name
Definition: avisynth_c.h:675
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:85
HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_r...
Definition: pixfmt.h:124
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:158
const char * s
Definition: avisynth_c.h:668
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:231
static int shift(int a, int b)
Definition: sonic.c:86
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:224
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:1778
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:228
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:151
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:212
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:73
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:1818
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:70
packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in ...
Definition: pixfmt.h:88
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:154
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:1731
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:1764
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:229
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:168
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:211
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 ...
Definition: pixfmt.h:117
HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the b...
Definition: pixfmt.h:126
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:195
#define AV_RL16
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
Definition: pixfmt.h:120
planar GBR 4:4:4 36bpp, little-endian
Definition: pixfmt.h:234
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:148
packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 ...
Definition: pixfmt.h:138
#define FF_ARRAY_ELEMS(a)
const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB]
Definition: pixdesc.c:131
packed BGR 8:8:8, 32bpp, 0BGR0BGR...
Definition: pixfmt.h:216
planar GBR 4:4:4 36bpp, big-endian
Definition: pixfmt.h:233
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:128
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:66
packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in ...
Definition: pixfmt.h:91
output residual component w
uint16_t shift
number of least significant bits that must be shifted away to get the value
Definition: pixdesc.h:42
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
Definition: pixfmt.h:115
set threshold d
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
Definition: pixfmt.h:89
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian ...
Definition: pixfmt.h:185
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
Definition: pixfmt.h:196
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:105
uint8_t bits
Definition: crc.c:216
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:86
uint8_t
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
Definition: avassert.h:63
packed RGB 8:8:8, 32bpp, RGB0RGB0...
Definition: pixfmt.h:215
8 bit with PIX_FMT_RGB32 palette
Definition: pixfmt.h:79
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:112
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:209
packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 ...
Definition: pixfmt.h:137
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:230
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
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
Definition: pixfmt.h:114
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:98
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:197
planar GBR 4:4:4 48bpp, big-endian
Definition: pixfmt.h:173
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range ...
Definition: pixfmt.h:104
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
Definition: pixfmt.h:81
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Definition: pixfmt.h:200
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
enum AVPixelFormat pix_fmt
Definition: v4l.c:63
const char * name
Definition: pixdesc.h:56
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:149
Discrete Time axis x
planar GBR 4:4:4 27bpp, big-endian
Definition: pixfmt.h:169
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:157
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:219
uint16_t depth_minus1
number of bits in the component minus 1
Definition: pixdesc.h:43
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:75
static const uint16_t mask[17]
Definition: lzw.c:37
#define AV_RB16
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:133
#define AV_WL16(p, darg)
Definition: intreadwrite.h:250
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:1806
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:99
Spectrum Plot time data
int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel for the pixel format described by pixdesc, including any padding ...
Definition: pixdesc.c:1744
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
Definition: pixfmt.h:188
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:153
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition: pixfmt.h:93
simple assert() macros that are a bit more flexible than ISO C assert().
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:227
XVideo Motion Acceleration via common packet passing.
Definition: pixfmt.h:83
#define PIX_FMT_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
Definition: pixdesc.h:90
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:131
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
Definition: pixfmt.h:189
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:96
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:143
int depth
Definition: v4l.c:62
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:97
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
Definition: pixfmt.h:190
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:72
as above, but U and V bytes are swapped
Definition: pixfmt.h:94
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
Definition: pixdesc.c:1797
uint8_t nb_components
The number of components each pixel has, (1-4)
Definition: pixdesc.h:57
8bit gray, 8bit alpha
Definition: pixfmt.h:141
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
Definition: pixfmt.h:92
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
Definition: pixfmt.h:80
ret
Definition: avfilter.c:821
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Definition: pixfmt.h:194
#define PIX_FMT_BITSTREAM
All values of a component are bit-wise packed end to end.
Definition: pixdesc.h:91
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
Definition: pixfmt.h:186
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:71
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:222
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:206
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:150
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:159
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:142
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
Definition: pixfmt.h:119
HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state str...
Definition: pixfmt.h:125
#define PIX_FMT_HWACCEL
Pixel format is an HW accelerated format.
Definition: pixdesc.h:92
NULL
Definition: eval.c:55
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
Definition: pixfmt.h:87
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:129
AVS_Value src
Definition: avisynth_c.h:523
#define PIX_FMT_PLANAR
At least one pixel component is not in the first data plane.
Definition: pixdesc.h:93
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:218
uint8_t flags
Definition: pixdesc.h:76
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:55
planar GBR 4:4:4 30bpp, big-endian
Definition: pixfmt.h:171
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
Definition: pixfmt.h:198
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:69
spectrum bins to fill(1-based indexing) for m
planar GBR 4:4:4 42bpp, little-endian
Definition: pixfmt.h:236
void * buf
Definition: avisynth_c.h:594
MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstre...
Definition: pixfmt.h:134
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:74
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
Definition: pixfmt.h:199
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:201
Y , 16bpp, big-endian.
Definition: pixfmt.h:101
synthesis window for stochastic i
#define AV_WB16(p, darg)
Definition: intreadwrite.h:237
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
Definition: pixfmt.h:203
static enum AVPixelFormat get_pix_fmt_internal(const char *name)
Definition: pixdesc.c:1688
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:223
uint16_t step_minus1
Number of elements between 2 horizontally consecutive pixels minus 1.
Definition: pixdesc.h:35
packed BGR 8:8:8, 32bpp, BGR0BGR0...
Definition: pixfmt.h:217
planar GBR 4:4:4 42bpp, big-endian
Definition: pixfmt.h:235
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
Definition: pixfmt.h:184
packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 ...
Definition: pixfmt.h:122
#define snprintf
Definition: snprintf.h:34
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFilterBuffer structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Buffer references ownership and permissions
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer. ...
Definition: pixfmt.h:135
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
#define PIX_FMT_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale)
Definition: pixdesc.h:94
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
Definition: pixfmt.h:193
static int flags
Definition: cpu.c:23
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 ...
Definition: pixfmt.h:116
packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 ...
Definition: pixfmt.h:140
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:155
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:132
VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstrea...
Definition: pixfmt.h:110
#define X_NE(be, le)
Definition: pixdesc.c:1709
hardware decoding through VDA
Definition: pixfmt.h:160
uint16_t plane
which of the 4 planes contains the component
Definition: pixdesc.h:29
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
Definition: pixfmt.h:78
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:68
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:226
Y , 8bpp.
Definition: pixfmt.h:76
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:77
planar GBR 4:4:4 27bpp, little-endian
Definition: pixfmt.h:170
static double c[64]
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:111
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:130
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
Definition: pixfmt.h:82
#define PIX_FMT_ALPHA
The pixel format has an alpha channel.
Definition: pixdesc.h:102
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
Definition: pixfmt.h:90
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:75
function y
Definition: D.m:1
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:191
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:205
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:232
#define PIX_FMT_PSEUDOPAL
The pixel format is "pseudo-paletted".
Definition: pixdesc.h:100
uint16_t offset_plus1
Number of elements before the component of the first pixel plus 1.
Definition: pixdesc.h:41
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160
Y , 16bpp, little-endian.
Definition: pixfmt.h:102
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
Definition: pixfmt.h:192
packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 ...
Definition: pixfmt.h:121
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
Definition: pixfmt.h:237
static void comp(unsigned char *dst, int dst_stride, unsigned char *src, int src_stride, int add)
Definition: eamad.c:71
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:103
planar GBR 4:4:4 48bpp, little-endian
Definition: pixfmt.h:174
void ff_check_pixfmt_descriptors(void)
Definition: pixdesc.c:1833
packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 ...
Definition: pixfmt.h:139
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
Definition: pixdesc.c:1712
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:1700
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
Definition: pixfmt.h:187
packed RGB 8:8:8, 32bpp, 0RGB0RGB...
Definition: pixfmt.h:214
packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
Definition: pixfmt.h:86
AVPixelFormat
Pixel format.
Definition: pixfmt.h:66
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:221
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:156
for(j=16;j >0;--j)
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:225
planar GBR 4:4:4 30bpp, little-endian
Definition: pixfmt.h:172
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:210
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But a word about which is also called distortion Distortion can be quantified by almost any quality measurement one chooses the sum of squared differences is used but more complex methods that consider psychovisual effects can be used as well It makes no difference in this discussion First step
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.
Definition: pixdesc.c:1785
#define PIX_FMT_BE
Pixel format is big-endian.
Definition: pixdesc.h:89
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:152