avcodec: remove avcodec-fast support
[vlc.git] / modules / codec / avcodec / avcodec.h
blob184ceb11d771eea398eeab627aff1d4adce7fdc4
1 /*****************************************************************************
2 * avcodec.h: decoder and encoder using libavcodec
3 *****************************************************************************
4 * Copyright (C) 2001-2008 VLC authors and VideoLAN
6 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2.1 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
23 #include "chroma.h"
24 #include "avcommon.h"
26 /* VLC <-> avcodec tables */
27 bool GetFfmpegCodec( enum es_format_category_e cat, vlc_fourcc_t i_fourcc,
28 unsigned *pi_ffmpeg_codec, const char **ppsz_name );
29 vlc_fourcc_t GetVlcFourcc( unsigned i_ffmpeg_codec );
30 vlc_fourcc_t GetVlcAudioFormat( int i_sample_fmt );
32 /* Video encoder module */
33 int InitVideoEnc ( vlc_object_t * );
34 void EndVideoEnc( vlc_object_t * );
36 /* Video Decoder */
37 int InitVideoDec( vlc_object_t * );
38 void EndVideoDec( vlc_object_t * );
40 /* Audio Decoder */
41 int InitAudioDec( vlc_object_t * );
42 void EndAudioDec( vlc_object_t * );
44 /* Subtitle Decoder */
45 int InitSubtitleDec( vlc_object_t * );
46 void EndSubtitleDec( vlc_object_t * );
48 /* Initialize decoder */
49 AVCodecContext *ffmpeg_AllocContext( decoder_t *, const AVCodec ** );
50 int ffmpeg_OpenCodec( decoder_t *p_dec, AVCodecContext *, const AVCodec * );
52 /*****************************************************************************
53 * Module descriptor help strings
54 *****************************************************************************/
55 #define DR_TEXT N_("Direct rendering")
56 /* FIXME Does somebody who knows what it does, explain */
58 #define CORRUPTED_TEXT N_("Show corrupted frames")
59 #define CORRUPTED_LONGTEXT N_("Prefer visual artifacts instead of missing frames")
61 #define ERROR_TEXT N_("Error resilience")
62 #define ERROR_LONGTEXT N_( \
63 "libavcodec can do error resilience.\n" \
64 "However, with a buggy encoder (such as the ISO MPEG-4 encoder from M$) " \
65 "this can produce a lot of errors.\n" \
66 "Valid values range from 0 to 4 (0 disables all errors resilience).")
68 #define BUGS_TEXT N_("Workaround bugs")
69 #define BUGS_LONGTEXT N_( \
70 "Try to fix some bugs:\n" \
71 "1 autodetect\n" \
72 "2 old msmpeg4\n" \
73 "4 xvid interlaced\n" \
74 "8 ump4 \n" \
75 "16 no padding\n" \
76 "32 ac vlc\n" \
77 "64 Qpel chroma.\n" \
78 "This must be the sum of the values. For example, to fix \"ac vlc\" and " \
79 "\"ump4\", enter 40.")
81 #define HURRYUP_TEXT N_("Hurry up")
82 #define HURRYUP_LONGTEXT N_( \
83 "The decoder can partially decode or skip frame(s) " \
84 "when there is not enough time. It's useful with low CPU power " \
85 "but it can produce distorted pictures.")
87 #define SKIP_FRAME_TEXT N_("Skip frame (default=0)")
88 #define SKIP_FRAME_LONGTEXT N_( \
89 "Force skipping of frames to speed up decoding " \
90 "(-1=None, 0=Default, 1=B-frames, 2=P-frames, 3=B+P frames, 4=all frames)." )
92 #define SKIP_IDCT_TEXT N_("Skip idct (default=0)")
93 #define SKIP_IDCT_LONGTEXT N_( \
94 "Force skipping of idct to speed up decoding for frame types " \
95 "(-1=None, 0=Default, 1=B-frames, 2=P-frames, 3=B+P frames, 4=all frames)." )
97 #define DEBUG_TEXT N_( "Debug mask" )
98 #define DEBUG_LONGTEXT N_( "Set FFmpeg debug mask" )
100 #define CODEC_TEXT N_( "Codec name" )
101 #define CODEC_LONGTEXT N_( "Internal libavcodec codec name" )
103 #define SKIPLOOPF_TEXT N_( "Skip the loop filter for H.264 decoding" )
104 #define SKIPLOOPF_LONGTEXT N_( "Skipping the loop filter (aka deblocking) " \
105 "usually has a detrimental effect on quality. However it provides a big " \
106 "speedup for high definition streams." )
108 #define THREADS_TEXT N_( "Threads" )
109 #define THREADS_LONGTEXT N_( "Number of threads used for decoding, 0 meaning auto" )
112 * Encoder options
114 #define ENC_CFG_PREFIX "sout-avcodec-"
116 #define ENC_KEYINT_TEXT N_( "Ratio of key frames" )
117 #define ENC_KEYINT_LONGTEXT N_( "Number of frames " \
118 "that will be coded for one key frame." )
120 #define ENC_BFRAMES_TEXT N_( "Ratio of B frames" )
121 #define ENC_BFRAMES_LONGTEXT N_( "Number of " \
122 "B frames that will be coded between two reference frames." )
124 #define ENC_VT_TEXT N_( "Video bitrate tolerance" )
125 #define ENC_VT_LONGTEXT N_( "Video bitrate tolerance in kbit/s." )
127 #define ENC_INTERLACE_TEXT N_( "Interlaced encoding" )
128 #define ENC_INTERLACE_LONGTEXT N_( "Enable dedicated " \
129 "algorithms for interlaced frames." )
131 #define ENC_INTERLACE_ME_TEXT N_( "Interlaced motion estimation" )
132 #define ENC_INTERLACE_ME_LONGTEXT N_( "Enable interlaced " \
133 "motion estimation algorithms. This requires more CPU." )
135 #define ENC_PRE_ME_TEXT N_( "Pre-motion estimation" )
136 #define ENC_PRE_ME_LONGTEXT N_( "Enable the pre-motion " \
137 "estimation algorithm.")
139 #define ENC_RC_BUF_TEXT N_( "Rate control buffer size" )
140 #define ENC_RC_BUF_LONGTEXT N_( "Rate control " \
141 "buffer size (in kbytes). A bigger buffer will allow for better rate " \
142 "control, but will cause a delay in the stream." )
144 #define ENC_RC_BUF_AGGR_TEXT N_( "Rate control buffer aggressiveness" )
145 #define ENC_RC_BUF_AGGR_LONGTEXT N_( "Rate control "\
146 "buffer aggressiveness." )
148 #define ENC_IQUANT_FACTOR_TEXT N_( "I quantization factor" )
149 #define ENC_IQUANT_FACTOR_LONGTEXT N_( \
150 "Quantization factor of I frames, compared with P frames (for instance " \
151 "1.0 => same qscale for I and P frames)." )
153 #define ENC_NOISE_RED_TEXT N_( "Noise reduction" )
154 #define ENC_NOISE_RED_LONGTEXT N_( "Enable a simple noise " \
155 "reduction algorithm to lower the encoding length and bitrate, at the " \
156 "expense of lower quality frames." )
158 #define ENC_MPEG4_MATRIX_TEXT N_( "MPEG4 quantization matrix" )
159 #define ENC_MPEG4_MATRIX_LONGTEXT N_( "Use the MPEG4 " \
160 "quantization matrix for MPEG2 encoding. This generally yields a " \
161 "better looking picture, while still retaining the compatibility with " \
162 "standard MPEG2 decoders.")
164 #define ENC_HQ_TEXT N_( "Quality level" )
165 #define ENC_HQ_LONGTEXT N_( "Quality level " \
166 "for the encoding of motions vectors (this can slow down the encoding " \
167 "very much)." )
169 #define ENC_HURRYUP_TEXT N_( "Hurry up" )
170 #define ENC_HURRYUP_LONGTEXT N_( "The encoder " \
171 "can make on-the-fly quality tradeoffs if your CPU can't keep up with " \
172 "the encoding rate. It will disable trellis quantization, then the rate " \
173 "distortion of motion vectors (hq), and raise the noise reduction " \
174 "threshold to ease the encoder's task." )
176 #define ENC_QMIN_TEXT N_( "Minimum video quantizer scale" )
177 #define ENC_QMIN_LONGTEXT N_( "Minimum video " \
178 "quantizer scale." )
180 #define ENC_QMAX_TEXT N_( "Maximum video quantizer scale" )
181 #define ENC_QMAX_LONGTEXT N_( "Maximum video " \
182 "quantizer scale." )
184 #define ENC_TRELLIS_TEXT N_( "Trellis quantization" )
185 #define ENC_TRELLIS_LONGTEXT N_( "Enable trellis " \
186 "quantization (rate distortion for block coefficients)." )
188 #define ENC_QSCALE_TEXT N_( "Fixed quantizer scale" )
189 #define ENC_QSCALE_LONGTEXT N_( "A fixed video " \
190 "quantizer scale for VBR encoding (accepted values: 0.01 to 255.0)." )
192 #define ENC_STRICT_TEXT N_( "Strict standard compliance" )
193 #define ENC_STRICT_LONGTEXT N_( "Force a strict standard " \
194 "compliance when encoding (accepted values: -2 to 2)." )
196 #define ENC_LUMI_MASKING_TEXT N_( "Luminance masking" )
197 #define ENC_LUMI_MASKING_LONGTEXT N_( "Raise the quantizer for " \
198 "very bright macroblocks (default: 0.0)." )
200 #define ENC_DARK_MASKING_TEXT N_( "Darkness masking" )
201 #define ENC_DARK_MASKING_LONGTEXT N_( "Raise the quantizer for " \
202 "very dark macroblocks (default: 0.0)." )
204 #define ENC_P_MASKING_TEXT N_( "Motion masking" )
205 #define ENC_P_MASKING_LONGTEXT N_( "Raise the quantizer for " \
206 "macroblocks with a high temporal complexity (default: 0.0)." )
208 #define ENC_BORDER_MASKING_TEXT N_( "Border masking" )
209 #define ENC_BORDER_MASKING_LONGTEXT N_( "Raise the quantizer " \
210 "for macroblocks at the border of the frame (default: 0.0)." )
212 #define ENC_LUMA_ELIM_TEXT N_( "Luminance elimination" )
213 #define ENC_LUMA_ELIM_LONGTEXT N_( "Eliminates luminance blocks when " \
214 "the PSNR isn't much changed (default: 0.0). The H264 specification " \
215 "recommends -4." )
217 #define ENC_CHROMA_ELIM_TEXT N_( "Chrominance elimination" )
218 #define ENC_CHROMA_ELIM_LONGTEXT N_( "Eliminates chrominance blocks when " \
219 "the PSNR isn't much changed (default: 0.0). The H264 specification " \
220 "recommends 7." )
222 #define ENC_PROFILE_TEXT N_( "Specify AAC audio profile to use" )
223 #define ENC_PROFILE_LONGTEXT N_( "Specify the AAC audio profile to use " \
224 "for encoding the audio bitstream. It takes the following options: " \
225 "main, low, ssr (not supported),ltp, hev1, hev2 (default: low). " \
226 "hev1 and hev2 are currently supported only with libfdk-aac enabled libavcodec" )
228 #ifndef AV_VERSION_INT
229 # define AV_VERSION_INT(a, b, c) ((a)<<16 | (b)<<8 | (c))
230 #endif