shithub: libvpx

Download patch

ref: e1921294f90d036736bb6dec5868172420ca4c39
parent: 2b08f89076d1e93339fbbcc10e3298a0eec66bd6
author: Marco Paniconi <marpan@google.com>
date: Tue May 29 11:50:00 EDT 2018

vp9-svc: Add frame dropper control to sample encoder.

Disabled as default as enc_cfg.rc_dropframe_thresh is
set to 0 as default.

Change-Id: Ia888aa16b1a86a716ec33ea041e8b16b19bf93be

--- a/examples/vp9_spatial_svc_encoder.c
+++ b/examples/vp9_spatial_svc_encoder.c
@@ -622,6 +622,7 @@
   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;
@@ -731,6 +732,12 @@
   vpx_codec_control(&codec, VP9E_SET_NOISE_SENSITIVITY, 0);
 
   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) {