diff options
Diffstat (limited to 'media/libstagefright/codecs/aacenc/src/block_switch.c')
-rw-r--r-- | media/libstagefright/codecs/aacenc/src/block_switch.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/media/libstagefright/codecs/aacenc/src/block_switch.c b/media/libstagefright/codecs/aacenc/src/block_switch.c index c0054f7..d54e32f 100644 --- a/media/libstagefright/codecs/aacenc/src/block_switch.c +++ b/media/libstagefright/codecs/aacenc/src/block_switch.c @@ -1,27 +1,27 @@ -/*
- ** Copyright 2003-2010, VisualOn, Inc.
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- ** http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-/*******************************************************************************
- File: block_switch.c
-
- Content: Block switching functions
-
+/* + ** Copyright 2003-2010, VisualOn, Inc. + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ +/******************************************************************************* + File: block_switch.c + + Content: Block switching functions + *******************************************************************************/ -#include "typedef.h"
-#include "basic_op.h"
+#include "typedef.h" +#include "basic_op.h" #include "oper_32b.h" #include "psy_const.h" #include "block_switch.h" @@ -132,7 +132,7 @@ Word16 BlockSwitching(BLOCK_SWITCHING_CONTROL *blockSwitchingControl, for (i=0; i<MAX_NO_OF_GROUPS; i++) { blockSwitchingControl->groupLen[i] = suggestedGroupingTable[blockSwitchingControl->attackIndex][i]; - }
+ } /* if the samplerate is less than 16000, it should be all the short block, avoid pre&post echo */ if(sampleRate >= 16000) { @@ -274,7 +274,7 @@ static Word32 SrchMaxWithIndex(const Word32 in[], Word16 *index, Word16 n) * returns: TRUE if success * **********************************************************************************/ -#ifndef ARMV5E
+#ifndef ARMV5E Word32 CalcWindowEnergy(BLOCK_SWITCHING_CONTROL *blockSwitchingControl, Word16 *timeSignal, Word16 chIncrement, @@ -283,14 +283,14 @@ Word32 CalcWindowEnergy(BLOCK_SWITCHING_CONTROL *blockSwitchingControl, Word32 w, i, wOffset, tidx, ch; Word32 accuUE, accuFE; Word32 tempUnfiltered; - Word32 tempFiltered;
- Word32 states0, states1;
- Word32 Coeff0, Coeff1;
-
- - states0 = blockSwitchingControl->iirStates[0];
- states1 = blockSwitchingControl->iirStates[1];
- Coeff0 = hiPassCoeff[0];
+ Word32 tempFiltered; + Word32 states0, states1; + Word32 Coeff0, Coeff1; + + + states0 = blockSwitchingControl->iirStates[0]; + states1 = blockSwitchingControl->iirStates[1]; + Coeff0 = hiPassCoeff[0]; Coeff1 = hiPassCoeff[1]; tidx = 0; for (w=0; w < BLOCK_SWITCH_WINDOWS; w++) { @@ -299,19 +299,19 @@ Word32 CalcWindowEnergy(BLOCK_SWITCHING_CONTROL *blockSwitchingControl, accuFE = 0; for(i=0; i<windowLen; i++) { - Word32 accu1, accu2, accu3;
- Word32 out;
+ Word32 accu1, accu2, accu3; + Word32 out; tempUnfiltered = timeSignal[tidx]; tidx = tidx + chIncrement; -
- accu1 = L_mpy_ls(Coeff1, tempUnfiltered);
- accu2 = fixmul( Coeff0, states1 );
- accu3 = accu1 - states0;
- out = accu3 - accu2;
-
- states0 = accu1;
- states1 = out;
-
+ + accu1 = L_mpy_ls(Coeff1, tempUnfiltered); + accu2 = fixmul( Coeff0, states1 ); + accu3 = accu1 - states0; + out = accu3 - accu2; + + states0 = accu1; + states1 = out; + tempFiltered = extract_h(out); accuUE += (tempUnfiltered * tempUnfiltered) >> ENERGY_SHIFT; accuFE += (tempFiltered * tempFiltered) >> ENERGY_SHIFT; @@ -320,9 +320,9 @@ Word32 CalcWindowEnergy(BLOCK_SWITCHING_CONTROL *blockSwitchingControl, blockSwitchingControl->windowNrg[1][w] = accuUE; blockSwitchingControl->windowNrgF[1][w] = accuFE; - }
-
- blockSwitchingControl->iirStates[0] = states0;
+ } + + blockSwitchingControl->iirStates[0] = states0; blockSwitchingControl->iirStates[1] = states1; return(TRUE); |