]> granicus.if.org Git - libvpx/commitdiff
Refactor encoder frame count update
authorJingning Han <jingning@google.com>
Wed, 22 Aug 2018 17:16:46 +0000 (10:16 -0700)
committerJingning Han <jingning@google.com>
Wed, 22 Aug 2018 22:09:18 +0000 (15:09 -0700)
This refactoring allows the encoder to skip frame count update in
the show_existing_frame mode.

Change-Id: Id69707976ccdad144cba93a8f5d36b6947611f91

vp9/encoder/vp9_encoder.c

index 3207b145724fa0b96560c6849b4c86e5431d3c24..2a88e55d90fd9316443f18a44e81827dae34233e 100644 (file)
@@ -4913,17 +4913,18 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, size_t *size,
   }
   vp9_update_reference_frames(cpi);
 
-  for (t = TX_4X4; t <= TX_32X32; t++)
-    full_to_model_counts(cpi->td.counts->coef[t],
-                         cpi->td.rd_counts.coef_counts[t]);
-
-  if (!cm->error_resilient_mode && !cm->frame_parallel_decoding_mode)
-    vp9_adapt_coef_probs(cm);
+  if (!cm->show_existing_frame) {
+    for (t = TX_4X4; t <= TX_32X32; ++t) {
+      full_to_model_counts(cpi->td.counts->coef[t],
+                           cpi->td.rd_counts.coef_counts[t]);
+    }
 
-  if (!frame_is_intra_only(cm)) {
     if (!cm->error_resilient_mode && !cm->frame_parallel_decoding_mode) {
-      vp9_adapt_mode_probs(cm);
-      vp9_adapt_mv_probs(cm, cm->allow_high_precision_mv);
+      if (!frame_is_intra_only(cm)) {
+        vp9_adapt_mode_probs(cm);
+        vp9_adapt_mv_probs(cm, cm->allow_high_precision_mv);
+      }
+      vp9_adapt_coef_probs(cm);
     }
   }