📄 util.h
字号:
*/ int noise_shaping_amp; /* 0 = ISO model: amplify all distorted bands 1 = amplify within 50% of max (on db scale) 2 = amplify only most distorted band 3 = method 1 and refine with method 2 */ int substep_shaping; /* 0 = no substep 1 = use substep shaping at last step(VBR only) (not implemented yet) 2 = use substep inside loop 3 = use substep inside loop and last step */ int psymodel; /* 1 = gpsycho. 0 = none */ int noise_shaping_stop; /* 0 = stop at over=0, all scalefacs amplified or a scalefac has reached max value 1 = stop when all scalefacs amplified or a scalefac has reached max value 2 = stop when all scalefacs amplified */ int subblock_gain; /* 0 = no, 1 = yes */ int use_best_huffman; /* 0 = no. 1=outside loop 2=inside loop(slow) */ int full_outer_loop; /* 0 = stop early after 0 distortion found. 1 = full search */ /* variables used by lame.c */ Bit_stream_struc bs; III_side_info_t l3_side; FLOAT ms_ratio[2]; /* used for padding */ int padding; /* padding for the current frame? */ int frac_SpF; int slot_lag; /* optional ID3 tags, used in id3tag.c */ struct id3tag_spec tag_spec; uint16_t nMusicCRC; /* variables used by quantize.c */ int OldValue[2]; int CurrentStep[2]; FLOAT masking_lower; char bv_scf[576]; int pseudohalf[SFBMAX]; int sfb21_extra; /* will be set in lame_init_params */ int sparsing; FLOAT sparseA; FLOAT sparseB; /* variables used by util.c */ /* BPC = maximum number of filter convolution windows to precompute */#define BPC 320 sample_t *inbuf_old[2]; sample_t *blackfilt[2 * BPC + 1]; FLOAT itime[2]; int sideinfo_len; /* variables for newmdct.c */ FLOAT sb_sample[2][2][18][SBLIMIT]; FLOAT amp_filter[32]; /* variables for bitstream.c */ /* mpeg1: buffer=511 bytes smallest frame: 96-38(sideinfo)=58 * max number of frames in reservoir: 8 * mpeg2: buffer=255 bytes. smallest frame: 24-23bytes=1 * with VBR, if you are encoding all silence, it is possible to * have 8kbs/24khz frames with 1byte of data each, which means we need * to buffer up to 255 headers! */ /* also, max_header_buf has to be a power of two */#define MAX_HEADER_BUF 256#define MAX_HEADER_LEN 40 /* max size of header is 38 */ struct { int write_timing; int ptr; char buf[MAX_HEADER_LEN]; } header[MAX_HEADER_BUF]; int h_ptr; int w_ptr; int ancillary_flag; /* variables for reservoir.c */ int ResvSize; /* in bits */ int ResvMax; /* in bits */ scalefac_struct scalefac_band; /* DATA FROM PSYMODEL.C *//* The static variables "r", "phi_sav", "new", "old" and "oldest" have *//* to be remembered for the unpredictability measure. For "r" and *//* "phi_sav", the first index from the left is the channel select and *//* the second index is the "age" of the data. */ FLOAT minval[CBANDS]; FLOAT nb_1[4][CBANDS], nb_2[4][CBANDS]; FLOAT nb_s1[4][CBANDS], nb_s2[4][CBANDS]; FLOAT *s3_ss; FLOAT *s3_ll; FLOAT decay; III_psy_xmin thm[4]; III_psy_xmin en[4]; /* unpredictability calculation */ int cw_upper_index; FLOAT ax_sav[4][2][HBLKSIZE]; FLOAT bx_sav[4][2][HBLKSIZE]; FLOAT rx_sav[4][2][HBLKSIZE]; FLOAT cw[HBLKSIZE]; /* fft and energy calculation */ FLOAT tot_ener[4]; /* loudness calculation (for adaptive threshold of hearing) */ FLOAT loudness_sq[2][2]; /* loudness^2 approx. per granule and channel */ FLOAT loudness_sq_save[2]; /* account for granule delay of L3psycho_anal */ /* Scale Factor Bands */ FLOAT mld_l[SBMAX_l], mld_s[SBMAX_s]; int bm_l[SBMAX_l], bo_l[SBMAX_l]; int bm_s[SBMAX_s], bo_s[SBMAX_s]; int npart_l, npart_s; int s3ind[CBANDS][2]; int s3ind_s[CBANDS][2]; int numlines_s[CBANDS]; int numlines_l[CBANDS]; FLOAT rnumlines_l[CBANDS]; /* ratios */ FLOAT pe[4]; FLOAT ms_ratio_s_old, ms_ratio_l_old; FLOAT ms_ener_ratio_old; /* block type */ int blocktype_old[2]; /* CPU features */ struct { unsigned int MMX:1; /* Pentium MMX, Pentium II...IV, K6, K6-2, K6-III, Athlon */ unsigned int AMD_3DNow:1; /* K6-2, K6-III, Athlon */ unsigned int SSE:1; /* Pentium III, Pentium 4 */ unsigned int SSE2:1; /* Pentium 4, K8 */ } CPU_features; /* functions to replace with CPU feature optimized versions in takehiro.c */ int (*choose_table) (const int *ix, const int *const end, int *const s); void (*fft_fht) (FLOAT *, int); void (*quantize_lines_xrpow) (int l, FLOAT istep, const FLOAT * xp, int *pi); void (*init_xrpow_core) (gr_info * const cod_info, FLOAT xrpow[576], int upper, FLOAT * sum); nsPsy_t nsPsy; /* variables used for --nspsytune */ VBR_seek_info_t VBR_seek_table; /* used for Xing VBR header */ ATH_t *ATH; /* all ATH related stuff */ PSY_t *PSY; int nogap_total; int nogap_current; /* ReplayGain */ int decode_on_the_fly : 1; int findReplayGain : 1; int findPeakSample : 1; sample_t PeakSample; int RadioGain; int AudiophileGain; replaygain_t *rgdata; int noclipGainChange; /* gain change required for preventing clipping */ FLOAT noclipScale; /* user-specified scale factor required for preventing clipping */#ifdef BRHIST /* simple statistics */ int bitrate_stereoMode_Hist[16][4 + 1]; int bitrate_blockType_Hist[16][4 + 1 + 1]; /*norm/start/short/stop/mixed(short)/sum */#endif#ifdef HAVE_GTK /* used by the frame analyzer */ plotting_data *pinfo; FLOAT energy_save[4][HBLKSIZE]; FLOAT ers_save[4];#endif int in_buffer_nsamples; sample_t *in_buffer_0; sample_t *in_buffer_1; };/************************************************************************* Global Function Prototype Declarations************************************************************************/ void freegfc(lame_internal_flags * const gfc); extern int BitrateIndex(int, int, int); extern int FindNearestBitrate(int, int); extern int map2MP3Frequency(int freq); extern int SmpFrqIndex(int, int *const); extern int nearestBitrateFullIndex(const int brate); extern FLOAT ATHformula(FLOAT freq, lame_global_flags * gfp); extern FLOAT freq2bark(FLOAT freq); extern FLOAT freq2cbw(FLOAT freq); void disable_FPE(void);/* log/log10 approximations */ extern void init_log_table(void); extern ieee754_float32_t fast_log2(ieee754_float32_t x); void fill_buffer(lame_global_flags * gfp, sample_t * mfbuf[2], sample_t * in_buffer[2], int nsamples, int *n_in, int *n_out); int fill_buffer_resample(lame_global_flags * gfp, sample_t * outbuf, int desired_len, sample_t * inbuf, int len, int *num_used, int channels);/* same as lame_decode1 (look in lame.h), but returns unclipped raw floating-point samples. It is declared here, not in lame.h, because it returns LAME's internal type sample_t. No more than 1152 samples per channel are allowed. */ int lame_decode1_unclipped(unsigned char *mp3buf, int len, sample_t pcm_l[], sample_t pcm_r[]); extern int has_MMX(void); extern int has_3DNow(void); extern int has_SSE(void); extern int has_SSE2(void);/************************************************************************* Macros about Message Printing and Exit************************************************************************/ extern void lame_errorf(const lame_internal_flags * gfc, const char *, ...); extern void lame_debugf(const lame_internal_flags * gfc, const char *, ...); extern void lame_msgf(const lame_internal_flags * gfc, const char *, ...);#define DEBUGF lame_debugf#define ERRORF lame_errorf#define MSGF lame_msgf#ifdef __cplusplus}#endif#endif /* LAME_UTIL_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -