shithub: openh264

Download patch

ref: 82a4bee00b8004778c1544bfcce49d661fb4199f
parent: ac1630f435e42421fced379e20d5c1965a998960
parent: dc56892d726b05db130dd767bc7f41c291b6fd31
author: dongzha <dongzha@cisco.com>
date: Mon Jun 23 10:51:35 EDT 2014

Merge pull request #997 from huili2/rc_align

misaligned_rc_structure

--- a/codec/encoder/core/src/ratectl.cpp
+++ b/codec/encoder/core/src/ratectl.cpp
@@ -74,6 +74,8 @@
   if (NULL == pBaseMem)
     return;
 
+  pWelsSvcRc->pTemporalOverRc			= (SRCTemporal*)pBaseMem;
+  pBaseMem += sizeof (SRCTemporal) * kiMaxTl;
   pWelsSvcRc->pGomComplexity				= (double*)pBaseMem;
   pBaseMem += kiGomSizeD;
   pWelsSvcRc->pGomForegroundBlockNum	= (int32_t*)pBaseMem;
@@ -81,8 +83,6 @@
   pWelsSvcRc->pCurrentFrameGomSad		= (int32_t*)pBaseMem;
   pBaseMem += kiGomSizeI;
   pWelsSvcRc->pGomCost					= (int32_t*)pBaseMem;
-  pBaseMem += kiGomSizeI;
-  pWelsSvcRc->pTemporalOverRc			= (SRCTemporal*)pBaseMem;
 
   pWelsSvcRc->pSlicingOverRc			= (SRCSlicing*)pMA->WelsMalloc (sizeof (SRCSlicing) * kiSliceNum, "SlicingOverRC");
 }
@@ -92,13 +92,13 @@
     pMA->WelsFree (pWelsSvcRc->pSlicingOverRc, "SlicingOverRC");
     pWelsSvcRc->pSlicingOverRc = NULL;
   }
-  if (pWelsSvcRc != NULL && pWelsSvcRc->pGomComplexity != NULL) {
-    pMA->WelsFree (pWelsSvcRc->pGomComplexity, "rc_layer_memory");
+  if (pWelsSvcRc != NULL && pWelsSvcRc->pTemporalOverRc != NULL) {
+    pMA->WelsFree (pWelsSvcRc->pTemporalOverRc, "rc_layer_memory");
+    pWelsSvcRc->pTemporalOverRc         = NULL;
     pWelsSvcRc->pGomComplexity			= NULL;
     pWelsSvcRc->pGomForegroundBlockNum	= NULL;
     pWelsSvcRc->pCurrentFrameGomSad	= NULL;
     pWelsSvcRc->pGomCost				= NULL;
-    pWelsSvcRc->pTemporalOverRc		= NULL;
   }
 }