Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
69665bd6
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
69665bd6
编写于
8月 11, 2012
作者:
M
Mans Rullgard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
g723.1: do not pass large structs by value
Signed-off-by:
N
Mans Rullgard
<
mans@mansr.com
>
上级
138914dc
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
21 addition
and
21 deletion
+21
-21
libavcodec/g723_1.c
libavcodec/g723_1.c
+21
-21
未找到文件。
libavcodec/g723_1.c
浏览文件 @
69665bd6
...
...
@@ -498,7 +498,7 @@ static void gen_dirac_train(int16_t *buf, int pitch_lag)
* @param pitch_lag closed loop pitch lag
* @param index current subframe index
*/
static
void
gen_fcb_excitation
(
int16_t
*
vector
,
G723_1_Subframe
subfrm
,
static
void
gen_fcb_excitation
(
int16_t
*
vector
,
G723_1_Subframe
*
subfrm
,
enum
Rate
cur_rate
,
int
pitch_lag
,
int
index
)
{
int
temp
,
i
,
j
;
...
...
@@ -506,34 +506,34 @@ static void gen_fcb_excitation(int16_t *vector, G723_1_Subframe subfrm,
memset
(
vector
,
0
,
SUBFRAME_LEN
*
sizeof
(
*
vector
));
if
(
cur_rate
==
RATE_6300
)
{
if
(
subfrm
.
pulse_pos
>=
max_pos
[
index
])
if
(
subfrm
->
pulse_pos
>=
max_pos
[
index
])
return
;
/* Decode amplitudes and positions */
j
=
PULSE_MAX
-
pulses
[
index
];
temp
=
subfrm
.
pulse_pos
;
temp
=
subfrm
->
pulse_pos
;
for
(
i
=
0
;
i
<
SUBFRAME_LEN
/
GRID_SIZE
;
i
++
)
{
temp
-=
combinatorial_table
[
j
][
i
];
if
(
temp
>=
0
)
continue
;
temp
+=
combinatorial_table
[
j
++
][
i
];
if
(
subfrm
.
pulse_sign
&
(
1
<<
(
PULSE_MAX
-
j
)))
{
vector
[
subfrm
.
grid_index
+
GRID_SIZE
*
i
]
=
-
fixed_cb_gain
[
subfrm
.
amp_index
];
if
(
subfrm
->
pulse_sign
&
(
1
<<
(
PULSE_MAX
-
j
)))
{
vector
[
subfrm
->
grid_index
+
GRID_SIZE
*
i
]
=
-
fixed_cb_gain
[
subfrm
->
amp_index
];
}
else
{
vector
[
subfrm
.
grid_index
+
GRID_SIZE
*
i
]
=
fixed_cb_gain
[
subfrm
.
amp_index
];
vector
[
subfrm
->
grid_index
+
GRID_SIZE
*
i
]
=
fixed_cb_gain
[
subfrm
->
amp_index
];
}
if
(
j
==
PULSE_MAX
)
break
;
}
if
(
subfrm
.
dirac_train
==
1
)
if
(
subfrm
->
dirac_train
==
1
)
gen_dirac_train
(
vector
,
pitch_lag
);
}
else
{
/* 5300 bps */
int
cb_gain
=
fixed_cb_gain
[
subfrm
.
amp_index
];
int
cb_shift
=
subfrm
.
grid_index
;
int
cb_sign
=
subfrm
.
pulse_sign
;
int
cb_pos
=
subfrm
.
pulse_pos
;
int
cb_gain
=
fixed_cb_gain
[
subfrm
->
amp_index
];
int
cb_shift
=
subfrm
->
grid_index
;
int
cb_sign
=
subfrm
->
pulse_sign
;
int
cb_pos
=
subfrm
->
pulse_pos
;
int
offset
,
beta
,
lag
;
for
(
i
=
0
;
i
<
8
;
i
+=
2
)
{
...
...
@@ -544,9 +544,9 @@ static void gen_fcb_excitation(int16_t *vector, G723_1_Subframe subfrm,
}
/* Enhance harmonic components */
lag
=
pitch_contrib
[
subfrm
.
ad_cb_gain
<<
1
]
+
pitch_lag
+
subfrm
.
ad_cb_lag
-
1
;
beta
=
pitch_contrib
[(
subfrm
.
ad_cb_gain
<<
1
)
+
1
];
lag
=
pitch_contrib
[
subfrm
->
ad_cb_gain
<<
1
]
+
pitch_lag
+
subfrm
->
ad_cb_lag
-
1
;
beta
=
pitch_contrib
[(
subfrm
->
ad_cb_gain
<<
1
)
+
1
];
if
(
lag
<
SUBFRAME_LEN
-
2
)
{
for
(
i
=
lag
;
i
<
SUBFRAME_LEN
;
i
++
)
...
...
@@ -586,12 +586,12 @@ static int dot_product(const int16_t *a, const int16_t *b, int length)
* Generate adaptive codebook excitation.
*/
static
void
gen_acb_excitation
(
int16_t
*
vector
,
int16_t
*
prev_excitation
,
int
pitch_lag
,
G723_1_Subframe
subfrm
,
int
pitch_lag
,
G723_1_Subframe
*
subfrm
,
enum
Rate
cur_rate
)
{
int16_t
residual
[
SUBFRAME_LEN
+
PITCH_ORDER
-
1
];
const
int16_t
*
cb_ptr
;
int
lag
=
pitch_lag
+
subfrm
.
ad_cb_lag
-
1
;
int
lag
=
pitch_lag
+
subfrm
->
ad_cb_lag
-
1
;
int
i
;
int
sum
;
...
...
@@ -605,7 +605,7 @@ static void gen_acb_excitation(int16_t *vector, int16_t *prev_excitation,
cb_ptr
=
adaptive_cb_gain170
;
/* Calculate adaptive vector */
cb_ptr
+=
subfrm
.
ad_cb_gain
*
20
;
cb_ptr
+=
subfrm
->
ad_cb_gain
*
20
;
for
(
i
=
0
;
i
<
SUBFRAME_LEN
;
i
++
)
{
sum
=
dot_product
(
residual
+
i
,
cb_ptr
,
PITCH_ORDER
);
vector
[
i
]
=
av_sat_dadd32
(
1
<<
15
,
sum
)
>>
16
;
...
...
@@ -1057,10 +1057,10 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
p
->
interp_gain
=
fixed_cb_gain
[(
p
->
subframe
[
2
].
amp_index
+
p
->
subframe
[
3
].
amp_index
)
>>
1
];
for
(
i
=
0
;
i
<
SUBFRAMES
;
i
++
)
{
gen_fcb_excitation
(
vector_ptr
,
p
->
subframe
[
i
],
p
->
cur_rate
,
gen_fcb_excitation
(
vector_ptr
,
&
p
->
subframe
[
i
],
p
->
cur_rate
,
p
->
pitch_lag
[
i
>>
1
],
i
);
gen_acb_excitation
(
acb_vector
,
&
p
->
excitation
[
SUBFRAME_LEN
*
i
],
p
->
pitch_lag
[
i
>>
1
],
p
->
subframe
[
i
],
p
->
pitch_lag
[
i
>>
1
],
&
p
->
subframe
[
i
],
p
->
cur_rate
);
/* Get the total excitation */
for
(
j
=
0
;
j
<
SUBFRAME_LEN
;
j
++
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录