Commit 502991f2 authored by Nishant S Kulgod's avatar Nishant S Kulgod
Browse files

rebase #3

parent a8dad8ab
Loading
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
@@ -804,6 +804,44 @@ Word16 getScaleFactor32( /* o: measured headroom in range [
    return i;
}

Word16 getScaleFactor32_copy(                      /* o: measured headroom in range [0..31], 0 if all x[i] == 0 */
                              const Word32 *x,     /* i: array containing 32-bit data */
                              const Word32 len_x ) /* i: length of the array to scan  */
{
    Word32 i;
    Word16 i_min, i_max;
    Word32 x_min, x_max;


    x_max = 0;
    move32();
    x_min = 0;
    move32();
    FOR( i = 0; i < len_x; i++ )
    {
        if ( x[i] >= 0 )
            x_max = L_max( x_max, x[i] );
        if ( x[i] < 0 )
            x_min = L_min( x_min, x[i] );
    }

    i_max = 0x20;
    move16();
    i_min = 0x20;
    move16();

    if ( x_max != 0 )
        i_max = norm_l( x_max );

    if ( x_min != 0 )
        i_min = norm_l( x_min );

    i_max = s_and( s_min( i_max, i_min ), 0x1F );


    return i_max;
}

Word16 normalize16( Word16 mantissa, Word16 *pexponent )
{
    Word16 tmp;
+3 −0
Original line number Diff line number Diff line
@@ -235,6 +235,9 @@ Word16 getScaleFactor32(
    const Word32 *x,      /* i  : array containing 32-bit data */
    const Word16 len_x ); /* i  : length of the array to scan  */

Word16 getScaleFactor32_copy(                       /* o: measured headroom in range [0..31], 0 if all x[i] == 0 */
                              const Word32 *x,      /* i: array containing 32-bit data */
                              const Word32 len_x ); /* i: length of the array to scan  */

/**
 * \brief normalize mantissa and update the exponent accordingly.
+1 −12
Original line number Diff line number Diff line
@@ -42,15 +42,14 @@
#include "ivas_rom_com.h"
#include "wmc_auto.h"

#ifndef IVAS_FLOAT_FIXED
/*-------------------------------------------------------------------*
 * Local function prototypes
 *--------------------------------------------------------------------*/

static int16_t BITS_ALLOC_adjust_acelp_fixed_cdk( const int16_t bits_frame, int16_t *fixed_cdk_index, const int16_t nb_subfr );

#ifndef IVAS_FLOAT_FIXED
static int16_t allocate_unused( const int32_t core_brate, const int16_t coder_type, const int16_t unused_bits, const int16_t nb_prm, const int16_t subfr, const int16_t prm_type, int16_t *prm_bit_mode );
#endif

typedef enum
{
@@ -358,7 +357,6 @@ static int16_t BITS_ALLOC_adjust_acelp_fixed_cdk(
 * Selection of fixed innovation codebook bitbudget table
 *--------------------------------------------------------------------*/

#ifndef IVAS_FLOAT_FIXED
static int16_t fcb_table(
    const int16_t n,
    const int16_t L_subfr )
@@ -373,7 +371,6 @@ static int16_t fcb_table(

    return ( out );
}
#endif

/*-------------------------------------------------------------------*
 * acelp_FCB_allocator()
@@ -381,7 +378,6 @@ static int16_t fcb_table(
 * Routine to allocate fixed innovation codebook bit-budget
 *--------------------------------------------------------------------*/

#ifndef IVAS_FLOAT_FIXED
static ivas_error acelp_FCB_allocator(
    int16_t *nBits,            /* i/o: available bit-budget    */
    int16_t fixed_cdk_index[], /* o  : codebook index          */
@@ -512,7 +508,6 @@ static ivas_error acelp_FCB_allocator(

    return error;
}
#endif


/*-------------------------------------------------------------------*
@@ -523,7 +518,6 @@ static ivas_error acelp_FCB_allocator(
 *   - per channel bitrate minimum is 13250 kbps for ACELP@16kHz
 *--------------------------------------------------------------------*/

#ifndef IVAS_FLOAT_FIXED
ivas_error config_acelp1_IVAS(
    const int16_t enc_dec,              /* i  : encoder/decoder flag            */
    const int32_t total_brate,          /* i  : total bitrate                   */
@@ -1341,7 +1335,6 @@ ivas_error config_acelp1_IVAS(

    return error;
}
#endif

/*-------------------------------------------------------------------*
 * allocate_unused()
@@ -1349,7 +1342,6 @@ ivas_error config_acelp1_IVAS(
 * Allocate unused bits
 *--------------------------------------------------------------------*/

#ifndef IVAS_FLOAT_FIXED
static int16_t allocate_unused(
    const int32_t core_brate,
    const int16_t coder_type,
@@ -1426,7 +1418,6 @@ static int16_t allocate_unused(

    return bit_added + max_bit_per_pos;
}
#endif


/*-------------------------------------------------------------------*
@@ -1436,8 +1427,6 @@ static int16_t allocate_unused(
 *--------------------------------------------------------------------*/

/*! r: ACELP16k flag */

#ifndef IVAS_FLOAT_FIXED
int16_t set_ACELP_flag_IVAS(
    const int16_t element_mode,  /* i  : element mode                */
    const int32_t element_brate, /* i  : element bitrate             */
+2 −1
Original line number Diff line number Diff line
@@ -478,7 +478,7 @@ void cng_params_postupd(
 *
 * update CNG parameters
 *-------------------------------------------------------*/

#ifndef IVAS_FLOAT_FIXED
void cng_params_upd(
    const float lsp_new[],           /* i  : LSP parameters                                      */
    const float exc2[],              /* i  : current enhanced excitation                         */
@@ -581,6 +581,7 @@ void cng_params_upd(

    return;
}
#endif


/*---------------------------------------------------------------------*
+151 −151

File changed.

Preview size limit exceeded, changes collapsed.

Loading