/****************************************************************************** * * Copyright (C) 1999-2012 Broadcom Corporation * * 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. * ******************************************************************************//* ... *//****************************************************************************** * * This file contains constants and structures used by Encoder. * ******************************************************************************//* ... */#ifndefSBC_ENCODER_H#defineSBC_ENCODER_H#defineENCODER_VERSION"0025"#ifdefBUILDCFG#include"common/bt_target.h"#endif/*DEFINES*/#ifndefFALSE#defineFALSE0#endif#ifndefTRUE#defineTRUE(!FALSE)#endif#defineSBC_MAX_NUM_OF_SUBBANDS8#defineSBC_MAX_NUM_OF_CHANNELS2#defineSBC_MAX_NUM_OF_BLOCKS16#defineSBC_LOUDNESS0#defineSBC_SNR1#defineSUB_BANDS_88#defineSUB_BANDS_44#defineSBC_sf160000#defineSBC_sf320001#defineSBC_sf441002#defineSBC_sf480003#defineSBC_MONO0#defineSBC_DUAL1#defineSBC_STEREO2#defineSBC_JOINT_STEREO3#defineSBC_BLOCK_04#defineSBC_BLOCK_18#defineSBC_BLOCK_212#defineSBC_BLOCK_316#defineSBC_NULL0#defineSBC_MODE_STD0#defineSBC_MODE_MSBC1#defineSBC_SYNC_WORD_STD(0x9C)#defineSBC_SYNC_WORD_MSBC(0xAD)24 defines#ifndefSBC_MAX_NUM_FRAME#defineSBC_MAX_NUM_FRAME1#endif#ifndefSBC_DSP_OPT#defineSBC_DSP_OPTFALSE#endif/* Set SBC_USE_ARM_PRAGMA to TRUE to use "#pragma arm section zidata" */#ifndefSBC_USE_ARM_PRAGMA#defineSBC_USE_ARM_PRAGMAFALSE#endif/* Set SBC_ARM_ASM_OPT to TRUE in case the target is an ARM *//* this will replace all the 32 and 64 bit mult by in line assembly code */#ifndefSBC_ARM_ASM_OPT#defineSBC_ARM_ASM_OPTFALSE#endif/* green hill compiler option -> Used to distinguish the syntax for inline assembly code*/#ifndefSBC_GHS_COMPILER#defineSBC_GHS_COMPILERFALSE#endif/* ARM compiler option -> Used to distinguish the syntax for inline assembly code */#ifndefSBC_ARM_COMPILER#defineSBC_ARM_COMPILERTRUE#endif/* Set SBC_IPAQ_OPT to TRUE in case the target is an ARM *//* 32 and 64 bit mult will be performed using SINT64 ( usualy __int64 ) cast that usualy give optimal performance if supported */#ifndefSBC_IPAQ_OPT#defineSBC_IPAQ_OPTTRUE#endif/* Debug only: set SBC_IS_64_MULT_IN_WINDOW_ACCU to TRUE to use 64 bit multiplication in the windowing *//* -> not recomended, more MIPS for the same restitution. */#ifndefSBC_IS_64_MULT_IN_WINDOW_ACCU#defineSBC_IS_64_MULT_IN_WINDOW_ACCUFALSE#endif/*SBC_IS_64_MULT_IN_WINDOW_ACCU *//* Set SBC_IS_64_MULT_IN_IDCT to TRUE to use 64 bits multiplication in the DCT of Matrixing *//* -> more MIPS required for a better audio quality. comparasion with the SIG utilities shows a division by 10 of the RMS *//* CAUTION: It only apply in the if SBC_FAST_DCT is set to TRUE */#ifndefSBC_IS_64_MULT_IN_IDCT#defineSBC_IS_64_MULT_IN_IDCTFALSE#endif/*SBC_IS_64_MULT_IN_IDCT *//* set SBC_IS_64_MULT_IN_QUANTIZER to TRUE to use 64 bits multiplication in the quantizer *//* setting this flag to FALSE add whistling noise at 5.5 and 11 KHz usualy not perceptible by human's hears. */#ifndefSBC_IS_64_MULT_IN_QUANTIZER#defineSBC_IS_64_MULT_IN_QUANTIZERTRUE#endif/*SBC_IS_64_MULT_IN_IDCT *//* Debug only: set this flag to FALSE to disable fast DCT algorithm */#ifndefSBC_FAST_DCT#defineSBC_FAST_DCTTRUE#endif/*SBC_FAST_DCT *//* In case we do not use joint stereo mode the flag save some RAM and ROM in case it is set to FALSE */#ifndefSBC_JOINT_STE_INCLUDED#defineSBC_JOINT_STE_INCLUDEDTRUE#endif/* TRUE -> application should provide PCM buffer, FALSE PCM buffer reside in SBC_ENC_PARAMS */#ifndefSBC_NO_PCM_CPY_OPTION#defineSBC_NO_PCM_CPY_OPTIONFALSE#endif#defineMINIMUM_ENC_VX_BUFFER_SIZE(8*10*2)#ifndefENC_VX_BUFFER_SIZE#defineENC_VX_BUFFER_SIZE(MINIMUM_ENC_VX_BUFFER_SIZE+64)/*#define ENC_VX_BUFFER_SIZE MINIMUM_ENC_VX_BUFFER_SIZE + 1024*//* ... */#endif#ifndefSBC_FOR_EMBEDDED_LINUX#defineSBC_FOR_EMBEDDED_LINUXFALSE#endif/*constants used for index calculation*/#defineSBC_BLK(SBC_MAX_NUM_OF_CHANNELS*SBC_MAX_NUM_OF_SUBBANDS)#include"sbc_types.h"typedefstructSBC_ENC_PARAMS_TAG{SINT16s16SamplingFreq;/* 16k, 32k, 44.1k or 48k*/SINT16s16ChannelMode;/* mono, dual, streo or joint streo*/SINT16s16NumOfSubBands;/* 4 or 8 */SINT16s16NumOfChannels;SINT16s16NumOfBlocks;/* 4, 8, 12 or 16*/SINT16s16AllocationMethod;/* loudness or SNR*/SINT16s16BitPool;/* 16*numOfSb for mono & dual; 32*numOfSb for stereo & joint stereo *//* ... */UINT16u16BitRate;UINT8sbc_mode;/* SBC_MODE_STD or SBC_MODE_MSBC */UINT8u8NumPacketToEncode;/* number of sbc frame to encode. Default is 1 */#if(SBC_JOINT_STE_INCLUDED==TRUE)SINT16as16Join[SBC_MAX_NUM_OF_SUBBANDS];/*1 if JS, 0 otherwise*/#endifSINT16s16MaxBitNeed;SINT16as16ScaleFactor[SBC_MAX_NUM_OF_CHANNELS*SBC_MAX_NUM_OF_SUBBANDS];SINT16*ps16NextPcmBuffer;#if(SBC_NO_PCM_CPY_OPTION==TRUE)SINT16*ps16PcmBuffer;#elseSINT16as16PcmBuffer[SBC_MAX_NUM_FRAME*SBC_MAX_NUM_OF_BLOCKS*SBC_MAX_NUM_OF_CHANNELS*SBC_MAX_NUM_OF_SUBBANDS];#endifSINT16s16ScartchMemForBitAlloc[16];SINT32s32SbBuffer[SBC_MAX_NUM_OF_CHANNELS*SBC_MAX_NUM_OF_SUBBANDS*SBC_MAX_NUM_OF_BLOCKS];SINT16as16Bits[SBC_MAX_NUM_OF_CHANNELS*SBC_MAX_NUM_OF_SUBBANDS];UINT8*pu8Packet;UINT8*pu8NextPacket;UINT16FrameHeader;UINT16u16PacketLength;}{ ... }SBC_ENC_PARAMS;#ifdef__cplusplusextern"C"{#endifexternvoidSBC_Encoder(SBC_ENC_PARAMS*strEncParams);externvoidSBC_Encoder_Init(SBC_ENC_PARAMS*strEncParams);#ifdef__cplusplus}#endif#endif
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.