Skip to content
GitLab
Menu
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
ad43a738
Commit
ad43a738
authored
Feb 01, 2016
by
Alex Converse
Browse files
Fix a signed overflow in vp9 motion cost.
Change-Id: I5975e3aede62202d8ee6ced33889350c0a56554a
parent
0a3593a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_mcomp.c
View file @
ad43a738
...
...
@@ -86,7 +86,9 @@ static int mv_err_cost(const MV *mv, const MV *ref,
if
(
mvcost
)
{
const
MV
diff
=
{
mv
->
row
-
ref
->
row
,
mv
->
col
-
ref
->
col
};
return
ROUND_POWER_OF_TWO
(
mv_cost
(
&
diff
,
mvjcost
,
mvcost
)
*
// TODO(aconverse): See if this shift needs to be tied to
// VP9_PROB_COST_SHIFT.
return
ROUND_POWER_OF_TWO
((
unsigned
)
mv_cost
(
&
diff
,
mvjcost
,
mvcost
)
*
error_per_bit
,
13
);
}
return
0
;
...
...
@@ -96,8 +98,9 @@ static int mvsad_err_cost(const MACROBLOCK *x, const MV *mv, const MV *ref,
int
error_per_bit
)
{
const
MV
diff
=
{
mv
->
row
-
ref
->
row
,
mv
->
col
-
ref
->
col
};
return
ROUND_POWER_OF_TWO
(
mv_cost
(
&
diff
,
x
->
nmvjointsadcost
,
x
->
nmvsadcost
)
*
error_per_bit
,
8
);
// TODO(aconverse): See if this shift needs to be tied to VP9_PROB_COST_SHIFT.
return
ROUND_POWER_OF_TWO
((
unsigned
)
mv_cost
(
&
diff
,
x
->
nmvjointsadcost
,
x
->
nmvsadcost
)
*
error_per_bit
,
8
);
}
void
vp9_init_dsmotion_compensation
(
search_site_config
*
cfg
,
int
stride
)
{
...
...
Write
Preview
Supports
Markdown
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