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
e316caf7
Commit
e316caf7
authored
Dec 03, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/opusdec: Use avpriv_float_dsp_alloc()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
9fa056ba
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
opus.h
libavcodec/opus.h
+1
-1
opusdec.c
libavcodec/opusdec.c
+6
-3
No files found.
libavcodec/opus.h
View file @
e316caf7
...
@@ -176,7 +176,7 @@ typedef struct OpusContext {
...
@@ -176,7 +176,7 @@ typedef struct OpusContext {
int
nb_streams
;
int
nb_streams
;
int
nb_stereo_streams
;
int
nb_stereo_streams
;
AVFloatDSPContext
fdsp
;
AVFloatDSPContext
*
fdsp
;
int16_t
gain_i
;
int16_t
gain_i
;
float
gain
;
float
gain
;
...
...
libavcodec/opusdec.c
View file @
e316caf7
...
@@ -535,7 +535,7 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data,
...
@@ -535,7 +535,7 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data,
}
}
if
(
c
->
gain_i
)
{
if
(
c
->
gain_i
)
{
c
->
fdsp
.
vector_fmul_scalar
((
float
*
)
frame
->
extended_data
[
i
],
c
->
fdsp
->
vector_fmul_scalar
((
float
*
)
frame
->
extended_data
[
i
],
(
float
*
)
frame
->
extended_data
[
i
],
(
float
*
)
frame
->
extended_data
[
i
],
c
->
gain
,
FFALIGN
(
decoded_samples
,
8
));
c
->
gain
,
FFALIGN
(
decoded_samples
,
8
));
}
}
...
@@ -589,6 +589,7 @@ static av_cold int opus_decode_close(AVCodecContext *avctx)
...
@@ -589,6 +589,7 @@ static av_cold int opus_decode_close(AVCodecContext *avctx)
c
->
nb_streams
=
0
;
c
->
nb_streams
=
0
;
av_freep
(
&
c
->
channel_maps
);
av_freep
(
&
c
->
channel_maps
);
av_freep
(
&
c
->
fdsp
);
return
0
;
return
0
;
}
}
...
@@ -601,7 +602,9 @@ static av_cold int opus_decode_init(AVCodecContext *avctx)
...
@@ -601,7 +602,9 @@ static av_cold int opus_decode_init(AVCodecContext *avctx)
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_FLTP
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_FLTP
;
avctx
->
sample_rate
=
48000
;
avctx
->
sample_rate
=
48000
;
avpriv_float_dsp_init
(
&
c
->
fdsp
,
0
);
c
->
fdsp
=
avpriv_float_dsp_alloc
(
0
);
if
(
!
c
->
fdsp
)
return
AVERROR
(
ENOMEM
);
/* find out the channel configuration */
/* find out the channel configuration */
ret
=
ff_opus_parse_extradata
(
avctx
,
c
);
ret
=
ff_opus_parse_extradata
(
avctx
,
c
);
...
@@ -630,7 +633,7 @@ static av_cold int opus_decode_init(AVCodecContext *avctx)
...
@@ -630,7 +633,7 @@ static av_cold int opus_decode_init(AVCodecContext *avctx)
s
->
redundancy_output
[
j
]
=
s
->
redundancy_buf
[
j
];
s
->
redundancy_output
[
j
]
=
s
->
redundancy_buf
[
j
];
}
}
s
->
fdsp
=
&
c
->
fdsp
;
s
->
fdsp
=
c
->
fdsp
;
s
->
swr
=
swr_alloc
();
s
->
swr
=
swr_alloc
();
if
(
!
s
->
swr
)
if
(
!
s
->
swr
)
...
...
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