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
Guillaume Martres
aom-rav1e
Commits
e2d6e37a
Commit
e2d6e37a
authored
Oct 10, 2013
by
Yaowu Xu
Committed by
Gerrit Code Review
Oct 10, 2013
Browse files
Merge "change to avoid out-of-range computation"
parents
09aca308
b47cef05
Changes
1
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_rdopt.c
View file @
e2d6e37a
...
...
@@ -3633,10 +3633,17 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
// values, which actually are bigger than this_rd itself. This can
// cause negative best_filter_rd[] values, which is obviously silly.
// Therefore, if filter_cache < ref, we do an adjusted calculation.
if
(
cpi
->
rd_filter_cache
[
i
]
>=
ref
)
if
(
cpi
->
rd_filter_cache
[
i
]
>=
ref
)
{
adj_rd
=
this_rd
+
cpi
->
rd_filter_cache
[
i
]
-
ref
;
else
// FIXME(rbultje) do this for comppred also
adj_rd
=
this_rd
-
(
ref
-
cpi
->
rd_filter_cache
[
i
])
*
this_rd
/
ref
;
}
else
{
// FIXME(rbultje) do this for comppsred also
//
// To prevent out-of-range computation in
// adj_rd = cpi->rd_filter_cache[i] * this_rd / ref
// cpi->rd_filter_cache[i] / ref is converted to a 256 based ratio.
int
tmp
=
cpi
->
rd_filter_cache
[
i
]
*
256
/
ref
;
adj_rd
=
(
this_rd
*
tmp
)
>>
8
;
}
best_filter_rd
[
i
]
=
MIN
(
best_filter_rd
[
i
],
adj_rd
);
}
}
...
...
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