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
d673a3f4
Commit
d673a3f4
authored
Aug 03, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
motion_est_template: switch to av_assert
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
a189475c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
22 deletions
+16
-22
motion_est_template.c
libavcodec/motion_est_template.c
+16
-22
No files found.
libavcodec/motion_est_template.c
View file @
d673a3f4
...
...
@@ -92,17 +92,14 @@ static int hpel_motion_search(MpegEncContext * s,
#if 1
unsigned
key
;
unsigned
map_generation
=
c
->
map_generation
;
#ifndef NDEBUG
uint32_t
*
map
=
c
->
map
;
#endif
key
=
((
my
-
1
)
<<
ME_MAP_MV_BITS
)
+
(
mx
)
+
map_generation
;
a
ssert
(
map
[(
index
-
(
1
<<
ME_MAP_SHIFT
))
&
(
ME_MAP_SIZE
-
1
)]
==
key
);
a
v_assert2
(
c
->
map
[(
index
-
(
1
<<
ME_MAP_SHIFT
))
&
(
ME_MAP_SIZE
-
1
)]
==
key
);
key
=
((
my
+
1
)
<<
ME_MAP_MV_BITS
)
+
(
mx
)
+
map_generation
;
a
ssert
(
map
[(
index
+
(
1
<<
ME_MAP_SHIFT
))
&
(
ME_MAP_SIZE
-
1
)]
==
key
);
a
v_assert2
(
c
->
map
[(
index
+
(
1
<<
ME_MAP_SHIFT
))
&
(
ME_MAP_SIZE
-
1
)]
==
key
);
key
=
((
my
)
<<
ME_MAP_MV_BITS
)
+
(
mx
+
1
)
+
map_generation
;
a
ssert
(
map
[(
index
+
1
)
&
(
ME_MAP_SIZE
-
1
)]
==
key
);
a
v_assert2
(
c
->
map
[(
index
+
1
)
&
(
ME_MAP_SIZE
-
1
)]
==
key
);
key
=
((
my
)
<<
ME_MAP_MV_BITS
)
+
(
mx
-
1
)
+
map_generation
;
a
ssert
(
map
[(
index
-
1
)
&
(
ME_MAP_SIZE
-
1
)]
==
key
);
a
v_assert2
(
c
->
map
[(
index
-
1
)
&
(
ME_MAP_SIZE
-
1
)]
==
key
);
#endif
if
(
t
<=
b
){
CHECK_HALF_MV
(
0
,
1
,
mx
,
my
-
1
)
...
...
@@ -143,7 +140,7 @@ static int hpel_motion_search(MpegEncContext * s,
}
CHECK_HALF_MV
(
0
,
1
,
mx
,
my
)
}
a
ssert
(
bx
>=
xmin
*
2
&&
bx
<=
xmax
*
2
&&
by
>=
ymin
*
2
&&
by
<=
ymax
*
2
);
a
v_assert2
(
bx
>=
xmin
*
2
&&
bx
<=
xmax
*
2
&&
by
>=
ymin
*
2
&&
by
<=
ymax
*
2
);
}
*
mx_ptr
=
bx
;
...
...
@@ -181,9 +178,6 @@ av_extern_inline int ff_get_mb_score(MpegEncContext * s, int mx, int my, int src
cmp_sub
=
s
->
dsp
.
mb_cmp
[
size
];
chroma_cmp_sub
=
s
->
dsp
.
mb_cmp
[
size
+
1
];
// assert(!c->skip);
// assert(c->avctx->me_sub_cmp != c->avctx->mb_cmp);
d
=
cmp
(
s
,
mx
>>
(
qpel
+
1
),
my
>>
(
qpel
+
1
),
mx
&
mask
,
my
&
mask
,
size
,
h
,
ref_index
,
src_index
,
cmp_sub
,
chroma_cmp_sub
,
flags
);
//FIXME check cbp before adding penalty for (0,0) vector
if
(
add_rate
&&
(
mx
||
my
||
size
>
0
))
...
...
@@ -304,11 +298,11 @@ static int qpel_motion_search(MpegEncContext * s,
cxy
=
2
*
tl
+
(
cx
+
cy
)
/
4
-
(
cx2
+
cy2
)
-
2
*
c
;
a
ssert
(
16
*
cx2
+
4
*
cx
+
32
*
c
==
32
*
r
);
a
ssert
(
16
*
cx2
-
4
*
cx
+
32
*
c
==
32
*
l
);
a
ssert
(
16
*
cy2
+
4
*
cy
+
32
*
c
==
32
*
b
);
a
ssert
(
16
*
cy2
-
4
*
cy
+
32
*
c
==
32
*
t
);
a
ssert
(
16
*
cxy
+
16
*
cy2
+
16
*
cx2
-
4
*
cy
-
4
*
cx
+
32
*
c
==
32
*
tl
);
a
v_assert2
(
16
*
cx2
+
4
*
cx
+
32
*
c
==
32
*
r
);
a
v_assert2
(
16
*
cx2
-
4
*
cx
+
32
*
c
==
32
*
l
);
a
v_assert2
(
16
*
cy2
+
4
*
cy
+
32
*
c
==
32
*
b
);
a
v_assert2
(
16
*
cy2
-
4
*
cy
+
32
*
c
==
32
*
t
);
a
v_assert2
(
16
*
cxy
+
16
*
cy2
+
16
*
cx2
-
4
*
cy
-
4
*
cx
+
32
*
c
==
32
*
tl
);
for
(
ny
=
-
3
;
ny
<=
3
;
ny
++
){
for
(
nx
=
-
3
;
nx
<=
3
;
nx
++
){
...
...
@@ -341,7 +335,7 @@ static int qpel_motion_search(MpegEncContext * s,
CHECK_QUARTER_MV
(
nx
&
3
,
ny
&
3
,
nx
>>
2
,
ny
>>
2
)
}
a
ssert
(
bx
>=
xmin
*
4
&&
bx
<=
xmax
*
4
&&
by
>=
ymin
*
4
&&
by
<=
ymax
*
4
);
a
v_assert2
(
bx
>=
xmin
*
4
&&
bx
<=
xmax
*
4
&&
by
>=
ymin
*
4
&&
by
<=
ymax
*
4
);
*
mx_ptr
=
bx
;
*
my_ptr
=
by
;
...
...
@@ -358,10 +352,10 @@ static int qpel_motion_search(MpegEncContext * s,
{\
const unsigned key = ((y)<<ME_MAP_MV_BITS) + (x) + map_generation;\
const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);\
a
ssert
((x) >= xmin);\
a
ssert
((x) <= xmax);\
a
ssert
((y) >= ymin);\
a
ssert
((y) <= ymax);\
a
v_assert2
((x) >= xmin);\
a
v_assert2
((x) <= xmax);\
a
v_assert2
((y) >= ymin);\
a
v_assert2
((y) <= ymax);\
/*printf("check_mv %d %d\n", x, y);*/
\
if(map[index]!=key){\
d= cmp(s, x, y, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\
...
...
@@ -890,7 +884,7 @@ static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int
map_generation
=
update_map_generation
(
c
);
a
ssert
(
cmpf
);
a
v_assert2
(
cmpf
);
dmin
=
cmp
(
s
,
0
,
0
,
0
,
0
,
size
,
h
,
ref_index
,
src_index
,
cmpf
,
chroma_cmpf
,
flags
);
map
[
0
]
=
map_generation
;
score_map
[
0
]
=
dmin
;
...
...
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