]> granicus.if.org Git - libvpx/commitdiff
vp9: Fix to the svc buffer update
authorMarco Paniconi <marpan@google.com>
Mon, 19 Nov 2018 20:24:52 +0000 (12:24 -0800)
committerMarco Paniconi <marpan@google.com>
Mon, 19 Nov 2018 21:32:20 +0000 (13:32 -0800)
Condition the pre-encode buffer update based on
TS diff on temporal layers = 1 for now, as some
fix is needed for the case where #temporal_layers > 1.

Change-Id: I58163b956db415217e4687a31f8ba110545b09f5

test/svc_datarate_test.cc
test/vp9_datarate_test.cc
vp9/encoder/vp9_ratectrl.c

index 8e15336298791f61a178d34f1f5a53b15df72691..0c35163bd7195f9d0747a56b6aa4b6acde69069a 100644 (file)
@@ -1163,7 +1163,7 @@ TEST_P(DatarateOnePassCbrSvcSmallKF, OnePassCbrSvc3SL3TLSmallKf) {
   AssignLayerBitrates();
   ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
   // TODO(jianj): webm:1554
-  CheckLayerRateTargeting(number_spatial_layers_, number_temporal_layers_, 0.76,
+  CheckLayerRateTargeting(number_spatial_layers_, number_temporal_layers_, 0.70,
                           1.15);
 #if CONFIG_VP9_DECODER
   // The non-reference frames are expected to be mismatched frames as the
index 62f2852f69aabdd17c0d427e75d07458dd50659f..4a7a8253e41970b8894b9143b73b9193538e3a30 100644 (file)
@@ -649,7 +649,7 @@ TEST_P(DatarateTestVP9RealTime,
         << " The datarate for the file is lower than target by too much, "
            "for layer: "
         << j;
-    ASSERT_LE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 1.15)
+    ASSERT_LE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 1.20)
         << " The datarate for the file is greater than target by too much, "
            "for layer: "
         << j;
index 129e0a1c1086fc5af604ac851e5b424745299cb0..bb316fe11d61363121344f1fc9feff492a19cb41 100644 (file)
@@ -274,12 +274,12 @@ static void update_buffer_level_svc_preencode(VP9_COMP *cpi) {
         LAYER_IDS_TO_IDX(svc->spatial_layer_id, i, svc->number_temporal_layers);
     LAYER_CONTEXT *const lc = &svc->layer_context[layer];
     RATE_CONTROL *const lrc = &lc->rc;
-    if (use_timestamp && cpi->svc.use_set_ref_frame_config && ts_delta > 0 &&
+    if (use_timestamp && cpi->svc.use_set_ref_frame_config &&
+        svc->number_temporal_layers == 1 && ts_delta > 0 &&
         svc->current_superframe > 0) {
+      // TODO(marpan): This may need to be modified for temporal layers.
       const double framerate_pts = 10000000.0 / ts_delta;
-      const double lc_framerate_pts =
-          framerate_pts / cpi->oxcf.ts_rate_decimator[i];
-      lrc->bits_off_target += (int)(lc->target_bandwidth / lc_framerate_pts);
+      lrc->bits_off_target += (int)(lc->target_bandwidth / framerate_pts);
     } else {
       lrc->bits_off_target += (int)(lc->target_bandwidth / lc->framerate);
     }