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
128e1fbf
Commit
128e1fbf
authored
Apr 10, 2017
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/float_dsp: add test for vector_dmac_scalar
parent
0da3c568
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
float_dsp.c
libavutil/tests/float_dsp.c
+24
-0
No files found.
libavutil/tests/float_dsp.c
View file @
128e1fbf
...
@@ -144,6 +144,26 @@ static int test_vector_fmul_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *c
...
@@ -144,6 +144,26 @@ static int test_vector_fmul_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *c
return
ret
;
return
ret
;
}
}
#define ARBITRARY_DMAC_SCALAR_CONST 0.005
static
int
test_vector_dmac_scalar
(
AVFloatDSPContext
*
fdsp
,
AVFloatDSPContext
*
cdsp
,
const
double
*
v1
,
const
double
*
src0
,
double
scale
)
{
LOCAL_ALIGNED
(
32
,
double
,
cdst
,
[
LEN
]);
LOCAL_ALIGNED
(
32
,
double
,
odst
,
[
LEN
]);
int
ret
;
memcpy
(
cdst
,
v1
,
LEN
*
sizeof
(
*
v1
));
memcpy
(
odst
,
v1
,
LEN
*
sizeof
(
*
v1
));
cdsp
->
vector_dmac_scalar
(
cdst
,
src0
,
scale
,
LEN
);
fdsp
->
vector_dmac_scalar
(
odst
,
src0
,
scale
,
LEN
);
if
(
ret
=
compare_doubles
(
cdst
,
odst
,
LEN
,
ARBITRARY_DMAC_SCALAR_CONST
))
av_log
(
NULL
,
AV_LOG_ERROR
,
"vector_dmac_scalar failed
\n
"
);
return
ret
;
}
static
int
test_vector_dmul_scalar
(
AVFloatDSPContext
*
fdsp
,
AVFloatDSPContext
*
cdsp
,
static
int
test_vector_dmul_scalar
(
AVFloatDSPContext
*
fdsp
,
AVFloatDSPContext
*
cdsp
,
const
double
*
v1
,
double
scale
)
const
double
*
v1
,
double
scale
)
{
{
...
@@ -262,6 +282,7 @@ int main(int argc, char **argv)
...
@@ -262,6 +282,7 @@ int main(int argc, char **argv)
LOCAL_ALIGNED
(
32
,
float
,
src2
,
[
LEN
]);
LOCAL_ALIGNED
(
32
,
float
,
src2
,
[
LEN
]);
LOCAL_ALIGNED
(
32
,
double
,
dbl_src0
,
[
LEN
]);
LOCAL_ALIGNED
(
32
,
double
,
dbl_src0
,
[
LEN
]);
LOCAL_ALIGNED
(
32
,
double
,
dbl_src1
,
[
LEN
]);
LOCAL_ALIGNED
(
32
,
double
,
dbl_src1
,
[
LEN
]);
LOCAL_ALIGNED
(
32
,
double
,
dbl_src2
,
[
LEN
]);
for
(;;)
{
for
(;;)
{
int
arg
=
getopt
(
argc
,
argv
,
"s:c:"
);
int
arg
=
getopt
(
argc
,
argv
,
"s:c:"
);
...
@@ -306,6 +327,7 @@ int main(int argc, char **argv)
...
@@ -306,6 +327,7 @@ int main(int argc, char **argv)
fill_double_array
(
&
lfg
,
dbl_src0
,
LEN
);
fill_double_array
(
&
lfg
,
dbl_src0
,
LEN
);
fill_double_array
(
&
lfg
,
dbl_src1
,
LEN
);
fill_double_array
(
&
lfg
,
dbl_src1
,
LEN
);
fill_double_array
(
&
lfg
,
dbl_src2
,
LEN
);
if
(
test_vector_fmul
(
fdsp
,
cdsp
,
src0
,
src1
))
if
(
test_vector_fmul
(
fdsp
,
cdsp
,
src0
,
src1
))
ret
-=
1
<<
0
;
ret
-=
1
<<
0
;
...
@@ -325,6 +347,8 @@ int main(int argc, char **argv)
...
@@ -325,6 +347,8 @@ int main(int argc, char **argv)
ret
-=
1
<<
7
;
ret
-=
1
<<
7
;
if
(
test_vector_dmul_scalar
(
fdsp
,
cdsp
,
dbl_src0
,
dbl_src1
[
0
]))
if
(
test_vector_dmul_scalar
(
fdsp
,
cdsp
,
dbl_src0
,
dbl_src1
[
0
]))
ret
-=
1
<<
8
;
ret
-=
1
<<
8
;
if
(
test_vector_dmac_scalar
(
fdsp
,
cdsp
,
dbl_src2
,
dbl_src0
,
dbl_src1
[
0
]))
ret
-=
1
<<
9
;
end:
end:
av_freep
(
&
fdsp
);
av_freep
(
&
fdsp
);
...
...
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