]> granicus.if.org Git - libvpx/commitdiff
vp9-svc: Add frame dropper control to sample encoder.
authorMarco Paniconi <marpan@google.com>
Tue, 29 May 2018 22:50:00 +0000 (15:50 -0700)
committerMarco Paniconi <marpan@google.com>
Wed, 30 May 2018 02:31:23 +0000 (19:31 -0700)
Disabled as default as enc_cfg.rc_dropframe_thresh is
set to 0 as default.

Change-Id: Ia888aa16b1a86a716ec33ea041e8b16b19bf93be

examples/vp9_spatial_svc_encoder.c

index 091c6954d12246fb448249894eb00d64ecde3fdb..3fd961bdc53d578fc3e1237d19d689f89725e277 100644 (file)
@@ -622,6 +622,7 @@ int main(int argc, const char **argv) {
   vpx_codec_ctx_t codec;
   vpx_codec_enc_cfg_t enc_cfg;
   SvcContext svc_ctx;
+  vpx_svc_frame_drop_t svc_drop_frame;
   uint32_t i;
   uint32_t frame_cnt = 0;
   vpx_image_t raw;
@@ -732,6 +733,12 @@ int main(int argc, const char **argv) {
 
   vpx_codec_control(&codec, VP9E_SET_TUNE_CONTENT, 0);
 
+  svc_drop_frame.framedrop_mode = FULL_SUPERFRAME_DROP;
+  for (sl = 0; sl < (unsigned int)svc_ctx.spatial_layers; ++sl)
+    svc_drop_frame.framedrop_thresh[sl] = enc_cfg.rc_dropframe_thresh;
+  svc_drop_frame.max_consec_drop = INT_MAX;
+  vpx_codec_control(&codec, VP9E_SET_SVC_FRAME_DROP_LAYER, &svc_drop_frame);
+
   // Encode frames
   while (!end_of_stream) {
     vpx_codec_iter_t iter = NULL;