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
81d4ee3e
Commit
81d4ee3e
authored
Jul 09, 2008
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New full search ME
Originally committed as revision 14142 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
304ba23a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
motion_est_template.c
libavcodec/motion_est_template.c
+37
-0
No files found.
libavcodec/motion_est_template.c
View file @
81d4ee3e
...
...
@@ -776,6 +776,41 @@ static int umh_search(MpegEncContext * s, int *best, int dmin,
return
hex_search
(
s
,
best
,
dmin
,
src_index
,
ref_index
,
penalty_factor
,
size
,
h
,
flags
,
2
);
}
static
int
full_search
(
MpegEncContext
*
s
,
int
*
best
,
int
dmin
,
int
src_index
,
int
ref_index
,
int
const
penalty_factor
,
int
size
,
int
h
,
int
flags
)
{
MotionEstContext
*
const
c
=
&
s
->
me
;
me_cmp_func
cmpf
,
chroma_cmpf
;
LOAD_COMMON
LOAD_COMMON2
int
map_generation
=
c
->
map_generation
;
int
x
,
y
,
d
;
const
int
dia_size
=
c
->
dia_size
&
0xFF
;
cmpf
=
s
->
dsp
.
me_cmp
[
size
];
chroma_cmpf
=
s
->
dsp
.
me_cmp
[
size
+
1
];
for
(
y
=
FFMAX
(
-
dia_size
,
ymin
);
y
<=
FFMIN
(
dia_size
,
ymax
);
y
++
){
for
(
x
=
FFMAX
(
-
dia_size
,
xmin
);
x
<=
FFMIN
(
dia_size
,
xmax
);
x
++
){
CHECK_MV
(
x
,
y
);
}
}
x
=
best
[
0
];
y
=
best
[
1
];
d
=
dmin
;
CHECK_CLIPPED_MV
(
x
,
y
);
CHECK_CLIPPED_MV
(
x
+
1
,
y
);
CHECK_CLIPPED_MV
(
x
,
y
+
1
);
CHECK_CLIPPED_MV
(
x
-
1
,
y
);
CHECK_CLIPPED_MV
(
x
,
y
-
1
);
best
[
0
]
=
x
;
best
[
1
]
=
y
;
return
d
;
}
#define SAB_CHECK_MV(ax,ay)\
{\
const int key= ((ay)<<ME_MAP_MV_BITS) + (ax) + map_generation;\
...
...
@@ -980,6 +1015,8 @@ static av_always_inline int diamond_search(MpegEncContext * s, int *best, int dm
return
sab_diamond_search
(
s
,
best
,
dmin
,
src_index
,
ref_index
,
penalty_factor
,
size
,
h
,
flags
);
else
if
(
c
->
dia_size
<
2
)
return
small_diamond_search
(
s
,
best
,
dmin
,
src_index
,
ref_index
,
penalty_factor
,
size
,
h
,
flags
);
else
if
(
c
->
dia_size
>
1024
)
return
full_search
(
s
,
best
,
dmin
,
src_index
,
ref_index
,
penalty_factor
,
size
,
h
,
flags
);
else
if
(
c
->
dia_size
>
768
)
return
umh_search
(
s
,
best
,
dmin
,
src_index
,
ref_index
,
penalty_factor
,
size
,
h
,
flags
);
else
if
(
c
->
dia_size
>
512
)
...
...
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