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
1aca990b
Commit
1aca990b
authored
Nov 30, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/libmp3lame: Use avpriv_float_dsp_alloc()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
2fbb9e64
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
libmp3lame.c
libavcodec/libmp3lame.c
+9
-3
No files found.
libavcodec/libmp3lame.c
View file @
1aca990b
...
...
@@ -52,7 +52,7 @@ typedef struct LAMEContext {
int
abr
;
float
*
samples_flt
[
2
];
AudioFrameQueue
afq
;
AVFloatDSPContext
fdsp
;
AVFloatDSPContext
*
fdsp
;
}
LAMEContext
;
...
...
@@ -79,6 +79,7 @@ static av_cold int mp3lame_encode_close(AVCodecContext *avctx)
av_freep
(
&
s
->
samples_flt
[
0
]);
av_freep
(
&
s
->
samples_flt
[
1
]);
av_freep
(
&
s
->
buffer
);
av_freep
(
&
s
->
fdsp
);
ff_af_queue_close
(
&
s
->
afq
);
...
...
@@ -158,7 +159,12 @@ static av_cold int mp3lame_encode_init(AVCodecContext *avctx)
if
(
ret
<
0
)
goto
error
;
avpriv_float_dsp_init
(
&
s
->
fdsp
,
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
s
->
fdsp
=
avpriv_float_dsp_alloc
(
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
if
(
!
s
->
fdsp
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
error
;
}
return
0
;
error:
...
...
@@ -197,7 +203,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
return
AVERROR
(
EINVAL
);
}
for
(
ch
=
0
;
ch
<
avctx
->
channels
;
ch
++
)
{
s
->
fdsp
.
vector_fmul_scalar
(
s
->
samples_flt
[
ch
],
s
->
fdsp
->
vector_fmul_scalar
(
s
->
samples_flt
[
ch
],
(
const
float
*
)
frame
->
data
[
ch
],
32768
.
0
f
,
FFALIGN
(
frame
->
nb_samples
,
8
));
...
...
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