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
d3e0766f
Commit
d3e0766f
authored
Aug 02, 2012
by
Kostya Shishkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
g723_1: scale output as supposed for the case with postfilter disabled
parent
94bfdfd6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
g723_1.c
libavcodec/g723_1.c
+10
-4
No files found.
libavcodec/g723_1.c
View file @
d3e0766f
...
@@ -1012,6 +1012,7 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1012,6 +1012,7 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
int16_t
lpc
[
SUBFRAMES
*
LPC_ORDER
];
int16_t
lpc
[
SUBFRAMES
*
LPC_ORDER
];
int16_t
acb_vector
[
SUBFRAME_LEN
];
int16_t
acb_vector
[
SUBFRAME_LEN
];
int16_t
*
vector_ptr
;
int16_t
*
vector_ptr
;
int16_t
*
out
;
int
bad_frame
=
0
,
i
,
j
,
ret
;
int
bad_frame
=
0
,
i
,
j
,
ret
;
if
(
buf_size
<
frame_size
[
dec_mode
])
{
if
(
buf_size
<
frame_size
[
dec_mode
])
{
...
@@ -1037,6 +1038,8 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1037,6 +1038,8 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
return
ret
;
return
ret
;
}
}
out
=
(
int16_t
*
)
p
->
frame
.
data
[
0
];
if
(
p
->
cur_frame_type
==
ACTIVE_FRAME
)
{
if
(
p
->
cur_frame_type
==
ACTIVE_FRAME
)
{
if
(
!
bad_frame
)
if
(
!
bad_frame
)
p
->
erased_frames
=
0
;
p
->
erased_frames
=
0
;
...
@@ -1120,7 +1123,7 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1120,7 +1123,7 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
memcpy
(
p
->
prev_excitation
,
p
->
excitation
+
FRAME_LEN
,
memcpy
(
p
->
prev_excitation
,
p
->
excitation
+
FRAME_LEN
,
PITCH_MAX
*
sizeof
(
*
p
->
excitation
));
PITCH_MAX
*
sizeof
(
*
p
->
excitation
));
}
else
{
}
else
{
memset
(
p
->
frame
.
data
[
0
]
,
0
,
FRAME_LEN
*
2
);
memset
(
out
,
0
,
FRAME_LEN
*
2
);
av_log
(
avctx
,
AV_LOG_WARNING
,
av_log
(
avctx
,
AV_LOG_WARNING
,
"G.723.1: Comfort noise generation not supported yet
\n
"
);
"G.723.1: Comfort noise generation not supported yet
\n
"
);
...
@@ -1138,10 +1141,13 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1138,10 +1141,13 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
0
,
1
,
1
<<
12
);
0
,
1
,
1
<<
12
);
memcpy
(
p
->
synth_mem
,
p
->
audio
+
FRAME_LEN
,
LPC_ORDER
*
sizeof
(
*
p
->
audio
));
memcpy
(
p
->
synth_mem
,
p
->
audio
+
FRAME_LEN
,
LPC_ORDER
*
sizeof
(
*
p
->
audio
));
if
(
p
->
postfilter
)
if
(
p
->
postfilter
)
{
formant_postfilter
(
p
,
lpc
,
p
->
audio
);
formant_postfilter
(
p
,
lpc
,
p
->
audio
);
memcpy
(
p
->
frame
.
data
[
0
],
p
->
audio
+
LPC_ORDER
,
FRAME_LEN
*
2
);
memcpy
(
p
->
frame
.
data
[
0
],
p
->
audio
+
LPC_ORDER
,
FRAME_LEN
*
2
);
}
else
{
// if output is not postfiltered it should be scaled by 2
for
(
i
=
0
;
i
<
FRAME_LEN
;
i
++
)
out
[
i
]
=
av_clip_int16
(
p
->
audio
[
LPC_ORDER
+
i
]
<<
1
);
}
*
got_frame_ptr
=
1
;
*
got_frame_ptr
=
1
;
*
(
AVFrame
*
)
data
=
p
->
frame
;
*
(
AVFrame
*
)
data
=
p
->
frame
;
...
...
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