/*___________________________________________________________________________
| |
| Basics operators. |
|___________________________________________________________________________|
*/
/*___________________________________________________________________________
| |
| Include-Files |
|___________________________________________________________________________|
*/
#include <stdio.h>
#include <stdlib.h>
#include "typedef.h"
#include "basic_op.h"
/*___________________________________________________________________________
| |
| Local Functions |
|___________________________________________________________________________|
*/
Word16 g729a_sature(Word32 L_var1);
/*___________________________________________________________________________
| |
| Constants and Globals |
|___________________________________________________________________________|
*/
Flag Overflow =0;
Flag Carry =0;
/*___________________________________________________________________________
| |
| Functions |
|___________________________________________________________________________|
*/
/*___________________________________________________________________________
| |
| Function Name : g729a_sature |
| |
| Purpose : |
| |
| Limit the 32 bit input to the range of a 16 bit word. |
| |
| Inputs : |
| |
| L_var1 |
| 32 bit long signed integer (Word32) whose value falls in the |
| range : 0x8000 0000 <= L_var1 <= 0x7fff ffff. |
| |
| Outputs : |
| |
| none |
| |
| Return Value : |
| |
| var_out |
| 16 bit short signed integer (Word16) whose value falls in the |
| range : 0xffff 8000 <= var_out <= 0x0000 7fff. |
|___________________________________________________________________________|
*/
inline Word16 g729a_sature(Word32 L_var1)
{
Word16 var_out;
#if 1
if (L_var1 > 0X00007fffL)
{
Overflow = 1;
var_out = MAX_16;
}
else if (L_var1 < (Word32)0xffff8000L)
{
Overflow = 1;
var_out = MIN_16;
}
else
{
Overflow = 0;
/*************************
20120514mended by YangQn
根据extract_l()函数的功能,其将L_var1强制类型转换为Word16返回给调用函数,因此去掉该函数调用
*************************/
//var_out = extract_l(L_var1);
var_out = (Word16)L_var1;
}
#endif
#if 0
//g729a_added by Yangqingna 20120516
Overflow = 0;
var_out = (Word16)L_var1;
if( var_out != L_var1)
{
Overflow = 1;
if ( L_var1 < (Word32)0xffff8000L )
{
var_out = MIN_16;
}
if( L_var1 > 0X00007fffL )
{
var_out = MAX_16;
}
}
#endif
return(var_out);
}
//g729a_added by Yangqingna 20120515
#if 0
Word16 sature_nof(Word32 L_var1)
{
Word16 var_out;
Overflow = 0;
var_out = (Word16)L_var1;
return(var_out);
}
#endif
/*___________________________________________________________________________
| |
| Function Name : g729a_add |
| |
| Purpose : |
| |
| Performs the g729a_addition (var1+var2) with overflow control and saturation;|
| the 16 bit result is set at +32767 when overflow occurs or at -32768 |
| when underflow occurs. |
| |
| Complexity weight : 1 |
| |
| Inputs : |
| |
| var1 |
| 16 bit short signed integer (Word16) whose value falls in the |
| range : 0xffff 8000 <= var1 <= 0x0000 7fff. |
| |
| var2 |
| 16 bit short signed integer (Word16) whose value falls in the |
| range : 0xffff 8000 <= var1 <= 0x0000 7fff. |
| |
| Outputs : |
| |
| none |
| |
| Return Value : |
| |
| var_out |
| 16 bit short signed integer (Word16) whose value falls in the |
| range : 0xffff 8000 <= var_out <= 0x0000 7fff. |
|___________________________________________________________________________|
*/
inline Word16 g729a_add(Word16 var1,Word16 var2)
{
Word16 var_out;
Word32 L_somme;
L_somme = (Word32) var1 + var2;
var_out = g729a_sature(L_somme);
return(var_out);
}
//g729a_added by Yangqingna 20120515
inline Word16 g729a_add_nsature(Word16 var1, Word16 var2)
{
Word16 var_out;
Word32 L_somme;
L_somme = (Word32) var1 + var2;
//var_out = sature_nof(L_somme);
var_out = (Word16)L_somme; //g729a_added by Yangqingna 20120516
return(var_out);
}
/*___________________________________________________________________________
|
没有合适的资源?快使用搜索试试~ 我知道了~
g729a_codec
5星 · 超过95%的资源 需积分: 16 46 下载量 21 浏览量
2014-10-21
17:37:11
上传
评论 1
收藏 344KB GZ 举报
温馨提示
共74个文件
c:30个
o:29个
h:6个
该g729a编解码库是在ITU开源代码基础上,使用统计算法,对其进行优化可以正常运行在ARM9处理器上,实现同编同解情况下CPU占用率小于等于80%
资源推荐
资源详情
资源评论
收起资源包目录
g729a_codec.tar.gz (74个子文件)
g729acodec
ld8a.h 25KB
tab_ld8a.c 27KB
qua_lsp.o 6KB
lpc.c 27KB
p_parity.c 2KB
pre_proc.o 2KB
p_parity.o 1KB
dec_ld8a.o 4KB
lpcfunc.o 4KB
libg729acodec-r.a 108KB
pre_proc.c 4KB
va_g729.h 364B
tab_ld8a.o 7KB
pred_lt3.c 2KB
acelp_ca.c 29KB
pred_lt3.o 1KB
dec_lag3.c 2KB
g729a 7KB
pitch_a.c 24KB
taming.o 2KB
bits.o 1KB
dec_gain.o 2KB
gainpred.c 10KB
util.o 1KB
coder 70KB
qua_gain.c 29KB
lpcfunc.c 13KB
post_pro.o 2KB
cod_ld8a.o 5KB
util.c 3KB
dspfunc.c 9KB
gainpred.o 2KB
filter.c 4KB
dspfunc.o 2KB
dec_lag3.o 2KB
oper_32b.h 777B
lspgetq.c 7KB
typedef.h 1KB
Makefile 1008B
lspdec.o 2KB
cor_func.o 2KB
basic_op.o 8KB
cor_func.c 7KB
de_acelp.o 1KB
va_g729.c 1KB
qua_lsp.c 12KB
lpc.o 7KB
post_pro.c 4KB
de_acelp.c 2KB
filter.o 2KB
decoder.mak 3KB
T07.INP 113KB
coder_bak.mak 3KB
postfilt.o 5KB
g729a.pcm 113KB
basic_op.c 107KB
va_g729.o 2KB
oper_32b.c 14KB
postfilt.c 17KB
taming.c 4KB
dec_ld8a.c 10KB
pitch_a.o 6KB
lspdec.c 3KB
tab_ld8a.h 1KB
dec_gain.c 5KB
coder.c 5KB
basic_op.h 6KB
cod_ld8a.c 20KB
coder.mak 3KB
lspgetq.o 3KB
bits.c 6KB
oper_32b.o 2KB
qua_gain.o 7KB
acelp_ca.o 11KB
共 74 条
- 1
资源评论
- zhanggf0012015-07-08很好,可用。已经用起来了
- wzc863541202018-04-16挺好,非常感谢
- csdn_385242302015-05-26不知道什么原因编译不过
yangqingna_1986
- 粉丝: 12
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功