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
46f929ad
Commit
46f929ad
authored
May 02, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavr: x86: optimized 2-channel s16p to flt conversion
parent
13df7d2d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
0 deletions
+58
-0
audio_convert.asm
libavresample/x86/audio_convert.asm
+49
-0
audio_convert_init.c
libavresample/x86/audio_convert_init.c
+9
-0
No files found.
libavresample/x86/audio_convert.asm
View file @
46f929ad
...
@@ -383,6 +383,55 @@ INIT_XMM avx
...
@@ -383,6 +383,55 @@ INIT_XMM avx
CONV_S16P_TO_S16_6CH
CONV_S16P_TO_S16_6CH
%endif
%endif
;------------------------------------------------------------------------------
; void ff_conv_s16p_to_flt_2ch(float *dst, int16_t *const *src, int len,
; int channels);
;------------------------------------------------------------------------------
%macro
CONV_S16P_TO_FLT_2CH
0
cglobal
conv_s16p_to_flt_2ch
,
3
,
4
,
6
,
dst
,
src0
,
len
,
src1
lea
lenq
,
[
2
*
lend
]
mov
src1q
,
[
src0q
+
gprsize
]
mov
src0q
,
[
src0q
]
lea
dstq
,
[
dstq
+
4
*
lenq
]
add
src0q
,
lenq
add
src1q
,
lenq
neg
lenq
mova
m5
,
[
pf_s32_inv_scale
]
.
loop
:
mova
m2
,
[
src0q
+
lenq
]
; m2 = 0, 2, 4, 6, 8, 10, 12, 14
mova
m4
,
[
src1q
+
lenq
]
; m4 = 1, 3, 5, 7, 9, 11, 13, 15
SBUTTERFLY2
wd
,
2
,
4
,
3
; m2 = 0, 1, 2, 3, 4, 5, 6, 7
; m4 = 8, 9, 10, 11, 12, 13, 14, 15
pxor
m3
,
m3
punpcklwd
m0
,
m3
,
m2
; m0 = 0, 1, 2, 3
punpckhwd
m1
,
m3
,
m2
; m1 = 4, 5, 6, 7
punpcklwd
m2
,
m3
,
m4
; m2 = 8, 9, 10, 11
punpckhwd
m3
,
m4
; m3 = 12, 13, 14, 15
cvtdq2ps
m0
,
m0
cvtdq2ps
m1
,
m1
cvtdq2ps
m2
,
m2
cvtdq2ps
m3
,
m3
mulps
m0
,
m5
mulps
m1
,
m5
mulps
m2
,
m5
mulps
m3
,
m5
mova
[
dstq
+
4
*
lenq
]
,
m0
mova
[
dstq
+
4
*
lenq
+
mmsize
]
,
m1
mova
[
dstq
+
4
*
lenq
+
2
*
mmsize
]
,
m2
mova
[
dstq
+
4
*
lenq
+
3
*
mmsize
]
,
m3
add
lenq
,
mmsize
jl
.
loop
REP_RET
%endmacro
INIT_XMM
sse2
CONV_S16P_TO_FLT_2CH
%if
HAVE_AVX
INIT_XMM
avx
CONV_S16P_TO_FLT_2CH
%endif
;-----------------------------------------------------------------------------
;-----------------------------------------------------------------------------
; void ff_conv_fltp_to_flt_6ch(float *dst, float *const *src, int len,
; void ff_conv_fltp_to_flt_6ch(float *dst, float *const *src, int len,
; int channels);
; int channels);
...
...
libavresample/x86/audio_convert_init.c
View file @
46f929ad
...
@@ -54,6 +54,11 @@ extern void ff_conv_s16p_to_s16_6ch_sse2slow(int16_t *dst, int16_t *const *src,
...
@@ -54,6 +54,11 @@ extern void ff_conv_s16p_to_s16_6ch_sse2slow(int16_t *dst, int16_t *const *src,
extern
void
ff_conv_s16p_to_s16_6ch_avx
(
int16_t
*
dst
,
int16_t
*
const
*
src
,
extern
void
ff_conv_s16p_to_s16_6ch_avx
(
int16_t
*
dst
,
int16_t
*
const
*
src
,
int
len
,
int
channels
);
int
len
,
int
channels
);
extern
void
ff_conv_s16p_to_flt_2ch_sse2
(
float
*
dst
,
int16_t
*
const
*
src
,
int
len
,
int
channels
);
extern
void
ff_conv_s16p_to_flt_2ch_avx
(
float
*
dst
,
int16_t
*
const
*
src
,
int
len
,
int
channels
);
extern
void
ff_conv_fltp_to_flt_6ch_mmx
(
float
*
dst
,
float
*
const
*
src
,
int
len
,
extern
void
ff_conv_fltp_to_flt_6ch_mmx
(
float
*
dst
,
float
*
const
*
src
,
int
len
,
int
channels
);
int
channels
);
extern
void
ff_conv_fltp_to_flt_6ch_sse4
(
float
*
dst
,
float
*
const
*
src
,
int
len
,
extern
void
ff_conv_fltp_to_flt_6ch_sse4
(
float
*
dst
,
float
*
const
*
src
,
int
len
,
...
@@ -94,6 +99,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
...
@@ -94,6 +99,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
0
,
16
,
16
,
"SSE2"
,
ff_conv_flt_to_s32_sse2
);
0
,
16
,
16
,
"SSE2"
,
ff_conv_flt_to_s32_sse2
);
ff_audio_convert_set_func
(
ac
,
AV_SAMPLE_FMT_S16
,
AV_SAMPLE_FMT_S16P
,
ff_audio_convert_set_func
(
ac
,
AV_SAMPLE_FMT_S16
,
AV_SAMPLE_FMT_S16P
,
2
,
16
,
16
,
"SSE2"
,
ff_conv_s16p_to_s16_2ch_sse2
);
2
,
16
,
16
,
"SSE2"
,
ff_conv_s16p_to_s16_2ch_sse2
);
ff_audio_convert_set_func
(
ac
,
AV_SAMPLE_FMT_FLT
,
AV_SAMPLE_FMT_S16P
,
2
,
16
,
8
,
"SSE2"
,
ff_conv_s16p_to_flt_2ch_sse2
);
}
}
if
(
mm_flags
&
AV_CPU_FLAG_SSE4
&&
HAVE_SSE
)
{
if
(
mm_flags
&
AV_CPU_FLAG_SSE4
&&
HAVE_SSE
)
{
ff_audio_convert_set_func
(
ac
,
AV_SAMPLE_FMT_FLT
,
AV_SAMPLE_FMT_S16
,
ff_audio_convert_set_func
(
ac
,
AV_SAMPLE_FMT_FLT
,
AV_SAMPLE_FMT_S16
,
...
@@ -110,6 +117,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
...
@@ -110,6 +117,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
2
,
16
,
16
,
"AVX"
,
ff_conv_s16p_to_s16_2ch_avx
);
2
,
16
,
16
,
"AVX"
,
ff_conv_s16p_to_s16_2ch_avx
);
ff_audio_convert_set_func
(
ac
,
AV_SAMPLE_FMT_S16
,
AV_SAMPLE_FMT_S16P
,
ff_audio_convert_set_func
(
ac
,
AV_SAMPLE_FMT_S16
,
AV_SAMPLE_FMT_S16P
,
6
,
16
,
8
,
"AVX"
,
ff_conv_s16p_to_s16_6ch_avx
);
6
,
16
,
8
,
"AVX"
,
ff_conv_s16p_to_s16_6ch_avx
);
ff_audio_convert_set_func
(
ac
,
AV_SAMPLE_FMT_FLT
,
AV_SAMPLE_FMT_S16P
,
2
,
16
,
8
,
"AVX"
,
ff_conv_s16p_to_flt_2ch_avx
);
ff_audio_convert_set_func
(
ac
,
AV_SAMPLE_FMT_FLT
,
AV_SAMPLE_FMT_FLTP
,
ff_audio_convert_set_func
(
ac
,
AV_SAMPLE_FMT_FLT
,
AV_SAMPLE_FMT_FLTP
,
6
,
16
,
4
,
"AVX"
,
ff_conv_fltp_to_flt_6ch_avx
);
6
,
16
,
4
,
"AVX"
,
ff_conv_fltp_to_flt_6ch_avx
);
}
}
...
...
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