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
73edb58c
Commit
73edb58c
authored
Apr 29, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swr: float_to_int16_sse2()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
5932938c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
audio_convert.asm
libswresample/x86/audio_convert.asm
+33
-0
swresample_x86.c
libswresample/x86/swresample_x86.c
+3
-0
No files found.
libswresample/x86/audio_convert.asm
View file @
73edb58c
...
@@ -25,6 +25,7 @@ SECTION_RODATA
...
@@ -25,6 +25,7 @@ SECTION_RODATA
flt2pm31
:
times
8
dd
4
.
6566129
e
-
10
flt2pm31
:
times
8
dd
4
.
6566129
e
-
10
flt2p31
:
times
8
dd
2147483648
.
0
flt2p31
:
times
8
dd
2147483648
.
0
flt2p15
:
times
8
dd
32768
.
0
SECTION
.
text
SECTION
.
text
...
@@ -163,6 +164,36 @@ float_to_int32_u_int %+ SUFFIX
...
@@ -163,6 +164,36 @@ float_to_int32_u_int %+ SUFFIX
REP_RET
REP_RET
%endmacro
%endmacro
%macro
FLOAT_TO_INT16
1
cglobal
float_to_int16_
%1
,
3
,
3
,
3
,
dst
,
src
,
len
mov
srcq
,
[srcq]
mov
dstq
,
[dstq]
%ifidn
%1
,
a
test
dstq
,
mmsize
-
1
jne
float_to_int16_u_int
%
+
SUFFIX
test
srcq
,
mmsize
-
1
jne
float_to_int16_u_int
%
+
SUFFIX
%else
float_to_int16_u_int
%
+
SUFFIX
%endif
lea
srcq
,
[
srcq
+
2
*
lenq
]
add
dstq
,
lenq
neg
lenq
mova
m2
,
[flt2p15]
.
next
:
mov%1
m0
,
[
srcq
+
2
*
lenq
]
mov%1
m1
,
[
mmsize
+
srcq
+
2
*
lenq
]
mulps
m0
,
m2
mulps
m1
,
m2
cvtps2dq
m0
,
m0
cvtps2dq
m1
,
m1
packssdw
m0
,
m1
mov%1
[
dstq
+
lenq
]
,
m0
add
lenq
,
mmsize
jl
.
next
REP_RET
%endmacro
INIT_MMX
mmx
INIT_MMX
mmx
INT16_TO_INT32
u
INT16_TO_INT32
u
...
@@ -179,3 +210,5 @@ INT16_TO_FLOAT u
...
@@ -179,3 +210,5 @@ INT16_TO_FLOAT u
INT16_TO_FLOAT
a
INT16_TO_FLOAT
a
FLOAT_TO_INT32
u
FLOAT_TO_INT32
u
FLOAT_TO_INT32
a
FLOAT_TO_INT32
a
FLOAT_TO_INT16
u
FLOAT_TO_INT16
a
libswresample/x86/swresample_x86.c
View file @
73edb58c
...
@@ -29,6 +29,7 @@ MULTI_CAPS_FUNC_DECL(sse)
...
@@ -29,6 +29,7 @@ MULTI_CAPS_FUNC_DECL(sse)
void
ff_int32_to_float_a_sse2
(
uint8_t
**
dst
,
const
uint8_t
**
src
,
int
len
);
void
ff_int32_to_float_a_sse2
(
uint8_t
**
dst
,
const
uint8_t
**
src
,
int
len
);
void
ff_int16_to_float_a_sse2
(
uint8_t
**
dst
,
const
uint8_t
**
src
,
int
len
);
void
ff_int16_to_float_a_sse2
(
uint8_t
**
dst
,
const
uint8_t
**
src
,
int
len
);
void
ff_float_to_int32_a_sse2
(
uint8_t
**
dst
,
const
uint8_t
**
src
,
int
len
);
void
ff_float_to_int32_a_sse2
(
uint8_t
**
dst
,
const
uint8_t
**
src
,
int
len
);
void
ff_float_to_int16_a_sse2
(
uint8_t
**
dst
,
const
uint8_t
**
src
,
int
len
);
void
swri_audio_convert_init_x86
(
struct
AudioConvert
*
ac
,
void
swri_audio_convert_init_x86
(
struct
AudioConvert
*
ac
,
enum
AVSampleFormat
out_fmt
,
enum
AVSampleFormat
out_fmt
,
...
@@ -56,5 +57,7 @@ MULTI_CAPS_FUNC(AV_CPU_FLAG_SSE, sse)
...
@@ -56,5 +57,7 @@ MULTI_CAPS_FUNC(AV_CPU_FLAG_SSE, sse)
ac
->
simd_f
=
ff_int16_to_float_a_sse2
;
ac
->
simd_f
=
ff_int16_to_float_a_sse2
;
if
(
out_fmt
==
AV_SAMPLE_FMT_S32
&&
in_fmt
==
AV_SAMPLE_FMT_FLT
||
out_fmt
==
AV_SAMPLE_FMT_S32P
&&
in_fmt
==
AV_SAMPLE_FMT_FLTP
)
if
(
out_fmt
==
AV_SAMPLE_FMT_S32
&&
in_fmt
==
AV_SAMPLE_FMT_FLT
||
out_fmt
==
AV_SAMPLE_FMT_S32P
&&
in_fmt
==
AV_SAMPLE_FMT_FLTP
)
ac
->
simd_f
=
ff_float_to_int32_a_sse2
;
ac
->
simd_f
=
ff_float_to_int32_a_sse2
;
if
(
out_fmt
==
AV_SAMPLE_FMT_S16
&&
in_fmt
==
AV_SAMPLE_FMT_FLT
||
out_fmt
==
AV_SAMPLE_FMT_S16P
&&
in_fmt
==
AV_SAMPLE_FMT_FLTP
)
ac
->
simd_f
=
ff_float_to_int16_a_sse2
;
}
}
}
}
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