shithub: openh264

Download patch

ref: 7de6eb2bad6b76ba7d6795a4dc74b8735948651f
parent: 153fa10dc5e02270e73a4a195742550f8b00ff3b
parent: 0adb3e1b9c401420a66accdf8bb0a48f3e3e8061
author: HaiboZhu <[email protected]>
date: Thu May 29 05:46:07 EDT 2014

Merge pull request #902 from huili2/remove_No_Waiting_Au

remove macro NO_WAITING_AU for always on

--- a/codec/decoder/core/inc/as264_common.h
+++ b/codec/decoder/core/inc/as264_common.h
@@ -38,6 +38,5 @@
  */
 #ifndef WELS_AS264_COMMON_H__
 #define WELS_AS264_COMMON_H__
-#define  NO_WAITING_AU //slice level decoding
 #define  LONG_TERM_REF //for app
 #endif // WELS_AS264_COMMON_H__
--- a/codec/decoder/core/inc/decoder_context.h
+++ b/codec/decoder/core/inc/decoder_context.h
@@ -322,11 +322,9 @@
   //trace handle
   void*      pTraceHandle;
 
-#ifdef NO_WAITING_AU
   //Save the last nal header info
   SNalUnitHeaderExt sLastNalHdrExt;
   SSliceHeader      sLastSliceHeader;
-#endif
 
 } SWelsDecoderContext, *PWelsDecoderContext;
 
--- a/codec/decoder/core/src/decoder_core.cpp
+++ b/codec/decoder/core/src/decoder_core.cpp
@@ -62,9 +62,8 @@
              pCtx->iTotalNumMbRec, kiTotalNumMbInCurLayer, pCurDq->iMbWidth, pCurDq->iMbHeight);
     bFrameCompleteFlag = false; //return later after output buffer is done
   }
-#ifdef NO_WAITING_AU
+
   pCtx->iTotalNumMbRec = 0;
-#endif
 
   if (pCtx->bNewSeqBegin) {
     memcpy (& (pCtx->sFrameCrop), & (pCurDq->sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.pSps->sFrameCrop),
@@ -1749,7 +1748,6 @@
       }
     }
 
-#ifdef NO_WAITING_AU
     //For fixing the nal lossing issue
     if ((pCtx->iTotalNumMbRec != 0) &&
         (CheckAccessUnitBoundaryExt (&pCtx->sLastNalHdrExt, &pNalCur->sNalHeaderExt, &pCtx->sLastSliceHeader,
@@ -1756,10 +1754,7 @@
                                      &pNalCur->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader))) {
       pCtx->iTotalNumMbRec = 0;
     }
-#else
-    //initialize at the starting of AU.
-    pCtx->iTotalNumMbRec = 0;
-#endif
+
     if (pCtx->iTotalNumMbRec == 0) { //Picture start to decode
       for (int32_t i = 0; i < LAYER_NUM_EXCHANGEABLE; ++ i)
         memset (pCtx->sMb.pSliceIdc[i], 0xff, (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t)));
@@ -1908,16 +1903,10 @@
 
     if (dq_cur->uiLayerDqId == kuiTargetLayerDqId) {
       if (DecodeFrameConstruction (pCtx, ppDst, pDstLen, pWidth, pHeight, pDstInfo)) {
-#ifdef NO_WAITING_AU
         memcpy (&pCtx->sLastNalHdrExt, &pCurAu->pNalUnitsList[iIdx - 1]->sNalHeaderExt, sizeof (SNalUnitHeaderExt));
         memcpy (&pCtx->sLastSliceHeader, &pCurAu->pNalUnitsList[iIdx - 1]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader,
                 sizeof (SSliceHeader));
         return ERR_NONE;
-#else
-        pCtx->iErrorCode |= dsBitstreamError;
-        return -1;
-#endif
-
       }
 
       pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //store latest decoded picture for EC