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
3d5d4623
Commit
3d5d4623
authored
Feb 01, 2015
by
Diego Biurrun
Committed by
Janne Grunau
Feb 02, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opus: Factor out imdct15 into a standalone component
It will be reused by the AAC decoder.
parent
28df0151
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
46 additions
and
41 deletions
+46
-41
configure
configure
+2
-0
Makefile
libavcodec/Makefile
+2
-2
Makefile
libavcodec/aarch64/Makefile
+2
-2
imdct15_init.c
libavcodec/aarch64/imdct15_init.c
+10
-9
imdct15_neon.S
libavcodec/aarch64/imdct15_neon.S
+0
-0
imdct15.c
libavcodec/imdct15.c
+16
-14
imdct15.h
libavcodec/imdct15.h
+9
-9
opus_celt.c
libavcodec/opus_celt.c
+5
-5
No files found.
configure
View file @
3d5d4623
...
...
@@ -1578,6 +1578,7 @@ CONFIG_EXTRA="
huffyuvencdsp
idctdsp
iirfilter
imdct15
intrax8
lgplv3
lpc
...
...
@@ -1872,6 +1873,7 @@ nellymoser_encoder_select="audio_frame_queue mdct sinewin"
nuv_decoder_select
=
"idctdsp lzo"
on2avc_decoder_select
=
"mdct"
opus_decoder_deps
=
"avresample"
opus_decoder_select
=
"imdct15"
png_decoder_deps
=
"zlib"
png_encoder_deps
=
"zlib"
png_encoder_select
=
"huffyuvencdsp"
...
...
libavcodec/Makefile
View file @
3d5d4623
...
...
@@ -57,6 +57,7 @@ OBJS-$(CONFIG_HUFFYUVDSP) += huffyuvdsp.o
OBJS-$(CONFIG_HUFFYUVENCDSP)
+=
huffyuvencdsp.o
OBJS-$(CONFIG_IDCTDSP)
+=
idctdsp.o
simple_idct.o
jrevdct.o
OBJS-$(CONFIG_IIRFILTER)
+=
iirfilter.o
OBJS-$(CONFIG_IMDCT15)
+=
imdct15.o
OBJS-$(CONFIG_INTRAX8)
+=
intrax8.o
intrax8dsp.o
OBJS-$(CONFIG_LIBXVID)
+=
libxvid_rc.o
OBJS-$(CONFIG_LPC)
+=
lpc.o
...
...
@@ -294,8 +295,7 @@ OBJS-$(CONFIG_NELLYMOSER_ENCODER) += nellymoserenc.o nellymoser.o
OBJS-$(CONFIG_NUV_DECODER)
+=
nuv.o
rtjpeg.o
OBJS-$(CONFIG_ON2AVC_DECODER)
+=
on2avc.o
on2avcdata.o
OBJS-$(CONFIG_OPUS_DECODER)
+=
opusdec.o
opus.o
opus_celt.o
\
opus_imdct.o
opus_silk.o
\
vorbis_data.o
opus_silk.o
vorbis_data.o
OBJS-$(CONFIG_PAF_AUDIO_DECODER)
+=
pafaudio.o
OBJS-$(CONFIG_PAF_VIDEO_DECODER)
+=
pafvideo.o
OBJS-$(CONFIG_PAM_DECODER)
+=
pnmdec.o
pnm.o
...
...
libavcodec/aarch64/Makefile
View file @
3d5d4623
...
...
@@ -3,11 +3,11 @@ OBJS-$(CONFIG_H264CHROMA) += aarch64/h264chroma_init_aarch64.o
OBJS-$(CONFIG_H264DSP)
+=
aarch64/h264dsp_init_aarch64.o
OBJS-$(CONFIG_H264QPEL)
+=
aarch64/h264qpel_init_aarch64.o
OBJS-$(CONFIG_HPELDSP)
+=
aarch64/hpeldsp_init_aarch64.o
OBJS-$(CONFIG_IMDCT15)
+=
aarch64/imdct15_init.o
OBJS-$(CONFIG_MPEGAUDIODSP)
+=
aarch64/mpegaudiodsp_init.o
OBJS-$(CONFIG_NEON_CLOBBER_TEST)
+=
aarch64/neontest.o
OBJS-$(CONFIG_VIDEODSP)
+=
aarch64/videodsp_init.o
OBJS-$(CONFIG_OPUS_DECODER)
+=
aarch64/opus_imdct_init.o
OBJS-$(CONFIG_RV40_DECODER)
+=
aarch64/rv40dsp_init_aarch64.o
OBJS-$(CONFIG_VC1_DECODER)
+=
aarch64/vc1dsp_init_aarch64.o
OBJS-$(CONFIG_VORBIS_DECODER)
+=
aarch64/vorbisdsp_init.o
...
...
@@ -21,8 +21,8 @@ NEON-OBJS-$(CONFIG_H264DSP) += aarch64/h264dsp_neon.o \
NEON-OBJS-$(CONFIG_H264QPEL)
+=
aarch64/h264qpel_neon.o
\
aarch64/hpeldsp_neon.o
NEON-OBJS-$(CONFIG_HPELDSP)
+=
aarch64/hpeldsp_neon.o
NEON-OBJS-$(CONFIG_IMDCT15)
+=
aarch64/imdct15_neon.o
NEON-OBJS-$(CONFIG_MPEGAUDIODSP)
+=
aarch64/mpegaudiodsp_neon.o
NEON-OBJS-$(CONFIG_MDCT)
+=
aarch64/mdct_neon.o
NEON-OBJS-$(CONFIG_OPUS_DECODER)
+=
aarch64/opus_imdct_neon.o
NEON-OBJS-$(CONFIG_VORBIS_DECODER)
+=
aarch64/vorbisdsp_neon.o
libavcodec/aarch64/
opus_imdct
_init.c
→
libavcodec/aarch64/
imdct15
_init.c
View file @
3d5d4623
...
...
@@ -21,21 +21,22 @@
#include "libavutil/cpu.h"
#include "libavutil/aarch64/cpu.h"
#include "libavutil/internal.h"
#include "libavcodec/opus_imdct.h"
#include "libavcodec/imdct15.h"
#include "asm-offsets.h"
AV_CHECK_OFFSET
(
CeltIMDCT
Context
,
exptab
,
CELT_EXPTAB
);
AV_CHECK_OFFSET
(
CeltIMDCT
Context
,
fft_n
,
CELT_FFT_N
);
AV_CHECK_OFFSET
(
CeltIMDCT
Context
,
len2
,
CELT_LEN2
);
AV_CHECK_OFFSET
(
CeltIMDCT
Context
,
len4
,
CELT_LEN4
);
AV_CHECK_OFFSET
(
CeltIMDCT
Context
,
tmp
,
CELT_TMP
);
AV_CHECK_OFFSET
(
CeltIMDCT
Context
,
twiddle_exptab
,
CELT_TWIDDLE
);
AV_CHECK_OFFSET
(
IMDCT15
Context
,
exptab
,
CELT_EXPTAB
);
AV_CHECK_OFFSET
(
IMDCT15
Context
,
fft_n
,
CELT_FFT_N
);
AV_CHECK_OFFSET
(
IMDCT15
Context
,
len2
,
CELT_LEN2
);
AV_CHECK_OFFSET
(
IMDCT15
Context
,
len4
,
CELT_LEN4
);
AV_CHECK_OFFSET
(
IMDCT15
Context
,
tmp
,
CELT_TMP
);
AV_CHECK_OFFSET
(
IMDCT15
Context
,
twiddle_exptab
,
CELT_TWIDDLE
);
void
ff_celt_imdct_half_neon
(
CeltIMDCT
Context
*
s
,
float
*
dst
,
const
float
*
src
,
void
ff_celt_imdct_half_neon
(
IMDCT15
Context
*
s
,
float
*
dst
,
const
float
*
src
,
ptrdiff_t
stride
,
float
scale
);
void
ff_
celt_imdct_init_aarch64
(
CeltIMDCT
Context
*
s
)
void
ff_
imdct15_init_aarch64
(
IMDCT15
Context
*
s
)
{
int
cpu_flags
=
av_get_cpu_flags
();
...
...
libavcodec/aarch64/
opus_imdct
_neon.S
→
libavcodec/aarch64/
imdct15
_neon.S
View file @
3d5d4623
File moved
libavcodec/
opus_imdct
.c
→
libavcodec/
imdct15
.c
View file @
3d5d4623
...
...
@@ -33,8 +33,8 @@
#include "libavutil/common.h"
#include "avfft.h"
#include "imdct15.h"
#include "opus.h"
#include "opus_imdct.h"
// minimal iMDCT size to make SIMD opts easier
#define CELT_MIN_IMDCT_SIZE 120
...
...
@@ -66,9 +66,9 @@ do { \
(d).im = -ri + ir; \
} while (0)
av_cold
void
ff_
celt_imdct_uninit
(
CeltIMDCT
Context
**
ps
)
av_cold
void
ff_
imdct15_uninit
(
IMDCT15
Context
**
ps
)
{
CeltIMDCT
Context
*
s
=
*
ps
;
IMDCT15
Context
*
s
=
*
ps
;
int
i
;
if
(
!
s
)
...
...
@@ -84,12 +84,12 @@ av_cold void ff_celt_imdct_uninit(CeltIMDCTContext **ps)
av_freep
(
ps
);
}
static
void
celt_imdct_half
(
CeltIMDCT
Context
*
s
,
float
*
dst
,
const
float
*
src
,
ptrdiff_t
stride
,
float
scale
);
static
void
imdct15_half
(
IMDCT15
Context
*
s
,
float
*
dst
,
const
float
*
src
,
ptrdiff_t
stride
,
float
scale
);
av_cold
int
ff_
celt_imdct_init
(
CeltIMDCT
Context
**
ps
,
int
N
)
av_cold
int
ff_
imdct15_init
(
IMDCT15
Context
**
ps
,
int
N
)
{
CeltIMDCT
Context
*
s
;
IMDCT15
Context
*
s
;
int
len2
=
15
*
(
1
<<
N
);
int
len
=
2
*
len2
;
int
i
,
j
;
...
...
@@ -134,16 +134,17 @@ av_cold int ff_celt_imdct_init(CeltIMDCTContext **ps, int N)
for
(
j
=
15
;
j
<
19
;
j
++
)
s
->
exptab
[
0
][
j
]
=
s
->
exptab
[
0
][
j
-
15
];
s
->
imdct_half
=
celt_imdct
_half
;
s
->
imdct_half
=
imdct15
_half
;
if
(
ARCH_AARCH64
)
ff_
celt_imdct
_init_aarch64
(
s
);
ff_
imdct15
_init_aarch64
(
s
);
*
ps
=
s
;
return
0
;
fail:
ff_
celt_imdct
_uninit
(
&
s
);
ff_
imdct15
_uninit
(
&
s
);
return
AVERROR
(
ENOMEM
);
}
...
...
@@ -180,7 +181,8 @@ static void fft5(FFTComplex *out, const FFTComplex *in, ptrdiff_t stride)
out
[
4
].
im
=
in
[
0
].
im
+
z
[
0
][
3
].
im
+
z
[
1
][
2
].
im
+
z
[
2
][
1
].
im
+
z
[
3
][
0
].
im
;
}
static
void
fft15
(
CeltIMDCTContext
*
s
,
FFTComplex
*
out
,
const
FFTComplex
*
in
,
ptrdiff_t
stride
)
static
void
fft15
(
IMDCT15Context
*
s
,
FFTComplex
*
out
,
const
FFTComplex
*
in
,
ptrdiff_t
stride
)
{
const
FFTComplex
*
exptab
=
s
->
exptab
[
0
];
FFTComplex
tmp
[
5
];
...
...
@@ -215,7 +217,7 @@ static void fft15(CeltIMDCTContext *s, FFTComplex *out, const FFTComplex *in, pt
/*
* FFT of the length 15 * (2^N)
*/
static
void
fft_calc
(
CeltIMDCT
Context
*
s
,
FFTComplex
*
out
,
const
FFTComplex
*
in
,
static
void
fft_calc
(
IMDCT15
Context
*
s
,
FFTComplex
*
out
,
const
FFTComplex
*
in
,
int
N
,
ptrdiff_t
stride
)
{
if
(
N
)
{
...
...
@@ -241,8 +243,8 @@ static void fft_calc(CeltIMDCTContext *s, FFTComplex *out, const FFTComplex *in,
fft15
(
s
,
out
,
in
,
stride
);
}
static
void
celt_imdct_half
(
CeltIMDCT
Context
*
s
,
float
*
dst
,
const
float
*
src
,
ptrdiff_t
stride
,
float
scale
)
static
void
imdct15_half
(
IMDCT15
Context
*
s
,
float
*
dst
,
const
float
*
src
,
ptrdiff_t
stride
,
float
scale
)
{
FFTComplex
*
z
=
(
FFTComplex
*
)
dst
;
const
int
len8
=
s
->
len4
/
2
;
...
...
libavcodec/
opus_imdct
.h
→
libavcodec/
imdct15
.h
View file @
3d5d4623
...
...
@@ -16,14 +16,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_
OPUS_IMDCT
_H
#define AVCODEC_
OPUS_IMDCT
_H
#ifndef AVCODEC_
IMDCT15
_H
#define AVCODEC_
IMDCT15
_H
#include <stddef.h>
#include "avfft.h"
typedef
struct
CeltIMDCT
Context
{
typedef
struct
IMDCT15
Context
{
int
fft_n
;
int
len2
;
int
len4
;
...
...
@@ -37,21 +37,21 @@ typedef struct CeltIMDCTContext {
/**
* Calculate the middle half of the iMDCT
*/
void
(
*
imdct_half
)(
struct
CeltIMDCT
Context
*
s
,
float
*
dst
,
const
float
*
src
,
void
(
*
imdct_half
)(
struct
IMDCT15
Context
*
s
,
float
*
dst
,
const
float
*
src
,
ptrdiff_t
src_stride
,
float
scale
);
}
CeltIMDCT
Context
;
}
IMDCT15
Context
;
/**
* Init an iMDCT of the length 2 * 15 * (2^N)
*/
int
ff_
celt_imdct_init
(
CeltIMDCT
Context
**
s
,
int
N
);
int
ff_
imdct15_init
(
IMDCT15
Context
**
s
,
int
N
);
/**
* Free an iMDCT.
*/
void
ff_
celt_imdct_uninit
(
CeltIMDCT
Context
**
s
);
void
ff_
imdct15_uninit
(
IMDCT15
Context
**
s
);
void
ff_
celt_imdct_init_aarch64
(
CeltIMDCT
Context
*
s
);
void
ff_
imdct15_init_aarch64
(
IMDCT15
Context
*
s
);
#endif
/* AVCODEC_
OPUS_IMDCT
_H */
#endif
/* AVCODEC_
IMDCT15
_H */
libavcodec/opus_celt.c
View file @
3d5d4623
...
...
@@ -28,8 +28,8 @@
#include "libavutil/float_dsp.h"
#include "imdct15.h"
#include "opus.h"
#include "opus_imdct.h"
enum
CeltSpread
{
CELT_SPREAD_NONE
,
...
...
@@ -61,7 +61,7 @@ typedef struct CeltFrame {
struct
CeltContext
{
// constant values that do not change during context lifetime
AVCodecContext
*
avctx
;
CeltIMDCTContext
*
imdct
[
4
];
IMDCT15Context
*
imdct
[
4
];
AVFloatDSPContext
dsp
;
int
output_channels
;
...
...
@@ -1983,7 +1983,7 @@ int ff_celt_decode_frame(CeltContext *s, OpusRangeCoder *rc,
int
silence
=
0
;
int
transient
=
0
;
int
anticollapse
=
0
;
CeltIMDCT
Context
*
imdct
;
IMDCT15
Context
*
imdct
;
float
imdct_scale
=
1
.
0
;
if
(
coded_channels
!=
1
&&
coded_channels
!=
2
)
{
...
...
@@ -2179,7 +2179,7 @@ void ff_celt_free(CeltContext **ps)
return
;
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
s
->
imdct
);
i
++
)
ff_
celt_imdct
_uninit
(
&
s
->
imdct
[
i
]);
ff_
imdct15
_uninit
(
&
s
->
imdct
[
i
]);
av_freep
(
ps
);
}
...
...
@@ -2203,7 +2203,7 @@ int ff_celt_init(AVCodecContext *avctx, CeltContext **ps, int output_channels)
s
->
output_channels
=
output_channels
;
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
s
->
imdct
);
i
++
)
{
ret
=
ff_
celt_imdct
_init
(
&
s
->
imdct
[
i
],
i
+
3
);
ret
=
ff_
imdct15
_init
(
&
s
->
imdct
[
i
],
i
+
3
);
if
(
ret
<
0
)
goto
fail
;
}
...
...
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