shithub: openh264

Download patch

ref: bf33bde15defd14765cd00c5d0742338f0bd96bd
parent: c9f19241fb2dd78912e67e88d2b20fc25e581d08
parent: 82e7dcd84fadd1a3ff153782b8cac785bc2a2fcc
author: HaiboZhu <[email protected]>
date: Mon Aug 17 12:38:54 EDT 2015

Merge pull request #2075 from sijchen/fix_abnormal_tid

[Encoder] change the solution when invalid tid is found

--- a/codec/encoder/core/src/wels_preprocess.cpp
+++ b/codec/encoder/core/src/wels_preprocess.cpp
@@ -1037,7 +1037,10 @@
                                           (pCurPicture->iHeightInPixel >> 3) * STATIC_SCENE_MOTION_RATIO));
   const uint8_t iCurTid = GetTemporalLevel (&pSvcParam->sDependencyLayers[m_pEncCtx->sSpatialIndexMap[0].iDid],
                           m_pEncCtx->iCodingIndex, pSvcParam->uiGopSize);
-  const int32_t iClosestLtrFrameNum = (iCurTid != INVALID_TEMPORAL_ID ?  pCtx->pLtr[iTargetDid].iLastLtrIdx[iCurTid] : -1);//TBD
+  if (iCurTid == INVALID_TEMPORAL_ID) {
+    return LARGE_CHANGED_SCENE;
+  }
+  const int32_t iClosestLtrFrameNum = pCtx->pLtr[iTargetDid].iLastLtrIdx[iCurTid];
   if (pSvcParam->bEnableLongTermReference) {
     GetAvailableRefListLosslessScreenRefSelection (pSrcPicList, iCurTid, iClosestLtrFrameNum, &sAvailableRefList[0],
         iAvailableRefNum,