Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
5f52094f
Unverified
Commit
5f52094f
authored
Nov 01, 2022
by
Lynne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atrac1: convert to lavu/tx
parent
978963a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
configure
configure
+1
-1
atrac1.c
libavcodec/atrac1.c
+18
-12
No files found.
configure
View file @
5f52094f
...
...
@@ -2791,7 +2791,7 @@ asv1_decoder_select="blockdsp bswapdsp idctdsp"
asv1_encoder_select
=
"aandcttables bswapdsp fdctdsp pixblockdsp"
asv2_decoder_select
=
"blockdsp bswapdsp idctdsp"
asv2_encoder_select
=
"aandcttables bswapdsp fdctdsp pixblockdsp"
atrac1_decoder_select
=
"
mdct
sinewin"
atrac1_decoder_select
=
"sinewin"
atrac3_decoder_select
=
"mdct"
atrac3al_decoder_select
=
"mdct"
atrac3p_decoder_select
=
"mdct sinewin"
...
...
libavcodec/atrac1.c
View file @
5f52094f
...
...
@@ -32,12 +32,12 @@
#include "libavutil/float_dsp.h"
#include "libavutil/mem_internal.h"
#include "libavutil/tx.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "fft.h"
#include "sinewin.h"
#include "atrac.h"
...
...
@@ -80,7 +80,8 @@ typedef struct AT1Ctx {
DECLARE_ALIGNED
(
32
,
float
,
mid
)[
256
];
DECLARE_ALIGNED
(
32
,
float
,
high
)[
512
];
float
*
bands
[
3
];
FFTContext
mdct_ctx
[
3
];
AVTXContext
*
mdct_ctx
[
3
];
av_tx_fn
mdct_fn
[
3
];
void
(
*
vector_fmul_window
)(
float
*
dst
,
const
float
*
src0
,
const
float
*
src1
,
const
float
*
win
,
int
len
);
}
AT1Ctx
;
...
...
@@ -93,7 +94,8 @@ static const uint8_t mdct_long_nbits[3] = {7, 7, 8};
static
void
at1_imdct
(
AT1Ctx
*
q
,
float
*
spec
,
float
*
out
,
int
nbits
,
int
rev_spec
)
{
FFTContext
*
mdct_context
=
&
q
->
mdct_ctx
[
nbits
-
5
-
(
nbits
>
6
)];
AVTXContext
*
mdct_context
=
q
->
mdct_ctx
[
nbits
-
5
-
(
nbits
>
6
)];
av_tx_fn
mdct_fn
=
q
->
mdct_fn
[
nbits
-
5
-
(
nbits
>
6
)];
int
transf_size
=
1
<<
nbits
;
if
(
rev_spec
)
{
...
...
@@ -101,7 +103,7 @@ static void at1_imdct(AT1Ctx *q, float *spec, float *out, int nbits,
for
(
i
=
0
;
i
<
transf_size
/
2
;
i
++
)
FFSWAP
(
float
,
spec
[
i
],
spec
[
transf_size
-
1
-
i
]);
}
mdct_
context
->
imdct_half
(
mdct_context
,
out
,
spec
);
mdct_
fn
(
mdct_context
,
out
,
spec
,
sizeof
(
float
)
);
}
...
...
@@ -322,9 +324,9 @@ static av_cold int atrac1_decode_end(AVCodecContext * avctx)
{
AT1Ctx
*
q
=
avctx
->
priv_data
;
ff_mdct_end
(
&
q
->
mdct_ctx
[
0
]);
ff_mdct_end
(
&
q
->
mdct_ctx
[
1
]);
ff_mdct_end
(
&
q
->
mdct_ctx
[
2
]);
av_tx_uninit
(
&
q
->
mdct_ctx
[
0
]);
av_tx_uninit
(
&
q
->
mdct_ctx
[
1
]);
av_tx_uninit
(
&
q
->
mdct_ctx
[
2
]);
return
0
;
}
...
...
@@ -335,6 +337,7 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx)
AT1Ctx
*
q
=
avctx
->
priv_data
;
AVFloatDSPContext
*
fdsp
;
int
channels
=
avctx
->
ch_layout
.
nb_channels
;
float
scale
=
-
1
.
0
/
(
1
<<
15
);
int
ret
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_FLTP
;
...
...
@@ -351,12 +354,15 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx)
}
/* Init the mdct transforms */
if
((
ret
=
ff_mdct_init
(
&
q
->
mdct_ctx
[
0
],
6
,
1
,
-
1
.
0
/
(
1
<<
15
)))
||
(
ret
=
ff_mdct_init
(
&
q
->
mdct_ctx
[
1
],
8
,
1
,
-
1
.
0
/
(
1
<<
15
)))
||
(
ret
=
ff_mdct_init
(
&
q
->
mdct_ctx
[
2
],
9
,
1
,
-
1
.
0
/
(
1
<<
15
))))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error initializing MDCT
\n
"
);
if
((
ret
=
av_tx_init
(
&
q
->
mdct_ctx
[
0
],
&
q
->
mdct_fn
[
0
],
AV_TX_FLOAT_MDCT
,
1
,
32
,
&
scale
,
0
)
<
0
))
return
ret
;
if
((
ret
=
av_tx_init
(
&
q
->
mdct_ctx
[
1
],
&
q
->
mdct_fn
[
1
],
AV_TX_FLOAT_MDCT
,
1
,
128
,
&
scale
,
0
)
<
0
))
return
ret
;
if
((
ret
=
av_tx_init
(
&
q
->
mdct_ctx
[
2
],
&
q
->
mdct_fn
[
2
],
AV_TX_FLOAT_MDCT
,
1
,
256
,
&
scale
,
0
)
<
0
))
return
ret
;
}
ff_init_ff_sine_windows
(
5
);
...
...
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