dacelpcp.c

来自「语音编码G.729 语音编码G.729」· C语言 代码 · 共 68 行

C
68
字号
/*   ITU-T G.729 Annex C+ - Reference C code for floating point                         implementation of G.729 Annex C+                         (integration of Annexes B, D and E)                          Version 2.1 of October 1999*//*File : DACELPCP.C*/#include "typedef.h"#include "ld8k.h"#include "ld8cp.h"#include "tabld8cp.h"/*-----------------------------------------------------------**  Function  decod_ACELP()                                  **  ~~~~~~~~~~~~~~~~~~~~~~~                                  **   Algebraic codebook decoder.                             **----------------------------------------------------------*/void decod_ACELP(    int sign,              /* input : signs of 4 pulses     */    int index,             /* input : positions of 4 pulses */    FLOAT cod[]            /* output: innovative codevector */){    int pos[4];    int i, j;        /* decode the positions of 4 pulses */    i = index & 7;    pos[0] = i*5;        index >>= 3;    i = index & 7;    pos[1] = i*5 + 1;        index >>= 3;    i = index & 7;    pos[2] = i*5 + 2;        index >>= 3;    j = index & 1;    index >>= 1;    i = index & 7;    pos[3] = i*5 + 3 + j;        /* find the algebraic codeword */    /*for (i = 0; i < L_SUBFR; i++) cod[i] = 0;*/	set_zero(cod, L_SUBFR);        /* decode the signs of 4 pulses */        for (j=0; j<4; j++)    {                i = sign & 1;        sign >>= 1;                if (i != 0) {            cod[pos[j]] = (F)1.0;        }        else {            cod[pos[j]] = (F)-1.0;        }    }}

⌨️ 快捷键说明

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