shithub: openh264

Download patch

ref: fe7684bf37ea38cd588c3a78a77bce92d6c9eb7b
parent: a3e60a1c6f7c092e9dab8bb55da7fb83fc45a916
parent: 08f7ad3f1fd0e0e5f7a5dd598fc597774fab94ba
author: HaiboZhu <haibozhu@cisco.com>
date: Wed Oct 28 05:58:31 EDT 2015

Merge pull request #2187 from shihuade/PSliceRefact_V1.1

refact slice header init

--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -2886,6 +2886,8 @@
       pBaseSlice->sSliceHeaderExt.sSliceHeader.pSps     = &pCtx->pSpsArray[iCurSpsId];
   }
 
+  pBaseSlice->bSliceHeaderExtFlag = (NAL_UNIT_CODED_SLICE_EXT == pCtx->eNalType);
+
   pSlice = pBaseSlice;
   iIdx = 1;
   while (iIdx < iSliceCount) {
@@ -2894,6 +2896,7 @@
     pSlice->sSliceHeaderExt.sSliceHeader.pPps   = pBaseSlice->sSliceHeaderExt.sSliceHeader.pPps;
     pSlice->sSliceHeaderExt.sSliceHeader.iSpsId = pBaseSlice->sSliceHeaderExt.sSliceHeader.iSpsId;
     pSlice->sSliceHeaderExt.sSliceHeader.pSps   = pBaseSlice->sSliceHeaderExt.sSliceHeader.pSps;
+    pSlice->bSliceHeaderExtFlag                 = pBaseSlice->bSliceHeaderExtFlag;
     ++ iIdx;
   }
 
@@ -2906,16 +2909,6 @@
   pNalHdExt->bIdrFlag                   = (pCtx->iFrameNum == 0) && ((pCtx->eNalType == NAL_UNIT_CODED_SLICE_IDR)
                                           || (pCtx->eSliceType == I_SLICE));
   pNalHdExt->uiTemporalId               = pCtx->uiTemporalId;
-
-  pBaseSlice->bSliceHeaderExtFlag       = (NAL_UNIT_CODED_SLICE_EXT == pNalHd->eNalUnitType);
-
-  pSlice = pBaseSlice;
-  iIdx = 1;
-  while (iIdx < iSliceCount) {
-    ++ pSlice;
-    pSlice->bSliceHeaderExtFlag = pBaseSlice->bSliceHeaderExtFlag;
-    ++ iIdx;
-  }
 
   // pEncPic pData
   pCurDq->pEncData[0]   = pEncPic->pData[0];