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
jpeg2000dsp.c
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 James Almer
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 "
checkasm.h
"
22
#include "
libavcodec/jpeg2000dsp.h
"
23
#include "
libavutil/common.h
"
24
#include "
libavutil/internal.h
"
25
#include "
libavutil/intreadwrite.h
"
26
27
#define BUF_SIZE 512
28
29
#define randomize_buffers() \
30
do { \
31
int i; \
32
for (i = 0; i < BUF_SIZE; i += 4) { \
33
uint32_t r = rnd(); \
34
AV_WN32A(ref0 + i, r); \
35
AV_WN32A(new0 + i, r); \
36
r = rnd(); \
37
AV_WN32A(ref1 + i, r); \
38
AV_WN32A(new1 + i, r); \
39
r = rnd(); \
40
AV_WN32A(ref2 + i, r); \
41
AV_WN32A(new2 + i, r); \
42
} \
43
} while (0)
44
45
static
void
check_mct
(
uint8_t
*ref0,
uint8_t
*ref1,
uint8_t
*ref2,
46
uint8_t
*new0,
uint8_t
*new1,
uint8_t
*new2) {
47
declare_func
(
void
,
void
*
src0
,
void
*
src1
,
void
*src2,
int
csize);
48
49
randomize_buffers
();
50
call_ref
(ref0, ref1, ref2,
BUF_SIZE
/
sizeof
(
int32_t
));
51
call_new
(new0, new1, new2,
BUF_SIZE
/
sizeof
(
int32_t
));
52
if
(memcmp(ref0, new0,
BUF_SIZE
) || memcmp(ref1, new1,
BUF_SIZE
) ||
53
memcmp(ref2, new2,
BUF_SIZE
))
54
fail
();
55
bench_new
(new0, new1, new2,
BUF_SIZE
/
sizeof
(
int32_t
));
56
}
57
58
void
checkasm_check_jpeg2000dsp
(
void
)
59
{
60
LOCAL_ALIGNED_32
(
uint8_t
,
ref
, [
BUF_SIZE
*3]);
61
LOCAL_ALIGNED_32
(
uint8_t
,
new
, [
BUF_SIZE
*3]);
62
Jpeg2000DSPContext
h
;
63
64
ff_jpeg2000dsp_init
(&h);
65
66
if
(
check_func
(h.
mct_decode
[
FF_DWT53
],
"jpeg2000_rct_int"
))
67
check_mct
(&
ref
[
BUF_SIZE
*0], &
ref
[BUF_SIZE*1], &
ref
[BUF_SIZE*2],
68
&
new
[BUF_SIZE*0], &
new
[BUF_SIZE*1], &
new
[BUF_SIZE*2]);
69
70
report
(
"mct_decode"
);
71
}
Jpeg2000DSPContext::mct_decode
void(* mct_decode[FF_DWT_NB])(void *src0, void *src1, void *src2, int csize)
Definition:
jpeg2000dsp.h:30
h
h
Definition:
vp9dsp_template.c:2093
ff_jpeg2000dsp_init
av_cold void ff_jpeg2000dsp_init(Jpeg2000DSPContext *c)
Definition:
jpeg2000dsp.c:93
FF_DWT53
Definition:
jpeg2000dwt.h:38
report
#define report
Definition:
checkasm.h:84
check_mct
static void check_mct(uint8_t *ref0, uint8_t *ref1, uint8_t *ref2, uint8_t *new0, uint8_t *new1, uint8_t *new2)
Definition:
jpeg2000dsp.c:45
uint8_t
uint8_t
Definition:
audio_convert.c:194
checkasm.h
declare_func
#define declare_func(ret,...)
Definition:
checkasm.h:77
fail
#define fail()
Definition:
checkasm.h:81
internal.h
common internal API header
intreadwrite.h
int32_t
int32_t
Definition:
audio_convert.c:194
call_ref
#define call_ref(...)
Definition:
checkasm.h:87
src1
#define src1
Definition:
h264pred.c:139
Jpeg2000DSPContext
Definition:
jpeg2000dsp.h:29
check_func
#define check_func(func,...)
Definition:
checkasm.h:73
src0
#define src0
Definition:
h264pred.c:138
BUF_SIZE
#define BUF_SIZE
Definition:
jpeg2000dsp.c:27
jpeg2000dsp.h
LOCAL_ALIGNED_32
#define LOCAL_ALIGNED_32(t, v,...)
Definition:
internal.h:127
common.h
common internal and external API header
ref
static int ref[MAX_W *MAX_W]
Definition:
jpeg2000dwt.c:107
randomize_buffers
#define randomize_buffers()
Definition:
jpeg2000dsp.c:29
bench_new
#define bench_new(...)
Definition:
checkasm.h:173
call_new
#define call_new(...)
Definition:
checkasm.h:142
checkasm_check_jpeg2000dsp
void checkasm_check_jpeg2000dsp(void)
Definition:
jpeg2000dsp.c:58
Generated on Mon Jun 27 2016 02:34:37 for FFmpeg by
1.8.6