Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

ffmpeg.h

00001 /*****************************************************************************
00002  * ffmpeg.h: decoder using the ffmpeg library
00003  *****************************************************************************
00004  * Copyright (C) 2001 the VideoLAN team
00005  * $Id: ffmpeg.h 11867 2005-07-27 16:55:17Z massiot $
00006  *
00007  * Authors: Laurent Aimar <[email protected]>
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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00022  *****************************************************************************/
00023 
00024 #include "codecs.h"                                      /* BITMAPINFOHEADER */
00025 
00026 #if LIBAVCODEC_BUILD >= 4663
00027 #   define LIBAVCODEC_PP
00028 #else
00029 #   undef  LIBAVCODEC_PP
00030 #endif
00031 
00032 struct picture_t;
00033 struct AVFrame;
00034 struct AVCodecContext;
00035 struct AVCodec;
00036 
00037 void E_(InitLibavcodec)( vlc_object_t * );
00038 int E_(GetFfmpegCodec) ( vlc_fourcc_t, int *, int *, char ** );
00039 int E_(GetVlcFourcc)   ( int, int *, vlc_fourcc_t *, char ** );
00040 int E_(GetFfmpegChroma)( vlc_fourcc_t );
00041 vlc_fourcc_t E_(GetVlcChroma)( int );
00042 
00043 /* Video decoder module */
00044 int  E_( InitVideoDec )( decoder_t *, AVCodecContext *, AVCodec *,
00045                          int, char * );
00046 void E_( EndVideoDec ) ( decoder_t * );
00047 picture_t *E_( DecodeVideo ) ( decoder_t *, block_t ** );
00048 
00049 /* Audio decoder module */
00050 int  E_( InitAudioDec )( decoder_t *, AVCodecContext *, AVCodec *,
00051                          int, char * );
00052 void E_( EndAudioDec ) ( decoder_t * );
00053 aout_buffer_t *E_( DecodeAudio ) ( decoder_t *, block_t ** );
00054 
00055 /* Chroma conversion module */
00056 int  E_(OpenChroma)( vlc_object_t * );
00057 void E_(CloseChroma)( vlc_object_t * );
00058 
00059 /* Video encoder module */
00060 int  E_(OpenEncoder) ( vlc_object_t * );
00061 void E_(CloseEncoder)( vlc_object_t * );
00062 
00063 /* Audio encoder module */
00064 int  E_(OpenAudioEncoder) ( vlc_object_t * );
00065 void E_(CloseAudioEncoder)( vlc_object_t * );
00066 
00067 /* Demux module */
00068 int  E_(OpenDemux) ( vlc_object_t * );
00069 void E_(CloseDemux)( vlc_object_t * );
00070 
00071 /* Video filter module */
00072 int  E_(OpenFilter)( vlc_object_t * );
00073 void E_(CloseFilter)( vlc_object_t * );
00074 int  E_(OpenDeinterlace)( vlc_object_t * );
00075 void E_(CloseDeinterlace)( vlc_object_t * );
00076 
00077 /* Postprocessing module */
00078 void *E_(OpenPostproc)( decoder_t *, vlc_bool_t * );
00079 int E_(InitPostproc)( decoder_t *, void *, int, int, int );
00080 int E_(PostprocPict)( decoder_t *, void *, picture_t *, AVFrame * );
00081 void E_(ClosePostproc)( decoder_t *, void * );
00082 
00083 /*****************************************************************************
00084  * Module descriptor help strings
00085  *****************************************************************************/
00086 #define DR_TEXT N_("Direct rendering")
00087 
00088 #define ERROR_TEXT N_("Error resilience")
00089 #define ERROR_LONGTEXT N_( \
00090     "ffmpeg can do error resilience.\n" \
00091     "However, with a buggy encoder (such as the ISO MPEG-4 encoder from M$) " \
00092     "this can produce a lot of errors.\n" \
00093     "Valid values range from 0 to 4 (0 disables all errors resilience).")
00094 
00095 #define BUGS_TEXT N_("Workaround bugs")
00096 #define BUGS_LONGTEXT N_( \
00097     "Try to fix some bugs\n" \
00098     "1  autodetect\n" \
00099     "2  old msmpeg4\n" \
00100     "4  xvid interlaced\n" \
00101     "8  ump4 \n" \
00102     "16 no padding\n" \
00103     "32 ac vlc\n" \
00104     "64 Qpel chroma")
00105 
00106 #define HURRYUP_TEXT N_("Hurry up")
00107 #define HURRYUP_LONGTEXT N_( \
00108     "Allow the decoder to partially decode or skip frame(s) " \
00109     "when there is not enough time. It's useful with low CPU power " \
00110     "but it can produce distorted pictures.")
00111 
00112 #define PP_Q_TEXT N_("Post processing quality")
00113 #define PP_Q_LONGTEXT N_( \
00114     "Quality of post processing. Valid range is 0 to 6\n" \
00115     "Higher levels require considerable more CPU power, but produce " \
00116     "better looking pictures." )
00117 
00118 #define DEBUG_TEXT N_( "Debug mask" )
00119 #define DEBUG_LONGTEXT N_( "Set ffmpeg debug mask" )
00120 
00121 #define VISMV_TEXT N_( "Visualize motion vectors" )
00122 #define VISMV_LONGTEXT N_( "Set motion vectors visualization mask.\n" \
00123     "1 - visualize forward predicted MVs of P frames\n" \
00124     "2 - visualize forward predicted MVs of B frames\n" \
00125     "4 - visualize backward predicted MVs of B frames" )
00126 
00127 #define LOWRES_TEXT N_( "Low resolution decoding" )
00128 #define LOWRES_LONGTEXT N_( "Will only decode a low resolution version of " \
00129     "the video." )
00130 
00131 #define LIBAVCODEC_PP_TEXT N_("ffmpeg post processing filter chains")
00132 /* FIXME (cut/past from ffmpeg */
00133 #define LIBAVCODEC_PP_LONGTEXT \
00134 "<filterName>[:<option>[:<option>...]][[,|/][-]<filterName>[:<option>...]]...\n" \
00135 "long form example:\n" \
00136 "vdeblock:autoq/hdeblock:autoq/linblenddeint    default,-vdeblock\n" \
00137 "short form example:\n" \
00138 "vb:a/hb:a/lb de,-vb\n" \
00139 "more examples:\n" \
00140 "tn:64:128:256\n" \
00141 "Filters                        Options\n" \
00142 "short  long name       short   long option     Description\n" \
00143 "*      *               a       autoq           cpu power dependant enabler\n" \
00144 "                       c       chrom           chrominance filtring enabled\n" \
00145 "                       y       nochrom         chrominance filtring disabled\n" \
00146 "hb     hdeblock        (2 Threshold)           horizontal deblocking filter\n" \
00147 "       1. difference factor: default=64, higher -> more deblocking\n" \
00148 "       2. flatness threshold: default=40, lower -> more deblocking\n" \
00149 "                       the h & v deblocking filters share these\n" \
00150 "                       so u cant set different thresholds for h / v\n" \
00151 "vb     vdeblock        (2 Threshold)           vertical deblocking filter\n" \
00152 "h1     x1hdeblock                              Experimental h deblock filter 1\n" \
00153 "v1     x1vdeblock                              Experimental v deblock filter 1\n" \
00154 "dr     dering                                  Deringing filter\n" \
00155 "al     autolevels                              automatic brightness / contrast\n" \
00156 "                       f       fullyrange      stretch luminance to (0..255)\n" \
00157 "lb     linblenddeint                           linear blend deinterlacer\n" \
00158 "li     linipoldeint                            linear interpolating deinterlace\n" \
00159 "ci     cubicipoldeint                          cubic interpolating deinterlacer\n" \
00160 "md     mediandeint                             median deinterlacer\n" \
00161 "fd     ffmpegdeint                             ffmpeg deinterlacer\n" \
00162 "de     default                                 hb:a,vb:a,dr:a,al\n" \
00163 "fa     fast                                    h1:a,v1:a,dr:a,al\n" \
00164 "tn     tmpnoise        (3 Thresholds)          Temporal Noise Reducer\n" \
00165 "                       1. <= 2. <= 3.          larger -> stronger filtering\n" \
00166 "fq     forceQuant      <quantizer>             Force quantizer\n"
00167 
00168 /*
00169  * Encoder options
00170  */
00171 #define ENC_CFG_PREFIX "sout-ffmpeg-"
00172 
00173 #define ENC_KEYINT_TEXT N_( "Ratio of key frames" )
00174 #define ENC_KEYINT_LONGTEXT N_( "Allows you to specify the number of frames " \
00175   "that will be coded for one key frame." )
00176 
00177 #define ENC_BFRAMES_TEXT N_( "Ratio of B frames" )
00178 #define ENC_BFRAMES_LONGTEXT N_( "Allows you to specify the number of " \
00179   "B frames that will be coded between two reference frames." )
00180 
00181 #define ENC_VT_TEXT N_( "Video bitrate tolerance" )
00182 #define ENC_VT_LONGTEXT N_( "Allows you to specify the video bitrate " \
00183   "tolerance in kbit/s." )
00184 
00185 #define ENC_INTERLACE_TEXT N_( "Enable interlaced encoding" )
00186 #define ENC_INTERLACE_LONGTEXT N_( "Allows you to enable dedicated " \
00187   "algorithms for interlaced frames." )
00188 
00189 #define ENC_INTERLACE_ME_TEXT N_( "Enable interlaced motion estimation" )
00190 #define ENC_INTERLACE_ME_LONGTEXT N_( "Allows you to enable interlaced " \
00191   "motion estimation algorithms. It requires more CPU." )
00192 
00193 #define ENC_PRE_ME_TEXT N_( "Enable pre motion estimation" )
00194 #define ENC_PRE_ME_LONGTEXT N_( "Allows you to enable the pre motion " \
00195   "estimation." )
00196 
00197 #define ENC_RC_STRICT_TEXT N_( "Enable strict rate control" )
00198 #define ENC_RC_STRICT_LONGTEXT N_( "Allows you to enable the strict rate " \
00199   "control algorithm." )
00200 
00201 #define ENC_RC_BUF_TEXT N_( "Rate control buffer size" )
00202 #define ENC_RC_BUF_LONGTEXT N_( "Allows you to specify the rate control " \
00203   "buffer size." )
00204 
00205 #define ENC_RC_BUF_AGGR_TEXT N_( "Rate control buffer aggressiveness" )
00206 #define ENC_RC_BUF_AGGR_LONGTEXT N_( "Allows you to specify the rate control "\
00207   "buffer aggressiveness." )
00208 
00209 #define ENC_IQUANT_FACTOR_TEXT N_( "I quantization factor" )
00210 #define ENC_IQUANT_FACTOR_LONGTEXT N_( "Allows you to specify the " \
00211   "quantization factor of I frames, compared with P frames (for instance " \
00212   "1.0 => same qscale for I and P frames)." )
00213 
00214 #define ENC_NOISE_RED_TEXT N_( "Noise reduction" )
00215 #define ENC_NOISE_RED_LONGTEXT N_( "Allows you to enable a simple noise " \
00216   "reduction algorithm to lower the encoding length and bitrate, at the " \
00217   "expense of lower quality frames." )
00218 
00219 #define ENC_MPEG4_MATRIX_TEXT N_( "Enable MPEG4 quantization matrix" )
00220 #define ENC_MPEG4_MATRIX_LONGTEXT N_( "Allows you to use the MPEG4 " \
00221   "quantization matrix for mpeg2 encoding. This generally yields a " \
00222   "better looking picture, while still retaining the compatibility with " \
00223   "standard MPEG-2 decoders.")
00224 
00225 #define ENC_HQ_TEXT N_( "Quality level" )
00226 #define ENC_HQ_LONGTEXT N_( "Allows you to specify the quality level " \
00227   "for the encoding of motions vectors (this can slow down the encoding " \
00228   "very much)." )
00229 
00230 #define ENC_HURRYUP_TEXT N_( "Hurry up" )
00231 #define ENC_HURRYUP_LONGTEXT N_( "Allows you to specify if the encoder " \
00232   "should make on-the-fly quality tradeoffs if your CPU can't keep up with " \
00233   "the encoding rate. It will disable trellis quantization, then the rate " \
00234   "distortion of motion vectors (hq), and raise the noise reduction " \
00235   "threshold to ease the encoder's task." )
00236 
00237 #define ENC_QMIN_TEXT N_( "Minimum video quantizer scale" )
00238 #define ENC_QMIN_LONGTEXT N_( "Allows you to specify the minimum video " \
00239   "quantizer scale." )
00240 
00241 #define ENC_QMAX_TEXT N_( "Maximum video quantizer scale" )
00242 #define ENC_QMAX_LONGTEXT N_( "Allows you to specify the maximum video " \
00243   "quantizer scale." )
00244 
00245 #define ENC_TRELLIS_TEXT N_( "Enable trellis quantization" )
00246 #define ENC_TRELLIS_LONGTEXT N_( "Allows you to enable trellis " \
00247   "quantization (rate distortion for block coefficients)." )
00248 
00249 #define ENC_QSCALE_TEXT N_( "Use fixed video quantizer scale" )
00250 #define ENC_QSCALE_LONGTEXT N_( "Allows you to specify a fixed video " \
00251   "quantizer scale for VBR encoding (accepted values: 0.01 to 255.0)." )
00252 
00253 #define ENC_STRICT_TEXT N_( "Strict standard compliance" )
00254 #define ENC_STRICT_LONGTEXT N_( "Allows you to force a strict standard " \
00255   "compliance when encoding (accepted values: -1, 0, 1)." )
00256 
00257 #define ENC_LUMI_MASKING_TEXT N_( "Luminance masking" )
00258 #define ENC_LUMI_MASKING_LONGTEXT N_( "Allows you to raise the quantizer for " \
00259   "very bright macroblocks (default: 0.0)." )
00260 
00261 #define ENC_DARK_MASKING_TEXT N_( "Darkness masking" )
00262 #define ENC_DARK_MASKING_LONGTEXT N_( "Allows you to raise the quantizer for " \
00263   "very dark macroblocks (default: 0.0)." )
00264 
00265 #define ENC_P_MASKING_TEXT N_( "Motion masking" )
00266 #define ENC_P_MASKING_LONGTEXT N_( "Allows you to raise the quantizer for " \
00267   "macroblocks with a high temporal complexity (default: 0.0)." )
00268 
00269 #define ENC_BORDER_MASKING_TEXT N_( "Border masking" )
00270 #define ENC_BORDER_MASKING_LONGTEXT N_( "Allows you to raise the quantizer " \
00271   "for macroblocks at the border of the frame (default: 0.0)." )
00272 
00273 #define ENC_LUMA_ELIM_TEXT N_( "Luminance elimination" )
00274 #define ENC_LUMA_ELIM_LONGTEXT N_( "Eliminates luminance blocks when " \
00275   "the PSNR isn't much changed (default: 0.0). The H264 specification " \
00276   "recommends -4." )
00277 
00278 #define ENC_CHROMA_ELIM_TEXT N_( "Chrominance elimination" )
00279 #define ENC_CHROMA_ELIM_LONGTEXT N_( "Eliminates chrominance blocks when " \
00280   "the PSNR isn't much changed (default: 0.0). The H264 specification " \
00281   "recommends 7." )

Generated on Tue Dec 20 10:14:29 2005 for vlc-0.8.4a by  doxygen 1.4.2