• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavcodec/raw.c

Go to the documentation of this file.
00001 /*
00002  * Raw Video Codec
00003  * Copyright (c) 2001 Fabrice Bellard
00004  *
00005  * This file is part of FFmpeg.
00006  *
00007  * FFmpeg is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * FFmpeg is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with FFmpeg; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00020  */
00021 
00027 #include "avcodec.h"
00028 #include "raw.h"
00029 
00030 const PixelFormatTag ff_raw_pixelFormatTags[] = {
00031     { PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */
00032     { PIX_FMT_YUV420P, MKTAG('I', 'Y', 'U', 'V') },
00033     { PIX_FMT_YUV420P, MKTAG('Y', 'V', '1', '2') },
00034     { PIX_FMT_YUV410P, MKTAG('Y', 'U', 'V', '9') },
00035     { PIX_FMT_YUV410P, MKTAG('Y', 'V', 'U', '9') },
00036     { PIX_FMT_YUV411P, MKTAG('Y', '4', '1', 'B') },
00037     { PIX_FMT_YUV422P, MKTAG('Y', '4', '2', 'B') },
00038     { PIX_FMT_YUV422P, MKTAG('P', '4', '2', '2') },
00039     { PIX_FMT_GRAY8,   MKTAG('Y', '8', '0', '0') },
00040     { PIX_FMT_GRAY8,   MKTAG(' ', ' ', 'Y', '8') },
00041 
00042 
00043     { PIX_FMT_YUYV422, MKTAG('Y', 'U', 'Y', '2') }, /* Packed formats */
00044     { PIX_FMT_YUYV422, MKTAG('Y', '4', '2', '2') },
00045     { PIX_FMT_YUYV422, MKTAG('V', '4', '2', '2') },
00046     { PIX_FMT_YUYV422, MKTAG('V', 'Y', 'U', 'Y') },
00047     { PIX_FMT_YUYV422, MKTAG('Y', 'U', 'N', 'V') },
00048     { PIX_FMT_UYVY422, MKTAG('U', 'Y', 'V', 'Y') },
00049     { PIX_FMT_UYVY422, MKTAG('H', 'D', 'Y', 'C') },
00050     { PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'V') },
00051     { PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'Y') },
00052     { PIX_FMT_UYVY422, MKTAG('u', 'y', 'v', '1') },
00053     { PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', '1') },
00054     { PIX_FMT_UYVY422, MKTAG('A', 'V', 'R', 'n') }, /* Avid AVI Codec 1:1 */
00055     { PIX_FMT_UYVY422, MKTAG('A', 'V', '1', 'x') }, /* Avid 1:1x */
00056     { PIX_FMT_UYVY422, MKTAG('A', 'V', 'u', 'p') },
00057     { PIX_FMT_UYVY422, MKTAG('V', 'D', 'T', 'Z') }, /* SoftLab-NSK VideoTizer */
00058     { PIX_FMT_GRAY8,   MKTAG('G', 'R', 'E', 'Y') },
00059     { PIX_FMT_RGB555LE, MKTAG('R', 'G', 'B', 15) },
00060     { PIX_FMT_BGR555LE, MKTAG('B', 'G', 'R', 15) },
00061     { PIX_FMT_RGB565LE, MKTAG('R', 'G', 'B', 16) },
00062     { PIX_FMT_BGR565LE, MKTAG('B', 'G', 'R', 16) },
00063     { PIX_FMT_RGB565LE, MKTAG( 3 ,  0 ,  0 ,  0) },
00064 
00065     /* quicktime */
00066     { PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') },
00067     { PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', 'y') },
00068     { PIX_FMT_UYVY422, MKTAG('A', 'V', 'U', 'I') }, /* FIXME merge both fields */
00069     { PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', '2') },
00070     { PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', 's') },
00071     { PIX_FMT_PAL8,    MKTAG('W', 'R', 'A', 'W') },
00072 
00073     { PIX_FMT_NONE, 0 },
00074 };
00075 
00076 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat fmt)
00077 {
00078     const PixelFormatTag * tags = ff_raw_pixelFormatTags;
00079     while (tags->pix_fmt >= 0) {
00080         if (tags->pix_fmt == fmt)
00081             return tags->fourcc;
00082         tags++;
00083     }
00084     return 0;
00085 }

Generated on Fri Sep 16 2011 17:17:42 for FFmpeg by  doxygen 1.7.1