FFmpeg
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
Functions
Variables
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
c
d
g
h
i
o
q
r
s
v
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
a
d
e
f
h
i
j
l
m
n
p
r
s
v
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
l
m
o
p
q
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
tests
checkasm
v210dec.c
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2019 James Darnley
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
#include "
checkasm.h
"
23
#include "
libavcodec/v210dec_init.h
"
24
25
static
uint32_t
get_v210
(
void
)
26
{
27
uint32_t t0 =
rnd
() & 0x3ff,
28
t1 =
rnd
() & 0x3ff,
29
t2 =
rnd
() & 0x3ff;
30
uint32_t
value
= t0
31
| (t1 << 10)
32
| (t2 << 20);
33
return
value
;
34
}
35
36
#define NUM_SAMPLES 2048
37
38
static
void
randomize_buffers
(uint32_t *
src0
, uint32_t *
src1
,
int
len
)
39
{
40
for
(
int
i
= 0;
i
<
len
;
i
++) {
41
uint32_t
value
=
get_v210
();
42
src0
[
i
] =
value
;
43
src1
[
i
] =
value
;
44
}
45
}
46
47
void
checkasm_check_v210dec
(
void
)
48
{
49
V210DecContext
h
;
50
51
h
.aligned_input = 0;
52
ff_v210dec_init
(&
h
);
53
54
if
(
check_func
(
h
.unpack_frame,
"v210_unpack"
)) {
55
uint32_t
src0
[
NUM_SAMPLES
/3];
56
uint32_t
src1
[
NUM_SAMPLES
/3];
57
uint16_t y0[
NUM_SAMPLES
/2 + 26];
58
uint16_t y1[
NUM_SAMPLES
/2 + 26];
59
uint16_t u0[
NUM_SAMPLES
/4 + 13];
60
uint16_t u1[
NUM_SAMPLES
/4 + 13];
61
uint16_t v0[
NUM_SAMPLES
/4 + 13];
62
uint16_t v1[
NUM_SAMPLES
/4 + 13];
63
declare_func
(
void
,
const
uint32_t *
src
, uint16_t *y, uint16_t *
u
, uint16_t *v,
int
width
);
64
const
int
pixels =
NUM_SAMPLES
/ 2 / 6 * 6;
65
66
randomize_buffers
(
src0
,
src1
,
NUM_SAMPLES
/3);
67
call_ref
(
src0
, y0, u0, v0, pixels);
68
call_new
(
src1
, y1, u1, v1, pixels);
69
if
(memcmp(
src0
,
src1
,
NUM_SAMPLES
/3 *
sizeof
src0
[0])
70
|| memcmp(y0, y1, pixels *
sizeof
y0[0])
71
|| memcmp(u0, u1, pixels/2 *
sizeof
u0[0])
72
|| memcmp(v0, v1, pixels/2 *
sizeof
v0[0]))
73
fail
();
74
bench_new
(
src1
, y1, u1, v1, pixels);
75
}
76
report
(
"v210_unpack"
);
77
}
u
#define u(width, name, range_min, range_max)
Definition:
cbs_h2645.c:251
NUM_SAMPLES
#define NUM_SAMPLES
Definition:
v210dec.c:36
src1
const pixel * src1
Definition:
h264pred_template.c:420
check_func
#define check_func(func,...)
Definition:
checkasm.h:184
call_ref
#define call_ref(...)
Definition:
checkasm.h:199
v210dec_init.h
randomize_buffers
static void randomize_buffers(uint32_t *src0, uint32_t *src1, int len)
Definition:
v210dec.c:38
checkasm_check_v210dec
void checkasm_check_v210dec(void)
Definition:
v210dec.c:47
fail
#define fail()
Definition:
checkasm.h:193
checkasm.h
rnd
#define rnd()
Definition:
checkasm.h:177
ff_v210dec_init
static av_unused av_cold void ff_v210dec_init(V210DecContext *s)
Definition:
v210dec_init.h:54
V210DecContext
Definition:
v210dec.h:26
call_new
#define call_new(...)
Definition:
checkasm.h:302
report
#define report
Definition:
checkasm.h:196
bench_new
#define bench_new(...)
Definition:
checkasm.h:373
i
#define i(width, name, range_min, range_max)
Definition:
cbs_h2645.c:256
value
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
Definition:
writing_filters.txt:86
len
int len
Definition:
vorbis_enc_data.h:426
src0
const pixel *const src0
Definition:
h264pred_template.c:419
declare_func
#define declare_func(ret,...)
Definition:
checkasm.h:188
get_v210
static uint32_t get_v210(void)
Definition:
v210dec.c:25
h
h
Definition:
vp9dsp_template.c:2070
width
#define width
Definition:
dsp.h:85
src
#define src
Definition:
vp8dsp.c:248
Generated on Fri Feb 21 2025 19:22:19 for FFmpeg by
1.8.17