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
fc568683
Commit
fc568683
authored
Jul 17, 2015
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cosmetics: Reformat checkasm tests
parent
d37f2326
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
62 deletions
+61
-62
bswapdsp.c
tests/checkasm/bswapdsp.c
+23
-23
h264pred.c
tests/checkasm/h264pred.c
+18
-18
h264qpel.c
tests/checkasm/h264qpel.c
+20
-21
No files found.
tests/checkasm/bswapdsp.c
View file @
fc568683
...
...
@@ -26,31 +26,31 @@
#define BUF_SIZE 512
#define randomize_buffers()\
do {\
int i;\
for (i = 0; i < BUF_SIZE; i += 4) {\
uint32_t r = rnd();\
AV_WN32A(src0
+i, r);
\
AV_WN32A(src1
+i, r);
\
r = rnd();\
AV_WN32A(dst0
+i, r);
\
AV_WN32A(dst1
+i, r);
\
}\
#define randomize_buffers()
\
do {
\
int i;
\
for (i = 0; i < BUF_SIZE; i += 4) {
\
uint32_t r = rnd();
\
AV_WN32A(src0
+ i, r);
\
AV_WN32A(src1
+ i, r);
\
r = rnd();
\
AV_WN32A(dst0
+ i, r);
\
AV_WN32A(dst1
+ i, r);
\
}
\
} while (0)
#define check_bswap(type)\
do {\
int w;\
for (w = 0; w < BUF_SIZE
/sizeof(type); w++) {
\
int offset = (BUF_SIZE
/sizeof(type) - w) & 15;
/* Test various alignments */
\
randomize_buffers();\
call_ref((type
*)dst0+offset, (type*)src0+offset, w);
\
call_new((type
*)dst1+offset, (type*)src1+offset, w);
\
if (memcmp(src0, src1, BUF_SIZE) || memcmp(dst0, dst1, BUF_SIZE))\
fail();\
bench_new((type
*)dst1+offset, (type*)src1+offset, w);
\
}\
#define check_bswap(type)
\
do {
\
int w;
\
for (w = 0; w < BUF_SIZE
/ sizeof(type); w++) {
\
int offset = (BUF_SIZE
/ sizeof(type) - w) & 15;
/* Test various alignments */
\
randomize_buffers();
\
call_ref((type
*)dst0 + offset, (type *)src0 + offset, w);
\
call_new((type
*)dst1 + offset, (type *)src1 + offset, w);
\
if (memcmp(src0, src1, BUF_SIZE) || memcmp(dst0, dst1, BUF_SIZE))
\
fail();
\
bench_new((type
*)dst1 + offset, (type *)src1 + offset, w);
\
}
\
} while (0)
void
checkasm_check_bswapdsp
(
void
)
...
...
tests/checkasm/h264pred.c
View file @
fc568683
...
...
@@ -117,26 +117,26 @@ static const char * const pred16x16_modes[4][9] = {
static
const
uint32_t
pixel_mask
[
3
]
=
{
0xffffffff
,
0x01ff01ff
,
0x03ff03ff
};
#define SIZEOF_PIXEL ((bit_depth + 7) / 8)
#define BUF_SIZE (3
*16*
17)
#define check_pred_func(func, name, mode_name)\
(mode_name && ((codec_ids[codec] == AV_CODEC_ID_H264) ?\
check_func(func, "pred%s_%s_%d", name, mode_name, bit_depth) :
\
check_func(func, "pred%s_%s", name, mode_name)))
#define randomize_buffers()\
do {\
uint32_t mask = pixel_mask[bit_depth
-8];
\
int i;\
for (i = 0; i < BUF_SIZE; i += 4) {\
uint32_t r = rnd() & mask;\
AV_WN32A(buf0
+i, r);
\
AV_WN32A(buf1
+i, r);
\
}\
#define BUF_SIZE (3
* 16 *
17)
#define check_pred_func(func, name, mode_name)
\
(mode_name && ((codec_ids[codec] == AV_CODEC_ID_H264) ?
\
check_func(func, "pred%s_%s_%d", name, mode_name, bit_depth) :
\
check_func(func, "pred%s_%s", name, mode_name)))
#define randomize_buffers()
\
do {
\
uint32_t mask = pixel_mask[bit_depth
- 8];
\
int i;
\
for (i = 0; i < BUF_SIZE; i += 4) {
\
uint32_t r = rnd() & mask;
\
AV_WN32A(buf0
+ i, r);
\
AV_WN32A(buf1
+ i, r);
\
}
\
} while (0)
#define src0 (buf0 + 4
*
16)
/* Offset to allow room for top and left */
#define src1 (buf1 + 4
*
16)
#define src0 (buf0 + 4
*
16)
/* Offset to allow room for top and left */
#define src1 (buf1 + 4
*
16)
static
void
check_pred4x4
(
H264PredContext
*
h
,
uint8_t
*
buf0
,
uint8_t
*
buf1
,
int
codec
,
int
chroma_format
,
int
bit_depth
)
...
...
tests/checkasm/h264qpel.c
View file @
fc568683
...
...
@@ -27,24 +27,24 @@
static
const
uint32_t
pixel_mask
[
3
]
=
{
0xffffffff
,
0x01ff01ff
,
0x03ff03ff
};
#define SIZEOF_PIXEL ((bit_depth + 7) / 8)
#define BUF_SIZE (2
*16*(16+3+
4))
#define BUF_SIZE (2
* 16 * (16 + 3 +
4))
#define randomize_buffers()\
do {\
uint32_t mask = pixel_mask[bit_depth
-8];
\
int k;\
for (k = 0; k < BUF_SIZE; k += 4) {\
uint32_t r = rnd() & mask;\
AV_WN32A(buf0
+k, r);
\
AV_WN32A(buf1
+k, r);
\
r = rnd();\
AV_WN32A(dst0
+k, r);
\
AV_WN32A(dst1
+k, r);
\
}\
#define randomize_buffers()
\
do {
\
uint32_t mask = pixel_mask[bit_depth
- 8];
\
int k;
\
for (k = 0; k < BUF_SIZE; k += 4) {
\
uint32_t r = rnd() & mask;
\
AV_WN32A(buf0
+ k, r);
\
AV_WN32A(buf1
+ k, r);
\
r = rnd();
\
AV_WN32A(dst0
+ k, r);
\
AV_WN32A(dst1
+ k, r);
\
}
\
} while (0)
#define src0 (buf0 + 3
*2*
16)
/* h264qpel functions read data from negative src pointer offsets */
#define src1 (buf1 + 3
*2*
16)
#define src0 (buf0 + 3
* 2 *
16)
/* h264qpel functions read data from negative src pointer offsets */
#define src1 (buf1 + 3
* 2 *
16)
void
checkasm_check_h264qpel
(
void
)
{
...
...
@@ -63,16 +63,15 @@ void checkasm_check_h264qpel(void)
ff_h264qpel_init
(
&
h
,
bit_depth
);
for
(
i
=
0
;
i
<
(
op
?
3
:
4
);
i
++
)
{
int
size
=
16
>>
i
;
for
(
j
=
0
;
j
<
16
;
j
++
)
{
if
(
check_func
(
tab
[
i
][
j
],
"%s_h264_qpel_%d_mc%d%d_%d"
,
op_name
,
size
,
j
&
3
,
j
>>
2
,
bit_depth
))
{
for
(
j
=
0
;
j
<
16
;
j
++
)
if
(
check_func
(
tab
[
i
][
j
],
"%s_h264_qpel_%d_mc%d%d_%d"
,
op_name
,
size
,
j
&
3
,
j
>>
2
,
bit_depth
))
{
randomize_buffers
();
call_ref
(
dst0
,
src0
,
(
ptrdiff_t
)
size
*
SIZEOF_PIXEL
);
call_new
(
dst1
,
src1
,
(
ptrdiff_t
)
size
*
SIZEOF_PIXEL
);
call_ref
(
dst0
,
src0
,
(
ptrdiff_t
)
size
*
SIZEOF_PIXEL
);
call_new
(
dst1
,
src1
,
(
ptrdiff_t
)
size
*
SIZEOF_PIXEL
);
if
(
memcmp
(
buf0
,
buf1
,
BUF_SIZE
)
||
memcmp
(
dst0
,
dst1
,
BUF_SIZE
))
fail
();
bench_new
(
dst1
,
src1
,
(
ptrdiff_t
)
size
*
SIZEOF_PIXEL
);
bench_new
(
dst1
,
src1
,
(
ptrdiff_t
)
size
*
SIZEOF_PIXEL
);
}
}
}
}
report
(
"%s_h264_qpel"
,
op_name
);
...
...
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