Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
cefb7e00
Commit
cefb7e00
authored
Dec 11, 2017
by
Martin Vignali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkasm/vf_hflip : add test for vf_hflip byte and short simd
parent
46f534bd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
0 deletions
+82
-0
Makefile
tests/checkasm/Makefile
+1
-0
checkasm.c
tests/checkasm/checkasm.c
+3
-0
checkasm.h
tests/checkasm/checkasm.h
+1
-0
vf_hflip.c
tests/checkasm/vf_hflip.c
+76
-0
checkasm.mak
tests/fate/checkasm.mak
+1
-0
No files found.
tests/checkasm/Makefile
View file @
cefb7e00
...
...
@@ -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_HFLIP_FILTER)
+=
vf_hflip.o
AVFILTEROBJS-$(CONFIG_THRESHOLD_FILTER)
+=
vf_threshold.o
CHECKASMOBJS-$(CONFIG_AVFILTER)
+=
$(AVFILTEROBJS-yes)
...
...
tests/checkasm/checkasm.c
View file @
cefb7e00
...
...
@@ -152,6 +152,9 @@ static const struct {
#if CONFIG_COLORSPACE_FILTER
{
"vf_colorspace"
,
checkasm_check_colorspace
},
#endif
#if CONFIG_HFLIP_FILTER
{
"vf_hflip"
,
checkasm_check_vf_hflip
},
#endif
#if CONFIG_THRESHOLD_FILTER
{
"vf_threshold"
,
checkasm_check_vf_threshold
},
#endif
...
...
tests/checkasm/checkasm.h
View file @
cefb7e00
...
...
@@ -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_hflip
(
void
);
void
checkasm_check_vf_threshold
(
void
);
void
checkasm_check_vp8dsp
(
void
);
void
checkasm_check_vp9dsp
(
void
);
...
...
tests/checkasm/vf_hflip.c
0 → 100644
View file @
cefb7e00
/*
* 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/hflip.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_hflip
(
int
step
,
const
char
*
report_name
){
LOCAL_ALIGNED_32
(
uint8_t
,
src
,
[
WIDTH_PADDED
]);
LOCAL_ALIGNED_32
(
uint8_t
,
dst_ref
,
[
WIDTH_PADDED
]);
LOCAL_ALIGNED_32
(
uint8_t
,
dst_new
,
[
WIDTH_PADDED
]);
int
w
=
WIDTH
;
int
i
;
int
step_array
[
4
]
=
{
1
,
1
,
1
,
1
};
FlipContext
s
;
declare_func
(
void
,
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
w
);
memset
(
src
,
0
,
WIDTH_PADDED
);
memset
(
dst_ref
,
0
,
WIDTH_PADDED
);
memset
(
dst_new
,
0
,
WIDTH_PADDED
);
randomize_buffers
(
src
,
WIDTH_PADDED
);
if
(
step
==
2
)
{
w
/=
2
;
for
(
i
=
0
;
i
<
4
;
i
++
)
step_array
[
i
]
=
step
;
}
ff_hflip_init
(
&
s
,
step_array
,
4
);
if
(
check_func
(
s
.
flip_line
[
0
],
"hflip_%s"
,
report_name
))
{
for
(
i
=
1
;
i
<
w
;
i
++
)
{
call_ref
(
src
+
(
w
-
1
)
*
step
,
dst_ref
,
i
);
call_new
(
src
+
(
w
-
1
)
*
step
,
dst_new
,
i
);
if
(
memcmp
(
dst_ref
,
dst_new
,
i
*
step
))
fail
();
}
bench_new
(
src
+
(
w
-
1
)
*
step
,
dst_new
,
w
);
}
}
void
checkasm_check_vf_hflip
(
void
)
{
check_hflip
(
1
,
"byte"
);
report
(
"hflip_byte"
);
check_hflip
(
2
,
"short"
);
report
(
"hflip_short"
);
}
tests/fate/checkasm.mak
View file @
cefb7e00
...
...
@@ -22,6 +22,7 @@ FATE_CHECKASM = fate-checkasm-aacpsdsp \
fate-checkasm-v210enc \
fate-checkasm-vf_blend \
fate-checkasm-vf_colorspace \
fate-checkasm-vf_hflip \
fate-checkasm-vf_threshold \
fate-checkasm-videodsp \
fate-checkasm-vp8dsp \
...
...
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