summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/aacenc/src/ms_stereo.c
diff options
context:
space:
mode:
Diffstat (limited to 'media/libstagefright/codecs/aacenc/src/ms_stereo.c')
-rw-r--r--media/libstagefright/codecs/aacenc/src/ms_stereo.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/media/libstagefright/codecs/aacenc/src/ms_stereo.c b/media/libstagefright/codecs/aacenc/src/ms_stereo.c
index 44d45cc..2e34f14 100644
--- a/media/libstagefright/codecs/aacenc/src/ms_stereo.c
+++ b/media/libstagefright/codecs/aacenc/src/ms_stereo.c
@@ -30,7 +30,7 @@
*
* function name: MsStereoProcessing
* description: detect use ms stereo or not
-* if ((min(thrLn, thrRn)*min(thrLn, thrRn))/(enMn*enSn))
+* if ((min(thrLn, thrRn)*min(thrLn, thrRn))/(enMn*enSn))
* >= ((thrLn *thrRn)/(enLn*enRn)) then ms stereo
*
**********************************************************************************/
@@ -51,7 +51,7 @@ void MsStereoProcessing(Word32 *sfbEnergyLeft,
const Word16 maxSfbPerGroup,
const Word16 *sfbOffset) {
Word32 temp;
- Word32 sfb,sfboffs, j;
+ Word32 sfb,sfboffs, j;
Word32 msMaskTrueSomewhere = 0;
Word32 msMaskFalseSomewhere = 0;
@@ -64,12 +64,12 @@ void MsStereoProcessing(Word32 *sfbEnergyLeft,
Word32 thrL, thrR, nrgL, nrgR;
Word32 idx, shift;
- idx = sfb + sfboffs;
+ idx = sfb + sfboffs;
- thrL = sfbThresholdLeft[idx];
- thrR = sfbThresholdRight[idx];
- nrgL = sfbEnergyLeft[idx];
- nrgR = sfbEnergyRight[idx];
+ thrL = sfbThresholdLeft[idx];
+ thrR = sfbThresholdRight[idx];
+ nrgL = sfbEnergyLeft[idx];
+ nrgR = sfbEnergyRight[idx];
minThreshold = min(thrL, thrR);
@@ -82,8 +82,8 @@ void MsStereoProcessing(Word32 *sfbEnergyLeft,
pnlr = fixmul(nrgL, nrgR);
- nrgL = sfbEnergyMid[idx];
- nrgR = sfbEnergySide[idx];
+ nrgL = sfbEnergyMid[idx];
+ nrgR = sfbEnergySide[idx];
nrgL = max(nrgL,minThreshold) + 1;
shift = norm_l(nrgL);
@@ -97,42 +97,42 @@ void MsStereoProcessing(Word32 *sfbEnergyLeft,
temp = (pnlr + 1) / ((pnms >> 8) + 1);
- temp = pnms - pnlr;
+ temp = pnms - pnlr;
if( temp > 0 ){
- msMask[idx] = 1;
- msMaskTrueSomewhere = 1;
+ msMask[idx] = 1;
+ msMaskTrueSomewhere = 1;
for (j=sfbOffset[idx]; j<sfbOffset[idx+1]; j++) {
Word32 left, right;
left = (mdctSpectrumLeft[j] >> 1);
right = (mdctSpectrumRight[j] >> 1);
- mdctSpectrumLeft[j] = left + right;
- mdctSpectrumRight[j] = left - right;
+ mdctSpectrumLeft[j] = left + right;
+ mdctSpectrumRight[j] = left - right;
}
-
- sfbThresholdLeft[idx] = minThreshold;
- sfbThresholdRight[idx] = minThreshold;
- sfbEnergyLeft[idx] = sfbEnergyMid[idx];
- sfbEnergyRight[idx] = sfbEnergySide[idx];
-
- sfbSpreadedEnRight[idx] = min(sfbSpreadedEnLeft[idx],sfbSpreadedEnRight[idx]) >> 1;
- sfbSpreadedEnLeft[idx] = sfbSpreadedEnRight[idx];
-
+
+ sfbThresholdLeft[idx] = minThreshold;
+ sfbThresholdRight[idx] = minThreshold;
+ sfbEnergyLeft[idx] = sfbEnergyMid[idx];
+ sfbEnergyRight[idx] = sfbEnergySide[idx];
+
+ sfbSpreadedEnRight[idx] = min(sfbSpreadedEnLeft[idx],sfbSpreadedEnRight[idx]) >> 1;
+ sfbSpreadedEnLeft[idx] = sfbSpreadedEnRight[idx];
+
}
else {
- msMask[idx] = 0;
- msMaskFalseSomewhere = 1;
+ msMask[idx] = 0;
+ msMaskFalseSomewhere = 1;
}
- }
- if ( msMaskTrueSomewhere ) {
+ }
+ if ( msMaskTrueSomewhere ) {
if(msMaskFalseSomewhere ) {
- *msDigest = SI_MS_MASK_SOME;
+ *msDigest = SI_MS_MASK_SOME;
} else {
- *msDigest = SI_MS_MASK_ALL;
+ *msDigest = SI_MS_MASK_ALL;
}
} else {
- *msDigest = SI_MS_MASK_NONE;
+ *msDigest = SI_MS_MASK_NONE;
}
}