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
4b728b47
Commit
4b728b47
authored
Aug 11, 2012
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
g723.1: avoid unnecessary memcpy() in residual_interp()
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
f645710c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
g723_1.c
libavcodec/g723_1.c
+15
-8
No files found.
libavcodec/g723_1.c
View file @
4b728b47
...
@@ -838,10 +838,9 @@ static void residual_interp(int16_t *buf, int16_t *out, int lag,
...
@@ -838,10 +838,9 @@ static void residual_interp(int16_t *buf, int16_t *out, int lag,
int16_t
*
vector_ptr
=
buf
+
PITCH_MAX
;
int16_t
*
vector_ptr
=
buf
+
PITCH_MAX
;
/* Attenuate */
/* Attenuate */
for
(
i
=
0
;
i
<
lag
;
i
++
)
for
(
i
=
0
;
i
<
lag
;
i
++
)
vector_ptr
[
i
-
lag
]
=
vector_ptr
[
i
-
lag
]
*
3
>>
2
;
out
[
i
]
=
vector_ptr
[
i
-
lag
]
*
3
>>
2
;
av_memcpy_backptr
((
uint8_t
*
)
vector_ptr
,
lag
*
sizeof
(
*
vector_ptr
),
av_memcpy_backptr
((
uint8_t
*
)(
out
+
lag
),
lag
*
sizeof
(
*
out
),
FRAME_LEN
*
sizeof
(
*
vector_ptr
));
(
FRAME_LEN
-
lag
)
*
sizeof
(
*
out
));
memcpy
(
out
,
vector_ptr
,
FRAME_LEN
*
sizeof
(
*
vector_ptr
));
}
else
{
/* Unvoiced */
}
else
{
/* Unvoiced */
for
(
i
=
0
;
i
<
FRAME_LEN
;
i
++
)
{
for
(
i
=
0
;
i
<
FRAME_LEN
;
i
++
)
{
*
rseed
=
*
rseed
*
521
+
259
;
*
rseed
=
*
rseed
*
521
+
259
;
...
@@ -1100,23 +1099,31 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1100,23 +1099,31 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
ppf
[
j
].
opt_gain
,
ppf
[
j
].
opt_gain
,
1
<<
14
,
15
,
SUBFRAME_LEN
);
1
<<
14
,
15
,
SUBFRAME_LEN
);
/* Save the excitation for the next frame */
memcpy
(
p
->
prev_excitation
,
p
->
excitation
+
FRAME_LEN
,
PITCH_MAX
*
sizeof
(
*
p
->
excitation
));
}
else
{
}
else
{
p
->
interp_gain
=
(
p
->
interp_gain
*
3
+
2
)
>>
2
;
p
->
interp_gain
=
(
p
->
interp_gain
*
3
+
2
)
>>
2
;
if
(
p
->
erased_frames
==
3
)
{
if
(
p
->
erased_frames
==
3
)
{
/* Mute output */
/* Mute output */
memset
(
p
->
excitation
,
0
,
memset
(
p
->
excitation
,
0
,
(
FRAME_LEN
+
PITCH_MAX
)
*
sizeof
(
*
p
->
excitation
));
(
FRAME_LEN
+
PITCH_MAX
)
*
sizeof
(
*
p
->
excitation
));
memset
(
p
->
prev_excitation
,
0
,
PITCH_MAX
*
sizeof
(
*
p
->
excitation
));
memset
(
p
->
frame
.
data
[
0
],
0
,
memset
(
p
->
frame
.
data
[
0
],
0
,
(
FRAME_LEN
+
LPC_ORDER
)
*
sizeof
(
int16_t
));
(
FRAME_LEN
+
LPC_ORDER
)
*
sizeof
(
int16_t
));
}
else
{
}
else
{
int16_t
*
buf
=
p
->
audio
+
LPC_ORDER
;
/* Regenerate frame */
/* Regenerate frame */
residual_interp
(
p
->
excitation
,
p
->
audio
+
LPC_ORDER
,
p
->
interp_index
,
residual_interp
(
p
->
excitation
,
buf
,
p
->
interp_index
,
p
->
interp_gain
,
&
p
->
random_seed
);
p
->
interp_gain
,
&
p
->
random_seed
);
/* Save the excitation for the next frame */
memcpy
(
p
->
prev_excitation
,
buf
+
(
FRAME_LEN
-
PITCH_MAX
),
PITCH_MAX
*
sizeof
(
*
p
->
excitation
));
}
}
}
}
/* Save the excitation for the next frame */
memcpy
(
p
->
prev_excitation
,
p
->
excitation
+
FRAME_LEN
,
PITCH_MAX
*
sizeof
(
*
p
->
excitation
));
}
else
{
}
else
{
memset
(
out
,
0
,
FRAME_LEN
*
2
);
memset
(
out
,
0
,
FRAME_LEN
*
2
);
av_log
(
avctx
,
AV_LOG_WARNING
,
av_log
(
avctx
,
AV_LOG_WARNING
,
...
...
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