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
7fd2c138
Commit
7fd2c138
authored
Jul 03, 2011
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dct-test: make speed test optional
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
cf2b4f88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
dct-test.c
libavcodec/dct-test.c
+18
-6
No files found.
libavcodec/dct-test.c
View file @
7fd2c138
...
...
@@ -200,7 +200,7 @@ static inline void mmx_emms(void)
#endif
}
static
void
dct_error
(
const
struct
algo
*
dct
,
int
test
,
int
is_idct
)
static
void
dct_error
(
const
struct
algo
*
dct
,
int
test
,
int
is_idct
,
int
speed
)
{
int
it
,
i
,
scale
;
int
err_inf
,
v
;
...
...
@@ -303,6 +303,9 @@ static void dct_error(const struct algo *dct, int test, int is_idct)
(
double
)
err2
/
NB_ITS
/
64
.
0
,
(
double
)
sysErrMax
/
NB_ITS
,
maxout
,
blockSumErrMax
);
if
(
!
speed
)
return
;
/* speed test */
for
(
i
=
0
;
i
<
64
;
i
++
)
block1
[
i
]
=
0
;
...
...
@@ -439,7 +442,8 @@ static void idct248_ref(uint8_t *dest, int linesize, int16_t *block)
static
void
idct248_error
(
const
char
*
name
,
void
(
*
idct248_put
)(
uint8_t
*
dest
,
int
line_size
,
int16_t
*
block
))
int16_t
*
block
),
int
speed
)
{
int
it
,
i
,
it1
,
ti
,
ti1
,
err_max
,
v
;
AVLFG
prng
;
...
...
@@ -473,6 +477,9 @@ static void idct248_error(const char *name,
}
printf
(
"%s %s: err_inf=%d
\n
"
,
1
?
"IDCT248"
:
"DCT248"
,
name
,
err_max
);
if
(
!
speed
)
return
;
ti
=
gettime
();
it1
=
0
;
do
{
...
...
@@ -497,7 +504,8 @@ static void help(void)
" 1 -> test with random sparse matrixes
\n
"
" 2 -> do 3. test from mpeg4 std
\n
"
"-i test IDCT implementations
\n
"
"-4 test IDCT248 implementations
\n
"
);
"-4 test IDCT248 implementations
\n
"
"-t speed test
\n
"
);
}
int
main
(
int
argc
,
char
**
argv
)
...
...
@@ -505,6 +513,7 @@ int main(int argc, char **argv)
int
test_idct
=
0
,
test_248_dct
=
0
;
int
c
,
i
;
int
test
=
1
;
int
speed
=
0
;
cpu_flags
=
av_get_cpu_flags
();
...
...
@@ -519,7 +528,7 @@ int main(int argc, char **argv)
}
for
(;;)
{
c
=
getopt
(
argc
,
argv
,
"ih4"
);
c
=
getopt
(
argc
,
argv
,
"ih4
t
"
);
if
(
c
==
-
1
)
break
;
switch
(
c
)
{
...
...
@@ -529,6 +538,9 @@ int main(int argc, char **argv)
case
'4'
:
test_248_dct
=
1
;
break
;
case
't'
:
speed
=
1
;
break
;
default:
case
'h'
:
help
();
...
...
@@ -542,12 +554,12 @@ int main(int argc, char **argv)
printf
(
"ffmpeg DCT/IDCT test
\n
"
);
if
(
test_248_dct
)
{
idct248_error
(
"SIMPLE-C"
,
ff_simple_idct248_put
);
idct248_error
(
"SIMPLE-C"
,
ff_simple_idct248_put
,
speed
);
}
else
{
const
struct
algo
*
algos
=
test_idct
?
idct_tab
:
fdct_tab
;
for
(
i
=
0
;
algos
[
i
].
name
;
i
++
)
if
(
!
(
~
cpu_flags
&
algos
[
i
].
mm_support
))
{
dct_error
(
&
algos
[
i
],
test
,
test_idct
);
dct_error
(
&
algos
[
i
],
test
,
test_idct
,
speed
);
}
}
return
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