filter_picture.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * filter_picture.h: Common picture functions for filters
00003  *****************************************************************************
00004  * Copyright (C) 2007 the VideoLAN team
00005  * $Id: c5b4473aa2f38344e583176fe9783d5f21237b24 $
00006  *
00007  * Authors: Antoine Cellerier <dionoea at videolan dot org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 /* FIXME: do all of these really have square pixels? */
00025 #define CASE_PLANAR_YUV_SQUARE              \
00026         case VLC_CODEC_I420:   \
00027         case VLC_CODEC_J420:   \
00028         case VLC_CODEC_YV12:   \
00029         case VLC_CODEC_I411:   \
00030         case VLC_CODEC_I410:   \
00031         case VLC_CODEC_I444:   \
00032         case VLC_CODEC_J444:   \
00033         case VLC_CODEC_YUVA:
00034 
00035 #define CASE_PLANAR_YUV_NONSQUARE           \
00036         case VLC_CODEC_I422:   \
00037         case VLC_CODEC_J422:
00038 
00039 #define CASE_PLANAR_YUV                     \
00040         CASE_PLANAR_YUV_SQUARE              \
00041         CASE_PLANAR_YUV_NONSQUARE           \
00042 
00043 #define CASE_PACKED_YUV_422                 \
00044         case VLC_CODEC_UYVY:   \
00045         case VLC_CODEC_CYUV:   \
00046         case VLC_CODEC_YUYV:   \
00047         case VLC_CODEC_YVYU:
00048 
00049 static inline int GetPackedYuvOffsets( vlc_fourcc_t i_chroma,
00050     int *i_y_offset, int *i_u_offset, int *i_v_offset )
00051 {
00052     switch( i_chroma )
00053     {
00054         case VLC_CODEC_UYVY:
00055         case VLC_CODEC_CYUV: /* <-- FIXME: reverted, whatever that means */
00056             /* UYVY */
00057             *i_y_offset = 1;
00058             *i_u_offset = 0;
00059             *i_v_offset = 2;
00060             return VLC_SUCCESS;
00061         case VLC_CODEC_YUYV:
00062             /* YUYV */
00063             *i_y_offset = 0;
00064             *i_u_offset = 1;
00065             *i_v_offset = 3;
00066             return VLC_SUCCESS;
00067         case VLC_CODEC_YVYU:
00068             /* YVYU */
00069             *i_y_offset = 0;
00070             *i_u_offset = 3;
00071             *i_v_offset = 1;
00072             return VLC_SUCCESS;
00073         default:
00074             return VLC_EGENERIC;
00075     }
00076 }
00077 
00078 /*****************************************************************************
00079  *
00080  *****************************************************************************/
00081 static inline picture_t *CopyInfoAndRelease( picture_t *p_outpic, picture_t *p_inpic )
00082 {
00083     picture_CopyProperties( p_outpic, p_inpic );
00084 
00085     picture_Release( p_inpic );
00086 
00087     return p_outpic;
00088 }

Generated on Tue May 25 08:05:00 2010 for VLC by  doxygen 1.5.6