⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lame.h

📁 音频编码
💻 H
📖 第 1 页 / 共 3 页
字号:
 ***********************************************************************//* disable the bit reservoir. For testing only. default=0 */int CDECL lame_set_disable_reservoir(lame_global_flags *, int);int CDECL lame_get_disable_reservoir(const lame_global_flags *);/* select a different "best quantization" function. default=0  */int CDECL lame_set_quant_comp(lame_global_flags *, int);int CDECL lame_get_quant_comp(const lame_global_flags *);int CDECL lame_set_quant_comp_short(lame_global_flags *, int);int CDECL lame_get_quant_comp_short(const lame_global_flags *);int CDECL lame_set_experimentalX(lame_global_flags *, int); /* compatibility*/int CDECL lame_get_experimentalX(const lame_global_flags *);/* another experimental option.  for testing only */int CDECL lame_set_experimentalY(lame_global_flags *, int);int CDECL lame_get_experimentalY(const lame_global_flags *);/* another experimental option.  for testing only */int CDECL lame_set_experimentalZ(lame_global_flags *, int);int CDECL lame_get_experimentalZ(const lame_global_flags *);/* Naoki's psycho acoustic model.  default=0 */int CDECL lame_set_exp_nspsytune(lame_global_flags *, int);int CDECL lame_get_exp_nspsytune(const lame_global_flags *);void CDECL lame_set_msfix(lame_global_flags *, double);float CDECL lame_get_msfix(const lame_global_flags *);int lame_set_exp_nspsytune2_int( lame_global_flags*, int, int);float lame_set_exp_nspsytune2_real( lame_global_flags*, int, float);void * lame_set_exp_nspsytune2_pointer( lame_global_flags*, int, void *);/******************************************************************** * VBR control ***********************************************************************//* Types of VBR.  default = vbr_off = CBR */int CDECL lame_set_VBR(lame_global_flags *, vbr_mode);vbr_mode CDECL lame_get_VBR(const lame_global_flags *);/* VBR quality level.  0=highest  9=lowest  */int CDECL lame_set_VBR_q(lame_global_flags *, int);int CDECL lame_get_VBR_q(const lame_global_flags *);/* Ignored except for VBR=vbr_abr (ABR mode) */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_set_VBR_min_bitrate_kbps(lame_global_flags *, int);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_get_VBR_max_bitrate_kbps(const lame_global_flags *);/*  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_get_VBR_hard_min(const lame_global_flags *);/* for preset */int CDECL lame_set_preset_expopts(lame_global_flags *, int);/******************************************************************** * Filtering control ***********************************************************************//* freq in Hz to apply lowpass. Default = 0 = lame chooses.  -1 = disabled */int CDECL lame_set_lowpassfreq(lame_global_flags *, int);int CDECL lame_get_lowpassfreq(const lame_global_flags *);/* width of transition band, in Hz.  Default = one polyphase filter band */int CDECL lame_set_lowpasswidth(lame_global_flags *, int);int CDECL lame_get_lowpasswidth(const lame_global_flags *);/* freq in Hz to apply highpass. Default = 0 = lame chooses.  -1 = disabled */int CDECL lame_set_highpassfreq(lame_global_flags *, int);int CDECL lame_get_highpassfreq(const lame_global_flags *);/* width of transition band, in Hz.  Default = one polyphase filter band */int CDECL lame_set_highpasswidth(lame_global_flags *, int);int CDECL lame_get_highpasswidth(const lame_global_flags *);/******************************************************************** * psycho acoustics and other arguments which you should not change  * unless you know what you are doing ***********************************************************************//* only use ATH for masking */int CDECL lame_set_ATHonly(lame_global_flags *, int);int CDECL lame_get_ATHonly(const lame_global_flags *);/* only use ATH for short blocks */int CDECL lame_set_ATHshort(lame_global_flags *, int);int CDECL lame_get_ATHshort(const lame_global_flags *);/* disable ATH */int CDECL lame_set_noATH(lame_global_flags *, int);int CDECL lame_get_noATH(const lame_global_flags *);/* select ATH formula */int CDECL lame_set_ATHtype(lame_global_flags *, int);int CDECL lame_get_ATHtype(const lame_global_flags *);/* lower ATH by this many db */int CDECL lame_set_ATHlower(lame_global_flags *, float);float CDECL lame_get_ATHlower(const lame_global_flags *);/* select ATH adaptive adjustment type */int CDECL lame_set_athaa_type( lame_global_flags *, int);int CDECL lame_get_athaa_type( const lame_global_flags *);/* select the loudness approximation used by the ATH adaptive auto-leveling  */int CDECL lame_set_athaa_loudapprox( lame_global_flags *, int);int CDECL lame_get_athaa_loudapprox( const lame_global_flags *);/* adjust (in dB) the point below which adaptive ATH level adjustment occurs */int CDECL lame_set_athaa_sensitivity( lame_global_flags *, float);float CDECL lame_get_athaa_sensitivity( const lame_global_flags* );/* predictability limit (ISO tonality formula) */int CDECL lame_set_cwlimit(lame_global_flags *, int);int CDECL lame_get_cwlimit(const lame_global_flags *);/*  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_get_allow_diff_short(const lame_global_flags *);/* use temporal masking effect (default = 1) */int CDECL lame_set_useTemporal(lame_global_flags *, int);int CDECL lame_get_useTemporal(const lame_global_flags *);/* use temporal masking effect (default = 1) */int CDECL lame_set_interChRatio(lame_global_flags *, float);float CDECL lame_get_interChRatio(const lame_global_flags *);/* disable short blocks */int CDECL lame_set_no_short_blocks(lame_global_flags *, int);int CDECL lame_get_no_short_blocks(const lame_global_flags *);/* force short blocks */int CDECL lame_set_force_short_blocks(lame_global_flags *, int);int CDECL lame_get_force_short_blocks(const lame_global_flags *);/* Input PCM is emphased PCM (for instance from one of the rarely   emphased CDs), it is STRONGLY not recommended to use this, because   psycho does not take it into account, and last but not least many decoders   ignore these bits */int CDECL lame_set_emphasis(lame_global_flags *, int);int CDECL lame_get_emphasis(const lame_global_flags *);/************************************************************************//* internal variables, cannot be set...                                 *//* provided because they may be of use to calling application           *//************************************************************************//* version  0=MPEG-2  1=MPEG-1  (2=MPEG-2.5)     */int CDECL lame_get_version(const lame_global_flags *);/* encoder delay   */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  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 *);/* size of MPEG frame */int CDECL lame_get_framesize(const lame_global_flags *);/* 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 );/*  size (bytes) of mp3 data buffered, but not yet encoded.  this is the number of bytes which would be output by a call to   lame_encode_flush_nogap.  NOTE: lame_encode_flush() will return  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 );/* number of frames encoded so far */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*/int CDECL lame_get_totalframes(const lame_global_flags *);/* RadioGain value. Multiplied by 10 and rounded to the nearest. */int CDECL lame_get_RadioGain(const lame_global_flags *);/* AudiophileGain value. Multipled by 10 and rounded to the nearest. */int CDECL lame_get_AudiophileGain(const lame_global_flags *);/* the peak sample */float CDECL lame_get_PeakSample(const lame_global_flags *);/* is decoding on the fly performed */int CDECL lame_get_decode_on_the_fly(const lame_global_flags *);/* is ReplayGain analysis performed */int CDECL lame_get_findReplayGain(const lame_global_flags *);/* Gain change required for preventing clipping. The value is correct only if    peak sample searching was enabled. If negative then the waveform    already does not clip. The value is multiplied by 10 and rounded up. */int CDECL lame_get_noclipGainChange(const lame_global_flags *);/* user-specified scale factor required for preventing clipping. Value is    correct only if peak sample searching was enabled and no user-specified   scaling was performed. If negative then either the waveform already does   not clip or the value cannot be determined */float CDECL lame_get_noclipScale(const lame_global_flags *);/* * REQUIRED: * sets more internal configuration based on data provided above. * returns -1 if something failed. */int CDECL lame_init_params(lame_global_flags * const );/* * OPTIONAL: * get the version number, in a string. of the form:   * "3.63 (beta)" or just "3.63".  */const char*  CDECL get_lame_version       ( void );const char*  CDECL get_lame_short_version ( void );const char*  CDECL get_lame_very_short_version ( void );const char*  CDECL get_psy_version        ( void );const char*  CDECL get_lame_url           ( void );/* * OPTIONAL: * get the version numbers in numerical form. */typedef struct {    /* generic LAME version */    int major;    int minor;    int alpha;               /* 0 if not an alpha version                  */    int beta;                /* 0 if not a beta version                    */    /* version of the psy model */    int psy_major;    int psy_minor;    int psy_alpha;           /* 0 if not an alpha version                  */    int psy_beta;            /* 0 if not a beta version                    */    /* compile time features */    const char *features;    /* Don't make assumptions about the contents! */} lame_version_t;void CDECL get_lame_version_numerical ( lame_version_t *const );/* * OPTIONAL: * print internal lame configuration to message handler */void CDECL lame_print_config(const lame_global_flags*  gfp);void CDECL lame_print_internals( const lame_global_flags *gfp);/* * input pcm data, output (maybe) mp3 frames. * This routine handles all buffering, resampling and filtering for you. *  * return code     number of bytes output in mp3buf. Can be 0  *                 -1:  mp3buf was too small *                 -2:  malloc() problem *                 -3:  lame_init_params() not called *                 -4:  psycho acoustic problems  * * The required mp3buf_size can be computed from num_samples,  * samplerate and encoding rate, but here is a worst case estimate: * * mp3buf_size in bytes = 1.25*num_samples + 7200 * * I think a tighter bound could be:  (mt, March 2000) * MPEG1: *    num_samples*(bitrate/8)/samplerate + 4*1152*(bitrate/8)/samplerate + 512 * MPEG2: *    num_samples*(bitrate/8)/samplerate + 4*576*(bitrate/8)/samplerate + 256 * * but test first if you use that! * * set mp3buf_size = 0 and LAME will not check if mp3buf_size is * large enough. * * NOTE: * if gfp->num_channels=2, but gfp->mode = 3 (mono), the L & R channels * will be averaged into the L channel before encoding only the L channel * This will overwrite the data in buffer_l[] and buffer_r[]. * */int CDECL lame_encode_buffer (        lame_global_flags*  gfp,           /* global context handle         */        const short int     buffer_l [],   /* PCM data for left channel     */        const short int     buffer_r [],   /* PCM data for right channel    */        const int           nsamples,      /* number of samples per channel */        unsigned char*      mp3buf,        /* pointer to encoded MP3 stream */        const int           mp3buf_size ); /* number of valid octets in this                                              stream                        *//* * as above, but input has L & R channel data interleaved. * NOTE:  * num_samples = number of samples in the L (or R) * channel, not the total number of samples in pcm[]   */int CDECL lame_encode_buffer_interleaved(        lame_global_flags*  gfp,           /* global context handlei        */        short int           pcm[],         /* PCM data for left and right                                              channel, interleaved          */        int                 num_samples,   /* number of samples per channel,                                              _not_ number of samples in                                              pcm[]                         */        unsigned char*      mp3buf,        /* pointer to encoded MP3 stream */        int                 mp3buf_size ); /* number of valid octets in this                                              stream                        *//* as lame_encode_buffer, but for 'float's. * !! NOTE: !! data must still be scaled to be in the same range as  * short int, +/- 32768   */int CDECL lame_encode_buffer_float(        lame_global_flags*  gfp,           /* global context handle         */        const float     buffer_l [],       /* PCM data for left channel     */        const float     buffer_r [],       /* PCM data for right channel    */        const int           nsamples,      /* number of samples per channel */        unsigned char*      mp3buf,        /* pointer to encoded MP3 stream */        const int           mp3buf_size ); /* number of valid octets in this                                              stream                        *//* as lame_encode_buffer, but for long's  * !! NOTE: !! data must still be scaled to be in the same range as  * short int, +/- 32768   * * This scaling was a mistake (doesn't allow one to exploit full * precision of type 'long'.  Use lame_encode_buffer_long2() instead. * */int CDECL lame_encode_buffer_long(        lame_global_flags*  gfp,           /* global context handle         */        const long     buffer_l [],       /* PCM data for left channel     */        const long     buffer_r [],       /* PCM data for right channel    */        const int           nsamples,      /* number of samples per channel */        unsigned char*      mp3buf,        /* pointer to encoded MP3 stream */        const int           mp3buf_size ); /* number of valid octets in this                                              stream                        */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -