shithub: libvpx

Download patch

ref: 45542ce51b8b76a705625e6f03447cbeeba6eb50
parent: 2d4eeae1c8adf31d60c2243286c130c85db7f17d
author: Angie Chiang <[email protected]>
date: Fri Oct 12 11:37:26 EDT 2018

Init mv_[dist/cost]_sum in init_tpl_stats

Change-Id: If45fba8a74186803eec09da7dbaf2e1fe4e9e156

--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -5492,6 +5492,13 @@
   int frame_idx;
   for (frame_idx = 0; frame_idx < MAX_ARF_GOP_SIZE; ++frame_idx) {
     TplDepFrame *tpl_frame = &cpi->tpl_stats[frame_idx];
+#if CONFIG_NON_GREEDY_MV
+    int rf_idx;
+    for (rf_idx = 0; rf_idx < 3; ++rf_idx) {
+      tpl_frame->mv_dist_sum[rf_idx] = 0;
+      tpl_frame->mv_cost_sum[rf_idx] = 0;
+    }
+#endif
     memset(tpl_frame->tpl_stats_ptr, 0,
            tpl_frame->height * tpl_frame->width *
                sizeof(*tpl_frame->tpl_stats_ptr));
@@ -6069,11 +6076,6 @@
 
   qsort(cpi->feature_score_loc_arr, fs_loc_arr_size,
         sizeof(*cpi->feature_score_loc_arr), compare_feature_score);
-
-  for (rf_idx = 0; rf_idx < 3; ++rf_idx) {
-    tpl_frame->mv_dist_sum[rf_idx] = 0;
-    tpl_frame->mv_cost_sum[rf_idx] = 0;
-  }
 
   for (i = 0; i < fs_loc_arr_size; ++i) {
     int mb_y_offset;