/*___________________________________________________________________________
| |
| Basics operators. |
|___________________________________________________________________________|
*/
/*___________________________________________________________________________
| |
| Include-Files |
|___________________________________________________________________________|
*/
#include <stdio.h>
#include <stdlib.h>
#include "typedef.h"
#include "basic_op.h"
/*___________________________________________________________________________
| |
| Local Functions |
|___________________________________________________________________________|
*/
Word16 sature(Word32 L_var1);
/*___________________________________________________________________________
| |
| Constants and Globals |
|___________________________________________________________________________|
*/
Flag Overflow =0;
Flag Carry =0;
/*___________________________________________________________________________
| |
| Functions |
|___________________________________________________________________________|
*/
/*___________________________________________________________________________
| |
| Function Name : 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. |
|___________________________________________________________________________|
*/
Word16 sature(Word32 L_var1)
{
Word16 var_out;
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;
var_out = extract_l(L_var1);
}
return(var_out);
}
/*___________________________________________________________________________
| |
| Function Name : add |
| |
| Purpose : |
| |
| Performs the 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. |
|___________________________________________________________________________|
*/
Word16 add(Word16 var1,Word16 var2)
{
Word16 var_out;
Word32 L_somme;
L_somme = (Word32) var1 + var2;
var_out = sature(L_somme);
return(var_out);
}
/*___________________________________________________________________________
| |
| Function Name : sub |
| |
| Purpose : |
| |
| Performs the subtraction (var1+var2) with overflow control and satu- |
| ration; the 16 bit result is set at +32767 when overflow occurs or at |
| -32768 when underflow occurs. |
| |
| Complexity weight : 1 |
| |
| Inputs : |
| |
| var1
没有合适的资源?快使用搜索试试~ 我知道了~
ITU-T-G.729-Source-code.zip_ITU g729_ITU-T G.729_Source Coding
共65个文件
c:37个
h:10个
exe:6个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 47 浏览量
2022-09-14
20:31:48
上传
评论
收藏 409KB ZIP 举报
温馨提示
voice g729 coding code
资源推荐
资源详情
资源评论
收起资源包目录
ITU-T-G.729-Source-code.zip (65个子文件)
ITU-T G.729 Source code
qua_gain.c 19KB
tab_dtx.c 2KB
qsidgain.c 4KB
ld8k.h 32KB
vad.h 793B
acelp_co.c 27KB
tab_dtx.h 725B
dec_ld8k.c 13KB
g729_win32
bin
dec_g729.exe 60KB
enc_g729.exe 80KB
g729_win32.dsw 949B
g729_win32.plg 254B
enc_g729
Release
enc_g729.exe 80KB
enc_g729.dsp 6KB
Debug
enc_g729.exe 256KB
enc_g729.plg 250B
g729_win32.dsp 4KB
g729_win32.ncb 129KB
g729_win32.opt 64KB
dec_g729
Release
dec_g729.exe 60KB
dec_g729.plg 5KB
dec_g729.dsp 6KB
Debug
dec_g729.exe 212KB
lspgetq.c 6KB
oper_32b.h 550B
de_acelp.c 2KB
dtx.c 12KB
dec_lag3.c 2KB
coder.mak 4KB
lpc.c 23KB
p_parity.c 2KB
dec_sid.c 5KB
taming.c 4KB
tab_ld8k.c 29KB
pred_lt3.c 2KB
sid.h 607B
read1_4.me 7KB
basic_op.h 3KB
typedef.h 955B
gainpred.c 8KB
filter.c 4KB
dspfunc.c 8KB
octet.h 678B
pre_proc.c 3KB
decoder.mak 3KB
basic_op.c 101KB
lspdec.c 3KB
util.c 2KB
cod_ld8k.c 27KB
pst.c 33KB
dec_gain.c 5KB
dtx.h 4KB
oper_32b.c 12KB
calcexc.c 9KB
bits.c 6KB
vad.c 14KB
qua_lsp.c 10KB
pwf.c 6KB
tab_ld8k.h 1KB
qsidlsf.c 11KB
post_pro.c 3KB
pitch.c 21KB
coder.c 5KB
lpcfunc.c 12KB
decoder.c 5KB
共 65 条
- 1
资源评论
Kinonoyomeo
- 粉丝: 74
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功