Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
c5dc8cc0
Commit
c5dc8cc0
authored
Dec 03, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mpegaudiodec_float: Use avpriv_float_dsp_alloc()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
e316caf7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
mpegaudiodec_float.c
libavcodec/mpegaudiodec_float.c
+4
-0
mpegaudiodec_template.c
libavcodec/mpegaudiodec_template.c
+16
-3
No files found.
libavcodec/mpegaudiodec_float.c
View file @
c5dc8cc0
...
@@ -46,6 +46,7 @@ AVCodec ff_mp1float_decoder = {
...
@@ -46,6 +46,7 @@ AVCodec ff_mp1float_decoder = {
.
id
=
AV_CODEC_ID_MP1
,
.
id
=
AV_CODEC_ID_MP1
,
.
priv_data_size
=
sizeof
(
MPADecodeContext
),
.
priv_data_size
=
sizeof
(
MPADecodeContext
),
.
init
=
decode_init
,
.
init
=
decode_init
,
.
close
=
decode_close
,
.
decode
=
decode_frame
,
.
decode
=
decode_frame
,
.
capabilities
=
CODEC_CAP_DR1
,
.
capabilities
=
CODEC_CAP_DR1
,
.
flush
=
flush
,
.
flush
=
flush
,
...
@@ -63,6 +64,7 @@ AVCodec ff_mp2float_decoder = {
...
@@ -63,6 +64,7 @@ AVCodec ff_mp2float_decoder = {
.
priv_data_size
=
sizeof
(
MPADecodeContext
),
.
priv_data_size
=
sizeof
(
MPADecodeContext
),
.
init
=
decode_init
,
.
init
=
decode_init
,
.
decode
=
decode_frame
,
.
decode
=
decode_frame
,
.
close
=
decode_close
,
.
capabilities
=
CODEC_CAP_DR1
,
.
capabilities
=
CODEC_CAP_DR1
,
.
flush
=
flush
,
.
flush
=
flush
,
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_FLTP
,
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_FLTP
,
...
@@ -78,6 +80,7 @@ AVCodec ff_mp3float_decoder = {
...
@@ -78,6 +80,7 @@ AVCodec ff_mp3float_decoder = {
.
id
=
AV_CODEC_ID_MP3
,
.
id
=
AV_CODEC_ID_MP3
,
.
priv_data_size
=
sizeof
(
MPADecodeContext
),
.
priv_data_size
=
sizeof
(
MPADecodeContext
),
.
init
=
decode_init
,
.
init
=
decode_init
,
.
close
=
decode_close
,
.
decode
=
decode_frame
,
.
decode
=
decode_frame
,
.
capabilities
=
CODEC_CAP_DR1
,
.
capabilities
=
CODEC_CAP_DR1
,
.
flush
=
flush
,
.
flush
=
flush
,
...
@@ -94,6 +97,7 @@ AVCodec ff_mp3adufloat_decoder = {
...
@@ -94,6 +97,7 @@ AVCodec ff_mp3adufloat_decoder = {
.
id
=
AV_CODEC_ID_MP3ADU
,
.
id
=
AV_CODEC_ID_MP3ADU
,
.
priv_data_size
=
sizeof
(
MPADecodeContext
),
.
priv_data_size
=
sizeof
(
MPADecodeContext
),
.
init
=
decode_init
,
.
init
=
decode_init
,
.
close
=
decode_close
,
.
decode
=
decode_frame_adu
,
.
decode
=
decode_frame_adu
,
.
capabilities
=
CODEC_CAP_DR1
,
.
capabilities
=
CODEC_CAP_DR1
,
.
flush
=
flush
,
.
flush
=
flush
,
...
...
libavcodec/mpegaudiodec_template.c
View file @
c5dc8cc0
...
@@ -85,7 +85,7 @@ typedef struct MPADecodeContext {
...
@@ -85,7 +85,7 @@ typedef struct MPADecodeContext {
int
err_recognition
;
int
err_recognition
;
AVCodecContext
*
avctx
;
AVCodecContext
*
avctx
;
MPADSPContext
mpadsp
;
MPADSPContext
mpadsp
;
AVFloatDSPContext
fdsp
;
AVFloatDSPContext
*
fdsp
;
AVFrame
*
frame
;
AVFrame
*
frame
;
}
MPADecodeContext
;
}
MPADecodeContext
;
...
@@ -406,6 +406,16 @@ static av_cold void decode_init_static(void)
...
@@ -406,6 +406,16 @@ static av_cold void decode_init_static(void)
}
}
}
}
#if USE_FLOATS
static
av_cold
int
decode_close
(
AVCodecContext
*
avctx
)
{
MPADecodeContext
*
s
=
avctx
->
priv_data
;
av_freep
(
&
s
->
fdsp
);
return
0
;
}
#endif
static
av_cold
int
decode_init
(
AVCodecContext
*
avctx
)
static
av_cold
int
decode_init
(
AVCodecContext
*
avctx
)
{
{
static
int
initialized_tables
=
0
;
static
int
initialized_tables
=
0
;
...
@@ -418,7 +428,10 @@ static av_cold int decode_init(AVCodecContext * avctx)
...
@@ -418,7 +428,10 @@ static av_cold int decode_init(AVCodecContext * avctx)
s
->
avctx
=
avctx
;
s
->
avctx
=
avctx
;
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
)
return
AVERROR
(
ENOMEM
);
ff_mpadsp_init
(
&
s
->
mpadsp
);
ff_mpadsp_init
(
&
s
->
mpadsp
);
if
(
avctx
->
request_sample_fmt
==
OUT_FMT
&&
if
(
avctx
->
request_sample_fmt
==
OUT_FMT
&&
...
@@ -1138,7 +1151,7 @@ found2:
...
@@ -1138,7 +1151,7 @@ found2:
/* NOTE: the 1/sqrt(2) normalization factor is included in the
/* NOTE: the 1/sqrt(2) normalization factor is included in the
global gain */
global gain */
#if USE_FLOATS
#if USE_FLOATS
s
->
fdsp
.
butterflies_float
(
g0
->
sb_hybrid
,
g1
->
sb_hybrid
,
576
);
s
->
fdsp
->
butterflies_float
(
g0
->
sb_hybrid
,
g1
->
sb_hybrid
,
576
);
#else
#else
tab0
=
g0
->
sb_hybrid
;
tab0
=
g0
->
sb_hybrid
;
tab1
=
g1
->
sb_hybrid
;
tab1
=
g1
->
sb_hybrid
;
...
...
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