shithub: openh264

Download patch

ref: 4ee0534f7f87467b49450411160d3e2fb6e6810a
parent: 1d91f02ee998e33e35b9cbab2464fc81fb76455a
author: sijchen@cisco.com <sijchen@cisco.com>
date: Fri Jan 19 11:20:17 EST 2018

add enhancement in param transcode

--- a/codec/encoder/core/inc/param_svc.h
+++ b/codec/encoder/core/inc/param_svc.h
@@ -417,6 +417,21 @@
       pSpatialLayer->iMaxSpatialBitrate =
         pCodingParam.sSpatialLayers[iIdxSpatial].iMaxSpatialBitrate;
 
+      if ((iSpatialLayerNum==1) && (iIdxSpatial==0)) {
+        if (pSpatialLayer->iVideoWidth == 0) {
+          pSpatialLayer->iVideoWidth = iPicWidth;
+        }
+        if (pSpatialLayer->iVideoHeight == 0) {
+          pSpatialLayer->iVideoHeight = iPicHeight;
+        }
+        if (pSpatialLayer->iSpatialBitrate == 0) {
+          pSpatialLayer->iSpatialBitrate = iTargetBitrate;
+        }
+        if (pSpatialLayer->iMaxSpatialBitrate == 0) {
+          pSpatialLayer->iMaxSpatialBitrate = iMaxBitrate;
+        }
+      }
+
       //multi slice
       pSpatialLayer->sSliceArgument = pCodingParam.sSpatialLayers[iIdxSpatial].sSliceArgument;