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

📄 ld8k.h

📁 语音编码G.729 语音编码G.729
💻 H
📖 第 1 页 / 共 2 页
字号:
/*   ITU-T G.729 Annex C - Reference C code for floating point                         implementation of G.729                         Version 1.01 of 15.September.98*//*----------------------------------------------------------------------                    COPYRIGHT NOTICE----------------------------------------------------------------------   ITU-T G.729 Annex C ANSI C source code   Copyright (C) 1998, AT&T, France Telecom, NTT, University of   Sherbrooke.  All rights reserved.----------------------------------------------------------------------*//* File : LD8K.H Used for the floating point version of G.729 main body (not for G.729A)*//*--------------------------------------------------------------------------- * ld8k.h - include file for all ITU-T 8 kb/s CELP coder routines *--------------------------------------------------------------------------- */#include <stdio.h>#include <stdlib.h>#ifndef _LD8K_H_INCL#define _LD8K_H_INCL#ifdef INLINE_FUNCS#ifdef _MSC_VER#	define __inline__ __inline#endif#define INLINE_PREFIX static __inline__#else /* INLINE_FUNCS */#define INLINE_PREFIX#endif /* INLINE_FUNCS */#ifdef PI#undef PI#endif#ifdef PI2#undef PI2#endif#define PI              (F)3.14159265358979323846#define PI2             (F)6.283185307#define FLT_MAX_G729         (F)1.e38   /* largest floating point number             */#define FLT_MIN_G729         -FLT_MAX_G729    /* largest floating point number             */#define L_TOTAL         240     /* Total size of speech buffer               */#define L_FRAME         80      /* LPC update frame size                     */#define L_SUBFR         40      /* Sub-frame size                            *//*---------------------------------------------------------------------------* * constants for bitstream packing                                           * *---------------------------------------------------------------------------*/#define BIT_1     (INT16)0x0081 /* definition of one-bit in bit-stream      */#define BIT_0     (INT16)0x007f /* definition of zero-bit in bit-stream      */#define SYNC_WORD (INT16)0x6b21 /* definition of frame erasure flag          */#define SIZE_WORD       80  /* size of bitstream frame */#define PRM_SIZE        11      /* number of parameters per 10 ms frame      */#define SERIAL_SIZE     82      /* bits per frame                            *//*---------------------------------------------------------------------------* * constants for lpc analysis and lsp quantizer                              * *---------------------------------------------------------------------------*/#define L_WINDOW        240     /* LPC analysis window size                  */#define L_NEXT          40      /* Samples of next frame needed for LPC ana. */#define M               10      /* LPC order                                 */#define MP1            (M+1)    /* LPC order+1                               */#define GRID_POINTS     60      /* resolution of lsp search                  */#define MA_NP           4       /* MA prediction order for LSP               */#define MODE            2       /* number of modes for MA prediction         */#define NC0_B           7       /* number of bits in first stage             */#define NC0          (1<<NC0_B) /* number of entries in first stage          */#define NC1_B           5       /* number of bits in second stage            */#define NC1          (1<<NC1_B) /* number of entries in second stage         */#define NC              (M/2)   /* LPC order / 2                            */#define L_LIMIT         (F)0.005   /*  */#define M_LIMIT         (F)3.135   /*  */#define GAP1            (F)0.0012  /*  */#define GAP2            (F)0.0006  /*  */#define GAP3            (F)0.0392  /*  */#define PI04            PI*(F)0.04   /* pi*0.04 */#define PI92            PI*(F)0.92   /* pi*0.92 */#define CONST12         (F)1.2/*------------------------------------------------------------------------- *  pwf constants *------------------------------------------------------------------------- */#define THRESH_L1   (F)-1.74#define THRESH_L2   (F)-1.52#define THRESH_H1   (F)0.65#define THRESH_H2   (F)0.43#define GAMMA1_0    (F)0.98#define GAMMA2_0_H  (F)0.7#define GAMMA2_0_L  (F)0.4#define GAMMA1_1    (F)0.94#define GAMMA2_1    (F)0.6#define ALPHA       (F)-6.0#define BETA        (F)1.0/*---------------------------------------------------------------------------- *  Constants for long-term predictor *---------------------------------------------------------------------------- */#define PIT_MIN         20      /* Minimum pitch lag in samples              */#define PIT_MAX         143     /* Maximum pitch lag in samples              */#define L_INTERPOL      (10+1)  /* Length of filter for interpolation.       */#define L_INTER10       10      /* Length for pitch interpolation            */#define L_INTER4        4       /* upsampling ration for pitch search        */#define UP_SAMP         3       /* resolution of fractional delays           */#define THRESHPIT    (F)0.85    /* Threshold to favor smaller pitch lags     */#define GAIN_PIT_MAX (F)1.2     /* maximum adaptive codebook gain            */#define FIR_SIZE_ANA (UP_SAMP*L_INTER4+1)#define FIR_SIZE_SYN (UP_SAMP*L_INTER10+1)/*---------------------------------------------------------------------------* * constants for fixed codebook                                              * *---------------------------------------------------------------------------*/#define DIM_RR  616 /* size of correlation matrix                            */#define NB_POS  8   /* Number of positions for each pulse                    */#define STEP    5   /* Step betweem position of the same pulse.              */#define MSIZE   64  /* Size of vectors for cross-correlation between 2 pulses*/#define SHARPMAX        (F)0.7945  /* Maximum value of pitch sharpening */#define SHARPMIN        (F)0.2     /* minimum value of pitch sharpening */ /*--------------------------------------------------------------------------*  * Example values for threshold and approximated worst case complexity:     *  *                                                                          *  *     threshold=0.40   maxtime= 75   extra=30   Mips =  6.0                *  *--------------------------------------------------------------------------*/#define THRESHFCB       (F)0.40    /*  */#define MAX_TIME        75      /*  *//*--------------------------------------------------------------------------* * Constants for taming procedure.                           * *--------------------------------------------------------------------------*/#define GPCLIP      (F)0.95     /* Maximum pitch gain if taming is needed */#define GPCLIP2     (F)0.94     /* Maximum pitch gain if taming is needed */#define GP0999      (F)0.9999   /* Maximum pitch gain if taming is needed    */#define THRESH_ERR  (F)60000.   /* Error threshold taming    */#define INV_L_SUBFR (FLOAT) ((F)1./(FLOAT)L_SUBFR) /* =0.025 *//*------------------------------------------------------------------------- *  gain quantizer  constants *------------------------------------------------------------------------- */#define MEAN_ENER        (F)36.0   /* average innovation energy */#define NCODE1_B  3                /* number of Codebook-bit                */#define NCODE2_B  4                /* number of Codebook-bit                */#define NCODE1    (1<<NCODE1_B)    /* Codebook 1 size                       */#define NCODE2    (1<<NCODE2_B)    /* Codebook 2 size                       */#define NCAN1            4      /* Pre-selecting order for #1 */#define NCAN2            8      /* Pre-selecting order for #2 */#define INV_COEF   (F)-0.032623/*--------------------------------------------------------------------------- * Constants for postfilter *--------------------------------------------------------------------------- */         /* INT16 term pst parameters :  */

⌨️ 快捷键说明

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