shithub: openh264

Download patch

ref: f421aab6a3bc615d3d1d3e496aeccde7b947f86b
parent: c7bffb66735df8ea01e268bc906695ee04f007ae
parent: 2dc76d74250d90dacd4f3ca0e1ec5348012db4ca
author: huili2 <[email protected]>
date: Thu Dec 22 12:00:35 EST 2016

Merge pull request #2625 from ruil2/cabac_change

    remove unusage code for cabac

--- a/codec/encoder/core/src/svc_encode_slice.cpp
+++ b/codec/encoder/core/src/svc_encode_slice.cpp
@@ -541,7 +541,8 @@
     sDss.iStartPos = sDss.iCurrentPos = 0;
   }
   for (; ;) {
-    pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, 0);
+    if (!pEncCtx->pSvcParam->iEntropyCodingModeFlag)
+      pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, 0);
     iCurMbIdx = iNextMbIdx;
     pCurMb = &pMbList[ iCurMbIdx ];
 
@@ -555,10 +556,12 @@
 
 
     iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb);
-    if ((iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) && (pCurMb->uiLumaQp < 50)) {
-      pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice);
-      UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset);
-      goto TRY_REENCODING;
+    if (!pEncCtx->pSvcParam->iEntropyCodingModeFlag) {
+      if ((iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) && (pCurMb->uiLumaQp < 50)) {
+        pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice);
+        UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset);
+        goto TRY_REENCODING;
+      }
     }
     if (ENC_RETURN_SUCCESS != iEncReturn)
       return iEncReturn;
@@ -1115,7 +1118,8 @@
   }
   pSlice->iMbSkipRun = 0;
   for (;;) {
-    pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, pSlice->iMbSkipRun);
+    if (!pEncCtx->pSvcParam->iEntropyCodingModeFlag)
+      pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, pSlice->iMbSkipRun);
     //point to current pMb
     iCurMbIdx = iNextMbIdx;
     pCurMb = &pMbList[ iCurMbIdx ];
@@ -1145,10 +1149,12 @@
     //step (6): begin to write bit stream; if the pSlice size is controlled, the writing may be skipped
 
     iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb);
-    if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND && (pCurMb->uiLumaQp < 50)) {
-      pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice);
-      UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset);
-      goto TRY_REENCODING;
+    if (!pEncCtx->pSvcParam->iEntropyCodingModeFlag) {
+      if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND && (pCurMb->uiLumaQp < 50)) {
+        pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice);
+        UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset);
+        goto TRY_REENCODING;
+      }
     }
     if (ENC_RETURN_SUCCESS != iEncReturn)
       return iEncReturn;