diff options
Diffstat (limited to 'media/libstagefright/codecs/aacenc/src/stat_bits.c')
-rw-r--r-- | media/libstagefright/codecs/aacenc/src/stat_bits.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/media/libstagefright/codecs/aacenc/src/stat_bits.c b/media/libstagefright/codecs/aacenc/src/stat_bits.c index 556104e..baa289c 100644 --- a/media/libstagefright/codecs/aacenc/src/stat_bits.c +++ b/media/libstagefright/codecs/aacenc/src/stat_bits.c @@ -1,23 +1,23 @@ -/*
- ** 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: stat_bits.c
-
- Content: Static bit counter 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: stat_bits.c + + Content: Static bit counter functions + *******************************************************************************/ #include "stat_bits.h" @@ -82,10 +82,10 @@ static Word16 tnsCount(TNS_INFO *tnsInfo, Word16 blockType) Flag tnsPresent; Word32 numOfWindows; Word32 count; - Word32 coefBits;
+ Word32 coefBits; Word16 *ptcoef; - count = 0;
+ count = 0; if (blockType == 2) numOfWindows = 8; @@ -127,7 +127,7 @@ static Word16 tnsCount(TNS_INFO *tnsInfo, Word16 blockType) count += 1; /*coef_compression */ if (tnsInfo->coefRes[i] == 4) { - ptcoef = tnsInfo->coef + i*TNS_MAX_ORDER_SHORT;
+ ptcoef = tnsInfo->coef + i*TNS_MAX_ORDER_SHORT; coefBits = 3; for(k=0; k<tnsInfo->order[i]; k++) { @@ -139,7 +139,7 @@ static Word16 tnsCount(TNS_INFO *tnsInfo, Word16 blockType) } else { coefBits = 2; - ptcoef = tnsInfo->coef + i*TNS_MAX_ORDER_SHORT;
+ ptcoef = tnsInfo->coef + i*TNS_MAX_ORDER_SHORT; for(k=0; k<tnsInfo->order[i]; k++) { if ((ptcoef[k] > 1) || (ptcoef[k] < -2)) { @@ -154,7 +154,7 @@ static Word16 tnsCount(TNS_INFO *tnsInfo, Word16 blockType) } } } - }
+ } return count; } @@ -178,14 +178,14 @@ static Word16 countTnsBits(TNS_INFO *tnsInfo,Word16 blockType) **********************************************************************************/ Word16 countStaticBitdemand(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], PSY_OUT_ELEMENT *psyOutElement, - Word16 channels,
+ Word16 channels, Word16 adtsUsed) { Word32 statBits; Word32 ch; - statBits = 0;
-
+ statBits = 0; + /* if adts used, add 56 bits */ if(adtsUsed) statBits += 56; |