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

📄 set_get.c

📁 音频编码
💻 C
📖 第 1 页 / 共 3 页
字号:
    return gfp->ATHshort;}/* Disable ATH. */intlame_set_noATH( lame_global_flags*  gfp,                int                 noATH ){    gfp->noATH = noATH;    return 0;}intlame_get_noATH( const lame_global_flags*  gfp ){    return gfp->noATH;}/* Select ATH formula. */intlame_set_ATHtype( lame_global_flags*  gfp,                  int                 ATHtype ){    /* XXX: ATHtype should be converted to an enum. */    gfp->ATHtype = ATHtype;    return 0;}intlame_get_ATHtype( const lame_global_flags*  gfp ){    return gfp->ATHtype;}/* Select ATH formula 4 shape. */intlame_set_ATHcurve( lame_global_flags*  gfp,                   float ATHcurve ){    gfp->ATHcurve = ATHcurve;    return 0;}floatlame_get_ATHcurve( const lame_global_flags*  gfp ){    return gfp->ATHcurve;}/* Lower ATH by this many db. */intlame_set_ATHlower( lame_global_flags*  gfp,                   float               ATHlower ){    gfp->ATHlower = -ATHlower / 10.0;    return 0;}floatlame_get_ATHlower( const lame_global_flags*  gfp ){    return -gfp->ATHlower * 10.0;}/* Select ATH adaptive adjustment scheme. */intlame_set_athaa_type( lame_global_flags*  gfp,                      int                athaa_type ){    gfp->athaa_type = athaa_type;    return 0;}intlame_get_athaa_type( const lame_global_flags*  gfp ){    return gfp->athaa_type;}/* Select the loudness approximation used by the ATH adaptive auto-leveling. */intlame_set_athaa_loudapprox( lame_global_flags*  gfp,                           int                 athaa_loudapprox ){    ERRORF(gfp->internal_flags, "--athaa-loudapprox is obsolete\n");    return 0;}intlame_get_athaa_loudapprox( const lame_global_flags*  gfp ){    /* obsolete, the type known under number 2 is the only survival */    return 2;}/* Adjust (in dB) the point below which adaptive ATH level adjustment occurs. */intlame_set_athaa_sensitivity( lame_global_flags*  gfp,                            float               athaa_sensitivity ){    gfp->athaa_sensitivity = athaa_sensitivity;    return 0;}floatlame_get_athaa_sensitivity( const lame_global_flags*  gfp ){    return gfp->athaa_sensitivity;}/* Predictability limit (ISO tonality formula) */intlame_set_cwlimit( lame_global_flags*  gfp,                  int                 cwlimit ){    gfp->cwlimit = cwlimit;    return 0;}intlame_get_cwlimit( const lame_global_flags*  gfp ){    return gfp->cwlimit;}/* * Allow blocktypes to differ between channels. * default: *  0 for jstereo => block types coupled *  1 for stereo  => block types may differ */intlame_set_allow_diff_short( lame_global_flags*  gfp,                           int                 allow_diff_short ){    gfp->short_blocks =         allow_diff_short ? short_block_allowed : short_block_coupled;    return 0;}intlame_get_allow_diff_short( const lame_global_flags*  gfp ){    if ( gfp->short_blocks == short_block_allowed )         return 1; /* short blocks allowed to differ */    else         return 0; /* not set, dispensed, forced or coupled */}/* Use temporal masking effect */intlame_set_useTemporal( lame_global_flags*  gfp,                      int                 useTemporal ){    /* 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 > useTemporal || 1 < useTemporal )        return -1;    gfp->useTemporal = useTemporal;    return 0;}intlame_get_useTemporal( const lame_global_flags*  gfp ){    assert( 0 <= gfp->useTemporal && 1 >= gfp->useTemporal );    return gfp->useTemporal;}/* Use inter-channel masking effect */intlame_set_interChRatio( lame_global_flags*  gfp,			float               ratio ){    /* default = 0.0 (no inter-channel maskin) */    if (! (0 <= ratio && ratio <= 1.0))        return -1;    gfp->interChRatio = ratio;    return 0;}floatlame_get_interChRatio( const lame_global_flags*  gfp ){    assert( (0 <= gfp->interChRatio && gfp->interChRatio <= 1.0) ||        (gfp->interChRatio == -1));    return gfp->interChRatio;}/* Use pseudo substep shaping method */intlame_set_substep( lame_global_flags*  gfp,		  int                 method ){    lame_internal_flags *gfc = gfp->internal_flags;    /* default = 0.0 (no substep noise shaping) */    if (! (0 <= method && method <= 7))        return -1;    gfc->substep_shaping = method;    return 0;}intlame_get_substep(const lame_global_flags*  gfp ){    lame_internal_flags *gfc = gfp->internal_flags;    assert(0 <= gfc->substep_shaping && gfc->substep_shaping <= 7);    return gfc->substep_shaping;}/* scalefactors scale */intlame_set_sfscale( lame_global_flags* gfp,                int val ){    if (val)        gfp->internal_flags->noise_shaping = 2;    else        gfp->internal_flags->noise_shaping = 1;    return 0;}intlame_get_sfscale(const lame_global_flags*  gfp ){    return (gfp->internal_flags->noise_shaping == 2);}/* subblock gain */intlame_set_subblock_gain(lame_global_flags *gfp, int sbgain){    gfp->internal_flags->subblock_gain = sbgain;    return sbgain;}intlame_get_subblock_gain(const lame_global_flags * gfp){    return gfp->internal_flags->subblock_gain;}/* Disable short blocks. */intlame_set_no_short_blocks( lame_global_flags*  gfp,                          int                 no_short_blocks ){    /* 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 > no_short_blocks || 1 < no_short_blocks )        return -1;    gfp->short_blocks =         no_short_blocks ? short_block_dispensed : short_block_allowed;    return 0;}intlame_get_no_short_blocks( const lame_global_flags*  gfp ){    switch ( gfp->short_blocks ) {    default:    case short_block_not_set:   return -1;    case short_block_dispensed: return 1;    case short_block_allowed:    case short_block_coupled:    case short_block_forced:    return 0;    }}/* Force short blocks. */intlame_set_force_short_blocks( lame_global_flags*  gfp,                          int                 short_blocks ){    /* 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 > short_blocks || 1 < short_blocks )        return -1;    if (short_blocks == 1)        gfp->short_blocks = short_block_forced;    else if (gfp->short_blocks == short_block_forced)         gfp->short_blocks = short_block_allowed;    return 0;}intlame_get_force_short_blocks( const lame_global_flags*  gfp ){    switch ( gfp->short_blocks ) {    default:    case short_block_not_set:   return -1;    case short_block_dispensed:     case short_block_allowed:    case short_block_coupled:   return 0;    case short_block_forced:    return 1;    }}intlame_set_short_threshold_lrm( lame_global_flags*  gfp,			  float lrm){    lame_internal_flags *gfc = gfp->internal_flags;    gfc->nsPsy.attackthre = lrm;    return 0;}floatlame_get_short_threshold_lrm( const lame_global_flags*  gfp){    lame_internal_flags *gfc = gfp->internal_flags;    return gfc->nsPsy.attackthre;}intlame_set_short_threshold_s( lame_global_flags*  gfp,			  float s){    lame_internal_flags *gfc = gfp->internal_flags;    gfc->nsPsy.attackthre_s = s;    return 0;}floatlame_get_short_threshold_s( const lame_global_flags*  gfp){    lame_internal_flags *gfc = gfp->internal_flags;    return gfc->nsPsy.attackthre_s;}intlame_set_short_threshold( lame_global_flags*  gfp,			  float lrm, float s){    lame_set_short_threshold_lrm(gfp, lrm);        lame_set_short_threshold_s(gfp, s);        return 0;}/* * 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 */intlame_set_emphasis( lame_global_flags*  gfp,                   int                 emphasis ){    /* XXX: emphasis should be converted to an enum */    if ( 0 > emphasis || 4 <= emphasis )        return -1;    gfp->emphasis = emphasis;    return 0;}intlame_get_emphasis( const lame_global_flags*  gfp ){    assert( 0 <= gfp->emphasis && 4 > gfp->emphasis );    return gfp->emphasis;}/***************************************************************//* internal variables, cannot be set...                        *//* provided because they may be of use to calling application  *//***************************************************************//* MPEG version. *  0 = MPEG-2 *  1 = MPEG-1 * (2 = MPEG-2.5)     */intlame_get_version( const lame_global_flags* gfp ){    return gfp->version;}/* Encoder delay. */intlame_get_encoder_delay( const lame_global_flags*  gfp ){    return gfp->encoder_delay;}/* padding added to the end of the input */intlame_get_encoder_padding( const lame_global_flags*  gfp ){    return gfp->encoder_padding;}/* Size of MPEG frame. */intlame_get_framesize( const lame_global_flags*  gfp ){    return gfp->framesize;}/* Number of frames encoded so far. */intlame_get_frameNum( const lame_global_flags*  gfp ){    return gfp->frameNum;}intlame_get_mf_samples_to_encode( const lame_global_flags*  gfp ){    lame_internal_flags *gfc = gfp->internal_flags;    return gfc->mf_samples_to_encode;}int CDECL lame_get_size_mp3buffer( const lame_global_flags*  gfp ){    int size;    compute_flushbits(gfp,&size);    return size;}intlame_get_RadioGain( const lame_global_flags*  gfp ){    lame_internal_flags *gfc = gfp->internal_flags;    return gfc->RadioGain;}intlame_get_AudiophileGain( const lame_global_flags*  gfp ){    lame_internal_flags *gfc = gfp->internal_flags;    return gfc->AudiophileGain;}floatlame_get_PeakSample( const lame_global_flags*  gfp ){    lame_internal_flags *gfc = gfp->internal_flags;    return (float)gfc->PeakSample;}intlame_get_noclipGainChange( const lame_global_flags* gfp ){    lame_internal_flags *gfc = gfp->internal_flags;    return gfc->noclipGainChange; }floatlame_get_noclipScale( const lame_global_flags* gfp ){    lame_internal_flags *gfc = gfp->internal_flags;    return gfc->noclipScale; }/* * LAME's estimate of the total number of frames to be encoded. * Only valid if calling program set num_samples. */intlame_get_totalframes( const lame_global_flags*  gfp ){    int totalframes;    /* estimate based on user set num_samples: */    totalframes =        2 + ((double)gfp->num_samples * gfp->out_samplerate) /               ((double)gfp->in_samplerate * gfp->framesize);    /* check to see if we underestimated totalframes */    /*    if (totalframes < gfp->frameNum) */    /*        totalframes = gfp->frameNum; */    return totalframes;}intlame_set_preset( lame_global_flags*  gfp, int preset ){    gfp->preset = preset;    return apply_preset(gfp, preset, 1);}int lame_set_asm_optimizations( lame_global_flags*  gfp, int optim, int mode){    mode = (mode == 1? 1 : 0);    switch (optim){        case MMX: {            gfp->asm_optimizations.mmx = mode;            return optim;        }        case AMD_3DNOW: {            gfp->asm_optimizations.amd3dnow = mode;            return optim;        }        case SSE: {            gfp->asm_optimizations.sse = mode;            return optim;        }        default: return optim;    }}/*UNDOCUMENTED, experimental settings.  These routines are not prototypedin lame.h.  You should not use them, they are experimental and maychange.  *//* *  just another daily changing developer switch   */void lame_set_tune( lame_global_flags* gfp, float val ) {    gfp->tune_value_a = val;    gfp->tune = 1;}void lame_set_ms_sparsing( lame_global_flags* gfp, int val ){    gfp->sparsing = val;}int lame_get_ms_sparsing( lame_global_flags* gfp ){    return gfp->sparsing;}void lame_set_ms_sparse_low( lame_global_flags* gfp, float val ){    gfp->sparse_low = val;}float lame_get_ms_sparse_low( lame_global_flags* gfp ){    return gfp->sparse_low;}void lame_set_ms_sparse_high( lame_global_flags* gfp, float val ){    gfp->sparse_high = val;}float lame_get_ms_sparse_high( lame_global_flags* gfp ){    return gfp->sparse_high;}/* Custom msfix hack */voidlame_set_msfix( lame_global_flags*  gfp, double msfix ){    /* default = 0 */    gfp->msfix = msfix;}floatlame_get_msfix( const lame_global_flags*  gfp ){    return gfp->msfix;}intlame_set_preset_expopts( lame_global_flags*  gfp, int preset_expopts ){    return 0;}intlame_set_preset_notune( lame_global_flags*  gfp, int preset_notune ){    return 0;}

⌨️ 快捷键说明

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