Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
2eb97af6
Commit
2eb97af6
authored
Aug 08, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkasm: add a test for blockdsp
parent
eea9857b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
0 deletions
+73
-0
Makefile
tests/checkasm/Makefile
+1
-0
blockdsp.c
tests/checkasm/blockdsp.c
+68
-0
checkasm.c
tests/checkasm/checkasm.c
+3
-0
checkasm.h
tests/checkasm/checkasm.h
+1
-0
No files found.
tests/checkasm/Makefile
View file @
2eb97af6
# libavcodec tests
# libavcodec tests
# subsystems
# subsystems
AVCODECOBJS-$(CONFIG_BLOCKDSP)
+=
blockdsp.o
AVCODECOBJS-$(CONFIG_BSWAPDSP)
+=
bswapdsp.o
AVCODECOBJS-$(CONFIG_BSWAPDSP)
+=
bswapdsp.o
AVCODECOBJS-$(CONFIG_FMTCONVERT)
+=
fmtconvert.o
AVCODECOBJS-$(CONFIG_FMTCONVERT)
+=
fmtconvert.o
AVCODECOBJS-$(CONFIG_H264DSP)
+=
h264dsp.o
AVCODECOBJS-$(CONFIG_H264DSP)
+=
h264dsp.o
...
...
tests/checkasm/blockdsp.c
0 → 100644
View file @
2eb97af6
/*
* Copyright (c) 2015 Henrik Gramner
*
* This file is part of Libav.
*
* Libav 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.
*
* Libav 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 Libav; 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/blockdsp.h"
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#define randomize_buffers(size) \
do { \
int i; \
for (i = 0; i < size; i++) { \
uint16_t r = rnd(); \
AV_WN16A(buf0 + i, r); \
AV_WN16A(buf1 + i, r); \
} \
} while (0)
#define check_clear(func, size) \
do { \
if (check_func(h.func, "blockdsp." #func)) { \
declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *block); \
randomize_buffers(size); \
call_ref(buf0); \
call_new(buf1); \
if (memcmp(buf0, buf1, sizeof(*buf0) * size)) \
fail(); \
bench_new(buf0); \
} \
} while (0)
void
checkasm_check_blockdsp
(
void
)
{
LOCAL_ALIGNED_16
(
uint16_t
,
buf0
,
[
6
*
8
*
8
]);
LOCAL_ALIGNED_16
(
uint16_t
,
buf1
,
[
6
*
8
*
8
]);
AVCodecContext
avctx
=
{
0
};
BlockDSPContext
h
;
ff_blockdsp_init
(
&
h
,
&
avctx
);
check_clear
(
clear_block
,
8
*
8
);
check_clear
(
clear_blocks
,
8
*
8
*
6
);
report
(
"blockdsp"
);
}
tests/checkasm/checkasm.c
View file @
2eb97af6
...
@@ -64,6 +64,9 @@ static const struct {
...
@@ -64,6 +64,9 @@ static const struct {
const
char
*
name
;
const
char
*
name
;
void
(
*
func
)(
void
);
void
(
*
func
)(
void
);
}
tests
[]
=
{
}
tests
[]
=
{
#if CONFIG_BLOCKDSP
{
"blockdsp"
,
checkasm_check_blockdsp
},
#endif
#if CONFIG_BSWAPDSP
#if CONFIG_BSWAPDSP
{
"bswapdsp"
,
checkasm_check_bswapdsp
},
{
"bswapdsp"
,
checkasm_check_bswapdsp
},
#endif
#endif
...
...
tests/checkasm/checkasm.h
View file @
2eb97af6
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include "libavutil/lfg.h"
#include "libavutil/lfg.h"
#include "libavutil/timer.h"
#include "libavutil/timer.h"
void
checkasm_check_blockdsp
(
void
);
void
checkasm_check_bswapdsp
(
void
);
void
checkasm_check_bswapdsp
(
void
);
void
checkasm_check_dcadsp
(
void
);
void
checkasm_check_dcadsp
(
void
);
void
checkasm_check_fmtconvert
(
void
);
void
checkasm_check_fmtconvert
(
void
);
...
...
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