]> granicus.if.org Git - libvpx/commitdiff
Only discount new mv mode when tpl model is ready
authorAngie Chiang <angiebird@google.com>
Sat, 9 Feb 2019 01:28:43 +0000 (17:28 -0800)
committerAngie Chiang <angiebird@google.com>
Wed, 13 Feb 2019 19:10:48 +0000 (11:10 -0800)
Change-Id: I3326f0912627981fd604b16ddbf668d2262d4287

vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_encoder.h
vp9/encoder/vp9_rdopt.c

index c69f581d6e3be5b966998a011037de8d2216cb87..d85c715f7cac3c7ca78f0928fa3af235023ce6ed 100644 (file)
@@ -2369,6 +2369,7 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
 
 #if CONFIG_NON_GREEDY_MV
   cpi->feature_score_loc_alloc = 0;
+  cpi->tpl_ready = 0;
 #endif  // CONFIG_NON_GREEDY_MV
   for (i = 0; i < MAX_ARF_GOP_SIZE; ++i) cpi->tpl_stats[i].tpl_stats_ptr = NULL;
 
@@ -6884,6 +6885,7 @@ static void setup_tpl_stats(VP9_COMP *cpi) {
     mc_flow_dispenser(cpi, gf_picture, frame_idx, cpi->tpl_bsize);
   }
 #if CONFIG_NON_GREEDY_MV
+  cpi->tpl_ready = 1;
 #if DUMP_TPL_STATS
   dump_tpl_stats(cpi, tpl_group_frames, gf_picture, cpi->tpl_bsize);
 #endif  // DUMP_TPL_STATS
index e543ae70b6eeecba7e1f666cb74e95c0a6bed5ed..f571a384f30cc1a6dddcc564fc5a1f10ba9afac7 100644 (file)
@@ -594,6 +594,7 @@ typedef struct VP9_COMP {
   YV12_BUFFER_CONFIG *tpl_recon_frames[REF_FRAMES];
   EncFrameBuf enc_frame_buf[REF_FRAMES];
 #if CONFIG_NON_GREEDY_MV
+  int tpl_ready;
   int feature_score_loc_alloc;
   FEATURE_SCORE_LOC *feature_score_loc_arr;
   FEATURE_SCORE_LOC **feature_score_loc_sort;
index a9c2c32d0ba801de361d8a99a7688ac25e581a26..c4eefa846f0a1b0e7f6b4af58efc61e03dd6a924 100644 (file)
@@ -2543,7 +2543,7 @@ static int discount_newmv_test(const VP9_COMP *cpi, int this_mode,
 #if CONFIG_NON_GREEDY_MV
   (void)mode_mv;
   (void)this_mv;
-  if (this_mode == NEWMV && bsize >= BLOCK_8X8) {
+  if (this_mode == NEWMV && bsize >= BLOCK_8X8 && cpi->tpl_ready) {
     const int gf_group_idx = cpi->twopass.gf_group.index;
     const int gf_rf_idx = ref_frame_to_gf_rf_idx(ref_frame);
     const TplDepFrame tpl_frame = cpi->tpl_stats[gf_group_idx];