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
76c370af
Commit
76c370af
authored
Mar 04, 2019
by
James Darnley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkasm: add test for v210dec
parent
e2cbf24f
Hide whitespace changes
Inline
Side-by-side
Showing
4 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
v210dec.c
tests/checkasm/v210dec.c
+77
-0
No files found.
tests/checkasm/Makefile
View file @
76c370af
...
...
@@ -25,6 +25,7 @@ AVCODECOBJS-$(CONFIG_JPEG2000_DECODER) += jpeg2000dsp.o
AVCODECOBJS-$(CONFIG_PIXBLOCKDSP)
+=
pixblockdsp.o
AVCODECOBJS-$(CONFIG_HEVC_DECODER)
+=
hevc_add_res.o
hevc_idct.o
hevc_sao.o
AVCODECOBJS-$(CONFIG_UTVIDEO_DECODER)
+=
utvideodsp.o
AVCODECOBJS-$(CONFIG_V210_DECODER)
+=
v210dec.o
AVCODECOBJS-$(CONFIG_V210_ENCODER)
+=
v210enc.o
AVCODECOBJS-$(CONFIG_VP9_DECODER)
+=
vp9dsp.o
...
...
tests/checkasm/checkasm.c
View file @
76c370af
...
...
@@ -136,6 +136,9 @@ static const struct {
#if CONFIG_UTVIDEO_DECODER
{
"utvideodsp"
,
checkasm_check_utvideodsp
},
#endif
#if CONFIG_V210_DECODER
{
"v210dec"
,
checkasm_check_v210dec
},
#endif
#if CONFIG_V210_ENCODER
{
"v210enc"
,
checkasm_check_v210enc
},
#endif
...
...
tests/checkasm/checkasm.h
View file @
76c370af
...
...
@@ -69,6 +69,7 @@ void checkasm_check_sbrdsp(void);
void
checkasm_check_synth_filter
(
void
);
void
checkasm_check_sw_rgb
(
void
);
void
checkasm_check_utvideodsp
(
void
);
void
checkasm_check_v210dec
(
void
);
void
checkasm_check_v210enc
(
void
);
void
checkasm_check_vf_hflip
(
void
);
void
checkasm_check_vf_threshold
(
void
);
...
...
tests/checkasm/v210dec.c
0 → 100644
View file @
76c370af
/*
* Copyright (c) 2019 James Darnley
*
* 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 "libavcodec/v210dec.h"
static
uint32_t
get_v210
(
void
)
{
uint32_t
t0
=
rnd
()
&
0x3ff
,
t1
=
rnd
()
&
0x3ff
,
t2
=
rnd
()
&
0x3ff
;
uint32_t
value
=
t0
|
(
t1
<<
10
)
|
(
t2
<<
20
);
return
value
;
}
#define NUM_SAMPLES 2048
static
void
randomize_buffers
(
uint32_t
*
src0
,
uint32_t
*
src1
,
int
len
)
{
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
uint32_t
value
=
get_v210
();
src0
[
i
]
=
value
;
src1
[
i
]
=
value
;
}
}
void
checkasm_check_v210dec
(
void
)
{
V210DecContext
h
;
h
.
aligned_input
=
0
;
ff_v210dec_init
(
&
h
);
if
(
check_func
(
h
.
unpack_frame
,
"v210_unpack"
))
{
uint32_t
src0
[
NUM_SAMPLES
/
3
];
uint32_t
src1
[
NUM_SAMPLES
/
3
];
uint16_t
y0
[
NUM_SAMPLES
/
2
];
uint16_t
y1
[
NUM_SAMPLES
/
2
];
uint16_t
u0
[
NUM_SAMPLES
/
4
];
uint16_t
u1
[
NUM_SAMPLES
/
4
];
uint16_t
v0
[
NUM_SAMPLES
/
4
];
uint16_t
v1
[
NUM_SAMPLES
/
4
];
declare_func
(
void
,
const
uint32_t
*
src
,
uint16_t
*
y
,
uint16_t
*
u
,
uint16_t
*
v
,
int
width
);
const
int
pixels
=
NUM_SAMPLES
/
2
/
6
*
6
;
randomize_buffers
(
src0
,
src1
,
NUM_SAMPLES
/
3
);
call_ref
(
src0
,
y0
,
u0
,
v0
,
pixels
);
call_new
(
src1
,
y1
,
u1
,
v1
,
pixels
);
if
(
memcmp
(
src0
,
src1
,
NUM_SAMPLES
/
3
*
sizeof
src0
[
0
])
||
memcmp
(
y0
,
y1
,
pixels
*
sizeof
y0
[
0
])
||
memcmp
(
u0
,
u1
,
pixels
/
2
*
sizeof
u0
[
0
])
||
memcmp
(
v0
,
v1
,
pixels
/
2
*
sizeof
v0
[
0
]))
fail
();
bench_new
(
src1
,
y1
,
u1
,
v1
,
pixels
);
}
report
(
"v210_unpack"
);
}
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