shithub: libvpx

Download patch

ref: d4124ea3174c1b901cce77f0904a0c9d8a1ad2f2
parent: 143b09558c0152c6f65be26fa114dc6f160fff21
author: Minghai Shang <[email protected]>
date: Thu Mar 27 09:35:27 EDT 2014

[svc] Fix issue for setting layers through ffmpeg

Root cause is number of spatial layers is set through
parse_options() when running from ffmpeg.

Change-Id: Icd79cd13fd76e8712150d803838a33fee9117dcb

--- a/vpx/src/svc_encodeframe.c
+++ b/vpx/src/svc_encodeframe.c
@@ -524,9 +524,6 @@
             svc_ctx->spatial_layers);
     return VPX_CODEC_INVALID_PARAM;
   }
-  // use SvcInternal value for number of layers to enable forcing single layer
-  // for first frame
-  si->layers = svc_ctx->spatial_layers;
 
   res = parse_quantizer_values(svc_ctx, si->quantizers, 0);
   if (res != VPX_CODEC_OK) return res;
@@ -538,9 +535,12 @@
   res = parse_scale_factors(svc_ctx, si->scale_factors);
   if (res != VPX_CODEC_OK) return res;
 
-  // parse aggregate command line options
+  // Parse aggregate command line options. Options must start with
+  // "layers=xx" then followed by other options
   res = parse_options(svc_ctx, si->options);
   if (res != VPX_CODEC_OK) return res;
+
+  si->layers = svc_ctx->spatial_layers;
 
   // Assign target bitrate for each layer. We calculate the ratio
   // from the resolution for now.