Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
84324ab7
提交
84324ab7
authored
10月 15, 2013
作者:
Steve Underwood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Eliminate some more warnings
上级
f236ca11
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
61 行增加
和
76 行删除
+61
-76
bv16encoder.c
libs/broadvoice/src/floating/bv16/bv16encoder.c
+3
-5
bv16excquan.c
libs/broadvoice/src/floating/bv16/bv16excquan.c
+2
-4
bv16lspquan.c
libs/broadvoice/src/floating/bv16/bv16lspquan.c
+47
-52
bv32encoder.c
libs/broadvoice/src/floating/bv32/bv32encoder.c
+4
-6
bv32excquan.c
libs/broadvoice/src/floating/bv32/bv32excquan.c
+2
-4
bv32lspquan.c
libs/broadvoice/src/floating/bv32/bv32lspquan.c
+3
-5
没有找到文件。
libs/broadvoice/src/floating/bv16/bv16encoder.c
浏览文件 @
84324ab7
...
...
@@ -20,8 +20,6 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: bv16encoder.c,v 1.1.1.1 2009/11/19 12:10:48 steveu Exp $
*/
/*! \file */
...
...
@@ -169,10 +167,10 @@ BV_DECLARE(int) bv16_encode(bv16_encode_state_t *cs,
/* Refine the pitch period in the neighborhood of coarse pitch period
also calculate the pitch predictor tap for single-tap predictor */
pp
=
refinepitch
(
dq
,
cpp
,
&
ppt
);
bs
.
ppidx
=
pp
-
MINPP
;
bs
.
ppidx
=
(
int16_t
)
(
pp
-
MINPP
)
;
/* Vector quantize 3 pitch predictor taps with minimum residual energy */
bs
.
bqidx
=
pitchtapquan
(
dq
,
pp
,
bq
,
&
lg
);
bs
.
bqidx
=
(
int16_t
)
pitchtapquan
(
dq
,
pp
,
bq
,
&
lg
);
/* Get coefficients of long-term noise feedback filter */
if
(
ppt
>
1
.
0
)
...
...
@@ -184,7 +182,7 @@ BV_DECLARE(int) bv16_encode(bv16_encode_state_t *cs,
/* Gain quantization */
lg
=
(
lg
<
FRSZ
)
?
0
:
log
(
lg
/
FRSZ
)
/
log
(
2
.
0
);
bs
.
gidx
=
gainquan
(
&
gainq
,
lg
,
cs
->
lgpm
,
cs
->
prevlg
,
cs
->
level
);
bs
.
gidx
=
(
int16_t
)
gainquan
(
&
gainq
,
lg
,
cs
->
lgpm
,
cs
->
prevlg
,
cs
->
level
);
/* Level estimation */
dummy
=
estl_alpha
;
...
...
libs/broadvoice/src/floating/bv16/bv16excquan.c
浏览文件 @
84324ab7
...
...
@@ -22,8 +22,6 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: bv16excquan.c,v 1.1.1.1 2009/11/19 12:10:48 steveu Exp $
*/
/*! \file */
...
...
@@ -241,9 +239,9 @@ void excquan(int16_t *idx, /* quantizer codebook index for uq[] vector */
/* The best codevector has been found; assign vq codebook index */
if
(
sign
==
1
.
0
F
)
idx
[
iv
++
]
=
jmin
;
idx
[
iv
++
]
=
(
int16_t
)
jmin
;
else
idx
[
iv
++
]
=
jmin
+
CBSZ
;
/* MSB of index is sign bit */
idx
[
iv
++
]
=
(
int16_t
)
(
jmin
+
CBSZ
)
;
/* MSB of index is sign bit */
fp3
=
&
cb
[
jmin
*
VDIM
];
/* fp3 points to start of best codevector */
for
(
n
=
0
;
n
<
VDIM
;
n
++
)
...
...
libs/broadvoice/src/floating/bv16/bv16lspquan.c
浏览文件 @
84324ab7
...
...
@@ -21,8 +21,6 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: bv16lspquan.c,v 1.1.1.1 2009/11/19 12:10:48 steveu Exp $
*/
/*! \file */
...
...
@@ -36,16 +34,14 @@
#include "bv16externs.h"
#include "bvcommon.h"
void
vqmse
(
Float
*
xq
,
void
vqmse
(
Float
*
xq
,
int16_t
*
idx
,
Float
*
x
,
const
Float
*
cb
,
int
vdim
,
int
cbsz
);
void
svqwmse
(
Float
*
xq
,
void
svqwmse
(
Float
*
xq
,
int16_t
*
idx
,
Float
*
x
,
Float
*
xa
,
...
...
@@ -54,12 +50,10 @@ void svqwmse(
int
vdim
,
int
cbsz
);
void
lspquan
(
Float
*
lspq
,
void
lspquan
(
Float
*
lspq
,
int16_t
*
lspidx
,
Float
*
lsp
,
Float
*
lsppm
)
Float
*
lsppm
)
{
Float
d
[
LPCO
];
Float
w
[
LPCO
];
...
...
@@ -75,7 +69,7 @@ void lspquan(
int
i
;
int
k
;
/*
c
alculate the weights for weighted mean-square error distortion */
/*
C
alculate the weights for weighted mean-square error distortion */
for
(
i
=
0
;
i
<
LPCO
-
1
;
i
++
)
d
[
i
]
=
lsp
[
i
+
1
]
-
lsp
[
i
];
/* LSP difference vector */
w
[
0
]
=
1
.
0
F
/
d
[
0
];
...
...
@@ -119,7 +113,7 @@ void lspquan(
for
(
i
=
0
;
i
<
LPCO
;
i
++
)
lspe
[
i
]
=
lspeq1
[
i
]
+
lspeq2
[
i
];
/*
u
pdate lsp ma predictor memory */
/*
U
pdate lsp ma predictor memory */
i
=
LPCO
*
LSPPORDER
-
1
;
fp1
=
&
lsppm
[
i
];
fp2
=
&
lsppm
[
i
-
1
];
...
...
@@ -131,11 +125,11 @@ void lspquan(
fp2
--
;
}
/*
c
alculate quantized lsp */
/*
C
alculate quantized lsp */
for
(
i
=
0
;
i
<
LPCO
;
i
++
)
lspq
[
i
]
=
lspa
[
i
]
+
lspeq2
[
i
];
/*
e
nsure correct ordering of lsp to guarantee lpc filter stability */
/*
E
nsure correct ordering of lsp to guarantee lpc filter stability */
stblz_lsp
(
lspq
,
LPCO
);
}
...
...
@@ -166,7 +160,7 @@ void vqmse(Float *xq, /* VQ output vector (quantized version of input vector)
if
(
d
<
dmin
)
{
dmin
=
d
;
*
idx
=
j
;
*
idx
=
(
int16_t
)
j
;
}
}
...
...
@@ -176,23 +170,24 @@ void vqmse(Float *xq, /* VQ output vector (quantized version of input vector)
}
/* Signed WMSE VQ */
void
svqwmse
(
Float
*
xq
,
/* VQ output vector (quantized version of input vector) */
void
svqwmse
(
Float
*
xq
,
/* VQ output vector (quantized version of input vector) */
int16_t
*
idx
,
/* VQ codebook index for the nearest neighbor */
Float
*
x
,
/* input vector */
Float
*
xa
,
/* approximation prior to current stage */
Float
*
w
,
/* weights for weighted Mean-Square Error */
const
Float
*
cb
,
/* VQ codebook */
int
vdim
,
/* vector dimension */
int
cbsz
/* codebook size (number of codevectors) */
)
int
cbsz
)
/* codebook size (number of codevectors) */
{
const
Float
*
fp1
;
const
Float
*
fp2
;
Float
dmin
;
Float
d
;
Float
xqc
[
STBLDIM
];
int
j
,
k
,
stbl
,
sign
=
1
;
int
j
;
int
k
;
int
stbl
;
int
sign
=
1
;
Float
e
;
fp1
=
cb
;
...
...
@@ -211,17 +206,17 @@ void svqwmse(
d
+=
w
[
k
]
*
e
*
e
;
}
/*
c
heck candidate - negative sign */
/*
C
heck candidate - negative sign */
if
(
d
<
dmin
)
{
for
(
k
=
0
;
k
<
STBLDIM
;
k
++
)
xqc
[
k
]
=
xa
[
k
]
-
*
fp2
++
;
/*
c
heck stability - negative sign */
/*
C
heck stability - negative sign */
stbl
=
stblchck
(
xqc
,
STBLDIM
);
if
(
stbl
>
0
)
{
dmin
=
d
;
*
idx
=
j
;
*
idx
=
(
int16_t
)
j
;
sign
=
-
1
;
}
}
...
...
@@ -237,18 +232,18 @@ void svqwmse(
d
+=
w
[
k
]
*
e
*
e
;
}
/*
c
heck candidate - positive sign */
/*
C
heck candidate - positive sign */
if
(
d
<
dmin
)
{
for
(
k
=
0
;
k
<
STBLDIM
;
k
++
)
xqc
[
k
]
=
xa
[
k
]
+
*
fp2
++
;
/*
c
heck stability - positive sign */
/*
C
heck stability - positive sign */
stbl
=
stblchck
(
xqc
,
STBLDIM
);
if
(
stbl
>
0
)
{
dmin
=
d
;
*
idx
=
j
;
*
idx
=
(
int16_t
)
j
;
sign
=
+
1
;
}
}
...
...
libs/broadvoice/src/floating/bv32/bv32encoder.c
浏览文件 @
84324ab7
...
...
@@ -20,8 +20,6 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: bv32encoder.c,v 1.1.1.1 2009/11/19 12:10:48 steveu Exp $
*/
/*! \file */
...
...
@@ -161,10 +159,10 @@ BV_DECLARE(int) bv32_encode(bv32_encode_state_t *cs,
/* Refine the pitch period in the neighborhood of coarse pitch period
also calculate the pitch predictor tap for single-tap predictor */
pp
=
bv32_refinepitch
(
dq
,
cpp
,
&
ppt
);
bs
.
ppidx
=
pp
-
MINPP
;
bs
.
ppidx
=
(
int16_t
)
(
pp
-
MINPP
)
;
/* vq 3 pitch predictor taps with minimum residual energy */
bs
.
bqidx
=
bv32_pitchtapquan
(
dq
,
pp
,
bq
);
bs
.
bqidx
=
(
int16_t
)
bv32_pitchtapquan
(
dq
,
pp
,
bq
);
/* get coefficients for long-term noise feedback filter */
if
(
ppt
>
1
.
0
)
...
...
@@ -190,9 +188,9 @@ BV_DECLARE(int) bv32_encode(bv32_encode_state_t *cs,
/* Log-gain quantization within each sub-frame */
lg
=
(
ee
<
TMinE
)
?
MinE
:
log
(
ee
/
SFRSZ
)
/
log
(
2
.
0
);
bs
.
gidx
[
issf
]
=
bv32_gainquan
(
gainq
+
issf
,
lg
,
cs
->
lgpm
,
cs
->
prevlg
,
cs
->
level
);
bs
.
gidx
[
issf
]
=
(
int16_t
)
bv32_gainquan
(
gainq
+
issf
,
lg
,
cs
->
lgpm
,
cs
->
prevlg
,
cs
->
level
);
/* Level
e
stimation */
/* Level
E
stimation */
bv32_estlevel
(
cs
->
prevlg
[
0
],
&
cs
->
level
,
&
cs
->
lmax
,
&
cs
->
lmin
,
&
cs
->
lmean
,
&
cs
->
x1
);
/* Scale the excitation codebook */
...
...
libs/broadvoice/src/floating/bv32/bv32excquan.c
浏览文件 @
84324ab7
...
...
@@ -20,8 +20,6 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: bv32excquan.c,v 1.1.1.1 2009/11/19 12:10:48 steveu Exp $
*/
/*! \file */
...
...
@@ -186,9 +184,9 @@ void bv32_excquan(Float *qv, /* output quantized excitation signal vector */
/* THE BEST CODEVECTOR HAS BEEN FOUND; ASSIGN VQ CODEBOOK INDEX */
if
(
sign
==
1
.
0
F
)
idx
[
iv
++
]
=
jmin
;
idx
[
iv
++
]
=
(
int16_t
)
jmin
;
else
idx
[
iv
++
]
=
jmin
+
CBSZ
;
/* MSB of index is sign bit */
idx
[
iv
++
]
=
(
int16_t
)
(
jmin
+
CBSZ
)
;
/* MSB of index is sign bit */
/* BORROW zbuf[] TO STORE FINAL VQ OUTPUT VECTOR WITH CORRECT SIGN */
fp3
=
&
cb
[
jmin
*
VDIM
];
/* fp3 points to start of best codevector */
...
...
libs/broadvoice/src/floating/bv32/bv32lspquan.c
浏览文件 @
84324ab7
...
...
@@ -20,8 +20,6 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: bv32lspquan.c,v 1.1.1.1 2009/11/19 12:10:48 steveu Exp $
*/
/*! \file */
...
...
@@ -153,7 +151,7 @@ static void vqmse(Float *xq, /* VQ output vector (quantized version of input
if
(
d
<
dmin
)
{
dmin
=
d
;
*
idx
=
j
;
*
idx
=
(
int16_t
)
j
;
}
}
...
...
@@ -211,7 +209,7 @@ static void vqwmse_stbl(Float *xq, /* VQ output vector (quantized version of
if
(
d
<
dmin
)
{
dmin
=
d
;
*
idx
=
j
;
*
idx
=
(
int16_t
)
j
;
}
}
}
...
...
@@ -256,7 +254,7 @@ static void vqwmse(Float *xq, /* VQ output vector (quantized version of inp
if
(
d
<
dmin
)
{
dmin
=
d
;
*
idx
=
j
;
*
idx
=
(
int16_t
)
j
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论