ref: b4d593381b6d8008bedf90359585369a847b767c
parent: 4d0fe85c1957cea215085e7da41ee797e6a51f01
parent: dddbe2263214fe847fa693c11288e8faf03150de
author: Paul Wilkins <paulwilkins@google.com>
date: Mon May 13 04:08:37 EDT 2019
Merge "Fix update of mb_smooth_pct and mb_av_energy"
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -3225,6 +3225,11 @@
if (gf_group->update_type[gf_group->index] == ARF_UPDATE) {
int target_rate;
+ vp9_zero(this_frame);
+ this_frame =
+ cpi->twopass.stats_in_start[cm->current_video_frame +
+ gf_group->arf_src_offset[gf_group->index]];
+
vp9_configure_buffer_updates(cpi, gf_group->index);
target_rate = gf_group->bit_allocation[gf_group->index];
@@ -3239,6 +3244,11 @@
!cpi->use_svc) {
cpi->partition_search_skippable_frame = is_skippable_frame(cpi);
}
+
+ // The multiplication by 256 reverses a scaling factor of (>> 8)
+ // applied when combining MB error values for the frame.
+ twopass->mb_av_energy = log((this_frame.intra_error * 256.0) + 1.0);
+ twopass->mb_smooth_pct = this_frame.intra_smooth_pct;
return;
}