2 * pixel format descriptor
3 * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
5 * This file is part of FFmpeg.
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.
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.
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
25 const AVPixFmtDescriptor av_pix_fmt_descriptors
[PIX_FMT_NB
] = {
103 [PIX_FMT_YUV411P
] = {
123 [PIX_FMT_MONOWHITE
] = {
131 .flags
= PIX_FMT_BITSTREAM
,
133 [PIX_FMT_MONOBLACK
] = {
141 .flags
= PIX_FMT_BITSTREAM
,
151 .flags
= PIX_FMT_PAL
,
153 [PIX_FMT_YUVJ420P
] = {
164 [PIX_FMT_YUVJ422P
] = {
175 [PIX_FMT_YUVJ444P
] = {
186 [PIX_FMT_XVMC_MPEG2_MC
] = {
188 .flags
= PIX_FMT_HWACCEL
,
190 [PIX_FMT_XVMC_MPEG2_IDCT
] = {
192 .flags
= PIX_FMT_HWACCEL
,
194 [PIX_FMT_UYVY422
] = {
205 [PIX_FMT_UYYVYY411
] = {
226 .flags
= PIX_FMT_PAL
,
238 .flags
= PIX_FMT_BITSTREAM
,
240 [PIX_FMT_BGR4_BYTE
] = {
250 .flags
= PIX_FMT_PAL
,
262 .flags
= PIX_FMT_PAL
,
274 .flags
= PIX_FMT_BITSTREAM
,
276 [PIX_FMT_RGB4_BYTE
] = {
286 .flags
= PIX_FMT_PAL
,
358 [PIX_FMT_GRAY16BE
] = {
364 {0,1,1,0,15}, /* Y */
368 [PIX_FMT_GRAY16LE
] = {
374 {0,1,1,0,15}, /* Y */
377 [PIX_FMT_YUV440P
] = {
388 [PIX_FMT_YUVJ440P
] = {
399 [PIX_FMT_YUVA420P
] = {
411 [PIX_FMT_VDPAU_H264
] = {
412 .name
= "vdpau_h264",
415 .flags
= PIX_FMT_HWACCEL
,
417 [PIX_FMT_VDPAU_MPEG1
] = {
418 .name
= "vdpau_mpeg1",
421 .flags
= PIX_FMT_HWACCEL
,
423 [PIX_FMT_VDPAU_MPEG2
] = {
424 .name
= "vdpau_mpeg2",
427 .flags
= PIX_FMT_HWACCEL
,
429 [PIX_FMT_VDPAU_WMV3
] = {
430 .name
= "vdpau_wmv3",
433 .flags
= PIX_FMT_HWACCEL
,
435 [PIX_FMT_VDPAU_VC1
] = {
439 .flags
= PIX_FMT_HWACCEL
,
441 [PIX_FMT_VDPAU_MPEG4
] = {
442 .name
= "vdpau_mpeg4",
445 .flags
= PIX_FMT_HWACCEL
,
447 [PIX_FMT_RGB48BE
] = {
453 {0,5,1,0,15}, /* R */
454 {0,5,3,0,15}, /* G */
455 {0,5,5,0,15}, /* B */
459 [PIX_FMT_RGB48LE
] = {
465 {0,5,1,0,15}, /* R */
466 {0,5,3,0,15}, /* G */
467 {0,5,5,0,15}, /* B */
470 [PIX_FMT_RGB565BE
] = {
482 [PIX_FMT_RGB565LE
] = {
493 [PIX_FMT_RGB555BE
] = {
505 [PIX_FMT_RGB555LE
] = {
516 [PIX_FMT_BGR565BE
] = {
528 [PIX_FMT_BGR565LE
] = {
539 [PIX_FMT_BGR555BE
] = {
551 [PIX_FMT_BGR555LE
] = {
562 [PIX_FMT_VAAPI_MOCO
] = {
563 .name
= "vaapi_moco",
566 .flags
= PIX_FMT_HWACCEL
,
568 [PIX_FMT_VAAPI_IDCT
] = {
569 .name
= "vaapi_idct",
572 .flags
= PIX_FMT_HWACCEL
,
574 [PIX_FMT_VAAPI_VLD
] = {
578 .flags
= PIX_FMT_HWACCEL
,
580 [PIX_FMT_YUV420P16LE
] = {
581 .name
= "yuv420p16le",
586 {0,1,1,0,15}, /* Y */
587 {1,1,1,0,15}, /* U */
588 {2,1,1,0,15}, /* V */
591 [PIX_FMT_YUV420P16BE
] = {
592 .name
= "yuv420p16be",
597 {0,1,1,0,15}, /* Y */
598 {1,1,1,0,15}, /* U */
599 {2,1,1,0,15}, /* V */
603 [PIX_FMT_YUV422P16LE
] = {
604 .name
= "yuv422p16le",
609 {0,1,1,0,15}, /* Y */
610 {1,1,1,0,15}, /* U */
611 {2,1,1,0,15}, /* V */
614 [PIX_FMT_YUV422P16BE
] = {
615 .name
= "yuv422p16be",
620 {0,1,1,0,15}, /* Y */
621 {1,1,1,0,15}, /* U */
622 {2,1,1,0,15}, /* V */
626 [PIX_FMT_YUV444P16LE
] = {
627 .name
= "yuv444p16le",
632 {0,1,1,0,15}, /* Y */
633 {1,1,1,0,15}, /* U */
634 {2,1,1,0,15}, /* V */
637 [PIX_FMT_YUV444P16BE
] = {
638 .name
= "yuv444p16be",
643 {0,1,1,0,15}, /* Y */
644 {1,1,1,0,15}, /* U */
645 {2,1,1,0,15}, /* V */
649 [PIX_FMT_DXVA2_VLD
] = {
653 .flags
= PIX_FMT_HWACCEL
,
657 int av_get_bits_per_pixel(const AVPixFmtDescriptor
*pixdesc
)
660 int log2_pixels
= pixdesc
->log2_chroma_w
+ pixdesc
->log2_chroma_h
;
662 for (c
= 0; c
< pixdesc
->nb_components
; c
++) {
663 int s
= c
==1 || c
==2 ?
0 : log2_pixels
;
664 bits
+= (pixdesc
->comp
[c
].depth_minus1
+1) << s
;
667 return bits
>> log2_pixels
;