shithub: openh264

Download patch

ref: 057e38663fa8e2784f095ae68ded945697f0e11a
parent: e4220b7b55925ff2feacc2f5944dc528629b57ad
author: ruil2 <[email protected]>
date: Wed Jun 25 12:18:42 EDT 2014

add iSubSeqId calculation

--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -2899,6 +2899,22 @@
   return ENC_RETURN_SUCCESS;
 }
 
+int32_t GetSubSequenceId(sWelsEncCtx* pCtx,EVideoFrameType eFrameType){
+  int32_t iSubSeqId = 0;
+  if(eFrameType == videoFrameTypeIDR )
+    iSubSeqId = 0;
+  else if(eFrameType == videoFrameTypeI)
+    iSubSeqId = 1;
+  else if (eFrameType == videoFrameTypeP){
+    if(pCtx->bCurFrameMarkedAsSceneLtr)
+      iSubSeqId = 2;
+    else 
+      iSubSeqId = 3 + pCtx->uiTemporalId; //T0:3 T1:4 T2:5 T3:6
+  }
+  else 
+    iSubSeqId = 3 + MAX_TEMPORAL_LAYER_NUM;
+   return iSubSeqId;
+}
 /*!
  * \brief	core svc encoding process
  *
@@ -3540,7 +3556,7 @@
   ++ pCtx->iCodingIndex;
   pCtx->eLastNalPriority	= eNalRefIdc;
   pFbi->iLayerNum			= iLayerNum;
-
+  pFbi->iSubSeqId = GetSubSequenceId(pCtx,eFrameType); 
   WelsEmms();
 
   pFbi->eFrameType = eFrameType;