Commit 8e7c1fe2 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'voiceage/bitstream' into 'main'

replace EVS push_indice_fx with push_indice (from IVAS)

See merge request !1339
parents 5e45b8d5 16b3fe61
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -240,11 +240,11 @@ Word16 rate2EVSmode(
}

/*-------------------------------------------------------------------*
 * push_indice_fx( )
 * push_indice( )
 *
 * Push a new indice into the buffer
 *-------------------------------------------------------------------*/

#ifndef HARM_PUSH_BIT
void push_indice_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */
    Word16 id,             /* i  : ID of the indice */
@@ -288,9 +288,8 @@ void push_indice_fx(

    return;
}

/*-------------------------------------------------------------------*
 * push_next_indice_fx()            *
 * push_next_indice()            *
 * Push a new indice into the buffer at the next position
 *-------------------------------------------------------------------*/

@@ -318,7 +317,7 @@ void push_next_indice_fx(


/*-------------------------------------------------------------------*
 * push_next_bits_fx()
 * push_next_bits()
 * Push a bit buffer into the buffer at the next position
 *-------------------------------------------------------------------*/

@@ -368,6 +367,7 @@ void push_next_bits_fx(
    hBstr->nb_bits_tot = add( hBstr->nb_bits_tot, nb_bits );
    move16();
}
#endif

/*-------------------------------------------------------------------*
 * get_next_indice_fx( )
@@ -530,11 +530,12 @@ void reset_indices_enc_fx(
    move16();
    hBstr->nb_bits_tot = 0;
    move16();
#ifndef HARM_PUSH_BIT
    hBstr->next_ind_fx = 0;
    move16();
    hBstr->last_ind_fx = -1;
    move16();

#endif
    FOR( i = 0; i < max_num_indices; i++ )
    {
        hBstr->ind_list[i].nb_bits = -1;
@@ -565,7 +566,7 @@ void reset_indices_dec_fx(
 *
 * Write the buffer of indices to a file
 *-------------------------------------------------------------------*/

#ifndef HARM_PUSH_BIT
void write_indices_fx(
    Encoder_State *st_fx,  /* i/o: encoder state structure */
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */
@@ -663,12 +664,13 @@ void write_indices_fx(

    return;
}
#endif
/*-------------------------------------------------------------------*
 * write_indices_buf_fx()
 *
 * Write the buffer of indices to a file
 *-------------------------------------------------------------------*/

#ifndef HARM_PUSH_BIT
void write_indices_buf_fx(
    Encoder_State *st_fx,  /* i/o: encoder state structure */
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */
@@ -772,6 +774,7 @@ void write_indices_buf_fx(

    return;
}
#endif
/*-------------------------------------------------------------------*
 * indices_to_serial()
 *
+14 −14
Original line number Diff line number Diff line
@@ -1028,7 +1028,7 @@ Word16 gsc_gainQ_fx( /*Q12*/
        mean_4g[0] = round_fx( L_tmp );
        move16();
        idx_g = vquant_fx( mean_4g, Gain_meanNB_fx, mean_4g, Gain_mean_dicNB_fx, 1, 64 );
        push_indice_fx( hBstr, IND_MEAN_GAIN2, idx_g, 6 );
        push_indice( hBstr, IND_MEAN_GAIN2, idx_g, 6 );

        FOR( i = 0; i < Mbands_gn; i++ )
        {
@@ -1040,21 +1040,21 @@ Word16 gsc_gainQ_fx( /*Q12*/
        move16();
        set16_fx( y_gain_tmp + 10, 0, MBANDS_GN - 10 );
        idx_g = vquant_fx( y_gain_tmp, Mean_dic_NB_fx, y_gain_tmp, Gain_dic1_NB_fx, 3, 64 );
        push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 6 );
        push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 6 );

        IF( LT_32( core_brate, ACELP_9k60 ) )
        {
            idx_g = vquant_fx( y_gain_tmp + 3, Mean_dic_NB_fx + 3, y_gain_tmp + 3, Gain_dic2_NB_fx, 3, 32 );
            push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 5 );
            push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 );
            idx_g = vquant_fx( y_gain_tmp + 6, Mean_dic_NB_fx + 6, y_gain_tmp + 6, Gain_dic3_NB_fx, 4, 16 );
            push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 4 );
            push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 4 );
        }
        ELSE
        {
            idx_g = vquant_fx( y_gain_tmp + 3, Mean_dic_NB_fx + 3, y_gain_tmp + 3, Gain_dic2_NBHR_fx, 3, 64 );
            push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 6 );
            push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 6 );
            idx_g = vquant_fx( y_gain_tmp + 6, Mean_dic_NB_fx + 6, y_gain_tmp + 6, Gain_dic3_NBHR_fx, 4, 128 );
            push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 7 );
            push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 7 );
        } /*add end */

        test();
@@ -1122,7 +1122,7 @@ Word16 gsc_gainQ_fx( /*Q12*/
        move16();

        idx_g = vquant_fx( mean_4g, mean_m_fx, mean_4g, mean_gain_dic_fx, 1, 64 );
        push_indice_fx( hBstr, IND_MEAN_GAIN2, idx_g, 6 );
        push_indice( hBstr, IND_MEAN_GAIN2, idx_g, 6 );

        FOR( i = 0; i < Mbands_gn; i++ )
        {
@@ -1148,11 +1148,11 @@ Word16 gsc_gainQ_fx( /*Q12*/
            move16();

            idx_g = vquant_fx( y_gain_tmp2, YGain_mean_LR_fx, y_gain_tmp2, YGain_dic1_LR_fx, 3, 32 );
            push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 5 );
            push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 );
            idx_g = vquant_fx( y_gain_tmp2 + 3, YGain_mean_LR_fx + 3, y_gain_tmp2 + 3, YGain_dic2_LR_fx, 4, 32 );
            push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 5 );
            push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 );
            idx_g = vquant_fx( y_gain_tmp2 + 7, YGain_mean_LR_fx + 7, y_gain_tmp2 + 7, YGain_dic3_LR_fx, 5, 32 );
            push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 5 );
            push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 );
            set16_fx( y_gain_tmp2 + 12, 0, MBANDS_GN - 12 );

            /* Update to quantized vector */
@@ -1185,13 +1185,13 @@ Word16 gsc_gainQ_fx( /*Q12*/
        ELSE
        {
            idx_g = vquant_fx( y_gain_tmp, YG_mean16_fx, y_gain_tmp, YG_dicMR_1_fx, 4, 64 );
            push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 6 );
            push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 6 );
            idx_g = vquant_fx( y_gain_tmp + 4, YG_mean16_fx + 4, y_gain_tmp + 4, YG_dicMR_2_fx, 4, 32 );
            push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 5 );
            push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 );
            idx_g = vquant_fx( y_gain_tmp + 8, YG_mean16_fx + 8, y_gain_tmp + 8, YG_dicMR_3_fx, 4, 32 );
            push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 5 );
            push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 );
            idx_g = vquant_fx( y_gain_tmp + 12, YG_mean16_fx + 12, y_gain_tmp + 12, YG_dicMR_4_fx, 4, 16 );
            push_indice_fx( hBstr, IND_Y_GAIN_TMP, idx_g, 4 );
            push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 4 );
        }
    }

+2 −2
Original line number Diff line number Diff line
@@ -2036,7 +2036,7 @@ Word16 calc_nor_delta_hf_fx(
        /* updating norm & storing delta norm */
        add_bits_denv = 2;
        move16();
        push_indice_fx( hBstr, IND_DELTA_ENV_HQ, sub( bitsforDelta, 2 ), 2 );
        push_indice( hBstr, IND_DELTA_ENV_HQ, sub( bitsforDelta, 2 ), 2 );
        FOR( i = num_env_bands; i < nb_sfm; ++i )
        {
            IF( Rsubband[i] != 0 )
@@ -2052,7 +2052,7 @@ Word16 calc_nor_delta_hf_fx(
                    delta = min_delta; /*Q0*/
                    move16();
                }
                push_indice_fx( hBstr, IND_DELTA_ENV_HQ, delta - min_delta, bitsforDelta );
                push_indice( hBstr, IND_DELTA_ENV_HQ, delta - min_delta, bitsforDelta );
                ynrm[i] = add( ynrm[i], delta ); /*Q0*/
                move16();
                add_bits_denv = add( add_bits_denv, bitsforDelta );
+1 −1
Original line number Diff line number Diff line
@@ -1242,7 +1242,7 @@ void IGFCommonFuncsWriteSerialBit(

    IF( hBstr )
    {
        push_next_indice_fx( hBstr, bit, 1 );
        push_next_indice( hBstr, bit, 1 );
    }
    *pBitOffset = add( *pBitOffset, 1 );
    move16();
+3 −0
Original line number Diff line number Diff line
@@ -75,4 +75,7 @@
/* Both following 2 macros (IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST*) are independent from each other, they refer to different code blocks */
#define IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE    /* FhG: reduces WMOPS of param_mc_prm_est, bit-exact to previous version */
#define IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE /* FhG: reduces WMOPS of param_mc_prm_est, not bit-exact to previous version */
#define HARM_PUSH_BIT
#define HARM_ENC_INIT
//#define HARM_SCE_INIT
#endif
Loading