00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef MODES_H
00037 #define MODES_H
00038
00039 #include "speex.h"
00040 #include "speex_bits.h"
00041 #include "misc.h"
00042
00043 #define NB_SUBMODES 16
00044 #define NB_SUBMODE_BITS 4
00045
00046 #define SB_SUBMODES 8
00047 #define SB_SUBMODE_BITS 3
00048
00049
00051 typedef void (*lsp_quant_func)(spx_lsp_t *, spx_lsp_t *, int, SpeexBits *);
00052
00054 typedef void (*lsp_unquant_func)(spx_lsp_t *, int, SpeexBits *);
00055
00056
00058 typedef int (*ltp_quant_func)(spx_sig_t *, spx_sig_t *, spx_coef_t *, spx_coef_t *,
00059 spx_coef_t *, spx_sig_t *, void *, int, int, float,
00060 int, int, SpeexBits*, char *, spx_sig_t *, spx_sig_t *, int, int);
00061
00063 typedef void (*ltp_unquant_func)(spx_sig_t *, int, int, float, void *, int, int *,
00064 float *, SpeexBits*, char*, int, int, float, int);
00065
00066
00068 typedef void (*innovation_quant_func)(spx_sig_t *, spx_coef_t *, spx_coef_t *, spx_coef_t *, void *, int, int,
00069 spx_sig_t *, spx_sig_t *, SpeexBits *, char *, int);
00070
00072 typedef void (*innovation_unquant_func)(spx_sig_t *, void *, int, SpeexBits*, char *);
00073
00075 typedef struct SpeexSubmode {
00076 int lbr_pitch;
00077 int forced_pitch_gain;
00078 int have_subframe_gain;
00079 int double_codebook;
00080
00081 lsp_quant_func lsp_quant;
00082 lsp_unquant_func lsp_unquant;
00084
00085 ltp_quant_func ltp_quant;
00086 ltp_unquant_func ltp_unquant;
00087 void *ltp_params;
00089
00090 innovation_quant_func innovation_quant;
00091 innovation_unquant_func innovation_unquant;
00092 void *innovation_params;
00094
00095 float lpc_enh_k1;
00096 float lpc_enh_k2;
00097 float comb_gain;
00099 int bits_per_frame;
00100 } SpeexSubmode;
00101
00103 typedef struct SpeexNBMode {
00104 int frameSize;
00105 int subframeSize;
00106 int lpcSize;
00107 int bufSize;
00108 int pitchStart;
00109 int pitchEnd;
00111 float gamma1;
00112 float gamma2;
00113 float lag_factor;
00114 float lpc_floor;
00116 #ifdef EPIC_48K
00117 int lbr48k;
00118 #endif
00119
00120 SpeexSubmode *submodes[NB_SUBMODES];
00121 int defaultSubmode;
00122 int quality_map[11];
00123 } SpeexNBMode;
00124
00125
00127 typedef struct SpeexSBMode {
00128 SpeexMode *nb_mode;
00129 int frameSize;
00130 int subframeSize;
00131 int lpcSize;
00132 int bufSize;
00133 float gamma1;
00134 float gamma2;
00135 float lag_factor;
00136 float lpc_floor;
00137 float folding_gain;
00138
00139 SpeexSubmode *submodes[SB_SUBMODES];
00140 int defaultSubmode;
00141 int low_quality_map[11];
00142 int quality_map[11];
00143 float (*vbr_thresh)[11];
00144 int nb_modes;
00145 } SpeexSBMode;
00146
00147
00148 #endif