ref: 2ef9613e55cbad9b20ed1387ddc59776b1f1630e
parent: c96c8b05a8c2b85dedb015f2ca62f7745711f7dd
author: Karina <ruil2@cisco.com>
date: Tue May 24 09:25:05 EDT 2016
avoid overflow
--- a/codec/encoder/core/src/ratectl.cpp
+++ b/codec/encoder/core/src/ratectl.cpp
@@ -982,7 +982,7 @@
pTOverRc->iLinearCmplx = ((int64_t)pWelsSvcRc->iFrameDqBits) * iQStep;
} else {
pTOverRc->iLinearCmplx = WELS_DIV_ROUND64 ((LINEAR_MODEL_DECAY_FACTOR * (int64_t)pTOverRc->iLinearCmplx
- + (INT_MULTIPLY - LINEAR_MODEL_DECAY_FACTOR) * (int64_t) (pWelsSvcRc->iFrameDqBits * iQStep)),
+ + (INT_MULTIPLY - LINEAR_MODEL_DECAY_FACTOR) *((int64_t)pWelsSvcRc->iFrameDqBits * iQStep)),
INT_MULTIPLY);
}
int32_t iAlpha = WELS_DIV_ROUND (INT_MULTIPLY, (1 + pTOverRc->iPFrameNum));