]> granicus.if.org Git - libvpx/commitdiff
vp9-resize: Force reference masking off for external dynamic-resizing.
authorMarco <marpan@google.com>
Thu, 11 Feb 2016 00:59:09 +0000 (16:59 -0800)
committerMarco <marpan@google.com>
Thu, 11 Feb 2016 16:35:57 +0000 (08:35 -0800)
An issue exists with reference_masking in non-rd pickmode for spatial
scaling. It was kept off for internal dynamic resizing and svc, this
change is to keep it off also for external dynamic resizing.

Update to external resize test, and update TODO to re-enable this
at frame level when references have same scale as source.

Change-Id: If880a643572127def703ee5b2d16fd41bdbf256c

test/resize_test.cc
vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_encoder.h
vp9/encoder/vp9_speed_features.c

index 10f7fe22f825a616dbb3bf66ead5312c852a9e97..c5f05f31048eeaa2b9964d1c84494057b8917501 100644 (file)
@@ -387,6 +387,8 @@ class ResizeRealtimeTest : public ::libvpx_test::EncoderTest,
 TEST_P(ResizeRealtimeTest, TestExternalResizeWorks) {
   ResizingVideoSource video;
   DefaultConfig();
+  // Disable internal resize for this test.
+  cfg_.rc_resize_allowed = 0;
   change_bitrate_ = false;
   ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 
index bd9813a774329ac53b89b9a696eaa24644ae7086..ff176fb9376e98cf6df233c225c3d76525fa710b 100644 (file)
@@ -1525,6 +1525,7 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
   if (last_w != cpi->oxcf.width || last_h != cpi->oxcf.height) {
     cm->width = cpi->oxcf.width;
     cm->height = cpi->oxcf.height;
+    cpi->external_resize = 1;
   }
 
   if (cpi->initial_width) {
@@ -1536,6 +1537,7 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
       alloc_compressor_data(cpi);
       realloc_segmentation_maps(cpi);
       cpi->initial_width = cpi->initial_height = 0;
+      cpi->external_resize = 0;
     }
   }
   update_frame_size(cpi);
@@ -1671,6 +1673,7 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
 
   cpi->use_svc = 0;
   cpi->resize_state = 0;
+  cpi->external_resize = 0;
   cpi->resize_avg_qp = 0;
   cpi->resize_buffer_underflow = 0;
   cpi->use_skin_detection = 0;
index 838ceacd67ae0e200426317ee4a5999f38d27574..c486ac258957f41b2c307cec90b5ddac12d995fd 100644 (file)
@@ -488,6 +488,7 @@ typedef struct VP9_COMP {
 
   int resize_pending;
   int resize_state;
+  int external_resize;
   int resize_scale_num;
   int resize_scale_den;
   int resize_avg_qp;
index b4f20fcd62b6b0781bda113aa0c08fa1f5985264..8a34fd9add1bb505230b700b8f0ceb3cb8f1e483 100644 (file)
@@ -303,11 +303,13 @@ static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf,
                                  FLAG_SKIP_INTRA_LOWVAR;
     sf->adaptive_pred_interp_filter = 2;
 
-    // Disable reference masking if using spatial scaling since
-    // pred_mv_sad will not be set (since vp9_mv_pred will not
-    // be called).
-    // TODO(marpan/agrange): Fix this condition.
-    sf->reference_masking = (cpi->oxcf.resize_mode != RESIZE_DYNAMIC &&
+    // Disable reference masking if using spatial scaling or for dynamic
+    // resizing (internal or external) since pred_mv_sad will not be set
+    // (since vp9_mv_pred will not be called).
+    // TODO(marpan): Fix this condition to allow reference masking for when
+    // all references have same resolution as source frame.
+    sf->reference_masking = (cpi->external_resize == 0 &&
+                             cpi->oxcf.resize_mode != RESIZE_DYNAMIC &&
                              cpi->svc.number_spatial_layers == 1) ? 1 : 0;
 
     sf->disable_filter_search_var_thresh = 50;