shithub: openh264

Download patch

ref: 7cfce53f53c653d2e0ad0238fa8e95f9b023b5ba
parent: 0ad30516c537bf6d4359e43bbe0185db6abcf809
parent: c05e1ad797cfd2a22c2895872e22a0400996fec3
author: ruil2 <[email protected]>
date: Sat Jul 5 10:12:55 EDT 2014

Merge pull request #1084 from JuannyWang/maxbr_refine

modify console for disable delay skip if maxbr==0

--- a/codec/console/enc/src/welsenc.cpp
+++ b/codec/console/enc/src/welsenc.cpp
@@ -163,11 +163,11 @@
       } else if (strTag[0].compare ("MaxSpatialBitrate") == 0) {
         pDLayer->iMaxSpatialBitrate = 1000 * atoi (strTag[1].c_str());
         if (pSvcParam.iRCMode != RC_OFF_MODE) {
-          if (pDLayer->iMaxSpatialBitrate <= 0) {
+          if (pDLayer->iMaxSpatialBitrate < 0) {
             fprintf (stderr, "Invalid max spatial bitrate(%d) in dependency layer #%d.\n", pDLayer->iMaxSpatialBitrate, iLayer);
             return -1;
           }
-          if (pDLayer->iMaxSpatialBitrate < pDLayer->iSpatialBitrate) {
+          if (pDLayer->iMaxSpatialBitrate > 0 && pDLayer->iMaxSpatialBitrate < pDLayer->iSpatialBitrate) {
             fprintf (stderr, "Invalid max spatial(#%d) bitrate(%d) setting::: < layerBitrate(%d)!\n", iLayer,
                      pDLayer->iMaxSpatialBitrate, pDLayer->iSpatialBitrate);
             return -1;
@@ -273,7 +273,7 @@
         }
       } else if (strTag[0].compare ("MaxOverallBitrate") == 0) {
         pSvcParam.iMaxBitrate	= 1000 * atoi (strTag[1].c_str());
-        if ((pSvcParam.iRCMode != RC_OFF_MODE) && pSvcParam.iMaxBitrate <= 0) {
+        if ((pSvcParam.iRCMode != RC_OFF_MODE) && pSvcParam.iMaxBitrate < 0) {
           fprintf (stderr, "Invalid max overall bitrate setting due to RC enabled. Check MaxOverallBitrate field please!\n");
           return 1;
         }