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] = {
187 .name = "xvmc_mpeg2_mc",
188 .flags = PIX_FMT_HWACCEL,
190 [PIX_FMT_XVMC_MPEG2_IDCT] = {
191 .name = "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_RGB48BE] = {
447 {0,5,1,0,15}, /* R */
448 {0,5,3,0,15}, /* G */
449 {0,5,5,0,15}, /* B */
453 [PIX_FMT_RGB48LE] = {
459 {0,5,1,0,15}, /* R */
460 {0,5,3,0,15}, /* G */
461 {0,5,5,0,15}, /* B */
464 [PIX_FMT_RGB565BE] = {
476 [PIX_FMT_RGB565LE] = {
487 [PIX_FMT_RGB555BE] = {
499 [PIX_FMT_RGB555LE] = {
510 [PIX_FMT_BGR565BE] = {
522 [PIX_FMT_BGR565LE] = {
533 [PIX_FMT_BGR555BE] = {
545 [PIX_FMT_BGR555LE] = {
556 [PIX_FMT_VAAPI_MOCO] = {
557 .name = "vaapi_moco",
560 .flags = PIX_FMT_HWACCEL,
562 [PIX_FMT_VAAPI_IDCT] = {
563 .name = "vaapi_idct",
566 .flags = PIX_FMT_HWACCEL,
568 [PIX_FMT_VAAPI_VLD] = {
572 .flags = PIX_FMT_HWACCEL,
574 [PIX_FMT_YUV420P16LE] = {
575 .name = "yuv420p16le",
580 {0,1,1,0,15}, /* Y */
581 {1,1,1,0,15}, /* U */
582 {2,1,1,0,15}, /* V */
585 [PIX_FMT_YUV420P16BE] = {
586 .name = "yuv420p16be",
591 {0,1,1,0,15}, /* Y */
592 {1,1,1,0,15}, /* U */
593 {2,1,1,0,15}, /* V */
597 [PIX_FMT_YUV422P16LE] = {
598 .name = "yuv422p16le",
603 {0,1,1,0,15}, /* Y */
604 {1,1,1,0,15}, /* U */
605 {2,1,1,0,15}, /* V */
608 [PIX_FMT_YUV422P16BE] = {
609 .name = "yuv422p16be",
614 {0,1,1,0,15}, /* Y */
615 {1,1,1,0,15}, /* U */
616 {2,1,1,0,15}, /* V */
620 [PIX_FMT_YUV444P16LE] = {
621 .name = "yuv444p16le",
626 {0,1,1,0,15}, /* Y */
627 {1,1,1,0,15}, /* U */
628 {2,1,1,0,15}, /* V */
631 [PIX_FMT_YUV444P16BE] = {
632 .name = "yuv444p16be",
637 {0,1,1,0,15}, /* Y */
638 {1,1,1,0,15}, /* U */
639 {2,1,1,0,15}, /* V */
645 int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
648 int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
650 for (c = 0; c < pixdesc->nb_channels; c++) {
651 int s = c==1 || c==2 ? 0 : log2_pixels;
652 bits += (pixdesc->comp[c].depth_minus1+1) << s;
655 return bits >> log2_pixels;