Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
0739cab8
Commit
0739cab8
authored
Apr 15, 2014
by
Dmitry Kovalev
Browse files
Adding get_search_range() function.
Change-Id: I988eea8f78f71135b914661420c5c75674e5c010
parent
e58ea39f
Changes
1
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_firstpass.c
View file @
0739cab8
...
...
@@ -385,25 +385,31 @@ static unsigned int get_prediction_error(BLOCK_SIZE bsize,
return
sse
;
}
// Refine the motion search range according to the frame dimension
// for first pass test.
static
int
get_search_range
(
const
VP9_COMMON
*
cm
)
{
int
sr
=
0
;
const
int
dim
=
MIN
(
cm
->
width
,
cm
->
height
);
while
((
dim
<<
sr
)
<
MAX_FULL_PEL_VAL
)
++
sr
;
return
sr
;
}
static
void
first_pass_motion_search
(
VP9_COMP
*
cpi
,
MACROBLOCK
*
x
,
const
MV
*
ref_mv
,
MV
*
best_mv
,
int
*
best_motion_err
)
{
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
MV
tmp_mv
=
{
0
,
0
};
MV
ref_mv_full
=
{
ref_mv
->
row
>>
3
,
ref_mv
->
col
>>
3
};
int
num00
,
tmp_err
,
n
,
sr
=
0
;
int
step_param
=
3
;
int
further_steps
=
(
MAX_MVSEARCH_STEPS
-
1
)
-
step_param
;
int
num00
,
tmp_err
,
n
;
const
BLOCK_SIZE
bsize
=
xd
->
mi
[
0
]
->
mbmi
.
sb_type
;
vp9_variance_fn_ptr_t
v_fn_ptr
=
cpi
->
fn_ptr
[
bsize
];
int
new_mv_mode_penalty
=
256
;
const
int
quart_frm
=
MIN
(
cpi
->
common
.
width
,
cpi
->
common
.
height
);
// Refine the motion search range according to the frame dimension
// for first pass test.
while
((
quart_frm
<<
sr
)
<
MAX_FULL_PEL_VAL
)
++
sr
;
const
int
new_mv_mode_penalty
=
256
;
int
step_param
=
3
;
int
further_steps
=
(
MAX_MVSEARCH_STEPS
-
1
)
-
step_param
;
const
int
sr
=
get_search_range
(
&
cpi
->
common
);
step_param
+=
sr
;
further_steps
-=
sr
;
...
...
@@ -421,8 +427,7 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
if
(
tmp_err
<
*
best_motion_err
)
{
*
best_motion_err
=
tmp_err
;
best_mv
->
row
=
tmp_mv
.
row
;
best_mv
->
col
=
tmp_mv
.
col
;
*
best_mv
=
tmp_mv
;
}
// Carry out further step/diamond searches as necessary.
...
...
@@ -445,8 +450,7 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
if
(
tmp_err
<
*
best_motion_err
)
{
*
best_motion_err
=
tmp_err
;
best_mv
->
row
=
tmp_mv
.
row
;
best_mv
->
col
=
tmp_mv
.
col
;
*
best_mv
=
tmp_mv
;
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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