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
f61ce90c
Commit
f61ce90c
authored
May 29, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavr: add x86-optimized functions for mixing 1-to-2 s16p with flt coeffs
parent
29f7490c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
0 deletions
+60
-0
audio_mix.asm
libavresample/x86/audio_mix.asm
+47
-0
audio_mix_init.c
libavresample/x86/audio_mix_init.c
+13
-0
No files found.
libavresample/x86/audio_mix.asm
View file @
f61ce90c
...
@@ -184,3 +184,50 @@ MIX_1_TO_2_FLTP_FLT
...
@@ -184,3 +184,50 @@ MIX_1_TO_2_FLTP_FLT
INIT_YMM
avx
INIT_YMM
avx
MIX_1_TO_2_FLTP_FLT
MIX_1_TO_2_FLTP_FLT
%endif
%endif
;-----------------------------------------------------------------------------
; void ff_mix_1_to_2_s16p_flt(int16_t **src, float **matrix, int len,
; int out_ch, int in_ch);
;-----------------------------------------------------------------------------
%macro
MIX_1_TO_2_S16P_FLT
0
cglobal
mix_1_to_2_s16p_flt
,
3
,
5
,
6
,
src0
,
matrix0
,
len
,
src1
,
matrix1
mov
src1q
,
[
src0q
+
gprsize
]
mov
src0q
,
[src0q]
sub
src1q
,
src0q
mov
matrix1q
,
[
matrix0q
+
gprsize
]
mov
matrix0q
,
[matrix0q]
VBROADCASTSS
m4
,
[matrix0q]
VBROADCASTSS
m5
,
[matrix1q]
ALIGN
16
.
loop
:
mova
m0
,
[src0q]
S16_TO_S32_SX
0
,
2
cvtdq2ps
m0
,
m0
cvtdq2ps
m2
,
m2
mulps
m1
,
m0
,
m5
mulps
m0
,
m0
,
m4
mulps
m3
,
m2
,
m5
mulps
m2
,
m2
,
m4
cvtps2dq
m0
,
m0
cvtps2dq
m1
,
m1
cvtps2dq
m2
,
m2
cvtps2dq
m3
,
m3
packssdw
m0
,
m2
packssdw
m1
,
m3
mova
[
src0q
]
,
m0
mova
[
src0q
+
src1q
]
,
m1
add
src0q
,
mmsize
sub
lend
,
mmsize
/
2
jg
.
loop
REP_RET
%endmacro
INIT_XMM
sse2
MIX_1_TO_2_S16P_FLT
INIT_XMM
sse4
MIX_1_TO_2_S16P_FLT
%if
HAVE_AVX
INIT_XMM
avx
MIX_1_TO_2_S16P_FLT
%endif
libavresample/x86/audio_mix_init.c
View file @
f61ce90c
...
@@ -40,6 +40,13 @@ extern void ff_mix_1_to_2_fltp_flt_sse(float **src, float **matrix, int len,
...
@@ -40,6 +40,13 @@ extern void ff_mix_1_to_2_fltp_flt_sse(float **src, float **matrix, int len,
extern
void
ff_mix_1_to_2_fltp_flt_avx
(
float
**
src
,
float
**
matrix
,
int
len
,
extern
void
ff_mix_1_to_2_fltp_flt_avx
(
float
**
src
,
float
**
matrix
,
int
len
,
int
out_ch
,
int
in_ch
);
int
out_ch
,
int
in_ch
);
extern
void
ff_mix_1_to_2_s16p_flt_sse2
(
int16_t
**
src
,
float
**
matrix
,
int
len
,
int
out_ch
,
int
in_ch
);
extern
void
ff_mix_1_to_2_s16p_flt_sse4
(
int16_t
**
src
,
float
**
matrix
,
int
len
,
int
out_ch
,
int
in_ch
);
extern
void
ff_mix_1_to_2_s16p_flt_avx
(
int16_t
**
src
,
float
**
matrix
,
int
len
,
int
out_ch
,
int
in_ch
);
av_cold
void
ff_audio_mix_init_x86
(
AudioMix
*
am
)
av_cold
void
ff_audio_mix_init_x86
(
AudioMix
*
am
)
{
{
#if HAVE_YASM
#if HAVE_YASM
...
@@ -56,16 +63,22 @@ av_cold void ff_audio_mix_init_x86(AudioMix *am)
...
@@ -56,16 +63,22 @@ av_cold void ff_audio_mix_init_x86(AudioMix *am)
2
,
1
,
16
,
8
,
"SSE2"
,
ff_mix_2_to_1_s16p_flt_sse2
);
2
,
1
,
16
,
8
,
"SSE2"
,
ff_mix_2_to_1_s16p_flt_sse2
);
ff_audio_mix_set_func
(
am
,
AV_SAMPLE_FMT_S16P
,
AV_MIX_COEFF_TYPE_Q8
,
ff_audio_mix_set_func
(
am
,
AV_SAMPLE_FMT_S16P
,
AV_MIX_COEFF_TYPE_Q8
,
2
,
1
,
16
,
8
,
"SSE2"
,
ff_mix_2_to_1_s16p_q8_sse2
);
2
,
1
,
16
,
8
,
"SSE2"
,
ff_mix_2_to_1_s16p_q8_sse2
);
ff_audio_mix_set_func
(
am
,
AV_SAMPLE_FMT_S16P
,
AV_MIX_COEFF_TYPE_FLT
,
1
,
2
,
16
,
8
,
"SSE2"
,
ff_mix_1_to_2_s16p_flt_sse2
);
}
}
if
(
mm_flags
&
AV_CPU_FLAG_SSE4
&&
HAVE_SSE
)
{
if
(
mm_flags
&
AV_CPU_FLAG_SSE4
&&
HAVE_SSE
)
{
ff_audio_mix_set_func
(
am
,
AV_SAMPLE_FMT_S16P
,
AV_MIX_COEFF_TYPE_FLT
,
ff_audio_mix_set_func
(
am
,
AV_SAMPLE_FMT_S16P
,
AV_MIX_COEFF_TYPE_FLT
,
2
,
1
,
16
,
8
,
"SSE4"
,
ff_mix_2_to_1_s16p_flt_sse4
);
2
,
1
,
16
,
8
,
"SSE4"
,
ff_mix_2_to_1_s16p_flt_sse4
);
ff_audio_mix_set_func
(
am
,
AV_SAMPLE_FMT_S16P
,
AV_MIX_COEFF_TYPE_FLT
,
1
,
2
,
16
,
8
,
"SSE4"
,
ff_mix_1_to_2_s16p_flt_sse4
);
}
}
if
(
mm_flags
&
AV_CPU_FLAG_AVX
&&
HAVE_AVX
)
{
if
(
mm_flags
&
AV_CPU_FLAG_AVX
&&
HAVE_AVX
)
{
ff_audio_mix_set_func
(
am
,
AV_SAMPLE_FMT_FLTP
,
AV_MIX_COEFF_TYPE_FLT
,
ff_audio_mix_set_func
(
am
,
AV_SAMPLE_FMT_FLTP
,
AV_MIX_COEFF_TYPE_FLT
,
2
,
1
,
32
,
16
,
"AVX"
,
ff_mix_2_to_1_fltp_flt_avx
);
2
,
1
,
32
,
16
,
"AVX"
,
ff_mix_2_to_1_fltp_flt_avx
);
ff_audio_mix_set_func
(
am
,
AV_SAMPLE_FMT_FLTP
,
AV_MIX_COEFF_TYPE_FLT
,
ff_audio_mix_set_func
(
am
,
AV_SAMPLE_FMT_FLTP
,
AV_MIX_COEFF_TYPE_FLT
,
1
,
2
,
32
,
8
,
"AVX"
,
ff_mix_1_to_2_fltp_flt_avx
);
1
,
2
,
32
,
8
,
"AVX"
,
ff_mix_1_to_2_fltp_flt_avx
);
ff_audio_mix_set_func
(
am
,
AV_SAMPLE_FMT_S16P
,
AV_MIX_COEFF_TYPE_FLT
,
1
,
2
,
16
,
8
,
"AVX"
,
ff_mix_1_to_2_s16p_flt_avx
);
}
}
#endif
#endif
}
}
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