vdecode.c
资源名称:celp32c.rar [点击查看]
上传用户:tsjrly
上传日期:2021-02-19
资源大小:107k
文件大小:1k
源码类别:
语音压缩
开发平台:
C/C++
- /**************************************************************************
- *
- * ROUTINE
- * vdecode
- *
- * FUNCTION
- *
- * create excitation vector from code book index and decoded gain
- *
- * SYNOPSIS
- * subroutine vdecode(decodedgain, l, vdecoded)
- *
- * formal
- *
- * data I/O
- * name type type function
- * -------------------------------------------------------------------
- * decodedgain r i decoded gain value
- * l i i pitch&code frame length
- * vdecoded r o decoded excitation array
- *
- * external
- * data I/O
- * name type type function
- * -------------------------------------------------------------------
- * x[] float i
- *
- ***************************************************************************
- *
- * CALLED BY
- *
- * celp
- *
- * CALLS
- *
- *
- *
- **************************************************************************/
- #include "ccsub.h"
- extern int cbindex, frame;
- extern float x[MAXCODE];
- vdecode(decodedgain, l, vdecoded)
- int l;
- float decodedgain, vdecoded[];
- {
- int i, codeword;
- /* *copy selected vector to excitation array */
- codeword = 2 * (MAXNCSIZE - cbindex);
- if (codeword < 0)
- {
- printf("vdecode: cbindex > MAXNCSIZE at frame %dn", frame);
- codeword = 0;
- }
- for (i = 0; i < l; i++)
- vdecoded[i] = x[i + codeword] * decodedgain;
- }