shithub: libvpx

Download patch

ref: 5850cf881710a1b634d3bde283d5f31272acf8b6
parent: 3c9a10261f8ebff025f6a808c0ce30971675412d
parent: e1921294f90d036736bb6dec5868172420ca4c39
author: Marco Paniconi <marpan@google.com>
date: Tue May 29 23:24:57 EDT 2018

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

--- 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) {