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
cfce4427
Commit
cfce4427
authored
Dec 03, 2017
by
Martin Vignali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkasm/vf_threshold : add checkasm test for threshold8
parent
fa470384
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
0 deletions
+84
-0
Makefile
tests/checkasm/Makefile
+1
-0
checkasm.c
tests/checkasm/checkasm.c
+3
-0
checkasm.h
tests/checkasm/checkasm.h
+1
-0
vf_threshold.c
tests/checkasm/vf_threshold.c
+79
-0
No files found.
tests/checkasm/Makefile
View file @
cfce4427
...
...
@@ -32,6 +32,7 @@ CHECKASMOBJS-$(CONFIG_AVCODEC) += $(AVCODECOBJS-yes)
# libavfilter tests
AVFILTEROBJS-$(CONFIG_BLEND_FILTER)
+=
vf_blend.o
AVFILTEROBJS-$(CONFIG_COLORSPACE_FILTER)
+=
vf_colorspace.o
AVFILTEROBJS-$(CONFIG_THRESHOLD_FILTER)
+=
vf_threshold.o
CHECKASMOBJS-$(CONFIG_AVFILTER)
+=
$(AVFILTEROBJS-yes)
...
...
tests/checkasm/checkasm.c
View file @
cfce4427
...
...
@@ -152,6 +152,9 @@ static const struct {
#if CONFIG_COLORSPACE_FILTER
{
"vf_colorspace"
,
checkasm_check_colorspace
},
#endif
#if CONFIG_THRESHOLD_FILTER
{
"vf_threshold"
,
checkasm_check_vf_threshold
},
#endif
#endif
#if CONFIG_AVUTIL
{
"fixed_dsp"
,
checkasm_check_fixed_dsp
},
...
...
tests/checkasm/checkasm.h
View file @
cfce4427
...
...
@@ -65,6 +65,7 @@ void checkasm_check_sbrdsp(void);
void
checkasm_check_synth_filter
(
void
);
void
checkasm_check_utvideodsp
(
void
);
void
checkasm_check_v210enc
(
void
);
void
checkasm_check_vf_threshold
(
void
);
void
checkasm_check_vp8dsp
(
void
);
void
checkasm_check_vp9dsp
(
void
);
void
checkasm_check_videodsp
(
void
);
...
...
tests/checkasm/vf_threshold.c
0 → 100644
View file @
cfce4427
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with FFmpeg; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <string.h>
#include "checkasm.h"
#include "libavfilter/threshold.h"
#include "libavutil/intreadwrite.h"
#define WIDTH 256
#define WIDTH_PADDED 256 + 32
#define randomize_buffers(buf, size) \
do { \
int j; \
uint8_t *tmp_buf = (uint8_t *)buf;\
for (j = 0; j < size; j++) \
tmp_buf[j] = rnd() & 0xFF; \
} while (0)
static
void
check_threshold_8
(
void
){
LOCAL_ALIGNED_32
(
uint8_t
,
in
,
[
WIDTH_PADDED
]);
LOCAL_ALIGNED_32
(
uint8_t
,
threshold
,
[
WIDTH_PADDED
]);
LOCAL_ALIGNED_32
(
uint8_t
,
min
,
[
WIDTH_PADDED
]);
LOCAL_ALIGNED_32
(
uint8_t
,
max
,
[
WIDTH_PADDED
]);
LOCAL_ALIGNED_32
(
uint8_t
,
out_ref
,
[
WIDTH_PADDED
]);
LOCAL_ALIGNED_32
(
uint8_t
,
out_new
,
[
WIDTH_PADDED
]);
ptrdiff_t
line_size
=
WIDTH_PADDED
;
int
w
=
WIDTH
;
ThresholdContext
s
;
s
.
depth
=
8
;
ff_threshold_init
(
&
s
);
declare_func
(
void
,
const
uint8_t
*
in
,
const
uint8_t
*
threshold
,
const
uint8_t
*
min
,
const
uint8_t
*
max
,
uint8_t
*
out
,
ptrdiff_t
ilinesize
,
ptrdiff_t
tlinesize
,
ptrdiff_t
flinesize
,
ptrdiff_t
slinesize
,
ptrdiff_t
olinesize
,
int
w
,
int
h
);
memset
(
in
,
0
,
WIDTH_PADDED
);
memset
(
threshold
,
0
,
WIDTH_PADDED
);
memset
(
min
,
0
,
WIDTH_PADDED
);
memset
(
max
,
0
,
WIDTH_PADDED
);
memset
(
out_ref
,
0
,
WIDTH_PADDED
);
memset
(
out_new
,
0
,
WIDTH_PADDED
);
randomize_buffers
(
in
,
WIDTH
);
randomize_buffers
(
threshold
,
WIDTH
);
randomize_buffers
(
min
,
WIDTH
);
randomize_buffers
(
max
,
WIDTH
);
if
(
check_func
(
s
.
threshold
,
"threshold8"
))
{
call_ref
(
in
,
threshold
,
min
,
max
,
out_ref
,
line_size
,
line_size
,
line_size
,
line_size
,
line_size
,
w
,
1
);
call_new
(
in
,
threshold
,
min
,
max
,
out_new
,
line_size
,
line_size
,
line_size
,
line_size
,
line_size
,
w
,
1
);
if
(
memcmp
(
out_ref
,
out_new
,
w
))
fail
();
bench_new
(
in
,
threshold
,
min
,
max
,
out_new
,
line_size
,
line_size
,
line_size
,
line_size
,
line_size
,
w
,
1
);
}
}
void
checkasm_check_vf_threshold
(
void
)
{
check_threshold_8
();
report
(
"threshold8"
);
}
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