]> granicus.if.org Git - libvpx/commitdiff
Refactor: Change cpi->resize_state to enum values.
authorJerome Jiang <jianj@google.com>
Mon, 13 Mar 2017 21:08:32 +0000 (14:08 -0700)
committerJerome Jiang <jianj@google.com>
Thu, 16 Mar 2017 00:16:17 +0000 (17:16 -0700)
Change-Id: Iab1409b0fc1175bc5a14afc4749a08c536c98c41

vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_encoder.h
vp9/encoder/vp9_speed_features.c

index 0d51f9b68a16f60eeadf1e184d303529ac06c63c..a3b133e4debb881d2680eccf082023d5adbb12ce 100644 (file)
@@ -1673,7 +1673,7 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
       (FRAME_CONTEXT *)vpx_calloc(FRAME_CONTEXTS, sizeof(*cm->frame_contexts)));
 
   cpi->use_svc = 0;
-  cpi->resize_state = 0;
+  cpi->resize_state = ORIG;
   cpi->external_resize = 0;
   cpi->resize_avg_qp = 0;
   cpi->resize_buffer_underflow = 0;
@@ -3162,7 +3162,7 @@ static void encode_without_recode_loop(VP9_COMP *cpi, size_t *size,
   vp9_update_noise_estimate(cpi);
 
   if (cpi->oxcf.pass == 0 && cpi->oxcf.mode == REALTIME &&
-      cpi->oxcf.speed >= 5 && cpi->resize_state == 0 &&
+      cpi->oxcf.speed >= 5 && cpi->resize_state == ORIG &&
       (cpi->oxcf.content == VP9E_CONTENT_SCREEN ||
        cpi->oxcf.rc_mode == VPX_VBR || compute_source_sad) &&
       cm->show_frame)
@@ -3215,7 +3215,7 @@ static void encode_without_recode_loop(VP9_COMP *cpi, size_t *size,
   // Check if we should drop this frame because of high overshoot.
   // Only for frames where high temporal-source SAD is detected.
   if (cpi->oxcf.pass == 0 && cpi->oxcf.rc_mode == VPX_CBR &&
-      cpi->resize_state == 0 && cm->frame_type != KEY_FRAME &&
+      cpi->resize_state == ORIG && cm->frame_type != KEY_FRAME &&
       cpi->oxcf.content == VP9E_CONTENT_SCREEN &&
       cpi->rc.high_source_sad == 1) {
     int frame_size = 0;
index 2d411329f2b36afd121a66f20db4b69721138fa1..ba29cabb1ffd2ca6764d5f842f1d263e96f4c1d6 100644 (file)
@@ -651,7 +651,7 @@ typedef struct VP9_COMP {
 #endif
 
   int resize_pending;
-  int resize_state;
+  RESIZE_STATE resize_state;
   int external_resize;
   int resize_scale_num;
   int resize_scale_den;
index 905506f5c4f1e09043e56a838542f6b54c93c454..ce53535396b81cdf08806b0b3a612232b948beb3 100644 (file)
@@ -525,7 +525,7 @@ static void set_rt_speed_feature_framesize_independent(
   if (speed >= 8) {
     sf->adaptive_rd_thresh = 4;
     // Enable partition copy
-    if (!cpi->use_svc && !cpi->resize_pending && !cpi->resize_state &&
+    if (!cpi->use_svc && !cpi->resize_pending && cpi->resize_state != ORIG &&
         !cpi->external_resize && cpi->oxcf.resize_mode == RESIZE_NONE)
       sf->copy_partition_flag = 1;