Commit 2805f2da authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'flt_code_cleanup_datatype_replace' into 'main'

Removal of unused float functions and replacing C datatypes with Basop Datatypes

See merge request !1600
parents 4b101949 720708ed
Loading
Loading
Loading
Loading
Loading
+33 −33
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ static Word16 rate2AMRWB_IOmode(
 *-------------------------------------------------------------------*/
Word16 rate2EVSmode_float(
    const Word32 brate, /* i  : bitrate                                               */
    int16_t *is_amr_wb  /* o  : (flag) does the bitrate belong to AMR-WB? Can be NULL */
    Word16 *is_amr_wb   /* o  : (flag) does the bitrate belong to AMR-WB? Can be NULL */
)
{
    if ( is_amr_wb != NULL )
@@ -575,8 +575,8 @@ Word16 get_ivas_max_num_indices_fx(
 *-----------------------------------------------------------------------*/

/*! r: maximum number of indices */
int16_t get_BWE_max_num_indices(
    const int32_t extl_brate /* i  : extensiona layer bitrate  */
Word16 get_BWE_max_num_indices(
    const Word32 extl_brate /* i  : extensiona layer bitrate  */
)
{
    /* set the maximum number of indices in the BWE */
@@ -787,10 +787,10 @@ Word16 get_ivas_max_num_indices_metadata_fx(
void move_indices(
    INDICE_HANDLE old_ind_list, /* i/o: old location of indices */
    INDICE_HANDLE new_ind_list, /* i/o: new location of indices */
    const int16_t nb_indices    /* i  : number of moved indices */
    const Word16 nb_indices     /* i  : number of moved indices */
)
{
    int16_t i;
    Word16 i;

    if ( new_ind_list < old_ind_list )
    {
@@ -1092,14 +1092,14 @@ ivas_error push_next_bits(
 *-------------------------------------------------------------------*/

/*! r: result: index of the indice in the list, -1 if not found */
int16_t find_indice(
Word16 find_indice(
    BSTR_ENC_HANDLE hBstr, /* i  : encoder bitstream handle                    */
    const int16_t id,      /* i  : ID of the indice                            */
    uint16_t *value,       /* o  : value of the quantized indice               */
    int16_t *nb_bits       /* o  : number of bits used to quantize the indice  */
    const Word16 id,       /* i  : ID of the indice                            */
    UWord16 *value,        /* o  : value of the quantized indice               */
    Word16 *nb_bits        /* o  : number of bits used to quantize the indice  */
)
{
    int16_t i;
    Word16 i;

    for ( i = 0; i < hBstr->nb_ind_tot; i++ )
    {
@@ -1122,12 +1122,12 @@ int16_t find_indice(
 *-------------------------------------------------------------------*/

/*! r: number of deleted indices */
uint16_t delete_indice(
UWord16 delete_indice(
    BSTR_ENC_HANDLE hBstr, /* i  : encoder bitstream handle                    */
    const int16_t id       /* i  : ID of the indice                            */
    const Word16 id        /* i  : ID of the indice                            */
)
{
    int16_t i, j;
    Word16 i, j;

    j = 0;
    for ( i = 0; i < hBstr->nb_ind_tot; i++ )
@@ -1168,14 +1168,14 @@ uint16_t delete_indice(
 *-------------------------------------------------------------------*/

/*! r: value of the indice */
uint16_t get_next_indice(
UWord16 get_next_indice(
    Decoder_State *st, /* i/o: decoder state structure                               */
    int16_t nb_bits    /* i  : number of bits that were used to quantize the indice  */
    Word16 nb_bits     /* i  : number of bits that were used to quantize the indice  */
)
{
    uint16_t value;
    int16_t i;
    int32_t nbits_total;
    UWord16 value;
    Word16 i;
    Word32 nbits_total;

    assert( nb_bits <= 16 );

@@ -1207,11 +1207,11 @@ uint16_t get_next_indice(
 *-------------------------------------------------------------------*/

/*! r: value of the indice */
uint16_t get_next_indice_1(
UWord16 get_next_indice_1(
    Decoder_State *st /* i/o: decoder state structure   */
)
{
    int32_t nbits_total;
    Word32 nbits_total;
    nbits_total = st->total_brate / FRAMES_PER_SEC;
    /* detect corrupted bitstream */
    if ( ( st->next_bit_pos + 1 > nbits_total && st->codec_mode == MODE1 ) ||
@@ -1233,7 +1233,7 @@ uint16_t get_next_indice_1(

void get_next_indice_tmp(
    Decoder_State *st, /* o  : decoder state structure                              */
    int16_t nb_bits    /* i  : number of bits that were used to quantize the indice */
    Word16 nb_bits     /* i  : number of bits that were used to quantize the indice */
)
{
    /* update the position in the bitstream */
@@ -1249,15 +1249,15 @@ void get_next_indice_tmp(
 *-------------------------------------------------------------------*/

/*! r: value of the indice */
uint16_t get_indice(
UWord16 get_indice(
    Decoder_State *st, /* i/o: decoder state structure                                    */
    int16_t pos,       /* i  : absolute position in the bitstream (update after the read) */
    int16_t nb_bits    /* i  : number of bits that were used to quantize the indice       */
    Word16 pos,        /* i  : absolute position in the bitstream (update after the read) */
    Word16 nb_bits     /* i  : number of bits that were used to quantize the indice       */
)
{
    uint16_t value;
    int16_t i;
    int32_t nbits_total;
    UWord16 value;
    Word16 i;
    Word32 nbits_total;

    assert( nb_bits <= 16 );

@@ -1585,8 +1585,8 @@ ivas_error write_indices_ivas_fx(

static void decoder_selectCodec(
    Decoder_State *st,        /* i/o: decoder state structure                */
    const int32_t total_brate, /* i  : total bitrate                          */
    const int16_t bit0         /* i  : first bit                              */
    const Word32 total_brate, /* i  : total bitrate                          */
    const Word16 bit0         /* i  : first bit                              */
)
{
    /* set the AMR-WB IO flag */
@@ -1724,7 +1724,7 @@ void ivas_set_bitstream_pointers(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder structure    */
)
{
    int16_t k, num_bits;
    Word16 k, num_bits;
    Decoder_State **sts;

    num_bits = 0;
@@ -1734,7 +1734,7 @@ void ivas_set_bitstream_pointers(
    {
        sts = st_ivas->hSCE[k]->hCoreCoder;
        sts[0]->bit_stream = st_ivas->bit_stream + num_bits;
        num_bits += (int16_t) ( st_ivas->hSCE[k]->element_brate / FRAMES_PER_SEC );
        num_bits += (Word16) ( st_ivas->hSCE[k]->element_brate / FRAMES_PER_SEC );
    }

    /* set bitstream pointers for CPEs */
@@ -1742,7 +1742,7 @@ void ivas_set_bitstream_pointers(
    {
        sts = st_ivas->hCPE[k]->hCoreCoder;
        sts[0]->bit_stream = st_ivas->bit_stream + num_bits;
        num_bits += (int16_t) ( st_ivas->hCPE[k]->element_brate / FRAMES_PER_SEC );
        num_bits += (Word16) ( st_ivas->hCPE[k]->element_brate / FRAMES_PER_SEC );
    }

    return;
+3 −3
Original line number Diff line number Diff line
@@ -492,12 +492,12 @@ Word16 sr2fscale_fx(
    return extract_l( Mpy_32_16_1( sr_core, FSCALE_DENOM_BY_12800_Q15 ) ); /*Q0*/
}

int16_t sr2fscale(
    const int32_t sr_core /* i  : internal sampling rate    */
Word16 sr2fscale(
    const Word32 sr_core /* i  : internal sampling rate    */
)
{

    return (int16_t) ( ( FSCALE_DENOM * sr_core ) / 12800 );
    return (Word16) ( ( FSCALE_DENOM * sr_core ) / 12800 );
}

Word32 getCoreSamplerateMode2(
+4 −4
Original line number Diff line number Diff line
@@ -509,8 +509,8 @@ enum
#define STEREO_DFT32MS_N_NS                     FRAME_SIZE_NS               /* 20 ms */
#define STEREO_DFT32MS_OVL_NS                   3125000L                    /* 3.125ms - Overlap for the outer edges of windows on decoder */
#define STEREO_DFT32MS_OVL2_NS                  9375000L                    /* 9.375ms - Overlap for the inner edges of windows on decoder */
#define STEREO_DFT32MS_WIN_CENTER_NS            ( int32_t )( ( FRAME_SIZE_NS + STEREO_DFT32MS_OVL_NS ) * 0.5f ) /* 11.5625ms - mid point of the two windows wrt the left edge of overlap */
#define STEREO_DFT32MS_ZP_NS                    ( int32_t )( 0.5f * ( STEREO_DFT32MS_N_NS - STEREO_DFT32MS_WIN_CENTER_NS - ( STEREO_DFT32MS_OVL2_NS * 0.5f ) ) ) /* 2 sided zp calculated such that window size is satisfied */
#define STEREO_DFT32MS_WIN_CENTER_NS            ( Word32 )( ( FRAME_SIZE_NS + STEREO_DFT32MS_OVL_NS ) * 0.5f ) /* 11.5625ms - mid point of the two windows wrt the left edge of overlap */
#define STEREO_DFT32MS_ZP_NS                    ( Word32 )( 0.5f * ( STEREO_DFT32MS_N_NS - STEREO_DFT32MS_WIN_CENTER_NS - ( STEREO_DFT32MS_OVL2_NS * 0.5f ) ) ) /* 2 sided zp calculated such that window size is satisfied */

#define STEREO_DFT32MS_OVL_MAX                  NS2SA( 48000, STEREO_DFT32MS_OVL_NS )
#define STEREO_DFT32MS_OVL2_MAX                 NS2SA( 48000, STEREO_DFT32MS_OVL2_NS )
@@ -799,7 +799,7 @@ enum fea_names
#define L_DEC_MEM_LEN_ICA                       L_NCSHIFTMAX + ( N_MAX_SHIFT_CHANGE + 1 ) + SINC_ORDER1 / INTERP_FACTOR1
#define L_FRAME_DS                              NS2SA( CORR_INTER_FS, FRAME_SIZE_NS )
#define L_XCORRMEM_DS                           NS2SA( CORR_INTER_FS, 2 * ( ACELP_LOOK_NS ) )
#define L_NCSHIFT_DS                            ( int16_t )( ( ( int32_t )(CORR_INTER_FS) *L_NCSHIFTMAX ) / 48000L )
#define L_NCSHIFT_DS                            ( Word16 )( ( ( Word32 )(CORR_INTER_FS) *L_NCSHIFTMAX ) / 48000L )
#define L_SAMPLES_LA_NS                         625000L

#define L_MEM_RECALC_TBE_16K                    NS2SA( 16000, L_MEM_RECALC_TBE_NS )
@@ -1446,7 +1446,7 @@ typedef struct {

typedef struct {
    Word32 value[81];
    unsigned short length[81];
    UWord16 length[81];
} HUFF_ELEMENTS;

typedef struct {
+2 −2
Original line number Diff line number Diff line
@@ -64,14 +64,14 @@ void longadd(
    assert( lena >= lenb );
    for ( h = 0; h < lenb; h++ )
    {
        carry += ( (uint32_t) a[h] ) + ( (uint32_t) b[h] );
        carry += ( (UWord32) a[h] ) + ( (UWord32) b[h] );
        a[h] = (UWord16) carry;
        carry = carry >> 16;
    }

    for ( ; h < lena; h++ )
    {
        carry = ( (uint32_t) a[h] ) + carry;
        carry = ( (UWord32) a[h] ) + carry;
        a[h] = (UWord16) carry;
        carry = carry >> 16;
    }
+183 −280

File changed.

Preview size limit exceeded, changes collapsed.

Loading