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
d283ee08
Commit
d283ee08
authored
Dec 18, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/g723_1dec: improve stereo support
parent
7a124138
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
g723_1dec.c
libavcodec/g723_1dec.c
+9
-6
No files found.
libavcodec/g723_1dec.c
View file @
d283ee08
...
...
@@ -43,7 +43,6 @@
static
av_cold
int
g723_1_decode_init
(
AVCodecContext
*
avctx
)
{
G723_1_Context
*
s
=
avctx
->
priv_data
;
G723_1_ChannelContext
*
p
=
&
s
->
ch
[
0
];
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16P
;
if
(
avctx
->
channels
<
1
||
avctx
->
channels
>
2
)
{
...
...
@@ -51,13 +50,17 @@ static av_cold int g723_1_decode_init(AVCodecContext *avctx)
return
AVERROR
(
EINVAL
);
}
avctx
->
channel_layout
=
avctx
->
channels
==
1
?
AV_CH_LAYOUT_MONO
:
AV_CH_LAYOUT_STEREO
;
p
->
pf_gain
=
1
<<
12
;
for
(
int
ch
=
0
;
ch
<
avctx
->
channels
;
ch
++
)
{
G723_1_ChannelContext
*
p
=
&
s
->
ch
[
ch
];
memcpy
(
p
->
prev_lsp
,
dc_lsp
,
LPC_ORDER
*
sizeof
(
*
p
->
prev_lsp
));
memcpy
(
p
->
sid_lsp
,
dc_lsp
,
LPC_ORDER
*
sizeof
(
*
p
->
sid_lsp
));
p
->
pf_gain
=
1
<<
12
;
p
->
cng_random_seed
=
CNG_RANDOM_SEED
;
p
->
past_frame_type
=
SID_FRAME
;
memcpy
(
p
->
prev_lsp
,
dc_lsp
,
LPC_ORDER
*
sizeof
(
*
p
->
prev_lsp
));
memcpy
(
p
->
sid_lsp
,
dc_lsp
,
LPC_ORDER
*
sizeof
(
*
p
->
sid_lsp
));
p
->
cng_random_seed
=
CNG_RANDOM_SEED
;
p
->
past_frame_type
=
SID_FRAME
;
}
return
0
;
}
...
...
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