lame.h   lame.h 
skipping to change at line 21 skipping to change at line 21
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to * along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: lame.h,v 1.107 2002/04/10 12:55:47 bouvigne Exp $ */ /* $Id: lame.h,v 1.118 2002/10/18 22:54:33 robert Exp $ */
#ifndef LAME_LAME_H #ifndef LAME_LAME_H
#define LAME_LAME_H #define LAME_LAME_H
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
skipping to change at line 79 skipping to change at line 79
typedef enum preset_mode_e { typedef enum preset_mode_e {
/*values from 8 to 320 should be reserved for abr bitrates*/ /*values from 8 to 320 should be reserved for abr bitrates*/
/*for abr I'd suggest to directly use the targeted bitrate as a value*/ /*for abr I'd suggest to directly use the targeted bitrate as a value*/
ABR_8 = 8, ABR_8 = 8,
ABR_320 = 320, ABR_320 = 320,
R3MIX = 1000, R3MIX = 1000,
STANDARD = 1001, STANDARD = 1001,
EXTREME = 1002, EXTREME = 1002,
INSANE = 1003, INSANE = 1003,
STANDARD_FAST = 1004, STANDARD_FAST = 1004,
EXTREME_FAST = 1005 EXTREME_FAST = 1005,
MEDIUM = 1006,
MEDIUM_FAST = 1007
} preset_mode; } preset_mode;
/*asm optimizations*/ /*asm optimizations*/
typedef enum asm_optimizations_e { typedef enum asm_optimizations_e {
MMX = 1, MMX = 1,
AMD_3DNOW = 2, AMD_3DNOW = 2,
SSE = 3 SSE = 3
} asm_optimizations; } asm_optimizations;
struct lame_global_struct; struct lame_global_struct;
skipping to change at line 119 skipping to change at line 121
int CDECL lame_init_old(lame_global_flags *); int CDECL lame_init_old(lame_global_flags *);
/* /*
* OPTIONAL: * OPTIONAL:
* set as needed to override defaults * set as needed to override defaults
*/ */
/******************************************************************** /********************************************************************
* input stream description * input stream description
***********************************************************************/ ***********************************************************************/
// number of samples. default = 2^32-1 /* number of samples. default = 2^32-1 */
int CDECL lame_set_num_samples(lame_global_flags *, unsigned long); int CDECL lame_set_num_samples(lame_global_flags *, unsigned long);
unsigned long CDECL lame_get_num_samples(const lame_global_flags *); unsigned long CDECL lame_get_num_samples(const lame_global_flags *);
// input sample rate in Hz. default = 44100hz /* input sample rate in Hz. default = 44100hz */
int CDECL lame_set_in_samplerate(lame_global_flags *, int); int CDECL lame_set_in_samplerate(lame_global_flags *, int);
int CDECL lame_get_in_samplerate(const lame_global_flags *); int CDECL lame_get_in_samplerate(const lame_global_flags *);
// number of channels in input stream. default=2 /* number of channels in input stream. default=2 */
int CDECL lame_set_num_channels(lame_global_flags *, int); int CDECL lame_set_num_channels(lame_global_flags *, int);
int CDECL lame_get_num_channels(const lame_global_flags *); int CDECL lame_get_num_channels(const lame_global_flags *);
// scale the input by this amount before encoding. default=0 (disabled) /*
// (not used by decoding routines) scale the input by this amount before encoding. default=0 (disabled)
(not used by decoding routines)
*/
int CDECL lame_set_scale(lame_global_flags *, float); int CDECL lame_set_scale(lame_global_flags *, float);
float CDECL lame_get_scale(const lame_global_flags *); float CDECL lame_get_scale(const lame_global_flags *);
// scale the channel 0 (left) input by this amount before encoding. /*
// default=0 (disabled) scale the channel 0 (left) input by this amount before encoding.
// (not used by decoding routines) default=0 (disabled)
(not used by decoding routines)
*/
int CDECL lame_set_scale_left(lame_global_flags *, float); int CDECL lame_set_scale_left(lame_global_flags *, float);
float CDECL lame_get_scale_left(const lame_global_flags *); float CDECL lame_get_scale_left(const lame_global_flags *);
// scale the channel 1 (right) input by this amount before encoding. /*
// default=0 (disabled) scale the channel 1 (right) input by this amount before encoding.
// (not used by decoding routines) default=0 (disabled)
(not used by decoding routines)
*/
int CDECL lame_set_scale_right(lame_global_flags *, float); int CDECL lame_set_scale_right(lame_global_flags *, float);
float CDECL lame_get_scale_right(const lame_global_flags *); float CDECL lame_get_scale_right(const lame_global_flags *);
// output sample rate in Hz. default = 0, which means LAME picks best valu /*
e output sample rate in Hz. default = 0, which means LAME picks best value
// based on the amount of compression. MPEG only allows: based on the amount of compression. MPEG only allows:
// MPEG1 32, 44.1, 48khz MPEG1 32, 44.1, 48khz
// MPEG2 16, 22.05, 24 MPEG2 16, 22.05, 24
// MPEG2.5 8, 11.025, 12 MPEG2.5 8, 11.025, 12
// (not used by decoding routines) (not used by decoding routines)
*/
int CDECL lame_set_out_samplerate(lame_global_flags *, int); int CDECL lame_set_out_samplerate(lame_global_flags *, int);
int CDECL lame_get_out_samplerate(const lame_global_flags *); int CDECL lame_get_out_samplerate(const lame_global_flags *);
/******************************************************************** /********************************************************************
* general control parameters * general control parameters
***********************************************************************/ ***********************************************************************/
// 1=cause LAME to collect data for an MP3 frame analyzer. default=0 /* 1=cause LAME to collect data for an MP3 frame analyzer. default=0 */
int CDECL lame_set_analysis(lame_global_flags *, int); int CDECL lame_set_analysis(lame_global_flags *, int);
int CDECL lame_get_analysis(const lame_global_flags *); int CDECL lame_get_analysis(const lame_global_flags *);
// 1 = write a Xing VBR header frame. /*
// default = 1 for VBR/ABR modes, 0 for CBR mode 1 = write a Xing header (VBR) / INFO tag (CBR) frame.
// this variable must have been added by a Hungarian notation Windows progr default = 1
ammer :-) this variable must have been added by a Hungarian notation Windows program
mer :-)
*/
int CDECL lame_set_bWriteVbrTag(lame_global_flags *, int); int CDECL lame_set_bWriteVbrTag(lame_global_flags *, int);
int CDECL lame_get_bWriteVbrTag(const lame_global_flags *); int CDECL lame_get_bWriteVbrTag(const lame_global_flags *);
// 1=decode only. use lame/mpglib to convert mp3/ogg to wav. default=0 /* 1=decode only. use lame/mpglib to convert mp3/ogg to wav. default=0 */
int CDECL lame_set_decode_only(lame_global_flags *, int); int CDECL lame_set_decode_only(lame_global_flags *, int);
int CDECL lame_get_decode_only(const lame_global_flags *); int CDECL lame_get_decode_only(const lame_global_flags *);
// 1=encode a Vorbis .ogg file. default=0 /* 1=encode a Vorbis .ogg file. default=0 */
int CDECL lame_set_ogg(lame_global_flags *, int); int CDECL lame_set_ogg(lame_global_flags *, int);
int CDECL lame_get_ogg(const lame_global_flags *); int CDECL lame_get_ogg(const lame_global_flags *);
// internal algorithm selection. True quality is determined by the bitrate /*
// but this variable will effect quality by selecting expensive or cheap al internal algorithm selection. True quality is determined by the bitrate
gorithms. but this variable will effect quality by selecting expensive or cheap algo
// quality=0..9. 0=best (very slow). 9=worst. rithms.
// recommended: 2 near-best quality, not too slow quality=0..9. 0=best (very slow). 9=worst.
// 5 good quality, fast recommended: 2 near-best quality, not too slow
// 7 ok quality, really fast 5 good quality, fast
7 ok quality, really fast
*/
int CDECL lame_set_quality(lame_global_flags *, int); int CDECL lame_set_quality(lame_global_flags *, int);
int CDECL lame_get_quality(const lame_global_flags *); int CDECL lame_get_quality(const lame_global_flags *);
// mode = 0,1,2,3 = stereo, jstereo, dual channel (not supported), mono /*
// default: lame picks based on compression ration and input channels mode = 0,1,2,3 = stereo, jstereo, dual channel (not supported), mono
default: lame picks based on compression ration and input channels
*/
int CDECL lame_set_mode(lame_global_flags *, MPEG_mode); int CDECL lame_set_mode(lame_global_flags *, MPEG_mode);
MPEG_mode CDECL lame_get_mode(const lame_global_flags *); MPEG_mode CDECL lame_get_mode(const lame_global_flags *);
// mode_automs. Use a M/S mode with a switching threshold based on /*
// compression ratio mode_automs. Use a M/S mode with a switching threshold based on
// default = 0 (disabled) compression ratio
default = 0 (disabled)
*/
int CDECL lame_set_mode_automs(lame_global_flags *, int); int CDECL lame_set_mode_automs(lame_global_flags *, int);
int CDECL lame_get_mode_automs(const lame_global_flags *); int CDECL lame_get_mode_automs(const lame_global_flags *);
// force_ms. Force M/S for all frames. For testing only. /*
// default = 0 (disabled) force_ms. Force M/S for all frames. For testing only.
default = 0 (disabled)
*/
int CDECL lame_set_force_ms(lame_global_flags *, int); int CDECL lame_set_force_ms(lame_global_flags *, int);
int CDECL lame_get_force_ms(const lame_global_flags *); int CDECL lame_get_force_ms(const lame_global_flags *);
// use free_format? default = 0 (disabled) /* use free_format? default = 0 (disabled) */
int CDECL lame_set_free_format(lame_global_flags *, int); int CDECL lame_set_free_format(lame_global_flags *, int);
int CDECL lame_get_free_format(const lame_global_flags *); int CDECL lame_get_free_format(const lame_global_flags *);
/* /*
* OPTIONAL: * OPTIONAL:
* Set printf like error/debug/message reporting functions. * Set printf like error/debug/message reporting functions.
* The second argument has to be a pointer to a function which looks like * The second argument has to be a pointer to a function which looks like
* void my_debugf(const char *format, va_list ap) * void my_debugf(const char *format, va_list ap)
* { * {
* (void) vfprintf(stdout, format, ap); * (void) vfprintf(stdout, format, ap);
skipping to change at line 239 skipping to change at line 259
int CDECL lame_get_brate(const lame_global_flags *); int CDECL lame_get_brate(const lame_global_flags *);
int CDECL lame_set_compression_ratio(lame_global_flags *, float); int CDECL lame_set_compression_ratio(lame_global_flags *, float);
float CDECL lame_get_compression_ratio(const lame_global_flags *); float CDECL lame_get_compression_ratio(const lame_global_flags *);
int CDECL lame_set_preset( lame_global_flags* gfp, int ); int CDECL lame_set_preset( lame_global_flags* gfp, int );
int CDECL lame_set_asm_optimizations( lame_global_flags* gfp, int, int ); int CDECL lame_set_asm_optimizations( lame_global_flags* gfp, int, int );
/******************************************************************** /********************************************************************
* frame params * frame params
***********************************************************************/ ***********************************************************************/
// mark as copyright. default=0 /* mark as copyright. default=0 */
int CDECL lame_set_copyright(lame_global_flags *, int); int CDECL lame_set_copyright(lame_global_flags *, int);
int CDECL lame_get_copyright(const lame_global_flags *); int CDECL lame_get_copyright(const lame_global_flags *);
// mark as original. default=1 /* mark as original. default=1 */
int CDECL lame_set_original(lame_global_flags *, int); int CDECL lame_set_original(lame_global_flags *, int);
int CDECL lame_get_original(const lame_global_flags *); int CDECL lame_get_original(const lame_global_flags *);
// error_protection. Use 2 bytes from each frame for CRC checksum. default =0 /* error_protection. Use 2 bytes from each frame for CRC checksum. default =0 */
int CDECL lame_set_error_protection(lame_global_flags *, int); int CDECL lame_set_error_protection(lame_global_flags *, int);
int CDECL lame_get_error_protection(const lame_global_flags *); int CDECL lame_get_error_protection(const lame_global_flags *);
// padding_type. 0=pad no frames 1=pad all frames 2=adjust padding(defaul t) /* padding_type. 0=pad no frames 1=pad all frames 2=adjust padding(defaul t) */
int CDECL lame_set_padding_type(lame_global_flags *, Padding_type); int CDECL lame_set_padding_type(lame_global_flags *, Padding_type);
Padding_type CDECL lame_get_padding_type(const lame_global_flags *); Padding_type CDECL lame_get_padding_type(const lame_global_flags *);
// MP3 'private extension' bit Meaningless. default=0 /* MP3 'private extension' bit Meaningless. default=0 */
int CDECL lame_set_extension(lame_global_flags *, int); int CDECL lame_set_extension(lame_global_flags *, int);
int CDECL lame_get_extension(const lame_global_flags *); int CDECL lame_get_extension(const lame_global_flags *);
// enforce strict ISO compliance. default=0 /* enforce strict ISO compliance. default=0 */
int CDECL lame_set_strict_ISO(lame_global_flags *, int); int CDECL lame_set_strict_ISO(lame_global_flags *, int);
int CDECL lame_get_strict_ISO(const lame_global_flags *); int CDECL lame_get_strict_ISO(const lame_global_flags *);
/******************************************************************** /********************************************************************
* quantization/noise shaping * quantization/noise shaping
***********************************************************************/ ***********************************************************************/
// disable the bit reservoir. For testing only. default=0 /* disable the bit reservoir. For testing only. default=0 */
int CDECL lame_set_disable_reservoir(lame_global_flags *, int); int CDECL lame_set_disable_reservoir(lame_global_flags *, int);
int CDECL lame_get_disable_reservoir(const lame_global_flags *); int CDECL lame_get_disable_reservoir(const lame_global_flags *);
// select a different "best quantization" function. default=0 /* select a different "best quantization" function. default=0 */
int CDECL lame_set_experimentalX(lame_global_flags *, int); int CDECL lame_set_experimentalX(lame_global_flags *, int);
int CDECL lame_get_experimentalX(const lame_global_flags *); int CDECL lame_get_experimentalX(const lame_global_flags *);
// another experimental option. for testing only /* another experimental option. for testing only */
int CDECL lame_set_experimentalY(lame_global_flags *, int); int CDECL lame_set_experimentalY(lame_global_flags *, int);
int CDECL lame_get_experimentalY(const lame_global_flags *); int CDECL lame_get_experimentalY(const lame_global_flags *);
// another experimental option. for testing only /* another experimental option. for testing only */
int CDECL lame_set_experimentalZ(lame_global_flags *, int); int CDECL lame_set_experimentalZ(lame_global_flags *, int);
int CDECL lame_get_experimentalZ(const lame_global_flags *); int CDECL lame_get_experimentalZ(const lame_global_flags *);
// Naoki's psycho acoustic model. default=0 /* Naoki's psycho acoustic model. default=0 */
int CDECL lame_set_exp_nspsytune(lame_global_flags *, int); int CDECL lame_set_exp_nspsytune(lame_global_flags *, int);
int CDECL lame_get_exp_nspsytune(const lame_global_flags *); int CDECL lame_get_exp_nspsytune(const lame_global_flags *);
void CDECL lame_set_msfix(lame_global_flags *, double);
int lame_set_exp_nspsytune2_int( lame_global_flags*, int, int); int lame_set_exp_nspsytune2_int( lame_global_flags*, int, int);
float lame_set_exp_nspsytune2_real( lame_global_flags*, int, float); float lame_set_exp_nspsytune2_real( lame_global_flags*, int, float);
void * lame_set_exp_nspsytune2_pointer( lame_global_flags*, int, void *); void * lame_set_exp_nspsytune2_pointer( lame_global_flags*, int, void *);
/******************************************************************** /********************************************************************
* VBR control * VBR control
***********************************************************************/ ***********************************************************************/
// Types of VBR. default = vbr_off = CBR /* Types of VBR. default = vbr_off = CBR */
int CDECL lame_set_VBR(lame_global_flags *, vbr_mode); int CDECL lame_set_VBR(lame_global_flags *, vbr_mode);
vbr_mode CDECL lame_get_VBR(const lame_global_flags *); vbr_mode CDECL lame_get_VBR(const lame_global_flags *);
// VBR quality level. 0=highest 9=lowest /* VBR quality level. 0=highest 9=lowest */
int CDECL lame_set_VBR_q(lame_global_flags *, int); int CDECL lame_set_VBR_q(lame_global_flags *, int);
int CDECL lame_get_VBR_q(const lame_global_flags *); int CDECL lame_get_VBR_q(const lame_global_flags *);
// Ignored except for VBR=vbr_abr (ABR mode) /* Ignored except for VBR=vbr_abr (ABR mode) */
int CDECL lame_set_VBR_mean_bitrate_kbps(lame_global_flags *, int); int CDECL lame_set_VBR_mean_bitrate_kbps(lame_global_flags *, int);
int CDECL lame_get_VBR_mean_bitrate_kbps(const lame_global_flags *); int CDECL lame_get_VBR_mean_bitrate_kbps(const lame_global_flags *);
int CDECL lame_set_VBR_min_bitrate_kbps(lame_global_flags *, int); int CDECL lame_set_VBR_min_bitrate_kbps(lame_global_flags *, int);
int CDECL lame_get_VBR_min_bitrate_kbps(const lame_global_flags *); int CDECL lame_get_VBR_min_bitrate_kbps(const lame_global_flags *);
int CDECL lame_set_VBR_max_bitrate_kbps(lame_global_flags *, int); int CDECL lame_set_VBR_max_bitrate_kbps(lame_global_flags *, int);
int CDECL lame_get_VBR_max_bitrate_kbps(const lame_global_flags *); int CDECL lame_get_VBR_max_bitrate_kbps(const lame_global_flags *);
// 1=stricetly enforce VBR_min_bitrate. Normally it will be violated for /*
// analog silence 1=strictly enforce VBR_min_bitrate. Normally it will be violated for
analog silence
*/
int CDECL lame_set_VBR_hard_min(lame_global_flags *, int); int CDECL lame_set_VBR_hard_min(lame_global_flags *, int);
int CDECL lame_get_VBR_hard_min(const lame_global_flags *); int CDECL lame_get_VBR_hard_min(const lame_global_flags *);
/* for preset */
int CDECL lame_set_preset_expopts(lame_global_flags *, int);
int CDECL lame_set_preset_notune(lame_global_flags *, int);
/******************************************************************** /********************************************************************
* Filtering control * Filtering control
***********************************************************************/ ***********************************************************************/
// freq in Hz to apply lowpass. Default = 0 = lame chooses. -1 = disabled /* freq in Hz to apply lowpass. Default = 0 = lame chooses. -1 = disabled */
int CDECL lame_set_lowpassfreq(lame_global_flags *, int); int CDECL lame_set_lowpassfreq(lame_global_flags *, int);
int CDECL lame_get_lowpassfreq(const lame_global_flags *); int CDECL lame_get_lowpassfreq(const lame_global_flags *);
// width of transition band, in Hz. Default = one polyphase filter band /* width of transition band, in Hz. Default = one polyphase filter band */
int CDECL lame_set_lowpasswidth(lame_global_flags *, int); int CDECL lame_set_lowpasswidth(lame_global_flags *, int);
int CDECL lame_get_lowpasswidth(const lame_global_flags *); int CDECL lame_get_lowpasswidth(const lame_global_flags *);
// freq in Hz to apply highpass. Default = 0 = lame chooses. -1 = disabled /* freq in Hz to apply highpass. Default = 0 = lame chooses. -1 = disabled */
int CDECL lame_set_highpassfreq(lame_global_flags *, int); int CDECL lame_set_highpassfreq(lame_global_flags *, int);
int CDECL lame_get_highpassfreq(const lame_global_flags *); int CDECL lame_get_highpassfreq(const lame_global_flags *);
// width of transition band, in Hz. Default = one polyphase filter band /* width of transition band, in Hz. Default = one polyphase filter band */
int CDECL lame_set_highpasswidth(lame_global_flags *, int); int CDECL lame_set_highpasswidth(lame_global_flags *, int);
int CDECL lame_get_highpasswidth(const lame_global_flags *); int CDECL lame_get_highpasswidth(const lame_global_flags *);
/******************************************************************** /********************************************************************
* psycho acoustics and other arguments which you should not change * psycho acoustics and other arguments which you should not change
* unless you know what you are doing * unless you know what you are doing
***********************************************************************/ ***********************************************************************/
// only use ATH for masking /* only use ATH for masking */
int CDECL lame_set_ATHonly(lame_global_flags *, int); int CDECL lame_set_ATHonly(lame_global_flags *, int);
int CDECL lame_get_ATHonly(const lame_global_flags *); int CDECL lame_get_ATHonly(const lame_global_flags *);
// only use ATH for short blocks /* only use ATH for short blocks */
int CDECL lame_set_ATHshort(lame_global_flags *, int); int CDECL lame_set_ATHshort(lame_global_flags *, int);
int CDECL lame_get_ATHshort(const lame_global_flags *); int CDECL lame_get_ATHshort(const lame_global_flags *);
// disable ATH /* disable ATH */
int CDECL lame_set_noATH(lame_global_flags *, int); int CDECL lame_set_noATH(lame_global_flags *, int);
int CDECL lame_get_noATH(const lame_global_flags *); int CDECL lame_get_noATH(const lame_global_flags *);
// select ATH formula /* select ATH formula */
int CDECL lame_set_ATHtype(lame_global_flags *, int); int CDECL lame_set_ATHtype(lame_global_flags *, int);
int CDECL lame_get_ATHtype(const lame_global_flags *); int CDECL lame_get_ATHtype(const lame_global_flags *);
// lower ATH by this many db /* lower ATH by this many db */
int CDECL lame_set_ATHlower(lame_global_flags *, float); int CDECL lame_set_ATHlower(lame_global_flags *, float);
float CDECL lame_get_ATHlower(const lame_global_flags *); float CDECL lame_get_ATHlower(const lame_global_flags *);
// select ATH adaptive adjustment type /* select ATH adaptive adjustment type */
int CDECL lame_set_athaa_type( lame_global_flags *, int); int CDECL lame_set_athaa_type( lame_global_flags *, int);
int CDECL lame_get_athaa_type( const lame_global_flags *); int CDECL lame_get_athaa_type( const lame_global_flags *);
// select the loudness approximation used by the ATH adaptive auto-leveling /* select the loudness approximation used by the ATH adaptive auto-leveling */
int CDECL lame_set_athaa_loudapprox( lame_global_flags *, int); int CDECL lame_set_athaa_loudapprox( lame_global_flags *, int);
int CDECL lame_get_athaa_loudapprox( const lame_global_flags *); int CDECL lame_get_athaa_loudapprox( const lame_global_flags *);
// adjust (in dB) the point below which adaptive ATH level adjustment occur s /* adjust (in dB) the point below which adaptive ATH level adjustment occur s */
int CDECL lame_set_athaa_sensitivity( lame_global_flags *, float); int CDECL lame_set_athaa_sensitivity( lame_global_flags *, float);
float CDECL lame_get_athaa_sensitivity( const lame_global_flags* ); float CDECL lame_get_athaa_sensitivity( const lame_global_flags* );
// predictability limit (ISO tonality formula) /* predictability limit (ISO tonality formula) */
int CDECL lame_set_cwlimit(lame_global_flags *, int); int CDECL lame_set_cwlimit(lame_global_flags *, int);
int CDECL lame_get_cwlimit(const lame_global_flags *); int CDECL lame_get_cwlimit(const lame_global_flags *);
// allow blocktypes to differ between channels? /*
// default: 0 for jstereo, 1 for stereo allow blocktypes to differ between channels?
default: 0 for jstereo, 1 for stereo
*/
int CDECL lame_set_allow_diff_short(lame_global_flags *, int); int CDECL lame_set_allow_diff_short(lame_global_flags *, int);
int CDECL lame_get_allow_diff_short(const lame_global_flags *); int CDECL lame_get_allow_diff_short(const lame_global_flags *);
// use temporal masking effect (default = 1) /* use temporal masking effect (default = 1) */
int CDECL lame_set_useTemporal(lame_global_flags *, int); int CDECL lame_set_useTemporal(lame_global_flags *, int);
int CDECL lame_get_useTemporal(const lame_global_flags *); int CDECL lame_get_useTemporal(const lame_global_flags *);
// use temporal masking effect (default = 1) /* use temporal masking effect (default = 1) */
int CDECL lame_set_interChRatio(lame_global_flags *, float); int CDECL lame_set_interChRatio(lame_global_flags *, float);
int CDECL lame_get_interChRatio(const lame_global_flags *); float CDECL lame_get_interChRatio(const lame_global_flags *);
// disable short blocks /* substep shaping method */
int CDECL lame_set_substep(lame_global_flags *, int);
int CDECL lame_get_substep(const lame_global_flags *);
/* disable short blocks */
int CDECL lame_set_no_short_blocks(lame_global_flags *, int); int CDECL lame_set_no_short_blocks(lame_global_flags *, int);
int CDECL lame_get_no_short_blocks(const lame_global_flags *); int CDECL lame_get_no_short_blocks(const lame_global_flags *);
// force short blocks /* force short blocks */
int CDECL lame_set_force_short_blocks(lame_global_flags *, int); int CDECL lame_set_force_short_blocks(lame_global_flags *, int);
int CDECL lame_get_force_short_blocks(const lame_global_flags *); int CDECL lame_get_force_short_blocks(const lame_global_flags *);
/* Input PCM is emphased PCM (for instance from one of the rarely /* Input PCM is emphased PCM (for instance from one of the rarely
emphased CDs), it is STRONGLY not recommended to use this, because emphased CDs), it is STRONGLY not recommended to use this, because
psycho does not take it into account, and last but not least many decode rs psycho does not take it into account, and last but not least many decode rs
ignore these bits */ ignore these bits */
int CDECL lame_set_emphasis(lame_global_flags *, int); int CDECL lame_set_emphasis(lame_global_flags *, int);
int CDECL lame_get_emphasis(const lame_global_flags *); int CDECL lame_get_emphasis(const lame_global_flags *);
/************************************************************************/ /************************************************************************/
/* internal variables, cannot be set... */ /* internal variables, cannot be set... */
/* provided because they may be of use to calling application */ /* provided because they may be of use to calling application */
/************************************************************************/ /************************************************************************/
// version 0=MPEG-2 1=MPEG-1 (2=MPEG-2.5) /* version 0=MPEG-2 1=MPEG-1 (2=MPEG-2.5) */
int CDECL lame_get_version(const lame_global_flags *); int CDECL lame_get_version(const lame_global_flags *);
// encoder delay /* encoder delay */
int CDECL lame_get_encoder_delay(const lame_global_flags *); int CDECL lame_get_encoder_delay(const lame_global_flags *);
// padding appended to the input to make sure decoder can fully decode /*
// all input. Note that this value can only be calculated during the padding appended to the input to make sure decoder can fully decode
// call to lame_encoder_flush(). Before lame_encoder_flush() has all input. Note that this value can only be calculated during the
// been called, the value of encoder_padding = 0. call to lame_encoder_flush(). Before lame_encoder_flush() has
been called, the value of encoder_padding = 0.
*/
int CDECL lame_get_encoder_padding(const lame_global_flags *); int CDECL lame_get_encoder_padding(const lame_global_flags *);
// size of MPEG frame /* size of MPEG frame */
int CDECL lame_get_framesize(const lame_global_flags *); int CDECL lame_get_framesize(const lame_global_flags *);
// number of PCM samples buffered, but not yet encoded to mp3 data. /* number of PCM samples buffered, but not yet encoded to mp3 data. */
int CDECL lame_get_mf_samples_to_encode( const lame_global_flags* gfp ); int CDECL lame_get_mf_samples_to_encode( const lame_global_flags* gfp );
// size (bytes) of mp3 data buffered, but not yet encoded. /*
// this is the number of bytes which would be output by a call to size (bytes) of mp3 data buffered, but not yet encoded.
// lame_encode_flush_nogap. NOTE: lame_encode_flush() will return this is the number of bytes which would be output by a call to
// more bytes than this because it will encode the reamining buffered lame_encode_flush_nogap. NOTE: lame_encode_flush() will return
// PCM samples before flushing the mp3 buffers. more bytes than this because it will encode the reamining buffered
PCM samples before flushing the mp3 buffers.
*/
int CDECL lame_get_size_mp3buffer( const lame_global_flags* gfp ); int CDECL lame_get_size_mp3buffer( const lame_global_flags* gfp );
// number of frames encoded so far /* number of frames encoded so far */
int CDECL lame_get_frameNum(const lame_global_flags *); int CDECL lame_get_frameNum(const lame_global_flags *);
// lame's estimate of the total number of frames to be encoded /*
// only valid if calling program set num_samples lame's estimate of the total number of frames to be encoded
only valid if calling program set num_samples
*/
int CDECL lame_get_totalframes(const lame_global_flags *); int CDECL lame_get_totalframes(const lame_global_flags *);
/* /*
* REQUIRED: * REQUIRED:
* sets more internal configuration based on data provided above. * sets more internal configuration based on data provided above.
* returns -1 if something failed. * returns -1 if something failed.
*/ */
int CDECL lame_init_params(lame_global_flags * const ); int CDECL lame_init_params(lame_global_flags * const );
/* /*
skipping to change at line 685 skipping to change at line 725
const lame_global_flags *const gfp, const lame_global_flags *const gfp,
int bitrate_kbps [14] ); int bitrate_kbps [14] );
void CDECL lame_stereo_mode_hist( void CDECL lame_stereo_mode_hist(
const lame_global_flags *const gfp, const lame_global_flags *const gfp,
int stereo_mode_count[4] ); int stereo_mode_count[4] );
void CDECL lame_bitrate_stereo_mode_hist ( void CDECL lame_bitrate_stereo_mode_hist (
const lame_global_flags * const gfp, const lame_global_flags * const gfp,
int bitrate_stmode_count [14] [4] ); int bitrate_stmode_count [14] [4] );
void CDECL lame_block_type_hist (
const lame_global_flags * const gfp,
int btype_count[6] );
void CDECL lame_bitrate_block_type_hist (
const lame_global_flags * const gfp,
int bitrate_btype_count[14][6] );
/* /*
* OPTIONAL: * OPTIONAL:
* lame_mp3_tags_fid will append a Xing VBR tag to the mp3 file with file * lame_mp3_tags_fid will append a Xing VBR tag to the mp3 file with file
* pointer fid. These calls perform forward and backwards seeks, so make * pointer fid. These calls perform forward and backwards seeks, so make
* sure fid is a real file. Make sure lame_encode_flush has been called, * sure fid is a real file. Make sure lame_encode_flush has been called,
* and all mp3 data has been written to the file before calling this * and all mp3 data has been written to the file before calling this
* function. * function.
* NOTE: * NOTE:
* if VBR tags are turned off by the user, or turned off by LAME because * if VBR tags are turned off by the user, or turned off by LAME because
* the output is not a regular file, this call does nothing * the output is not a regular file, this call does nothing
skipping to change at line 746 skipping to change at line 794
/* this data is not currently computed by the mpglib routines */ /* this data is not currently computed by the mpglib routines */
int framenum; /* frames decoded counter */ int framenum; /* frames decoded counter */
} mp3data_struct; } mp3data_struct;
/* required call to initialize decoder */ /* required call to initialize decoder */
int CDECL lame_decode_init(void); int CDECL lame_decode_init(void);
/********************************************************************* /*********************************************************************
* input 1 mp3 frame, output (maybe) pcm data. * input 1 mp3 frame, output (maybe) pcm data.
* lame_decode() return code: *
* -1: error * nout = lame_decode(mp3buf,len,pcm_l,pcm_r);
* 0: need more data *
* n>0: size of pcm output * input:
* len : number of bytes of mp3 data in mp3buf
* mp3buf[len] : mp3 data to be decoded
*
* output:
* nout: -1 : decoding error
* 0 : need more data before we can complete the decode
* >0 : returned 'nout' samples worth of data in pcm_l,pcm_r
* pcm_l[nout] : left channel data
* pcm_r[nout] : right channel data
*
*********************************************************************/ *********************************************************************/
int CDECL lame_decode( int CDECL lame_decode(
unsigned char * mp3buf, unsigned char * mp3buf,
int len, int len,
short pcm_l[], short pcm_l[],
short pcm_r[] ); short pcm_r[] );
/* same as lame_decode, and also returns mp3 header data */ /* same as lame_decode, and also returns mp3 header data */
int CDECL lame_decode_headers( int CDECL lame_decode_headers(
unsigned char* mp3buf, unsigned char* mp3buf,
skipping to change at line 791 skipping to change at line 849
from VBR Info tag, (-1 if no info tag was found) */ from VBR Info tag, (-1 if no info tag was found) */
int CDECL lame_decode1_headersB( int CDECL lame_decode1_headersB(
unsigned char* mp3buf, unsigned char* mp3buf,
int len, int len,
short pcm_l[], short pcm_l[],
short pcm_r[], short pcm_r[],
mp3data_struct* mp3data, mp3data_struct* mp3data,
int *enc_delay, int *enc_delay,
int *enc_padding ); int *enc_padding );
/* cleanup call to exit decoder */
int CDECL lame_decode_exit(void);
/********************************************************************* /*********************************************************************
* *
* id3tag stuff * id3tag stuff
* *
*********************************************************************/ *********************************************************************/
/* /*
* id3tag.h -- Interface to write ID3 version 1 and 2 tags. * id3tag.h -- Interface to write ID3 version 1 and 2 tags.
* *
* Copyright (C) 2000 Don Melton. * Copyright (C) 2000 Don Melton.
 End of changes. 65 change blocks. 
98 lines changed or deleted 158 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/