File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
media/libstagefright/codecs/aacenc/src Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ static void correctThresh(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS],
438438 for (sfb = 0 ; sfb < psyOutChan -> maxSfbPerGroup ; sfb ++ ) {
439439 Word32 redThrExp = thrExp [ch ][sfbGrp + sfb ] + redVal ;
440440
441- if (((* pahFlag < AH_ACTIVE ) || (deltaPe > 0 )) && (redThrExp > 0 ) ) {
441+ if (((* pahFlag < AH_ACTIVE ) || (deltaPe > 0 )) && (redThrExp > 0 ) && ( redThrExp >= * psfbNActiveLines ) ) {
442442
443443 * psfbPeFactors = (* psfbNActiveLines ) * (0x7fffffff / redThrExp );
444444 normFactor = L_add (normFactor , * psfbPeFactors );
@@ -466,7 +466,7 @@ static void correctThresh(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS],
466466 deltaSfbPe = * psfbPeFactors * deltaPe ;
467467
468468 /* thr3(n) = thr2(n)*2^deltaSfbPe/b(n) */
469- if (* psfbNActiveLines > 0 ) {
469+ if (* psfbNActiveLines > 0 && ( normFactor * ( * psfbNActiveLines )) != 0 ) {
470470 /* new threshold */
471471 Word32 thrFactor ;
472472 sfbEn = psyOutChan -> sfbEnergy [sfbGrp + sfb ];
You can’t perform that action at this time.
0 commit comments