shithub: openh264

Download patch

ref: 0c32465aacec94d57c0d5453e652a7b004034493
parent: 863dc78c254550240bcb1881fe6219a2abfdf3b1
author: lyao2 <lyao2@LYAO2-WS01.cisco.com>
date: Tue Aug 26 09:31:14 EDT 2014

fix pps assert issue when enable bEnableSpsPpsIdAddition

--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -2642,19 +2642,13 @@
   //31st finish:	next_spsid_in_bs == 1;
 
   const int32_t kiEncId			= kiCurEncoderParaSetId;
-  const uint32_t kuiPrevIdInBs	= sParaSetOffsetVariable->iParaSetIdDelta[kiEncId] + kiEncId;//mark current_id
   const bool* kpUsedIdPointer   = &sParaSetOffsetVariable->bUsedParaSetIdInBs[0];
   uint32_t uiNextIdInBs			= sParaSetOffsetVariable->uiNextParaSetIdToUseInBs;
 
-#if _DEBUG
-  if (0 != sParaSetOffsetVariable->iParaSetIdDelta[kiEncId])
-    assert (sParaSetOffsetVariable->bUsedParaSetIdInBs[kuiPrevIdInBs]);   //sure the prev-used one was marked activated correctly
-#endif
   //update current layer's pCodingParam
   sParaSetOffsetVariable->iParaSetIdDelta[kiEncId]	= uiNextIdInBs -
       kiEncId;  //for current parameter set, change its id_delta
   //write pso pData for next update:
-  sParaSetOffsetVariable->bUsedParaSetIdInBs[kuiPrevIdInBs] = false;	//
   sParaSetOffsetVariable->bUsedParaSetIdInBs[uiNextIdInBs] = true;		//   update current used_id
 
   //prepare for next update:
@@ -3677,6 +3671,8 @@
     SParaSetOffsetVariable sTmpPsoVariable[PARA_SET_TYPE];
     uint16_t	          uiTmpIdrPicId;//this is for LTR!
     SLogContext sLogCtx = (*ppCtx)->sLogCtx;
+    for (int32_t k=0;k<PARA_SET_TYPE;k++)
+      memset(((*ppCtx)->sPSOVector.sParaSetOffsetVariable[k].bUsedParaSetIdInBs), 0, MAX_PPS_COUNT*sizeof(bool));
     memcpy (sTmpPsoVariable, (*ppCtx)->sPSOVector.sParaSetOffsetVariable,
             (PARA_SET_TYPE)*sizeof (SParaSetOffsetVariable)); // confirmed_safe_unsafe_usage
     uiTmpIdrPicId = (*ppCtx)->sPSOVector.uiIdrPicId;