📄 set_get.c
字号:
* frame parameters *//* Mark as copyright protected. */intlame_set_copyright( lame_global_flags* gfp, int copyright ){ /* default = 0 (disabled) */ /* enforce disable/enable meaning, if we need more than two values we need to switch to an enum to have an apropriate representation of the possible meanings of the value */ if ( 0 > copyright || 1 < copyright ) return -1; gfp->copyright = copyright; return 0;}intlame_get_copyright( const lame_global_flags* gfp ){ assert( 0 <= gfp->copyright && 1 >= gfp->copyright ); return gfp->copyright;}/* Mark as original. */intlame_set_original( lame_global_flags* gfp, int original ){ /* default = 1 (enabled) */ /* enforce disable/enable meaning, if we need more than two values we need to switch to an enum to have an apropriate representation of the possible meanings of the value */ if ( 0 > original || 1 < original ) return -1; gfp->original = original; return 0;}intlame_get_original( const lame_global_flags* gfp ){ assert( 0 <= gfp->original && 1 >= gfp->original ); return gfp->original;}/* * error_protection. * Use 2 bytes from each frame for CRC checksum. */intlame_set_error_protection( lame_global_flags* gfp, int error_protection ){ /* default = 0 (disabled) */ /* enforce disable/enable meaning, if we need more than two values we need to switch to an enum to have an apropriate representation of the possible meanings of the value */ if ( 0 > error_protection || 1 < error_protection ) return -1; gfp->error_protection = error_protection; return 0;}intlame_get_error_protection( const lame_global_flags* gfp ){ assert( 0 <= gfp->error_protection && 1 >= gfp->error_protection ); return gfp->error_protection;}/* * padding_type. * PAD_NO = pad no frames * PAD_ALL = pad all frames * PAD_ADJUST = adjust padding */intlame_set_padding_type( lame_global_flags* gfp, Padding_type padding_type ){ return 0;}Padding_typelame_get_padding_type( const lame_global_flags* gfp ){ return PAD_ADJUST;}/* MP3 'private extension' bit. Meaningless. */intlame_set_extension( lame_global_flags* gfp, int extension ){ /* default = 0 (disabled) */ /* enforce disable/enable meaning, if we need more than two values we need to switch to an enum to have an apropriate representation of the possible meanings of the value */ if ( 0 > extension || 1 < extension ) return -1; gfp->extension = extension; return 0;}intlame_get_extension( const lame_global_flags* gfp ){ assert( 0 <= gfp->extension && 1 >= gfp->extension ); return gfp->extension;}/* Enforce strict ISO compliance. */intlame_set_strict_ISO( lame_global_flags* gfp, int strict_ISO ){ /* default = 0 (disabled) */ /* enforce disable/enable meaning, if we need more than two values we need to switch to an enum to have an apropriate representation of the possible meanings of the value */ if ( 0 > strict_ISO || 1 < strict_ISO ) return -1; gfp->strict_ISO = strict_ISO; return 0;}intlame_get_strict_ISO( const lame_global_flags* gfp ){ assert( 0 <= gfp->strict_ISO && 1 >= gfp->strict_ISO ); return gfp->strict_ISO;} /******************************************************************** * quantization/noise shaping ***********************************************************************//* Disable the bit reservoir. For testing only. */intlame_set_disable_reservoir( lame_global_flags* gfp, int disable_reservoir ){ /* default = 0 (disabled) */ /* enforce disable/enable meaning, if we need more than two values we need to switch to an enum to have an apropriate representation of the possible meanings of the value */ if ( 0 > disable_reservoir || 1 < disable_reservoir ) return -1; gfp->disable_reservoir = disable_reservoir; return 0;}intlame_get_disable_reservoir( const lame_global_flags* gfp ){ assert( 0 <= gfp->disable_reservoir && 1 >= gfp->disable_reservoir ); return gfp->disable_reservoir;}intlame_set_experimentalX( lame_global_flags* gfp, int experimentalX ){ lame_set_quant_comp( gfp, experimentalX); lame_set_quant_comp_short( gfp, experimentalX); return 0;}intlame_get_experimentalX( const lame_global_flags* gfp ){ return lame_get_quant_comp( gfp);}/* Select a different "best quantization" function. default = 0 */intlame_set_quant_comp( lame_global_flags* gfp, int quant_type ){ gfp->quant_comp = quant_type; return 0;}intlame_get_quant_comp( const lame_global_flags* gfp ){ return gfp->quant_comp;}/* Select a different "best quantization" function. default = 0 */intlame_set_quant_comp_short( lame_global_flags* gfp, int quant_type ){ gfp->quant_comp_short = quant_type; return 0;}intlame_get_quant_comp_short( const lame_global_flags* gfp ){ return gfp->quant_comp_short;}/* Another experimental option. For testing only. */intlame_set_experimentalY( lame_global_flags* gfp, int experimentalY ){ gfp->experimentalY = experimentalY; return 0;}intlame_get_experimentalY( const lame_global_flags* gfp ){ return gfp->experimentalY;}intlame_set_experimentalZ( lame_global_flags* gfp, int experimentalZ ){ return 0;}intlame_get_experimentalZ( const lame_global_flags* gfp ){ return 0;}/* Naoki's psycho acoustic model. */intlame_set_exp_nspsytune( lame_global_flags* gfp, int exp_nspsytune ){ /* default = 0 (disabled) */ gfp->exp_nspsytune = exp_nspsytune; return 0;}intlame_get_exp_nspsytune( const lame_global_flags* gfp ){ return gfp->exp_nspsytune;}intlame_set_exp_nspsytune2_int( lame_global_flags* gfp, int adr,int val){ int ret = gfp->exp_nspsytune2.integer[adr]; gfp->exp_nspsytune2.integer[adr] = val; return ret;}floatlame_set_exp_nspsytune2_real( lame_global_flags* gfp, int adr,float val){ float ret = gfp->exp_nspsytune2.real[adr]; gfp->exp_nspsytune2.real[adr] = val; return ret;}void *lame_set_exp_nspsytune2_pointer( lame_global_flags* gfp, int adr,void *val){ void *ret = gfp->exp_nspsytune2.pointer[adr]; gfp->exp_nspsytune2.pointer[adr] = val; return ret;}/******************************************************************** * VBR control ***********************************************************************//* Types of VBR. default = vbr_off = CBR */intlame_set_VBR( lame_global_flags* gfp, vbr_mode VBR ){ if( 0 > VBR || vbr_max_indicator <= VBR ) return -1; /* Unknown VBR mode! */ gfp->VBR = VBR; return 0;}vbr_modelame_get_VBR( const lame_global_flags* gfp ){ assert( 0 <= gfp->VBR && vbr_max_indicator > gfp->VBR ); return gfp->VBR;}/* * VBR quality level. * 0 = highest * 9 = lowest */intlame_set_VBR_q( lame_global_flags* gfp, int VBR_q ){ /* XXX: This should be an enum */ /* to whoever added this note: why should it be an enum? do you want to call a specific setting by name? say VBR quality level red? */ /* No, but VBR_Q_HIGHEST, VBR_Q_HIGH, ..., VBR_Q_MID, ... VBR_Q_LOW, VBR_Q_LOWEST (or something like that )and a VBR_Q_DEFAULT, which aliases the default setting of e.g. VBR_Q_MID. */ if( 0 > VBR_q || 10 <= VBR_q ) return -1; /* Unknown VBR quality level! */ gfp->VBR_q = VBR_q;/* lame_set_ATHcurve(gfp, VBR_q);*/ return 0;}intlame_get_VBR_q( const lame_global_flags* gfp ){ assert( 0 <= gfp->VBR_q && 10 > gfp->VBR_q ); return gfp->VBR_q;}/* Ignored except for VBR = vbr_abr (ABR mode) */intlame_set_VBR_mean_bitrate_kbps( lame_global_flags* gfp, int VBR_mean_bitrate_kbps ){ gfp->VBR_mean_bitrate_kbps = VBR_mean_bitrate_kbps; return 0;}intlame_get_VBR_mean_bitrate_kbps( const lame_global_flags* gfp ){ return gfp->VBR_mean_bitrate_kbps;}intlame_set_VBR_min_bitrate_kbps( lame_global_flags* gfp, int VBR_min_bitrate_kbps ){ gfp->VBR_min_bitrate_kbps = VBR_min_bitrate_kbps; return 0;}intlame_get_VBR_min_bitrate_kbps( const lame_global_flags* gfp ){ return gfp->VBR_min_bitrate_kbps;}intlame_set_VBR_max_bitrate_kbps( lame_global_flags* gfp, int VBR_max_bitrate_kbps ){ gfp->VBR_max_bitrate_kbps = VBR_max_bitrate_kbps; return 0;}intlame_get_VBR_max_bitrate_kbps( const lame_global_flags* gfp ){ return gfp->VBR_max_bitrate_kbps;}/* * Strictly enforce VBR_min_bitrate. * Normally it will be violated for analog silence. */intlame_set_VBR_hard_min( lame_global_flags* gfp, int VBR_hard_min ){ /* default = 0 (disabled) */ /* enforce disable/enable meaning, if we need more than two values we need to switch to an enum to have an apropriate representation of the possible meanings of the value */ if ( 0 > VBR_hard_min || 1 < VBR_hard_min ) return -1; gfp->VBR_hard_min = VBR_hard_min; return 0;}intlame_get_VBR_hard_min( const lame_global_flags* gfp ){ assert( 0 <= gfp->VBR_hard_min && 1 >= gfp->VBR_hard_min ); return gfp->VBR_hard_min;}/******************************************************************** * Filtering control ***********************************************************************//* * Freqency in Hz to apply lowpass. * 0 = default = lame chooses * -1 = disabled */intlame_set_lowpassfreq( lame_global_flags* gfp, int lowpassfreq ){ gfp->lowpassfreq = lowpassfreq; return 0;}intlame_get_lowpassfreq( const lame_global_flags* gfp ){ return gfp->lowpassfreq;}/* * Width of transition band (in Hz). * default = one polyphase filter band */intlame_set_lowpasswidth( lame_global_flags* gfp, int lowpasswidth ){ gfp->lowpasswidth = lowpasswidth; return 0;}intlame_get_lowpasswidth( const lame_global_flags* gfp ){ return gfp->lowpasswidth;}/* * Frequency in Hz to apply highpass. * 0 = default = lame chooses * -1 = disabled */intlame_set_highpassfreq( lame_global_flags* gfp, int highpassfreq ){ gfp->highpassfreq = highpassfreq; return 0;}intlame_get_highpassfreq( const lame_global_flags* gfp ){ return gfp->highpassfreq;}/* * Width of transition band (in Hz). * default = one polyphase filter band */intlame_set_highpasswidth( lame_global_flags* gfp, int highpasswidth ){ gfp->highpasswidth = highpasswidth; return 0;}intlame_get_highpasswidth( const lame_global_flags* gfp ){ return gfp->highpasswidth;}/* * psycho acoustics and other arguments which you should not change * unless you know what you are doing */intlame_set_psy_model( lame_global_flags* gfp, int psy ){ gfp->psymodel = psy; return 0;}intlame_get_psy_model( const lame_global_flags* gfp ){ return gfp->psymodel;}/* Adjust masking values. */intlame_set_maskingadjust( lame_global_flags* gfp, float adjust ){ gfp->maskingadjust = adjust; return 0;}floatlame_get_maskingadjust( const lame_global_flags* gfp ){ return gfp->maskingadjust;}intlame_set_maskingadjust_short( lame_global_flags* gfp, float adjust ){ gfp->maskingadjust_short = adjust; return 0;}floatlame_get_maskingadjust_short( const lame_global_flags* gfp ){ return gfp->maskingadjust_short;}/* Only use ATH for masking. */intlame_set_ATHonly( lame_global_flags* gfp, int ATHonly ){ gfp->ATHonly = ATHonly; return 0;}intlame_get_ATHonly( const lame_global_flags* gfp ){ return gfp->ATHonly;}/* Only use ATH for short blocks. */intlame_set_ATHshort( lame_global_flags* gfp, int ATHshort ){ gfp->ATHshort = ATHshort; return 0;}intlame_get_ATHshort( const lame_global_flags* gfp ){
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -