]> granicus.if.org Git - libvpx/commitdiff
Fix update of mb_smooth_pct and mb_av_energy
authorRavi Chaudhary <ravi.chaudhary@ittiam.com>
Mon, 4 Mar 2019 05:27:17 +0000 (10:57 +0530)
committerRavi Chaudhary <ravi.chaudhary@ittiam.com>
Mon, 6 May 2019 10:11:02 +0000 (10:11 +0000)
Values of mb_smooth_pct and mb_av_energy have been updated
correctly in vp9_rc_get_second_pass_params for higher layer
ARF frames.

Change-Id: Ic176e393eb8cc5f418235fee9accee84e9809607

vp9/encoder/vp9_firstpass.c

index 97c6e8cd71879c04457382c31e7ccd6c55dbc9c6..ee22d488be0922a1a6f4e24c636c1c91a38ca3c8 100644 (file)
@@ -3216,6 +3216,11 @@ void vp9_rc_get_second_pass_params(VP9_COMP *cpi) {
   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];
@@ -3231,6 +3236,11 @@ void vp9_rc_get_second_pass_params(VP9_COMP *cpi) {
       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;
   }