Commit 5a50d7e9 authored by vasilache's avatar vasilache
Browse files

Fix 2492 removing offset parameters in LSF functions and align functions

parent 9ae0ce0e
Loading
Loading
Loading
Loading
Loading
+51 −1
Original line number Diff line number Diff line
@@ -1816,7 +1816,57 @@ void a2rc_fx(
    return;
}

#ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
Word16 vq_dec_lvq_fx(
    Word16 sf_flag,   /* i  : safety net flag                           */
    Word16 x[],       /* o  : Decoded vector                    Q(x2.56)*/
    Word16 indices[], /* i  : Indices                                   */
    Word16 stages,    /* i  : Number of stages                          */
    Word16 N,         /* i  : Vector dimension                          */
    Word16 mode,      /* i  : mode_lvq, or mode_lvq_p                   */
    Word16 no_bits    /* i  : no. bits for lattice                      */
)
{
    Word16 x_lvq[M];
    Word16 i, stagesm1;
    Word16 pt_fx;
    Word16 ber_flag;

    /* clear vector */
    set16_fx( x, 0, N );

    /*-----------------------------------------------*
     * add contribution of each stage
     *-----------------------------------------------*/
    stagesm1 = sub( stages, 1 );
    IF( EQ_16( sf_flag, 1 ) )
    {
        FOR( i = 0; i < stagesm1; i++ )
        {
            pt_fx = i_mult2( indices[i], N );
            Vr_add( x, &Quantizers_fx[CB_lsf[mode] + i][pt_fx], x, N );
        }

        ber_flag =
            deindex_lvq_fx( &indices[stagesm1], x_lvq, mode, sf_flag, no_bits );
    }
    ELSE
    {
        FOR( i = 0; i < stagesm1; i++ )
        {
            pt_fx = i_mult2( indices[i], N );
            Vr_add( x, &Quantizers_p_fx[CB_p_lsf[mode] + i][pt_fx], x, N );
        }

        ber_flag =
            deindex_lvq_fx( &indices[stagesm1], x_lvq, mode, sf_flag, no_bits );
    }

    Vr_add( x, x_lvq, x, N );

    return ber_flag;
}
#else
Word16 vq_dec_lvq_fx(
    Word16 sf_flag,   /* i  : safety net flag                           */
    Word16 x[],       /* o  : Decoded vector                    Q(x2.56)*/
@@ -1923,7 +1973,7 @@ Word16 vq_dec_lvq_ivas_fx(

    return ber_flag;
}

#endif
ivas_error lsf_allocate_fx(
    const Word16 nBits,       /* i  : Number of bits to use for quantization     */
    const Word16 framemode,   /* i  : ISF quantizer mode                         */
+171 −96
Original line number Diff line number Diff line
@@ -32,6 +32,10 @@
*******************************************************************************************************/

#include <stdint.h>
#ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
#include <assert.h>
#include <string.h>
#endif
#include "options.h"
#include "cnst.h"
#include "prot_fx.h"
@@ -45,9 +49,12 @@
/*-----------------------------------------------------------------*
 * Local functions
 *-----------------------------------------------------------------*/

#ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
static void make_offset_scale_fx( const Word32 tab_no_cv[], const Word8 *no_ld, const Word16 no_scl, UWord32 *offset_scale );
#else
static void make_offset_scale_fx( Word16 j, const Word32 tab_no_cv[], const Word16 no_ld[], Word16 no_scl, Word32 offset_scale[][MAX_NO_SCALES + 1] );
static void init_offset_fx( Word32 offset_scale1[][MAX_NO_SCALES + 1], Word32 offset_scale2[][MAX_NO_SCALES + 1], Word32 offset_scale1_p[][MAX_NO_SCALES + 1], Word32 offset_scale2_p[][MAX_NO_SCALES + 1], Word16 no_scales[][2], Word16 no_scales_p[][2] );
#endif
static void decode_comb_fx( Word32 index, Word16 *cv, Word16 idx_lead );
static void decode_sign_pc1_fx( Word16 *c, Word16 idx_sign, Word16 parity );
static void put_value_fx( Word16 *cv, Word16 *p, Word16 val, Word16 dim, Word16 no_new_val );
@@ -55,7 +62,8 @@ static void decode_leaders_fx( Word16 index, Word16 idx_lead, Word16 *cv );
static void idx2c_fx( Word16 n, Word16 *p, Word16 k, Word16 val );
static void divide_64_32_fx( Word16 *xs, Word32 y, Word32 *result, Word32 *rem );
#ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
Word16 decode_indexes_fx( Word16 *index, Word16 no_bits, const Word16 *p_scales, Word16 *p_no_scales, Word32 *p_offset_scale1, Word32 *p_offset_scale2, Word16 *x_lvq, Word16 mode_glb, Word16 *scales_mslvq, Word16 use_ivas_mode, Word16 prediction_flag );
Word16 decode_indexes_fx( Word16 *index, Word16 no_bits, const Word16 *p_scales, Word16 *x_lvq, Word16 mode_glb, Word16 *scales_mslvq, Word16 prediction_flag );

#else
static Word16 decode_indexes_fx( Word16 *index, Word16 no_bits, const Word16 *p_scales, Word16 *p_no_scales, Word32 *p_offset_scale1, Word32 *p_offset_scale2, Word16 *x_lvq, Word16 mode_glb, Word16 *scales );
static Word16 decode_indexes_ivas_fx( Word16 *index, const Word16 no_bits, const Word16 *p_scales, const Word16 prediction_flag, Word16 *x_lvq, const Word16 mode_glb, Word16 *scales_mslvq );
@@ -105,7 +113,7 @@ void permute_fx(
    return;
}


#ifndef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
void init_lvq_fx(
    Word32 offset_scale1[][MAX_NO_SCALES + 1],   /* o  : lattice truncation index offset for the first LSF subvector - safety net structures*/
    Word32 offset_scale2[][MAX_NO_SCALES + 1],   /* o  : lattice truncation index offset for the second LSF subvector - safety net structures*/
@@ -192,7 +200,6 @@ void init_lvq_fx(
    return;
}


/* make_offset_scale_fx() - calculates scale offset values for a particular MSLVQ structure  */
static void make_offset_scale_fx(
    Word16 j,                                /* i  : MSLVQ structure index */
@@ -214,10 +221,10 @@ static void make_offset_scale_fx(

    return;
}
#endif

#ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
/* To do: make_offset_scale functions needs to be unified */
static void make_offset_scale(
static void make_offset_scale_fx(
    const Word32 tab_no_cv[],
    const Word8 *no_ld,
    const Word16 no_scl,
@@ -235,6 +242,7 @@ static void make_offset_scale(

    return;
}

#else
static void make_offset_scale(
    const UWord32 tab_no_cv[],
@@ -256,6 +264,7 @@ static void make_offset_scale(
}
#endif

#ifndef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
void init_offset_fx(
    Word32 offset_scale1[][MAX_NO_SCALES + 1],   /* o  : lattice truncation index offset for the first LSF subvector - safety net structures*/
    Word32 offset_scale2[][MAX_NO_SCALES + 1],   /* o  : lattice truncation index offset for the second LSF subvector - safety net structures*/
@@ -290,6 +299,7 @@ void init_offset_fx(

    return;
}
#endif

/* Unified decode_indexes function under compilation switch */
#ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
@@ -297,52 +307,23 @@ Word16 decode_indexes_fx(
    Word16 *index,
    Word16 no_bits,
    const Word16 *p_scales,
    Word16 *p_no_scales,     /* NULL for IVAS mode */
    Word32 *p_offset_scale1, /* NULL for IVAS mode */
    Word32 *p_offset_scale2, /* NULL for IVAS mode */
    Word16 *x_lvq,
    Word16 mode_glb,
    Word16 *scales_mslvq,
    Word16 use_ivas_mode,  /* 0: EVS, 1: IVAS */
    Word16 prediction_flag /* only used in IVAS mode */
)
    Word16 prediction_flag )
{
    Word32 index1 = 0, index2 = 0;
    Word16 i, im1 = 0, idx_scale = 0;
    Word16 len_scales = shl( MAX_NO_SCALES, 1 );
    Word16 no_modes = add( MAX_NO_SCALES, 1 );
    Word32 offset_scale1[MAX_NO_SCALES + 1], offset_scale2[MAX_NO_SCALES + 1];
    Word16 max_scale_index;
    move32();
    move32();
    move16();
    move16();

    /* Setup local offset arrays for both modes */
    IF( use_ivas_mode )
    {
        create_offset( (UWord32 *) offset_scale1, (UWord32 *) offset_scale2, mode_glb, prediction_flag );
        max_scale_index = MAX_NO_SCALES;
        move16();
    }
    ELSE
    {
        Word16 tmp = i_mult2( mode_glb, no_modes );
        move16();
        /* Extract relevant row from 2D offset arrays into local arrays */
        FOR( i = 0; i <= MAX_NO_SCALES; i++ )
        {
            offset_scale1[i] = p_offset_scale1[add( tmp, i )];
    UWord32 offset_scale1[MAX_NO_SCALES + 1], offset_scale2[MAX_NO_SCALES + 1];

    move32();
            offset_scale2[i] = p_offset_scale2[add( tmp, i )];
    move32();
        }
        max_scale_index = p_no_scales[shl( mode_glb, 1 )];
    move16();
    }
    move16();

    /* Handle index[2] and index[1] zeroing for both modes */
    IF( LE_16( no_bits, shl( LEN_INDICE, 1 ) ) )
    IF( LE_16( no_bits, shl( LEN_INDICE, 1 ) ) ) /* the third short is not used */
    {
        index[2] = 0;
        move16();
@@ -370,10 +351,11 @@ Word16 decode_indexes_fx(
        }
    }

    /* First subvector: unified logic using local offset arrays */
    IF( offset_scale2[max_scale_index] > 0 )
    create_offset( (UWord32 *) offset_scale1, (UWord32 *) offset_scale2, mode_glb, prediction_flag );
    /* Divide using second subvector's max scale index */
    IF( offset_scale2[MAX_NO_SCALES - 1] > 0 )
    {
        divide_64_32_fx( index, offset_scale2[max_scale_index], &index1, &index2 );
        divide_64_32_fx( index, (Word32) offset_scale2[MAX_NO_SCALES], &index1, &index2 );
    }
    ELSE
    {
@@ -397,7 +379,7 @@ Word16 decode_indexes_fx(
    ELSE
    {
        /* safety check in case of bit errors */
        IF( GE_32( index1, offset_scale1[max_scale_index] ) )
        IF( GE_32( index1, offset_scale1[MAX_NO_SCALES] ) )
        {
            set16_fx( x_lvq, 0, shl( LATTICE_DIM, 1 ) );
            scales_mslvq[0] = 0;
@@ -410,7 +392,7 @@ Word16 decode_indexes_fx(
        /* Find idx_scale */
        i = 1;
        move16();
        WHILE( LE_16( i, max_scale_index ) && GE_32( index1, offset_scale1[i] ) )
        WHILE( LE_16( i, MAX_NO_SCALES ) && GE_32( index1, offset_scale1[i] ) )
        {
            i = add( i, 1 );
        }
@@ -429,7 +411,6 @@ Word16 decode_indexes_fx(
        }
        im1 = sub( i, 1 );
        decode_comb_fx( L_sub( index1, table_no_cv_fx[im1] ), x_lvq, im1 );

        scales_mslvq[0] = p_scales[add( i_mult2( mode_glb, len_scales ), idx_scale )];
        move16();
    }
@@ -458,33 +439,28 @@ Word16 decode_indexes_fx(
        move16();
        index2 = L_sub( index2, offset_scale2[idx_scale] );
        move32();

        /* Find leader (common) */
        i = 1;
        move16();
        IF( use_ivas_mode )
        {

        WHILE( GE_32( index2, (Word32) table_no_cv_fx[i] ) )
            {
                i++;
            }
            decode_comb_fx( (Word32) ( index2 - table_no_cv_fx[i - 1] ), &x_lvq[LATTICE_DIM], i - 1 );
            scales_mslvq[1] = p_scales[mode_glb * len_scales + MAX_NO_SCALES + idx_scale];
        }
        ELSE
        {
            WHILE( GE_32( index2, table_no_cv_fx[i] ) )
        {
            i = add( i, 1 );
        }
        im1 = sub( i, 1 );
        decode_comb_fx( index2 - table_no_cv_fx[im1], &x_lvq[LATTICE_DIM], im1 );
        scales_mslvq[1] = p_scales[add( i_mult2( mode_glb, len_scales ), add( MAX_NO_SCALES, idx_scale ) )];
        }

        move16();
    }
    /* Why is x_lvq not multiplied with scales_mslvq?  */


    return 0;
}


#else

static Word16 decode_indexes_fx(
@@ -791,6 +767,109 @@ static Word16 decode_indexes_ivas_fx(
}
#endif

#ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
Word16 deindex_lvq_fx(
    Word16 *index,  /* i  : index to be decoded, as an array of 3 Word16             */
    Word16 *x_lvq,  /* o  : decoded codevector                             Q(x2.56)  */
    Word16 mode,    /* i  : LVQ  coding mode/MSLVQ structure index (select scales & no_lead ), or idx_cv for CNG case */
    Word16 sf_flag, /* i  : safety net flag                                          */
    Word16 no_bits  /* i  : number of bits for lattice                               */
)
{
    Word16 i;
    const Word16 *p_scales;
    Word16 mode_glb;
    Word32 L_tmp;
    // note_ : renamed from scales
    Word16 scales_mslvq[2];
    Word16 ber_flag;

    IF( EQ_16( sf_flag, 1 ) )
    {
        IF( LT_16( mode, 6 ) ) /* for NB */
        {
            mode_glb = add( offset_lvq_modes_SN_fx[mode], offset_in_lvq_mode_SN_fx[mode][sub( no_bits, min_lat_bits_SN_fx[mode] )] );
        }
        ELSE
        {
            mode_glb = add( offset_lvq_modes_SN_fx[mode], sub( no_bits, min_lat_bits_SN_fx[mode] ) ); /* there is granularity of 1 bit */
        }
        p_scales = &scales_fx[0][0]; // Q11
        move16();
    }
    ELSE
    {
        test();
        IF( ( LT_16( mode, 6 ) ) || ( EQ_16( mode, 12 ) ) ) /* for NB */
        {
            mode_glb = add( offset_lvq_modes_pred_fx[mode], offset_in_lvq_mode_pred_fx[mode][sub( no_bits, min_lat_bits_pred_fx[mode] )] );
        }
        ELSE
        {
            mode_glb = add( offset_lvq_modes_pred_fx[mode], sub( no_bits, min_lat_bits_pred_fx[mode] ) );
        }
        p_scales = &scales_p_fx[0][0]; // Q11
        move16();
    }

    /* decode the lattice index into the lattice codevectors for the two subvectors */

    ber_flag = decode_indexes_fx( index, no_bits, p_scales, x_lvq, mode_glb, scales_mslvq, 1 - sf_flag ); /* x_lvq is here Q1 */

    IF( EQ_16( sf_flag, 1 ) )
    {
        /* safety-net case*/
        IF( scales_mslvq[0] )
        {
            FOR( i = 0; i < LATTICE_DIM; i++ )
            {
                L_tmp = L_mult( x_lvq[i], scales_mslvq[0] ); /* Q1+Q11+Q1  = Q13 */
                /* Increase calculation accuracy  by shifting more to the left and using rounding instead of truncation*/
                L_tmp = L_shl( Mult_32_16( L_tmp, shl( sigma_MSLVQ_fx[mode][i], 3 ) ), 15 ); /* Q13 + Q2 +x2.56 -Q15 */
                x_lvq[i] = round_fx( L_tmp );
                move16();
            }
        }
        IF( scales_mslvq[1] )
        {
            FOR( i = LATTICE_DIM; i < 2 * LATTICE_DIM; i++ )
            {
                L_tmp = L_mult( x_lvq[i], scales_mslvq[1] );                                 /* Q1+Q11+Q1  = Q13 */
                L_tmp = L_shl( Mult_32_16( L_tmp, shl( sigma_MSLVQ_fx[mode][i], 3 ) ), 15 ); /* Q13 + Q2 +x2.56 -Q15 */
                x_lvq[i] = round_fx( L_tmp );
                move16();
            }
        }
    }
    ELSE
    {
        /* predictive mode AR or MA */
        IF( scales_mslvq[0] )
        {
            FOR( i = 0; i < LATTICE_DIM; i++ )
            {
                L_tmp = L_mult( x_lvq[i], scales_mslvq[0] );                             /* Q1+Q11+Q1  = Q13 */
                L_tmp = L_shl( Mult_32_16( L_tmp, shl( sigma_p_fx[mode][i], 3 ) ), 15 ); /* Q13 + Q2 +x2.56 -Q15 */
                x_lvq[i] = round_fx( L_tmp );
                move16();
            }
        }
        IF( scales_mslvq[1] )
        {
            FOR( i = LATTICE_DIM; i < 2 * LATTICE_DIM; i++ )
            {
                L_tmp = L_mult( x_lvq[i], scales_mslvq[1] );                             /* Q1+Q11+Q1  = Q13 */
                L_tmp = L_shl( Mult_32_16( L_tmp, shl( sigma_p_fx[mode][i], 3 ) ), 15 ); /* Q13 + Q2 +x2.56 -Q15 */
                x_lvq[i] = round_fx( L_tmp );
                move16();
            }
        }
    }

    return ber_flag;
}

#else
Word16 deindex_lvq_fx(
    Word16 *index,           /* i  : index to be decoded, as an array of 3 Word16             */
    Word16 *x_lvq,           /* o  : decoded codevector                             Q(x2.56)  */
@@ -824,17 +903,11 @@ Word16 deindex_lvq_fx(
    }

    /* decode the lattice index into the lattice codevectors for the two subvectors */
#ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
    ber_flag = decode_indexes_fx( index, no_bits, p_scales, p_no_scales,
                                  p_offset_scale1, p_offset_scale2,
                                  x_lvq, mode_glb, scales_mslvq,
                                  0, 0 ); /* use_ivas_mode=0, prediction_flag=0 */
                                          /* x_lvq is here Q1 */
#else

    ber_flag =
        decode_indexes_fx( index, no_bits, p_scales, p_no_scales, p_offset_scale1,
                           p_offset_scale2, x_lvq, mode_glb, scales_mslvq ); /* x_lvq is here Q1 */
#endif


    IF( EQ_16( sf_flag, 1 ) )
    {
@@ -937,15 +1010,9 @@ Word16 deindex_lvq_ivas_fx(
    create_offset( offset_scale1, offset_scale2, mode_glb, 1 - sf_flag );

    /* decode the lattice index into the lattice codevectors for the two subvectors */
#ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
    ber_flag = decode_indexes_fx( index, no_bits, p_scales, NULL,
                                  NULL, NULL,
                                  x_lvq, mode_glb, scales_mslvq,
                                  1, 1 - sf_flag );
    /* use_ivas_mode=1 */ /* x_lvq is here Q1 */
#else

    ber_flag = decode_indexes_ivas_fx( index, no_bits, p_scales, 1 - sf_flag, x_lvq, mode_glb, scales_mslvq ); /* x_lvq is here Q1 */
#endif


    IF( EQ_16( sf_flag, 1 ) )
    {
@@ -999,7 +1066,7 @@ Word16 deindex_lvq_ivas_fx(

    return ber_flag;
}

#endif
/*----------------------------------------------------------------------------------------------------*
 * deindex_lvq_cng()
 * Note:
@@ -1007,7 +1074,14 @@ Word16 deindex_lvq_ivas_fx(
 * value of the highest order LSF coefficient. Thus sampling rate information, nor extra codebooks are
 * not needed for deindex_lvq_cng(), since it is embedded inside the LSF codebooks.
 *----------------------------------------------------------------------------------------------------*/

#ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
Word16 deindex_lvq_cng_fx(
    Word16 *index, /* i  : index to be decoded, as an array of 3 short */
    Word16 *x_lvq, /* o  : decoded codevector  Q9 */
    Word16 idx_cv, /* i  : relative mode_lvq, wrt START_CNG */
    Word16 no_bits /* i  : number of bits for lattice */
)
#else
Word16 deindex_lvq_cng_fx(
    Word16 *index,           /* i  : index to be decoded, as an array of 3 short */
    Word16 *x_lvq,           /* o  : decoded codevector  Q9 */
@@ -1017,6 +1091,7 @@ Word16 deindex_lvq_cng_fx(
    Word32 *p_offset_scale2, /* i  : scale index offset for second LSF subvector */
    Word16 *p_no_scales      /* i  : number of scales for each MSLVQ structure and each subvector */
)
#endif
{
    Word16 i;
    Word32 L_tmp;
@@ -1034,10 +1109,7 @@ Word16 deindex_lvq_cng_fx(
    p_scales = &scales_fx[0][0];
    move16();
#ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
    ber_flag = decode_indexes_fx( index, no_bits, p_scales, p_no_scales,
                                  p_offset_scale1, p_offset_scale2,
                                  x_lvq, mode_glb, scales_mslvq,
                                  0, 0 ); /* use_ivas_mode=0, prediction_flag=0 */
    ber_flag = decode_indexes_fx( index, no_bits, p_scales, x_lvq, mode_glb, scales_mslvq, 0 ); /*  prediction_flag=0 */
#else
    ber_flag =
        decode_indexes_fx( index, no_bits, p_scales, p_no_scales, p_offset_scale1, p_offset_scale2, x_lvq, mode_glb, scales_mslvq );
@@ -1067,7 +1139,7 @@ Word16 deindex_lvq_cng_fx(
    return ber_flag;
}


#ifndef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
/*----------------------------------------------------------------------------------------------------*
 * deindex_lvq_cng()
 * Note:
@@ -1098,15 +1170,10 @@ Word16 deindex_lvq_cng_ivas_fx(

    p_scales = &scales_ivas_fx[0][0];
    move16();
#ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
    ber_flag = decode_indexes_fx( index, no_bits, p_scales, NULL,
                                  NULL, NULL,
                                  x_lvq, mode_glb, scales_mslvq,
                                  1, 0 ); /* use_ivas_mode=1, prediction_flag=0 */
#else

    ber_flag =
        decode_indexes_ivas_fx( index, no_bits, p_scales, 0, x_lvq, mode_glb, scales_mslvq );
#endif


    FOR( i = 0; i < LATTICE_DIM; i++ )
    {
@@ -1131,7 +1198,7 @@ Word16 deindex_lvq_cng_ivas_fx(

    return ber_flag;
}

#endif
/* combinatorial indexing */
static void idx2c_fx(
    Word16 n,  /* i  : total number of positions (components)*/
@@ -1548,9 +1615,13 @@ void create_offset(
        {
            tmp += DELTA_LEADER;
        }

#ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
        make_offset_scale_fx( table_no_cv_fx, leaders_short[tmp], MAX_NO_SCALES, offset_scale1 );
        make_offset_scale_fx( table_no_cv_fx, leaders_short[no_lead_idx[mode][1]], MAX_NO_SCALES, offset_scale2 );
#else
        make_offset_scale( table_no_cv_fx, leaders_short[tmp], MAX_NO_SCALES, offset_scale1 );
        make_offset_scale( table_no_cv_fx, leaders_short[no_lead_idx[mode][1]], MAX_NO_SCALES, offset_scale2 );
#endif
    }
    else
    {
@@ -1566,9 +1637,13 @@ void create_offset(
            tmp += DELTA_LEADER;
            tmp1 = DELTA_LEADER;
        }

#ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
        make_offset_scale_fx( table_no_cv_fx, leaders_short[tmp], MAX_NO_SCALES, offset_scale1 );
        make_offset_scale_fx( table_no_cv_fx, leaders_short[tmp1], MAX_NO_SCALES, offset_scale2 );
#else
        make_offset_scale( table_no_cv_fx, leaders_short[tmp], MAX_NO_SCALES, offset_scale1 );
        make_offset_scale( table_no_cv_fx, leaders_short[tmp1], MAX_NO_SCALES, offset_scale2 );
#endif
    }

    return;
+2 −1
Original line number Diff line number Diff line
@@ -93,7 +93,8 @@
#define FIX_FLOAT_1539_G192_FORMAT_SWITCH               /* VA/Nokia: reintroduce format switching for g192 bitstreams */
#define OPTIMIZE_FFT_STACK                              /* VA: removal of intermediate FFT buffers */
#define HARMONIZE_DCT                                   /* VA: removal of duplicated DCT functions */
#define FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES   /* Nokia: basop issue 2492: remove duplicates for decode_indexes() */
#define FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES   /* Nokia: basop issue 2492: remove duplicates for decode_indexes() unify the use of offset scales between IVAS and EVS, which also allows to remove some duplicated tables and parameters */

/* #################### End BE switches ################################## */

/* #################### Start NON-BE switches ############################ */
+39 −22

File changed.

Preview size limit exceeded, changes collapsed.

+32 −17
Original line number Diff line number Diff line
@@ -414,13 +414,19 @@ extern const UWord8 no_lead_p_idx[][2]; // Q0
extern const Word8 leaders_short[][MAX_NO_SCALES]; // Q0
extern const Word16 sigma_MSLVQ_fx[][16];          // Qlog2(2.56)
extern const Word16 sigma_p_fx[][16];              // Qlog2(2.56)
#ifndef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
extern const Word16 sigma_p_ivas_fx[][16];         // Qlog2(2.56)
#endif
extern const Word16 inv_sigma_MSLVQ_fx[][16];               // Q15
extern const Word16 inv_sigma_p_fx[][16];                   // Q15
#ifndef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
extern const Word16 inv_sigma_p_ivas_fx[][16];              // Qlog2(2.56)
#endif
extern const Word16 scales_fx[][MAX_NO_SCALES * 2];         // Q11
#ifndef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
extern const Word16 scales_ivas_fx[][MAX_NO_SCALES * 2];    // Q11
extern const Word16 scales_p_ivas_fx[][MAX_NO_SCALES * 2];  // Q11
#endif
extern const Word16 scales_p_fx[][MAX_NO_SCALES * 2];       // Q11
extern const Word16 predmode_tab_float[][6];
extern const Word16 predmode_tab[][6]; // Q0
@@ -444,6 +450,14 @@ extern const Word16 cng_sort[]; // Q0
extern const Word16 perm_MSLVQ[][4]; // Q0
// extern const Word16 perm_MSLVQ_fx[][4];

#ifdef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
extern const Word16 min_lat_bits_SN_fx[];             // Q0
extern const Word16 min_lat_bits_pred_fx[];           // Q0
extern const Word16 offset_in_lvq_mode_SN_fx[][21];   // Q0
extern const Word16 offset_in_lvq_mode_pred_fx[][32]; // Q0
extern const Word16 offset_lvq_modes_SN_fx[];         // Q0
extern const Word16 offset_lvq_modes_pred_fx[];       // Qlog2(1.6)
#else
extern const Word16 min_lat_bits_SN[];
extern const Word16 min_lat_bits_SN_fx[]; // Q0

@@ -461,7 +475,7 @@ extern const Word16 offset_lvq_modes_SN_fx[]; // Q0

extern const Word16 offset_lvq_modes_pred[];
extern const Word16 offset_lvq_modes_pred_fx[]; // Qlog2(1.6)

#endif
/*-----------------------------------------------------------------*
 * LSF quantization - BC-TCVQ tables
 *-----------------------------------------------------------------*/
@@ -1563,9 +1577,10 @@ extern const Word16 sin_scale_tbl_1200[1200]; // Q15
extern const Word16 cos_scale_tbl_800[800];   // Q15
extern const Word16 sin_scale_tbl_800[800];   // Q15
#endif

#ifndef FIX_2492_REMOVE_DUPLICATES_FOR_DECODE_INDEXES
extern const Word16 scales_ivas_fx[][MAX_NO_SCALES * 2];   // Q11
extern const Word16 scales_p_ivas_fx[][MAX_NO_SCALES * 2]; // Q11
#endif

/*------------------------------------------------------------------------------*
 * FFT transform tables
Loading