shithub: openh264

Download patch

ref: 95012b0af6df9168a5184f892d8edc20d2d5f109
parent: dd5b9b89f6c0162cb8c47038d477cca35189096e
author: huili2 <[email protected]>
date: Thu Jun 19 22:01:02 EDT 2014

enable MB re-decoding

--- a/codec/decoder/core/src/decode_slice.cpp
+++ b/codec/decoder/core/src/decode_slice.cpp
@@ -93,7 +93,11 @@
     }
 
     ++iCountNumMb;
-    ++pCtx->iTotalNumMbRec;
+    if (!pCurLayer->pMbCorrectlyDecodedFlag[iNextMbXyIndex]) { //already con-ed, overwrite
+      pCurLayer->pMbCorrectlyDecodedFlag[iNextMbXyIndex] = true;
+      ++pCtx->iTotalNumMbRec;
+    }
+
     if (iCountNumMb >= iTotalNumMb) {
       break;
     }
@@ -394,7 +398,6 @@
     }
 
     ++pSlice->iTotalMbInCurSlice;
-    pCurLayer->pMbCorrectlyDecodedFlag[iNextMbXyIndex] = true;
 
     if (pSliceHeader->pPps->uiNumSliceGroups > 1) {
       iNextMbXyIndex = FmoNextMb (pFmo, iNextMbXyIndex);