shithub: openh264

Download patch

ref: 153fa10dc5e02270e73a4a195742550f8b00ff3b
parent: 85e5108452042db9e7d85a18a28605e3f0cc1d29
parent: c8299d7d8fa77ac14727e0e58747abd2d6a0806d
author: huili2 <[email protected]>
date: Wed May 28 12:21:10 EDT 2014

Merge pull request #898 from ruil2/enc_rc_4

simplify stash pop bs

--- a/codec/encoder/core/src/svc_encode_slice.cpp
+++ b/codec/encoder/core/src/svc_encode_slice.cpp
@@ -593,11 +593,7 @@
     sDss.iCurrentPos = BsGetBitsPos (pBs);
 
     if (DynSlcJudgeSliceBoundaryStepBack (pEncCtx, pSlice, pSliceCtx, pCurMb, &sDss)) { //islice
-      //stack pBs pointer
-      pBs->pBufPtr		= sDss.pBsStackBufPtr;
-      pBs->uiCurBits	= sDss.uiBsStackCurBits;
-      pBs->iLeftBits	= sDss.iBsStackLeftBits;
-
+      StashPopMBStatus (&sDss, pBs, pSlice);
       pCurLayer->pLastCodedMbIdxOfPartition[kiPartitionId] = iCurMbIdx -
           1;	// update pLastCodedMbIdxOfPartition, need to -1 due to stepping back
       ++ pCurLayer->pNumSliceCodedOfPartition[kiPartitionId];
@@ -1116,13 +1112,7 @@
     //DYNAMIC_SLICING_ONE_THREAD - MultiD
     sDss.iCurrentPos = BsGetBitsPos (pBs);
     if (DynSlcJudgeSliceBoundaryStepBack (pEncCtx, pSlice, pSliceCtx, pCurMb, &sDss)) {
-      //stack pBs pointer
-      pBs->pBufPtr		= sDss.pBsStackBufPtr;
-      pBs->uiCurBits	= sDss.uiBsStackCurBits;
-      pBs->iLeftBits	= sDss.iBsStackLeftBits;
-
-      iMbSkipRun = sDss.iMbSkipRunStack;
-
+      StashPopMBStatus (&sDss, pBs, pSlice, &iMbSkipRun);
       pCurLayer->pLastCodedMbIdxOfPartition[kiPartitionId] = iCurMbIdx -
           1;	// update pLastCodedMbIdxOfPartition, need to -1 due to stepping back
       ++ pCurLayer->pNumSliceCodedOfPartition[kiPartitionId];