Set up the unit scaling factor for motion search
authorYunqing Wang <yunqingwang@google.com>
Mon, 8 Oct 2018 18:43:02 +0000 (11:43 -0700)
committerYunqing Wang <yunqingwang@google.com>
Mon, 8 Oct 2018 22:59:32 +0000 (15:59 -0700)
Set up the unit scaling factor used during motion search.

Change-Id: I6fda018d593b7ad4b7658d44c39be950a502d192

vp9/encoder/vp9_block.h
vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_encoder.h

index 0613058..563fdbb 100644 (file)
@@ -211,6 +211,8 @@ struct macroblock {
 #if CONFIG_ML_VAR_PARTITION
   DECLARE_ALIGNED(16, uint8_t, est_pred[64 * 64]);
 #endif  // CONFIG_ML_VAR_PARTITION
+
+  struct scale_factors *me_sf;
 };
 
 #ifdef __cplusplus
index c2ffe1a..5628f14 100644 (file)
@@ -2449,6 +2449,17 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
 
   vp9_loop_filter_init(cm);
 
+  // Set up the unit scaling factor used during motion search.
+#if CONFIG_VP9_HIGHBITDEPTH
+  vp9_setup_scale_factors_for_frame(&cpi->me_sf, cm->width, cm->height,
+                                    cm->width, cm->height,
+                                    cm->use_highbitdepth);
+#else
+  vp9_setup_scale_factors_for_frame(&cpi->me_sf, cm->width, cm->height,
+                                    cm->width, cm->height);
+#endif  // CONFIG_VP9_HIGHBITDEPTH
+  cpi->td.mb.me_sf = &cpi->me_sf;
+
   cm->error.setjmp = 0;
 
   return cpi;
index b8922dc..e1bdf16 100644 (file)
@@ -604,6 +604,7 @@ typedef struct VP9_COMP {
   ActiveMap active_map;
 
   fractional_mv_step_fp *find_fractional_mv_step;
+  struct scale_factors me_sf;
   vp9_diamond_search_fn_t diamond_search_sad;
   vp9_variance_fn_ptr_t fn_ptr[BLOCK_SIZES];
   uint64_t time_receive_data;