Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
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
efb150bb
Commit
efb150bb
authored
Jan 03, 2014
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Jan 03, 2014
Browse files
Merge "Cleaning up get_prediction_decay_rate() function."
parents
2336853b
84520829
Changes
1
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_firstpass.c
View file @
efb150bb
...
...
@@ -1163,32 +1163,15 @@ void vp9_end_second_pass(VP9_COMP *cpi) {
// the prediction quality is decaying from frame to frame.
static
double
get_prediction_decay_rate
(
VP9_COMP
*
cpi
,
FIRSTPASS_STATS
*
next_frame
)
{
double
prediction_decay_rate
;
double
second_ref_decay
;
double
mb_sr_err_diff
;
// Initial basis is the % mbs inter coded
prediction_decay_rate
=
next_frame
->
pcnt_inter
;
// Look at the observed drop in prediction quality between the last frame
// and the GF buffer (which contains an older frame).
mb_sr_err_diff
=
(
next_frame
->
sr_coded_error
-
next_frame
->
coded_error
)
/
cpi
->
common
.
MBs
;
if
(
mb_sr_err_diff
<=
512
.
0
)
{
second_ref_decay
=
1
.
0
-
(
mb_sr_err_diff
/
512
.
0
);
second_ref_decay
=
pow
(
second_ref_decay
,
0
.
5
);
if
(
second_ref_decay
<
0
.
85
)
second_ref_decay
=
0
.
85
;
else
if
(
second_ref_decay
>
1
.
0
)
second_ref_decay
=
1
.
0
;
}
else
{
second_ref_decay
=
0
.
85
;
}
if
(
second_ref_decay
<
prediction_decay_rate
)
prediction_decay_rate
=
second_ref_decay
;
const
double
mb_sr_err_diff
=
(
next_frame
->
sr_coded_error
-
next_frame
->
coded_error
)
/
cpi
->
common
.
MBs
;
const
double
second_ref_decay
=
mb_sr_err_diff
<=
512
.
0
?
fclamp
(
pow
(
1
.
0
-
(
mb_sr_err_diff
/
512
.
0
),
0
.
5
),
0
.
85
,
1
.
0
)
:
0
.
85
;
return
prediction_decay_rate
;
return
MIN
(
second_ref_decay
,
next_frame
->
pcnt_inter
)
;
}
// Function to test for a condition where a complex transition is followed
...
...
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