Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c44eee54 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Use proper types in SBC related code"

parents ea04c89c af218e7d
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -30,28 +30,28 @@
{																			    \
    __asm																		\
{																				\
    MUL s32OutLow,(SINT32)s16In2, (s32In1>>15)        \
    MUL s32OutLow,(int32_t)s16In2, (s32In1>>15)        \
}																				\
}
#else
#if (SBC_DSP_OPT == TRUE)
#define SBC_MULT_32_16_SIMPLIFIED(s16In2, s32In1 , s32OutLow) s32OutLow = SBC_Multiply_32_16_Simplified((SINT32)s16In2,s32In1);
#define SBC_MULT_32_16_SIMPLIFIED(s16In2, s32In1 , s32OutLow) s32OutLow = SBC_Multiply_32_16_Simplified((int32_t)s16In2,s32In1);
#else
#if (SBC_IPAQ_OPT == TRUE)
/*#define SBC_MULT_32_16_SIMPLIFIED(s16In2, s32In1 , s32OutLow) s32OutLow=(SINT32)((SINT32)(s16In2)*(SINT32)(s32In1>>15)); */
#define SBC_MULT_32_16_SIMPLIFIED(s16In2, s32In1 , s32OutLow) s32OutLow=(SINT32)(((SINT64)(s16In2)*(SINT64)(s32In1))>>15);
/*#define SBC_MULT_32_16_SIMPLIFIED(s16In2, s32In1 , s32OutLow) s32OutLow=(int32_t)((int32_t)(s16In2)*(int32_t)(s32In1>>15)); */
#define SBC_MULT_32_16_SIMPLIFIED(s16In2, s32In1 , s32OutLow) s32OutLow=(int32_t)(((int64_t)(s16In2)*(int64_t)(s32In1))>>15);
#if (SBC_IS_64_MULT_IN_IDCT == TRUE)
#define SBC_MULT_32_32(s32In2, s32In1, s32OutLow)                           \
{                                                                           \
    s64Temp = ((SINT64) s32In2) * ((SINT64) s32In1)>>31;            \
    s32OutLow = (SINT32) s64Temp;                                                    \
    s64Temp = ((int64_t) s32In2) * ((int64_t) s32In1)>>31;            \
    s32OutLow = (int32_t) s64Temp;                                                    \
}
#endif
#else
#define SBC_MULT_32_16_SIMPLIFIED(s16In2, s32In1 , s32OutLow)                   \
{                                                                               \
    s32In1Temp = s32In1;                                                        \
    s32In2Temp = (SINT32)s16In2;                                                \
    s32In2Temp = (int32_t)s16In2;                                                \
                                                                                \
    /* Multiply one +ve and the other -ve number */                             \
    if (s32In1Temp < 0)                                                         \
@@ -73,8 +73,8 @@
#if (SBC_IS_64_MULT_IN_IDCT == TRUE)
#define SBC_MULT_64(s32In1, s32In2, s32OutLow, s32OutHi)  \
{\
        s32OutLow=(SINT32)(((SINT64)s32In1*(SINT64)s32In2)& 0x00000000FFFFFFFF);\
        s32OutHi=(SINT32)(((SINT64)s32In1*(SINT64)s32In2)>>32);\
        s32OutLow=(int32_t)(((int64_t)s32In1*(int64_t)s32In2)& 0x00000000FFFFFFFF);\
        s32OutHi=(int32_t)(((int64_t)s32In1*(int64_t)s32In2)>>32);\
}
#define SBC_MULT_32_32(s32In2, s32In1, s32OutLow)                           \
{                                                                           \
+7 −7
Original line number Diff line number Diff line
@@ -28,11 +28,11 @@
/*#include "sbc_encoder.h"*/
/* Global data */
#if (SBC_IS_64_MULT_IN_WINDOW_ACCU == FALSE)
extern const SINT16 gas32CoeffFor4SBs[];
extern const SINT16 gas32CoeffFor8SBs[];
extern const int16_t gas32CoeffFor4SBs[];
extern const int16_t gas32CoeffFor8SBs[];
#else
extern const SINT32 gas32CoeffFor4SBs[];
extern const SINT32 gas32CoeffFor8SBs[];
extern const int32_t gas32CoeffFor4SBs[];
extern const int32_t gas32CoeffFor8SBs[];
#endif

/* Global functions*/
@@ -45,13 +45,13 @@ extern void SbcAnalysisInit (void);
extern void SbcAnalysisFilter4(SBC_ENC_PARAMS *strEncParams);
extern void SbcAnalysisFilter8(SBC_ENC_PARAMS *strEncParams);

extern void SBC_FastIDCT8 (SINT32 *pInVect, SINT32 *pOutVect);
extern void SBC_FastIDCT4 (SINT32 *x0, SINT32 *pOutVect);
extern void SBC_FastIDCT8 (int32_t *pInVect, int32_t *pOutVect);
extern void SBC_FastIDCT4 (int32_t *x0, int32_t *pOutVect);

extern void EncPacking(SBC_ENC_PARAMS *strEncParams);
extern void EncQuantizer(SBC_ENC_PARAMS *);
#if (SBC_DSP_OPT == TRUE)
    SINT32 SBC_Multiply_32_16_Simplified(SINT32 s32In2Temp,SINT32 s32In1Temp);
    int32_t SBC_Multiply_32_16_Simplified(int32_t s32In2Temp,int32_t s32In1Temp);
#endif
#endif
+17 −17
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@
#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 */
/* 32 and 64 bit mult will be performed using int64_t ( usualy __int64 ) cast that usualy give optimal performance if supported */
#ifndef SBC_IPAQ_OPT
#define SBC_IPAQ_OPT TRUE
#endif
@@ -153,35 +153,35 @@

typedef struct SBC_ENC_PARAMS_TAG
{
    SINT16 s16SamplingFreq;                         /* 16k, 32k, 44.1k or 48k*/
    SINT16 s16ChannelMode;                          /* mono, dual, streo or joint streo*/
    SINT16 s16NumOfSubBands;                        /* 4 or 8 */
    SINT16 s16NumOfChannels;
    SINT16 s16NumOfBlocks;                          /* 4, 8, 12 or 16*/
    SINT16 s16AllocationMethod;                     /* loudness or SNR*/
    SINT16 s16BitPool;                              /* 16*numOfSb for mono & dual;
    int16_t s16SamplingFreq;                         /* 16k, 32k, 44.1k or 48k*/
    int16_t s16ChannelMode;                          /* mono, dual, streo or joint streo*/
    int16_t s16NumOfSubBands;                        /* 4 or 8 */
    int16_t s16NumOfChannels;
    int16_t s16NumOfBlocks;                          /* 4, 8, 12 or 16*/
    int16_t s16AllocationMethod;                     /* loudness or SNR*/
    int16_t s16BitPool;                              /* 16*numOfSb for mono & dual;
                                                       32*numOfSb for stereo & joint stereo */
    uint16_t u16BitRate;
    uint8_t u8NumPacketToEncode;                    /* number of sbc frame to encode. Default is 1 */
#if (SBC_JOINT_STE_INCLUDED == TRUE)
    SINT16 as16Join[SBC_MAX_NUM_OF_SUBBANDS];       /*1 if JS, 0 otherwise*/
    int16_t as16Join[SBC_MAX_NUM_OF_SUBBANDS];       /*1 if JS, 0 otherwise*/
#endif

    SINT16 s16MaxBitNeed;
    SINT16 as16ScaleFactor[SBC_MAX_NUM_OF_CHANNELS*SBC_MAX_NUM_OF_SUBBANDS];
    int16_t s16MaxBitNeed;
    int16_t as16ScaleFactor[SBC_MAX_NUM_OF_CHANNELS*SBC_MAX_NUM_OF_SUBBANDS];

    SINT16 *ps16NextPcmBuffer;
    int16_t *ps16NextPcmBuffer;
#if (SBC_NO_PCM_CPY_OPTION == TRUE)
    SINT16 *ps16PcmBuffer;
    int16_t *ps16PcmBuffer;
#else
    SINT16 as16PcmBuffer[SBC_MAX_NUM_FRAME*SBC_MAX_NUM_OF_BLOCKS * SBC_MAX_NUM_OF_CHANNELS * SBC_MAX_NUM_OF_SUBBANDS];
    int16_t as16PcmBuffer[SBC_MAX_NUM_FRAME*SBC_MAX_NUM_OF_BLOCKS * SBC_MAX_NUM_OF_CHANNELS * SBC_MAX_NUM_OF_SUBBANDS];
#endif

    SINT16  s16ScartchMemForBitAlloc[16];
    int16_t  s16ScartchMemForBitAlloc[16];

    SINT32  s32SbBuffer[SBC_MAX_NUM_OF_CHANNELS * SBC_MAX_NUM_OF_SUBBANDS * SBC_MAX_NUM_OF_BLOCKS];
    int32_t  s32SbBuffer[SBC_MAX_NUM_OF_CHANNELS * SBC_MAX_NUM_OF_SUBBANDS * SBC_MAX_NUM_OF_BLOCKS];

    SINT16 as16Bits[SBC_MAX_NUM_OF_CHANNELS*SBC_MAX_NUM_OF_SUBBANDS];
    int16_t as16Bits[SBC_MAX_NUM_OF_CHANNELS*SBC_MAX_NUM_OF_SUBBANDS];

    uint8_t  *pu8Packet;
    uint8_t  *pu8NextPacket;
+0 −21
Original line number Diff line number Diff line
@@ -33,27 +33,6 @@

#include "bt_types.h"

typedef short SINT16;
typedef long SINT32;

#if (SBC_IPAQ_OPT == TRUE)

#if (SBC_FOR_EMBEDDED_LINUX == TRUE)
typedef long long SINT64;
#else
typedef int64_t SINT64;
#endif

#elif (SBC_IS_64_MULT_IN_WINDOW_ACCU == TRUE || SBC_IS_64_MULT_IN_IDCT == TRUE)

#if (SBC_FOR_EMBEDDED_LINUX == TRUE)
typedef long long SINT64;
#else
typedef int64_t SINT64;
#endif

#endif

#define abs32(x) ( ((x) >= 0) ? (x) : (-(x)) )

#endif
+448 −448

File changed.

Preview size limit exceeded, changes collapsed.

Loading