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
b59e6b5d
Unverified
Commit
b59e6b5d
authored
Nov 01, 2022
by
Lynne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atrac3: convert to lavu/tx
parent
5f52094f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
configure
configure
+0
-2
atrac3.c
libavcodec/atrac3.c
+8
-5
No files found.
configure
View file @
b59e6b5d
...
...
@@ -2792,8 +2792,6 @@ asv1_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp"
asv2_decoder_select
=
"blockdsp bswapdsp idctdsp"
asv2_encoder_select
=
"aandcttables bswapdsp fdctdsp pixblockdsp"
atrac1_decoder_select
=
"sinewin"
atrac3_decoder_select
=
"mdct"
atrac3al_decoder_select
=
"mdct"
atrac3p_decoder_select
=
"mdct sinewin"
atrac3pal_decoder_select
=
"mdct sinewin"
av1_decoder_select
=
"av1_frame_split_bsf cbs_av1"
...
...
libavcodec/atrac3.c
View file @
b59e6b5d
...
...
@@ -40,12 +40,12 @@
#include "libavutil/libm.h"
#include "libavutil/mem_internal.h"
#include "libavutil/thread.h"
#include "libavutil/tx.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"
#include "fft.h"
#include "get_bits.h"
#include "atrac.h"
...
...
@@ -115,7 +115,8 @@ typedef struct ATRAC3Context {
//@}
AtracGCContext
gainc_ctx
;
FFTContext
mdct_ctx
;
AVTXContext
*
mdct_ctx
;
av_tx_fn
mdct_fn
;
void
(
*
vector_fmul
)(
float
*
dst
,
const
float
*
src0
,
const
float
*
src1
,
int
len
);
}
ATRAC3Context
;
...
...
@@ -147,7 +148,7 @@ static void imlt(ATRAC3Context *q, float *input, float *output, int odd_band)
FFSWAP
(
float
,
input
[
i
],
input
[
255
-
i
]);
}
q
->
mdct_
ctx
.
imdct_calc
(
&
q
->
mdct_ctx
,
output
,
input
);
q
->
mdct_
fn
(
q
->
mdct_ctx
,
output
,
input
,
sizeof
(
float
)
);
/* Perform windowing on the output. */
q
->
vector_fmul
(
output
,
output
,
mdct_window
,
MDCT_SIZE
);
...
...
@@ -201,7 +202,7 @@ static av_cold int atrac3_decode_close(AVCodecContext *avctx)
av_freep
(
&
q
->
units
);
av_freep
(
&
q
->
decoded_bytes_buffer
);
ff_mdct_end
(
&
q
->
mdct_ctx
);
av_tx_uninit
(
&
q
->
mdct_ctx
);
return
0
;
}
...
...
@@ -879,6 +880,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
const
uint8_t
*
edata_ptr
=
avctx
->
extradata
;
ATRAC3Context
*
q
=
avctx
->
priv_data
;
AVFloatDSPContext
*
fdsp
;
float
scale
=
1
.
0
/
32768
;
int
channels
=
avctx
->
ch_layout
.
nb_channels
;
if
(
channels
<
MIN_CHANNELS
||
channels
>
MAX_CHANNELS
)
{
...
...
@@ -977,7 +979,8 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_FLTP
;
/* initialize the MDCT transform */
if
((
ret
=
ff_mdct_init
(
&
q
->
mdct_ctx
,
9
,
1
,
1
.
0
/
32768
))
<
0
)
{
if
((
ret
=
av_tx_init
(
&
q
->
mdct_ctx
,
&
q
->
mdct_fn
,
AV_TX_FLOAT_MDCT
,
1
,
256
,
&
scale
,
AV_TX_FULL_IMDCT
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error initializing MDCT
\n
"
);
return
ret
;
}
...
...
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