i've tested, now you can too

This commit is contained in:
Brian West
2012-12-20 20:08:42 -06:00
parent d3fcfa8245
commit d67b96af8a
94 changed files with 25305 additions and 2005 deletions

View File

@@ -20,65 +20,104 @@
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __QUANTISE__
#define __QUANTISE__
#define WO_BITS 7
#define WO_LEVELS (1<<WO_BITS)
#define E_BITS 5
#define E_LEVELS (1<<E_BITS)
#define E_MIN_DB -10.0
#define E_MAX_DB 40.0
#include "kiss_fft.h"
#define WO_BITS 7
#define WO_LEVELS (1<<WO_BITS)
#define WO_DT_BITS 3
#define E_BITS 5
#define E_LEVELS (1<<E_BITS)
#define E_MIN_DB -10.0
#define E_MAX_DB 40.0
#define LSP_SCALAR_INDEXES 10
#define LSPD_SCALAR_INDEXES 10
#define LSP_PRED_VQ_INDEXES 3
#define LSP_DIFF_FREQ_INDEXES 5
#define LSP_DIFF_TIME_BITS 7
#define LSPDT_ALL 0
#define LSPDT_LOW 1
#define LSPDT_HIGH 2
#define WO_E_BITS 8
#define LPCPF_GAMMA 0.5
#define LPCPF_BETA 0.2
void quantise_init();
float lpc_model_amplitudes(float Sn[], float w[], MODEL *model, int order,
int lsp,float ak[]);
void aks_to_M2(float ak[], int order, MODEL *model, float E, float *snr,
int dump);
float get_gmin(void);
void aks_to_M2(kiss_fft_cfg fft_fwd_cfg, float ak[], int order, MODEL *model,
float E, float *snr, int dump, int sim_pf,
int pf, int bass_boost, float beta, float gamma);
int encode_Wo(float Wo);
float decode_Wo(int index);
int encode_Wo_dt(float Wo, float prev_Wo);
float decode_Wo_dt(int index, float prev_Wo);
void encode_lsps_scalar(int indexes[], float lsp[], int order);
void decode_lsps_scalar(float lsp[], int indexes[], int order);
void encode_lspds_scalar(int indexes[], float lsp[], int order);
void decode_lspds_scalar(float lsp[], int indexes[], int order);
void encode_lsps_diff_freq_vq(int indexes[], float lsp[], int order);
void decode_lsps_diff_freq_vq(float lsp_[], int indexes[], int order);
void encode_lsps_diff_time(int indexes[],
float lsp[],
float lsp__prev[],
int order);
void decode_lsps_diff_time(float lsp_[],
int indexes[],
float lsp__prev[],
int order);
void encode_lsps(int indexes[], float lsp[], int order);
void decode_lsps(float lsp[], int indexes[], int order);
void encode_lsps_vq(int *indexes, float *x, float *xq, int ndim);
void decode_lsps_vq(int *indexes, float *xq, int ndim);
long quantise(const float * cb, float vec[], float w[], int k, int m, float *se);
void lspvq_quantise(float lsp[], float lsp_[], int order);
void lspjnd_quantise(float lsp[], float lsp_[], int order);
void lspdt_quantise(float lsps[], float lsps_[], float lsps__prev[], int mode);
void lspjvm_quantise(float lsps[], float lsps_[], int order);
void lspanssi_quantise(float lsps[], float lsps_[], int order, int mbest_entries);
void quantise_WoE(MODEL *model, float *e, float xq[]);
int encode_WoE(MODEL *model, float e, float xq[]);
void decode_WoE(MODEL *model, float *e, float xq[], int n1);
int encode_energy(float e);
float decode_energy(int index);
void encode_amplitudes(int lsp_indexes[],
int *lpc_correction,
int *energy_index,
MODEL *model,
float Sn[],
float w[]);
float decode_amplitudes(MODEL *model,
float ak[],
int lsp_indexes[],
int lpc_correction,
int energy_index);
void pack(unsigned char * bits, unsigned int *nbit, int index, unsigned int index_bits);
int unpack(const unsigned char * bits, unsigned int *nbit, unsigned int index_bits);
int lsp_bits(int i);
int lspd_bits(int i);
int lspdt_bits(int i);
int lsp_pred_vq_bits(int i);
int need_lpc_correction(MODEL *model, float ak[], float E);
void apply_lpc_correction(MODEL *model, int lpc_correction);
void apply_lpc_correction(MODEL *model);
float speech_to_uq_lsps(float lsp[],
float ak[],
float Sn[],
float w[],
int order
);
void bw_expand_lsps(float lsp[],
int order
);
void decode_lsps(float lsp[], int indexes[], int order);
int check_lsp_order(float lsp[], int lpc_order);
void bw_expand_lsps(float lsp[], int order);
void locate_lsps_jnd_steps(float lsp[], int order);
float decode_amplitudes(MODEL *model,
float ak[],
int lsp_indexes[],
int energy_index,
float lsps[],
float *e);
#endif