From ad2d45b15aae80ba254277c3d1fa036207d8b926 Mon Sep 17 00:00:00 2001 From: Matthew Xie Date: Tue, 18 Sep 2012 16:14:30 -0700 Subject: Revert "Header file and whitespace cleanups" This reverts commit cc914cffd521b2e6e1be804c82aea2388b843ebf More changes in the original CL after my cherry-pick. Change-Id: Ic144dba96aeb8a60611baac7565c9f628ab8f9eb --- embdrv/sbc/encoder/srce/sbc_enc_bit_alloc_mono.c | 32 ++++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'embdrv/sbc/encoder/srce/sbc_enc_bit_alloc_mono.c') diff --git a/embdrv/sbc/encoder/srce/sbc_enc_bit_alloc_mono.c b/embdrv/sbc/encoder/srce/sbc_enc_bit_alloc_mono.c index 497f014..c8b13a9 100644 --- a/embdrv/sbc/encoder/srce/sbc_enc_bit_alloc_mono.c +++ b/embdrv/sbc/encoder/srce/sbc_enc_bit_alloc_mono.c @@ -2,7 +2,7 @@ ** ** File Name: $RCSfile: sbc_enc_bit_alloc_mono.c,v $ ** -** Description: This file contains the code for bit allocation algorithm. +** Description: This file contains the code for bit allocation algorithm. ** It calculates the number of bits required for the encoded stream of data. ** ** Revision : $Id: sbc_enc_bit_alloc_mono.c,v 1.9 2006/03/31 17:16:35 mjougit Exp $ @@ -17,16 +17,16 @@ #include "sbc_enc_func_declare.h" /*global arrays*/ -const SINT16 sbc_enc_as16Offset4[4][4] = { {-1, 0, 0, 0}, {-2, 0, 0, 1}, +const SINT16 sbc_enc_as16Offset4[4][4] = { {-1, 0, 0, 0}, {-2, 0, 0, 1}, {-2, 0, 0, 1}, {-2, 0, 0, 1} }; -const SINT16 sbc_enc_as16Offset8[4][8] = { {-2, 0, 0, 0, 0, 0, 0, 1}, +const SINT16 sbc_enc_as16Offset8[4][8] = { {-2, 0, 0, 0, 0, 0, 0, 1}, {-3, 0, 0, 0, 0, 0, 1, 2}, - {-4, 0, 0, 0, 0, 0, 1, 2}, + {-4, 0, 0, 0, 0, 0, 1, 2}, {-4, 0, 0, 0, 0, 0, 1, 2} }; /**************************************************************************** * BitAlloc - Calculates the required number of bits for the given scale factor -* and the number of subbands. +* and the number of subbands. * * RETURNS : N/A */ @@ -78,8 +78,8 @@ void sbc_enc_bit_alloc_mono(SBC_ENC_PARAMS *pstrCodecParams) *(ps16GenBufPtr) = -5; else { - s32Loudness = - (SINT32)(pstrCodecParams->as16ScaleFactor[s32Ch*s32NumOfSubBands+s32Sb] + s32Loudness = + (SINT32)(pstrCodecParams->as16ScaleFactor[s32Ch*s32NumOfSubBands+s32Sb] - *ps16GenTabPtr); if(s32Loudness > 0) *(ps16GenBufPtr) = (SINT16)(s32Loudness >>1); @@ -89,7 +89,7 @@ void sbc_enc_bit_alloc_mono(SBC_ENC_PARAMS *pstrCodecParams) ps16GenBufPtr++; ps16GenTabPtr++; } - + } /* max bitneed index is searched*/ @@ -112,7 +112,7 @@ void sbc_enc_bit_alloc_mono(SBC_ENC_PARAMS *pstrCodecParams) s32BitSlice --; s32BitCount -= s32SliceCount; s32SliceCount = 0; - + for(s32Sb=0; s32Sb= 1)) @@ -123,17 +123,17 @@ void sbc_enc_bit_alloc_mono(SBC_ENC_PARAMS *pstrCodecParams) s32SliceCount++; } ps16GenBufPtr++; - + }/*end of for*/ ps16GenBufPtr = ps16BitNeed + s32Ch*s32NumOfSubBands; }while(s32BitCount-s32SliceCount>0); - + if(s32BitCount == 0) { s32BitCount -= s32SliceCount; s32BitSlice --; } - + /*Bits are distributed until the last bitslice is reached*/ ps16GenArrPtr = pstrCodecParams->as16Bits+s32Ch*s32NumOfSubBands; ps16GenBufPtr = ps16BitNeed + s32Ch*s32NumOfSubBands; @@ -142,7 +142,7 @@ void sbc_enc_bit_alloc_mono(SBC_ENC_PARAMS *pstrCodecParams) if(*(ps16GenBufPtr) < s32BitSlice+2) *(ps16GenArrPtr) = 0; else - *(ps16GenArrPtr) = ((*(ps16GenBufPtr)-s32BitSlice)<16) ? + *(ps16GenArrPtr) = ((*(ps16GenBufPtr)-s32BitSlice)<16) ? (SINT16)(*(ps16GenBufPtr)-s32BitSlice) : 16; ps16GenBufPtr++; @@ -159,7 +159,7 @@ void sbc_enc_bit_alloc_mono(SBC_ENC_PARAMS *pstrCodecParams) (*(ps16GenArrPtr))++; s32BitCount--; } - else if( (*(ps16GenBufPtr) == s32BitSlice+1) && + else if( (*(ps16GenBufPtr) == s32BitSlice+1) && (s32BitCount > 1) ) { *(ps16GenArrPtr) = 2; @@ -170,8 +170,8 @@ void sbc_enc_bit_alloc_mono(SBC_ENC_PARAMS *pstrCodecParams) ps16GenBufPtr++; } ps16GenArrPtr = pstrCodecParams->as16Bits+s32Ch*s32NumOfSubBands; - - + + s32Sb=0; while( (s32BitCount > 0) && (s32Sb < s32NumOfSubBands) ) { -- cgit v1.1