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
6a7eb65e
Commit
6a7eb65e
authored
Nov 21, 2017
by
Martin Vignali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkasm : add utvideodsp test
parent
a5870cb3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
110 additions
and
0 deletions
+110
-0
Makefile
tests/checkasm/Makefile
+1
-0
checkasm.c
tests/checkasm/checkasm.c
+3
-0
checkasm.h
tests/checkasm/checkasm.h
+1
-0
utvideodsp.c
tests/checkasm/utvideodsp.c
+105
-0
No files found.
tests/checkasm/Makefile
View file @
6a7eb65e
...
...
@@ -22,6 +22,7 @@ AVCODECOBJS-$(CONFIG_EXR_DECODER) += exrdsp.o
AVCODECOBJS-$(CONFIG_JPEG2000_DECODER)
+=
jpeg2000dsp.o
AVCODECOBJS-$(CONFIG_PIXBLOCKDSP)
+=
pixblockdsp.o
AVCODECOBJS-$(CONFIG_HEVC_DECODER)
+=
hevc_add_res.o
hevc_idct.o
AVCODECOBJS-$(CONFIG_UTVIDEO_DECODER)
+=
utvideodsp.o
AVCODECOBJS-$(CONFIG_V210_ENCODER)
+=
v210enc.o
AVCODECOBJS-$(CONFIG_VP9_DECODER)
+=
vp9dsp.o
...
...
tests/checkasm/checkasm.c
View file @
6a7eb65e
...
...
@@ -126,6 +126,9 @@ static const struct {
#if CONFIG_PIXBLOCKDSP
{
"pixblockdsp"
,
checkasm_check_pixblockdsp
},
#endif
#if CONFIG_UTVIDEO_DECODER
{
"utvideodsp"
,
checkasm_check_utvideodsp
},
#endif
#if CONFIG_V210_ENCODER
{
"v210enc"
,
checkasm_check_v210enc
},
#endif
...
...
tests/checkasm/checkasm.h
View file @
6a7eb65e
...
...
@@ -62,6 +62,7 @@ void checkasm_check_llviddsp(void);
void
checkasm_check_pixblockdsp
(
void
);
void
checkasm_check_sbrdsp
(
void
);
void
checkasm_check_synth_filter
(
void
);
void
checkasm_check_utvideodsp
(
void
);
void
checkasm_check_v210enc
(
void
);
void
checkasm_check_vp8dsp
(
void
);
void
checkasm_check_vp9dsp
(
void
);
...
...
tests/checkasm/utvideodsp.c
0 → 100644
View file @
6a7eb65e
/*
* Copyright (c) 2017 Jokyo Images
*
* 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/avcodec.h"
#include "libavcodec/utvideodsp.h"
#include "libavutil/intreadwrite.h"
#define WIDTH 240
#define HEIGHT 120
#define WIDTH_PADDED (WIDTH+WIDTH%32)
#define BUFFER_SIZE (WIDTH_PADDED * HEIGHT)
#define randomize_plane(buf, type) \
do { \
int w, h; \
type * tmp = buf; \
for (h = 0; h < HEIGHT; h++) { \
for (w = 0; w < WIDTH; w++) \
tmp[w] = rnd() & 0xFF; \
tmp += WIDTH_PADDED; \
} \
} while (0)
#define cmp_plane(buf0, buf1, s) \
do { \
int h; \
for (h = 0; h < HEIGHT; h++) { \
if (memcmp(buf0 + h*WIDTH_PADDED, \
buf1 + h*WIDTH_PADDED, WIDTH *s)) \
fail();\
} \
} while (0)
#define CHECK_RESTORE(type)\
LOCAL_ALIGNED_32(type, src_r0, [BUFFER_SIZE]); \
LOCAL_ALIGNED_32(type, src_g0, [BUFFER_SIZE]); \
LOCAL_ALIGNED_32(type, src_b0, [BUFFER_SIZE]); \
LOCAL_ALIGNED_32(type, src_r1, [BUFFER_SIZE]); \
LOCAL_ALIGNED_32(type, src_g1, [BUFFER_SIZE]); \
LOCAL_ALIGNED_32(type, src_b1, [BUFFER_SIZE]); \
memset(src_r0, 0, BUFFER_SIZE); \
memset(src_g0, 0, BUFFER_SIZE); \
memset(src_b0, 0, BUFFER_SIZE); \
randomize_plane(src_r0, type); \
randomize_plane(src_g0, type); \
randomize_plane(src_b0, type); \
memcpy(src_r1, src_r0, BUFFER_SIZE * sizeof(type)); \
memcpy(src_g1, src_g0, BUFFER_SIZE * sizeof(type)); \
memcpy(src_b1, src_b0, BUFFER_SIZE * sizeof(type)); \
declare_func(void, type *src_r, type *src_g, type *src_b, \
ptrdiff_t linesize_r, ptrdiff_t linesize_g, \
ptrdiff_t linesize_b, int width, int height); \
call_ref(src_r0, src_g0, src_b0, WIDTH_PADDED, WIDTH_PADDED, WIDTH_PADDED, WIDTH, HEIGHT);\
call_new(src_r1, src_g1, src_b1, WIDTH_PADDED, WIDTH_PADDED, WIDTH_PADDED, WIDTH, HEIGHT);\
cmp_plane(src_r0, src_r1, sizeof(type)); \
cmp_plane(src_g0, src_g1, sizeof(type)); \
cmp_plane(src_b0, src_b1, sizeof(type)); \
bench_new(src_r1, src_g1, src_b1, WIDTH_PADDED, WIDTH_PADDED, WIDTH_PADDED, WIDTH, HEIGHT)
static
void
check_restore_rgb_planes
(
void
)
{
CHECK_RESTORE
(
uint8_t
);
}
static
void
check_restore_rgb_planes10
(
void
)
{
CHECK_RESTORE
(
uint16_t
);
}
void
checkasm_check_utvideodsp
(
void
)
{
UTVideoDSPContext
h
;
ff_utvideodsp_init
(
&
h
);
if
(
check_func
(
h
.
restore_rgb_planes
,
"restore_rgb_planes"
))
check_restore_rgb_planes
();
report
(
"restore_rgb_planes"
);
if
(
check_func
(
h
.
restore_rgb_planes10
,
"restore_rgb_planes10"
))
check_restore_rgb_planes10
();
report
(
"restore_rgb_planes10"
);
}
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