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
4a6aa6d1
Commit
4a6aa6d1
authored
Nov 21, 2017
by
Martin Vignali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkasm : add test for huffyuvdsp add_int16
parent
caf51a57
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
86 additions
and
0 deletions
+86
-0
Makefile
tests/checkasm/Makefile
+1
-0
checkasm.c
tests/checkasm/checkasm.c
+3
-0
checkasm.h
tests/checkasm/checkasm.h
+1
-0
huffyuvdsp.c
tests/checkasm/huffyuvdsp.c
+81
-0
No files found.
tests/checkasm/Makefile
View file @
4a6aa6d1
...
...
@@ -19,6 +19,7 @@ AVCODECOBJS-$(CONFIG_AAC_DECODER) += aacpsdsp.o \
AVCODECOBJS-$(CONFIG_ALAC_DECODER)
+=
alacdsp.o
AVCODECOBJS-$(CONFIG_DCA_DECODER)
+=
synth_filter.o
AVCODECOBJS-$(CONFIG_EXR_DECODER)
+=
exrdsp.o
AVCODECOBJS-$(CONFIG_HUFFYUV_DECODER)
+=
huffyuvdsp.o
AVCODECOBJS-$(CONFIG_JPEG2000_DECODER)
+=
jpeg2000dsp.o
AVCODECOBJS-$(CONFIG_PIXBLOCKDSP)
+=
pixblockdsp.o
AVCODECOBJS-$(CONFIG_HEVC_DECODER)
+=
hevc_add_res.o
hevc_idct.o
...
...
tests/checkasm/checkasm.c
View file @
4a6aa6d1
...
...
@@ -117,6 +117,9 @@ static const struct {
{
"hevc_add_res"
,
checkasm_check_hevc_add_res
},
{
"hevc_idct"
,
checkasm_check_hevc_idct
},
#endif
#if CONFIG_HUFFYUV_DECODER
{
"huffyuvdsp"
,
checkasm_check_huffyuvdsp
},
#endif
#if CONFIG_JPEG2000_DECODER
{
"jpeg2000dsp"
,
checkasm_check_jpeg2000dsp
},
#endif
...
...
tests/checkasm/checkasm.h
View file @
4a6aa6d1
...
...
@@ -57,6 +57,7 @@ void checkasm_check_h264pred(void);
void
checkasm_check_h264qpel
(
void
);
void
checkasm_check_hevc_add_res
(
void
);
void
checkasm_check_hevc_idct
(
void
);
void
checkasm_check_huffyuvdsp
(
void
);
void
checkasm_check_jpeg2000dsp
(
void
);
void
checkasm_check_llviddsp
(
void
);
void
checkasm_check_pixblockdsp
(
void
);
...
...
tests/checkasm/huffyuvdsp.c
0 → 100644
View file @
4a6aa6d1
/*
* Copyright (c) 2016 Alexandra Hájková
*
* 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 "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "libavcodec/huffyuvdsp.h"
#include "checkasm.h"
#define randomize_buffers(buf, size) \
do { \
int j; \
for (j = 0; j < size; j++) \
buf[j] = rnd() & 0xFFFF; \
} while (0)
static
void
check_add_int16
(
HuffYUVDSPContext
c
,
unsigned
mask
,
int
width
,
const
char
*
name
)
{
uint16_t
*
src0
=
av_mallocz
(
width
*
sizeof
(
uint16_t
));
uint16_t
*
src1
=
av_mallocz
(
width
*
sizeof
(
uint16_t
));
uint16_t
*
dst0
=
av_mallocz
(
width
*
sizeof
(
uint16_t
));
uint16_t
*
dst1
=
av_mallocz
(
width
*
sizeof
(
uint16_t
));
declare_func_emms
(
AV_CPU_FLAG_MMX
,
void
,
uint16_t
*
dst
,
uint16_t
*
src
,
unsigned
mask
,
int
w
);
if
(
!
src0
||
!
src1
||
!
dst0
||
!
dst1
)
fail
();
randomize_buffers
(
src0
,
width
);
memcpy
(
src1
,
src0
,
width
*
sizeof
(
uint16_t
));
if
(
check_func
(
c
.
add_int16
,
"%s"
,
name
))
{
call_ref
(
dst0
,
src0
,
mask
,
width
);
call_new
(
dst1
,
src1
,
mask
,
width
);
if
(
memcmp
(
dst0
,
dst1
,
width
*
sizeof
(
uint16_t
)))
fail
();
bench_new
(
dst1
,
src1
,
mask
,
width
);
}
av_free
(
src0
);
av_free
(
src1
);
av_free
(
dst0
);
av_free
(
dst1
);
}
void
checkasm_check_huffyuvdsp
(
void
)
{
HuffYUVDSPContext
c
;
int
width
=
16
*
av_clip
(
rnd
(),
16
,
128
);
ff_huffyuvdsp_init
(
&
c
,
AV_PIX_FMT_YUV422P
);
/*! test width not multiple of mmsize */
check_add_int16
(
c
,
65535
,
width
,
"add_int16_rnd_width"
);
report
(
"add_int16_rnd_width"
);
/*! test always with the same size (for perf test) */
check_add_int16
(
c
,
65535
,
16
*
128
,
"add_int16_128"
);
report
(
"add_int16_128"
);
}
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