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
20a93ea8
Commit
20a93ea8
authored
Nov 19, 2017
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkasm/jpeg2000dsp: refactor rct_int test
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
ca940ed2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
22 deletions
+21
-22
jpeg2000dsp.c
tests/checkasm/jpeg2000dsp.c
+21
-22
No files found.
tests/checkasm/jpeg2000dsp.c
View file @
20a93ea8
...
...
@@ -29,43 +29,42 @@
#define randomize_buffers() \
do { \
int i; \
for (i = 0; i < BUF_SIZE; i += 4) { \
uint32_t r = rnd(); \
AV_WN32A(ref0 + i, r); \
AV_WN32A(new0 + i, r); \
r = rnd(); \
AV_WN32A(ref1 + i, r); \
AV_WN32A(new1 + i, r); \
r = rnd(); \
AV_WN32A(ref2 + i, r); \
AV_WN32A(new2 + i, r); \
} \
for (i = 0; i < BUF_SIZE*3; i++) \
src[i] = rnd(); \
} while (0)
static
void
check_mct
(
uint8_t
*
ref0
,
uint8_t
*
ref1
,
uint8_t
*
ref2
,
uint8_t
*
new0
,
uint8_t
*
new1
,
uint8_t
*
new2
)
{
static
void
check_rct_int
(
void
)
{
LOCAL_ALIGNED_32
(
int32_t
,
src
,
[
BUF_SIZE
*
3
]);
LOCAL_ALIGNED_32
(
int32_t
,
ref
,
[
BUF_SIZE
*
3
]);
LOCAL_ALIGNED_32
(
int32_t
,
new
,
[
BUF_SIZE
*
3
]);
int32_t
*
ref0
=
&
ref
[
BUF_SIZE
*
0
],
*
new0
=
&
new
[
BUF_SIZE
*
0
];
int32_t
*
ref1
=
&
ref
[
BUF_SIZE
*
1
],
*
new1
=
&
new
[
BUF_SIZE
*
1
];
int32_t
*
ref2
=
&
ref
[
BUF_SIZE
*
2
],
*
new2
=
&
new
[
BUF_SIZE
*
2
];
declare_func
(
void
,
void
*
src0
,
void
*
src1
,
void
*
src2
,
int
csize
);
randomize_buffers
();
call_ref
(
ref0
,
ref1
,
ref2
,
BUF_SIZE
/
sizeof
(
int32_t
));
call_new
(
new0
,
new1
,
new2
,
BUF_SIZE
/
sizeof
(
int32_t
));
if
(
memcmp
(
ref0
,
new0
,
BUF_SIZE
)
||
memcmp
(
ref1
,
new1
,
BUF_SIZE
)
||
memcmp
(
ref2
,
new2
,
BUF_SIZE
))
memcpy
(
ref
,
src
,
BUF_SIZE
*
3
*
sizeof
(
*
src
));
memcpy
(
new
,
src
,
BUF_SIZE
*
3
*
sizeof
(
*
src
));
call_ref
(
ref0
,
ref1
,
ref2
,
BUF_SIZE
);
call_new
(
new0
,
new1
,
new2
,
BUF_SIZE
);
if
(
memcmp
(
ref0
,
new0
,
BUF_SIZE
*
sizeof
(
*
src
))
||
memcmp
(
ref1
,
new1
,
BUF_SIZE
*
sizeof
(
*
src
))
||
memcmp
(
ref2
,
new2
,
BUF_SIZE
*
sizeof
(
*
src
)))
fail
();
bench_new
(
new0
,
new1
,
new2
,
BUF_SIZE
/
sizeof
(
int32_t
));
memcpy
(
new
,
src
,
BUF_SIZE
*
3
*
sizeof
(
*
src
));
bench_new
(
new0
,
new1
,
new2
,
BUF_SIZE
);
}
void
checkasm_check_jpeg2000dsp
(
void
)
{
LOCAL_ALIGNED_32
(
uint8_t
,
ref
,
[
BUF_SIZE
*
3
]);
LOCAL_ALIGNED_32
(
uint8_t
,
new
,
[
BUF_SIZE
*
3
]);
Jpeg2000DSPContext
h
;
ff_jpeg2000dsp_init
(
&
h
);
if
(
check_func
(
h
.
mct_decode
[
FF_DWT53
],
"jpeg2000_rct_int"
))
check_mct
(
&
ref
[
BUF_SIZE
*
0
],
&
ref
[
BUF_SIZE
*
1
],
&
ref
[
BUF_SIZE
*
2
],
&
new
[
BUF_SIZE
*
0
],
&
new
[
BUF_SIZE
*
1
],
&
new
[
BUF_SIZE
*
2
]);
check_rct_int
();
report
(
"mct_decode"
);
}
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