FFmpeg
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
tests
checkasm
llviddsp.c
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2016 Alexandra Hájková
3
*
4
* This file is part of FFmpeg.
5
*
6
* FFmpeg is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
10
*
11
* FFmpeg is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License along
17
* with FFmpeg; if not, write to the Free Software Foundation, Inc.,
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
*/
20
21
#include <string.h>
22
23
#include "
libavutil/common.h
"
24
#include "
libavutil/intreadwrite.h
"
25
#include "
libavutil/mem.h
"
26
27
#include "
libavcodec/lossless_videodsp.h
"
28
29
#include "
checkasm.h
"
30
31
#define randomize_buffers(buf, size) \
32
do { \
33
int j; \
34
for (j = 0; j < size; j++) \
35
buf[j] = rnd() & 0xFF; \
36
} while (0)
37
38
static
void
check_add_bytes
(
LLVidDSPContext
c
,
int
width
)
39
{
40
uint8_t
*
src0
=
av_mallocz
(width);
41
uint8_t
*
src1
=
av_mallocz
(width);
42
uint8_t
*dst0 =
av_mallocz
(width);
43
uint8_t
*dst1 =
av_mallocz
(width);
44
declare_func_emms
(
AV_CPU_FLAG_MMX
,
void
,
uint8_t
*dst,
uint8_t
*
src
, ptrdiff_t w);
45
46
if
(!src0 || !src1 || !dst0 || !dst1)
47
fail
();
48
49
randomize_buffers
(src0, width);
50
memcpy(src1, src0, width);
51
52
if
(
check_func
(c.
add_bytes
,
"add_bytes"
)) {
53
call_ref
(dst0, src0, width);
54
call_new
(dst1, src1, width);
55
if
(memcmp(dst0, dst1, width))
56
fail
();
57
bench_new
(dst1, src1, width);
58
}
59
60
av_free
(src0);
61
av_free
(src1);
62
av_free
(dst0);
63
av_free
(dst1);
64
}
65
66
void
checkasm_check_llviddsp
(
void
)
67
{
68
LLVidDSPContext
c
;
69
int
width
= 16 * av_clip(
rnd
(), 16, 128);
70
71
ff_llviddsp_init
(&c);
72
73
check_add_bytes
(c, width);
74
75
report
(
"add_bytes"
);
76
}
mem.h
Memory handling functions.
lossless_videodsp.h
av_mallocz
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
Definition:
mem.c:222
src
#define src
Definition:
vp8dsp.c:254
report
#define report
Definition:
checkasm.h:92
LLVidDSPContext::add_bytes
void(* add_bytes)(uint8_t *dst, uint8_t *src, ptrdiff_t w)
Definition:
lossless_videodsp.h:32
checkasm_check_llviddsp
void checkasm_check_llviddsp(void)
Definition:
llviddsp.c:66
uint8_t
uint8_t
Definition:
audio_convert.c:194
LLVidDSPContext
Definition:
lossless_videodsp.h:31
checkasm.h
fail
#define fail()
Definition:
checkasm.h:89
width
#define width
intreadwrite.h
declare_func_emms
#define declare_func_emms(cpu_flags, ret,...)
Definition:
checkasm.h:86
call_ref
#define call_ref(...)
Definition:
checkasm.h:95
src1
#define src1
Definition:
h264pred.c:139
check_add_bytes
static void check_add_bytes(LLVidDSPContext c, int width)
Definition:
llviddsp.c:38
AV_CPU_FLAG_MMX
#define AV_CPU_FLAG_MMX
standard MMX
Definition:
cpu.h:29
ff_llviddsp_init
void ff_llviddsp_init(LLVidDSPContext *c)
Definition:
lossless_videodsp.c:102
check_func
#define check_func(func,...)
Definition:
checkasm.h:81
src0
#define src0
Definition:
h264pred.c:138
common.h
common internal and external API header
c
static double c[64]
Definition:
vsrc_mptestsrc.c:87
rnd
#define rnd()
Definition:
checkasm.h:74
av_free
#define av_free(p)
Definition:
tableprint_vlc.h:34
bench_new
#define bench_new(...)
Definition:
checkasm.h:187
randomize_buffers
#define randomize_buffers(buf, size)
Definition:
llviddsp.c:31
call_new
#define call_new(...)
Definition:
checkasm.h:155
Generated on Fri Jan 12 2018 01:46:02 for FFmpeg by
1.8.6