ref: dc56892d726b05db130dd767bc7f41c291b6fd31
parent: 0dcb7584b55e5b2afbfae427595f4a696047a081
author: huili2 <huili2@cisco.com>
date: Thu Jun 19 13:59:40 EDT 2014
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;
}
}