
18.05.2010, 16:29
|
Прохожий
|
|
Регистрация: 02.03.2009
Сообщения: 26
Репутация: 10
|
|
...последовало.
Код:
typedef struct {
int window_shape;
int prev_window_shape;
int block_type;
int desired_block_type;
int global_gain;
int scale_factor[MAX_SCFAC_BANDS];
int num_window_groups;
int window_group_length[8];
int max_sfb;
int nr_of_sfb;
int sfb_offset[250];
int lastx;
double avgenrg;
int spectral_count;
/* Huffman codebook selected for each sf band */
int book_vector[MAX_SCFAC_BANDS];
/* Data of spectral bitstream elements, for each spectral pair,
5 elements are required: 1*(esc)+2*(sign)+2*(esc value)=5 */
int *data;
/* Lengths of spectral bitstream elements */
int *len;
/* Holds the requantized spectrum */
double *requantFreq;
TnsInfo tnsInfo;
LtpInfo ltpInfo;
BwpInfo bwpInfo;
int max_pred_sfb;
int pred_global_flag;
int pred_sfb_flag[MAX_SCFAC_BANDS];
int reset_group_number;
} CoderInfo;
typedef struct {
int tag;
int present;
int ch_is_left;
int paired_ch;
int common_window;
int cpe;
int sce;
int lfe;
MSInfo msInfo;
} ChannelInfo;
typedef struct {
int size;
int sizeS;
/* Previous input samples */
double *prevSamples;
double *prevSamplesS;
int block_type;
void *data;
} PsyInfo;
typedef struct {
double sampleRate;
/* Hann window */
double *hannWindow;
double *hannWindowS;
void *data;
} GlobalPsyInfo;
typedef struct
{
void (*PsyInit) (GlobalPsyInfo *gpsyInfo, PsyInfo *psyInfo,
unsigned int numChannels, unsigned int sampleRate,
int *cb_width_long, int num_cb_long,
int *cb_width_short, int num_cb_short);
void (*PsyEnd) (GlobalPsyInfo *gpsyInfo, PsyInfo *psyInfo,
unsigned int numChannels);
void (*PsyCalculate) (ChannelInfo *channelInfo, GlobalPsyInfo *gpsyInfo,
PsyInfo *psyInfo, int *cb_width_long, int num_cb_long,
int *cb_width_short, int num_cb_short,
unsigned int numChannels);
void (*PsyBufferUpdate) ( FFT_Tables *fft_tables, GlobalPsyInfo * gpsyInfo, PsyInfo * psyInfo,
double *newSamples, unsigned int bandwidth,
int *cb_width_short, int num_cb_short);
void (*BlockSwitch) (CoderInfo *coderInfo, PsyInfo *psyInfo,
unsigned int numChannels);
} psymodel_t;
typedef struct
{
double *pow43;
double *adj43;
double quality;
} AACQuantCfg;
typedef struct
{
fftfloat **costbl;
fftfloat **negsintbl;
unsigned short **reordertbl;
} FFT_Tables;
typedef struct {
int order; /* Filter order */
int direction; /* Filtering direction */
int coefCompress; /* Are coeffs compressed? */
int length; /* Length, in bands */
double aCoeffs[TNS_MAX_ORDER+1]; /* AR Coefficients */
double kCoeffs[TNS_MAX_ORDER+1]; /* Reflection Coefficients */
int index[TNS_MAX_ORDER+1]; /* Coefficient indices */
} TnsFilterData;
typedef struct {
int numFilters; /* Number of filters */
int coefResolution; /* Coefficient resolution */
TnsFilterData tnsFilter[1<<LEN_TNS_NFILTL]; /* TNS filters */
} TnsWindowData;
typedef struct {
int tnsDataPresent;
int tnsMinBandNumberLong;
int tnsMinBandNumberShort;
int tnsMaxBandsLong;
int tnsMaxBandsShort;
int tnsMaxOrderLong;
int tnsMaxOrderShort;
TnsWindowData windowData[MAX_SHORT_WINDOWS]; /* TNS data per window */
} TnsInfo;
typedef struct
{
int weight_idx;
double weight;
int sbk_prediction_used[MAX_SHORT_WINDOWS];
int sfb_prediction_used[MAX_SCFAC_BANDS];
int delay[MAX_SHORT_WINDOWS];
int global_pred_flag;
int side_info;
double *buffer;
double *mdct_predicted;
double *time_buffer;
double *ltp_overlap_buffer;
} LtpInfo;
typedef struct
{
int psy_init_mc;
double dr_mc[LPC][BLOCK_LEN_LONG],e_mc[LPC+1+1][BLOCK_LEN_LONG];
double K_mc[LPC+1][BLOCK_LEN_LONG], R_mc[LPC+1][BLOCK_LEN_LONG];
double VAR_mc[LPC+1][BLOCK_LEN_LONG], KOR_mc[LPC+1][BLOCK_LEN_LONG];
double sb_samples_pred_mc[BLOCK_LEN_LONG];
int thisLineNeedsResetting_mc[BLOCK_LEN_LONG];
int reset_count_mc;
} BwpInfo;
typedef struct {
int is_present;
int ms_used[MAX_SCFAC_BANDS];
} MSInfo;
typedef float fftfloat;
|