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
39df0c43
Commit
39df0c43
authored
Jan 05, 2012
by
Vitor Sessak
Committed by
Ronald S. Bultje
Jan 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegaudiodec: optimized iMDCT transform
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
06677d0d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
805 additions
and
1 deletion
+805
-1
mpegaudiodec.c
libavcodec/mpegaudiodec.c
+1
-1
Makefile
libavcodec/x86/Makefile
+1
-0
imdct36_sse.asm
libavcodec/x86/imdct36_sse.asm
+721
-0
mpegaudiodec_mmx.c
libavcodec/x86/mpegaudiodec_mmx.c
+80
-0
x86inc.asm
libavutil/x86/x86inc.asm
+2
-0
No files found.
libavcodec/mpegaudiodec.c
View file @
39df0c43
...
...
@@ -58,7 +58,7 @@ typedef struct GranuleDef {
int
preflag
;
int
short_start
,
long_end
;
/* long/short band indexes */
uint8_t
scale_factors
[
40
];
INTFLOAT
sb_hybrid
[
SBLIMIT
*
18
];
/* 576 samples */
DECLARE_ALIGNED
(
16
,
INTFLOAT
,
sb_hybrid
)
[
SBLIMIT
*
18
];
/* 576 samples */
}
GranuleDef
;
typedef
struct
MPADecodeContext
{
...
...
libavcodec/x86/Makefile
View file @
39df0c43
...
...
@@ -33,6 +33,7 @@ YASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o
MMX-OBJS-$(CONFIG_CAVS_DECODER)
+=
x86/cavsdsp_mmx.o
MMX-OBJS-$(CONFIG_DNXHD_ENCODER)
+=
x86/dnxhd_mmx.o
MMX-OBJS-$(CONFIG_MPEGAUDIODSP)
+=
x86/mpegaudiodec_mmx.o
YASM-OBJS-$(CONFIG_MPEGAUDIODSP)
+=
x86/imdct36_sse.o
MMX-OBJS-$(CONFIG_ENCODERS)
+=
x86/dsputilenc_mmx.o
YASM-OBJS-$(CONFIG_ENCODERS)
+=
x86/dsputilenc_yasm.o
MMX-OBJS-$(CONFIG_GPL)
+=
x86/idct_mmx.o
...
...
libavcodec/x86/imdct36_sse.asm
0 → 100644
View file @
39df0c43
This diff is collapsed.
Click to expand it.
libavcodec/x86/mpegaudiodec_mmx.c
View file @
39df0c43
...
...
@@ -24,6 +24,18 @@
#include "libavcodec/dsputil.h"
#include "libavcodec/mpegaudiodsp.h"
void
ff_imdct36_float_sse
(
float
*
out
,
float
*
buf
,
float
*
in
,
float
*
win
);
void
ff_imdct36_float_sse2
(
float
*
out
,
float
*
buf
,
float
*
in
,
float
*
win
);
void
ff_imdct36_float_sse3
(
float
*
out
,
float
*
buf
,
float
*
in
,
float
*
win
);
void
ff_imdct36_float_ssse3
(
float
*
out
,
float
*
buf
,
float
*
in
,
float
*
win
);
void
ff_imdct36_float_avx
(
float
*
out
,
float
*
buf
,
float
*
in
,
float
*
win
);
void
ff_four_imdct36_float_sse
(
float
*
out
,
float
*
buf
,
float
*
in
,
float
*
win
,
float
*
tmpbuf
);
void
ff_four_imdct36_float_avx
(
float
*
out
,
float
*
buf
,
float
*
in
,
float
*
win
,
float
*
tmpbuf
);
DECLARE_ALIGNED
(
16
,
static
float
,
mdct_win_sse
)[
2
][
4
][
4
*
40
];
#define MACS(rt, ra, rb) rt+=(ra)*(rb)
#define MLSS(rt, ra, rb) rt-=(ra)*(rb)
...
...
@@ -147,11 +159,79 @@ static void apply_window_mp3(float *in, float *win, int *unused, float *out,
*
out
=
sum
;
}
#define DECL_IMDCT_BLOCKS(CPU1, CPU2) \
static void imdct36_blocks_ ## CPU1(float *out, float *buf, float *in, \
int count, int switch_point, int block_type) \
{ \
int align_end = count - (count & 3); \
int j; \
for (j = 0; j < align_end; j+= 4) { \
LOCAL_ALIGNED_16(float, tmpbuf, [1024]); \
float *win = mdct_win_sse[switch_point && j < 4][block_type]; \
/* apply window & overlap with previous buffer */
\
\
/* select window */
\
ff_four_imdct36_float_ ## CPU2(out, buf, in, win, tmpbuf); \
in += 4*18; \
buf += 4*18; \
out += 4; \
} \
for (; j < count; j++) { \
/* apply window & overlap with previous buffer */
\
\
/* select window */
\
int win_idx = (switch_point && j < 2) ? 0 : block_type; \
float *win = ff_mdct_win_float[win_idx + (4 & -(j & 1))]; \
\
ff_imdct36_float_ ## CPU1(out, buf, in, win); \
\
in += 18; \
buf++; \
out++; \
} \
}
DECL_IMDCT_BLOCKS
(
sse
,
sse
)
DECL_IMDCT_BLOCKS
(
sse2
,
sse
)
DECL_IMDCT_BLOCKS
(
sse3
,
sse
)
DECL_IMDCT_BLOCKS
(
ssse3
,
sse
)
DECL_IMDCT_BLOCKS
(
avx
,
avx
)
void
ff_mpadsp_init_mmx
(
MPADSPContext
*
s
)
{
int
mm_flags
=
av_get_cpu_flags
();
int
i
,
j
;
for
(
j
=
0
;
j
<
4
;
j
++
)
{
for
(
i
=
0
;
i
<
40
;
i
++
)
{
mdct_win_sse
[
0
][
j
][
4
*
i
]
=
ff_mdct_win_float
[
j
][
i
];
mdct_win_sse
[
0
][
j
][
4
*
i
+
1
]
=
ff_mdct_win_float
[
j
+
4
][
i
];
mdct_win_sse
[
0
][
j
][
4
*
i
+
2
]
=
ff_mdct_win_float
[
j
][
i
];
mdct_win_sse
[
0
][
j
][
4
*
i
+
3
]
=
ff_mdct_win_float
[
j
+
4
][
i
];
mdct_win_sse
[
1
][
j
][
4
*
i
]
=
ff_mdct_win_float
[
0
][
i
];
mdct_win_sse
[
1
][
j
][
4
*
i
+
1
]
=
ff_mdct_win_float
[
4
][
i
];
mdct_win_sse
[
1
][
j
][
4
*
i
+
2
]
=
ff_mdct_win_float
[
j
][
i
];
mdct_win_sse
[
1
][
j
][
4
*
i
+
3
]
=
ff_mdct_win_float
[
j
+
4
][
i
];
}
}
if
(
mm_flags
&
AV_CPU_FLAG_SSE2
)
{
s
->
apply_window_float
=
apply_window_mp3
;
}
#if HAVE_YASM
if
(
mm_flags
&
AV_CPU_FLAG_AVX
&&
HAVE_AVX
)
{
s
->
imdct36_blocks_float
=
imdct36_blocks_avx
;
#if HAVE_SSE
}
else
if
(
mm_flags
&
AV_CPU_FLAG_SSSE3
)
{
s
->
imdct36_blocks_float
=
imdct36_blocks_ssse3
;
}
else
if
(
mm_flags
&
AV_CPU_FLAG_SSE3
)
{
s
->
imdct36_blocks_float
=
imdct36_blocks_sse3
;
}
else
if
(
mm_flags
&
AV_CPU_FLAG_SSE2
)
{
s
->
imdct36_blocks_float
=
imdct36_blocks_sse2
;
}
else
if
(
mm_flags
&
AV_CPU_FLAG_SSE
)
{
s
->
imdct36_blocks_float
=
imdct36_blocks_sse
;
#endif
/* HAVE_SSE */
}
#endif
/* HAVE_YASM */
}
libavutil/x86/x86inc.asm
View file @
39df0c43
...
...
@@ -916,6 +916,8 @@ AVX_INSTR minpd, 1, 0, 1
AVX_INSTR
minps
,
1
,
0
,
1
AVX_INSTR
minsd
,
1
,
0
,
1
AVX_INSTR
minss
,
1
,
0
,
1
AVX_INSTR
movhlps
,
1
,
0
,
0
AVX_INSTR
movlhps
,
1
,
0
,
0
AVX_INSTR
movsd
,
1
,
0
,
0
AVX_INSTR
movss
,
1
,
0
,
0
AVX_INSTR
mpsadbw
,
0
,
1
,
0
...
...
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