UTIL.C
资源名称:G711-729.rar [点击查看]
上传用户:meifeng08
上传日期:2013-06-18
资源大小:5304k
文件大小:2k
源码类别:
语音压缩
开发平台:
C/C++
- /*
- ITU-T G.729A Speech Coder ANSI-C Source Code
- Version 1.1 Last modified: September 1996
- Copyright (c) 1996,
- AT&T, France Telecom, NTT, Universite de Sherbrooke
- All rights reserved.
- */
- /*-------------------------------------------------------------------*
- * Function Set zero() *
- * ~~~~~~~~~~ *
- * Set vector x[] to zero *
- *-------------------------------------------------------------------*/
- #include "typedef.h"
- #include "basic_op.h"
- #include "ld8a.h"
- void Set_zero(
- Word16 x[], /* (o) : vector to clear */
- Word16 L /* (i) : length of vector */
- )
- {
- Word16 i;
- for (i = 0; i < L; i++)
- x[i] = 0;
- return;
- }
- /*-------------------------------------------------------------------*
- * Function Copy: *
- * ~~~~~ *
- * Copy vector x[] to y[] *
- *-------------------------------------------------------------------*/
- void Copy(
- Word16 x[], /* (i) : input vector */
- Word16 y[], /* (o) : output vector */
- Word16 L /* (i) : vector length */
- )
- {
- Word16 i;
- for (i = 0; i < L; i++)
- y[i] = x[i];
- return;
- }
- /* Random generator */
- Word16 Random()
- {
- static Word16 seed = 21845;
- /* seed = seed*31821 + 13849; */
- seed = extract_l(L_add(L_shr(L_mult(seed, 31821), 1), 13849L));
- return(seed);
- }