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
534f901f
Commit
534f901f
authored
Dec 03, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/atrac3plusdec: Use avpriv_float_dsp_alloc()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
c5dc8cc0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
atrac3plusdec.c
libavcodec/atrac3plusdec.c
+9
-7
No files found.
libavcodec/atrac3plusdec.c
View file @
534f901f
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
typedef
struct
ATRAC3PContext
{
typedef
struct
ATRAC3PContext
{
GetBitContext
gb
;
GetBitContext
gb
;
AVFloatDSPContext
fdsp
;
AVFloatDSPContext
*
fdsp
;
DECLARE_ALIGNED
(
32
,
float
,
samples
)[
2
][
ATRAC3P_FRAME_SAMPLES
];
///< quantized MDCT spectrum
DECLARE_ALIGNED
(
32
,
float
,
samples
)[
2
][
ATRAC3P_FRAME_SAMPLES
];
///< quantized MDCT spectrum
DECLARE_ALIGNED
(
32
,
float
,
mdct_buf
)[
2
][
ATRAC3P_FRAME_SAMPLES
];
///< output of the IMDCT
DECLARE_ALIGNED
(
32
,
float
,
mdct_buf
)[
2
][
ATRAC3P_FRAME_SAMPLES
];
///< output of the IMDCT
...
@@ -67,7 +67,10 @@ typedef struct ATRAC3PContext {
...
@@ -67,7 +67,10 @@ typedef struct ATRAC3PContext {
static
av_cold
int
atrac3p_decode_close
(
AVCodecContext
*
avctx
)
static
av_cold
int
atrac3p_decode_close
(
AVCodecContext
*
avctx
)
{
{
av_freep
(
&
((
ATRAC3PContext
*
)(
avctx
->
priv_data
))
->
ch_units
);
ATRAC3PContext
*
ctx
=
avctx
->
priv_data
;
av_freep
(
&
ctx
->
ch_units
);
av_freep
(
&
ctx
->
fdsp
);
return
0
;
return
0
;
}
}
...
@@ -150,8 +153,6 @@ static av_cold int atrac3p_decode_init(AVCodecContext *avctx)
...
@@ -150,8 +153,6 @@ static av_cold int atrac3p_decode_init(AVCodecContext *avctx)
ff_atrac3p_init_vlcs
();
ff_atrac3p_init_vlcs
();
avpriv_float_dsp_init
(
&
ctx
->
fdsp
,
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
/* initialize IPQF */
/* initialize IPQF */
ff_mdct_init
(
&
ctx
->
ipqf_dct_ctx
,
5
,
1
,
32
.
0
/
32768
.
0
);
ff_mdct_init
(
&
ctx
->
ipqf_dct_ctx
,
5
,
1
,
32
.
0
/
32768
.
0
);
...
@@ -167,8 +168,9 @@ static av_cold int atrac3p_decode_init(AVCodecContext *avctx)
...
@@ -167,8 +168,9 @@ static av_cold int atrac3p_decode_init(AVCodecContext *avctx)
ctx
->
my_channel_layout
=
avctx
->
channel_layout
;
ctx
->
my_channel_layout
=
avctx
->
channel_layout
;
ctx
->
ch_units
=
av_mallocz_array
(
ctx
->
num_channel_blocks
,
sizeof
(
*
ctx
->
ch_units
));
ctx
->
ch_units
=
av_mallocz_array
(
ctx
->
num_channel_blocks
,
sizeof
(
*
ctx
->
ch_units
));
ctx
->
fdsp
=
avpriv_float_dsp_alloc
(
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
if
(
!
ctx
->
ch_units
)
{
if
(
!
ctx
->
ch_units
||
!
ctx
->
fdsp
)
{
atrac3p_decode_close
(
avctx
);
atrac3p_decode_close
(
avctx
);
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
}
}
...
@@ -265,7 +267,7 @@ static void reconstruct_frame(ATRAC3PContext *ctx, Atrac3pChanUnitCtx *ch_unit,
...
@@ -265,7 +267,7 @@ static void reconstruct_frame(ATRAC3PContext *ctx, Atrac3pChanUnitCtx *ch_unit,
for
(
ch
=
0
;
ch
<
num_channels
;
ch
++
)
{
for
(
ch
=
0
;
ch
<
num_channels
;
ch
++
)
{
for
(
sb
=
0
;
sb
<
ch_unit
->
num_subbands
;
sb
++
)
{
for
(
sb
=
0
;
sb
<
ch_unit
->
num_subbands
;
sb
++
)
{
/* inverse transform and windowing */
/* inverse transform and windowing */
ff_atrac3p_imdct
(
&
ctx
->
fdsp
,
&
ctx
->
mdct_ctx
,
ff_atrac3p_imdct
(
ctx
->
fdsp
,
&
ctx
->
mdct_ctx
,
&
ctx
->
samples
[
ch
][
sb
*
ATRAC3P_SUBBAND_SAMPLES
],
&
ctx
->
samples
[
ch
][
sb
*
ATRAC3P_SUBBAND_SAMPLES
],
&
ctx
->
mdct_buf
[
ch
][
sb
*
ATRAC3P_SUBBAND_SAMPLES
],
&
ctx
->
mdct_buf
[
ch
][
sb
*
ATRAC3P_SUBBAND_SAMPLES
],
(
ch_unit
->
channels
[
ch
].
wnd_shape_prev
[
sb
]
<<
1
)
+
(
ch_unit
->
channels
[
ch
].
wnd_shape_prev
[
sb
]
<<
1
)
+
...
@@ -299,7 +301,7 @@ static void reconstruct_frame(ATRAC3PContext *ctx, Atrac3pChanUnitCtx *ch_unit,
...
@@ -299,7 +301,7 @@ static void reconstruct_frame(ATRAC3PContext *ctx, Atrac3pChanUnitCtx *ch_unit,
for
(
sb
=
0
;
sb
<
ch_unit
->
num_subbands
;
sb
++
)
for
(
sb
=
0
;
sb
<
ch_unit
->
num_subbands
;
sb
++
)
if
(
ch_unit
->
channels
[
ch
].
tones_info
[
sb
].
num_wavs
||
if
(
ch_unit
->
channels
[
ch
].
tones_info
[
sb
].
num_wavs
||
ch_unit
->
channels
[
ch
].
tones_info_prev
[
sb
].
num_wavs
)
{
ch_unit
->
channels
[
ch
].
tones_info_prev
[
sb
].
num_wavs
)
{
ff_atrac3p_generate_tones
(
ch_unit
,
&
ctx
->
fdsp
,
ch
,
sb
,
ff_atrac3p_generate_tones
(
ch_unit
,
ctx
->
fdsp
,
ch
,
sb
,
&
ctx
->
time_buf
[
ch
][
sb
*
128
]);
&
ctx
->
time_buf
[
ch
][
sb
*
128
]);
}
}
}
}
...
...
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