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
b2af2c4b
Commit
b2af2c4b
authored
Aug 11, 2012
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
g723.1: make scale_vector() output to a separate buffer
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
783da0d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
g723_1.c
libavcodec/g723_1.c
+6
-7
No files found.
libavcodec/g723_1.c
View file @
b2af2c4b
...
...
@@ -278,7 +278,7 @@ static int normalize_bits(int num, int width)
/**
* Scale vector contents based on the largest of their absolutes.
*/
static
int
scale_vector
(
int16_t
*
vector
,
int
length
)
static
int
scale_vector
(
int16_t
*
dst
,
const
int16_t
*
vector
,
int
length
)
{
int
bits
,
max
=
0
;
int
i
;
...
...
@@ -292,10 +292,10 @@ static int scale_vector(int16_t *vector, int length)
if
(
bits
==
15
)
for
(
i
=
0
;
i
<
length
;
i
++
)
vector
[
i
]
=
vector
[
i
]
*
0x7fff
>>
3
;
dst
[
i
]
=
vector
[
i
]
*
0x7fff
>>
3
;
else
for
(
i
=
0
;
i
<
length
;
i
++
)
vector
[
i
]
=
vector
[
i
]
<<
bits
>>
3
;
dst
[
i
]
=
vector
[
i
]
<<
bits
>>
3
;
return
bits
-
3
;
}
...
...
@@ -791,11 +791,11 @@ static int comp_interp_index(G723_1_Context *p, int pitch_lag,
int
*
exc_eng
,
int
*
scale
)
{
int
offset
=
PITCH_MAX
+
2
*
SUBFRAME_LEN
;
int16_t
*
buf
=
p
->
excitation
+
offset
;
const
int16_t
*
buf
=
p
->
excitation
+
offset
;
int
index
,
ccr
,
tgt_eng
,
best_eng
,
temp
;
*
scale
=
scale_vector
(
p
->
excitation
,
FRAME_LEN
+
PITCH_MAX
);
*
scale
=
scale_vector
(
p
->
excitation
,
p
->
excitation
,
FRAME_LEN
+
PITCH_MAX
);
/* Compute maximum backward cross-correlation */
ccr
=
0
;
...
...
@@ -958,8 +958,7 @@ static void formant_postfilter(G723_1_Context *p, int16_t *lpc, int16_t *buf)
int
scale
,
energy
;
/* Normalize */
memcpy
(
temp_vector
,
buf_ptr
,
SUBFRAME_LEN
*
sizeof
(
*
temp_vector
));
scale
=
scale_vector
(
temp_vector
,
SUBFRAME_LEN
);
scale
=
scale_vector
(
temp_vector
,
buf_ptr
,
SUBFRAME_LEN
);
/* Compute auto correlation coefficients */
auto_corr
[
0
]
=
dot_product
(
temp_vector
,
temp_vector
+
1
,
...
...
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