Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
783da0d6
Commit
783da0d6
authored
Aug 11, 2012
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
g723.1: make autocorr_max() work on an arbitrary buffer
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
37161051
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
g723_1.c
libavcodec/g723_1.c
+5
-6
No files found.
libavcodec/g723_1.c
View file @
783da0d6
...
...
@@ -615,18 +615,17 @@ static void gen_acb_excitation(int16_t *vector, int16_t *prev_excitation,
/**
* Estimate maximum auto-correlation around pitch lag.
*
* @param
p the context
* @param
buf buffer with offset applied
* @param offset offset of the excitation vector
* @param ccr_max pointer to the maximum auto-correlation
* @param pitch_lag decoded pitch lag
* @param length length of autocorrelation
* @param dir forward lag(1) / backward lag(-1)
*/
static
int
autocorr_max
(
G723_1_Context
*
p
,
int
offset
,
int
*
ccr_max
,
static
int
autocorr_max
(
const
int16_t
*
buf
,
int
offset
,
int
*
ccr_max
,
int
pitch_lag
,
int
length
,
int
dir
)
{
int
limit
,
ccr
,
lag
=
0
;
int16_t
*
buf
=
p
->
excitation
+
offset
;
int
i
;
pitch_lag
=
FFMIN
(
PITCH_MAX
-
3
,
pitch_lag
);
...
...
@@ -721,9 +720,9 @@ static void comp_ppf_coeff(G723_1_Context *p, int offset, int pitch_lag,
*/
int
energy
[
5
]
=
{
0
,
0
,
0
,
0
,
0
};
int16_t
*
buf
=
p
->
excitation
+
offset
;
int
fwd_lag
=
autocorr_max
(
p
,
offset
,
&
energy
[
1
],
pitch_lag
,
int
fwd_lag
=
autocorr_max
(
buf
,
offset
,
&
energy
[
1
],
pitch_lag
,
SUBFRAME_LEN
,
1
);
int
back_lag
=
autocorr_max
(
p
,
offset
,
&
energy
[
3
],
pitch_lag
,
int
back_lag
=
autocorr_max
(
buf
,
offset
,
&
energy
[
3
],
pitch_lag
,
SUBFRAME_LEN
,
-
1
);
ppf
->
index
=
0
;
...
...
@@ -800,7 +799,7 @@ static int comp_interp_index(G723_1_Context *p, int pitch_lag,
/* Compute maximum backward cross-correlation */
ccr
=
0
;
index
=
autocorr_max
(
p
,
offset
,
&
ccr
,
pitch_lag
,
SUBFRAME_LEN
*
2
,
-
1
);
index
=
autocorr_max
(
buf
,
offset
,
&
ccr
,
pitch_lag
,
SUBFRAME_LEN
*
2
,
-
1
);
ccr
=
av_sat_add32
(
ccr
,
1
<<
15
)
>>
16
;
/* Compute target energy */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment