Commit fb8f3da9 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'ivas_fixed_converted_funcs_integration_1' into 'main'

Few fixed point converted functions included in call-stack

See merge request !191
parents dbc49984 ee1e477e
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1551,6 +1551,11 @@ float stereo_dft_dmx_swb_nrg(
    const int16_t frame_length                                  /* i  : frame lanegth                       */
);

#ifdef IVAS_FLOAT_FIXED
Word16 stereo_dft_sg_recovery_fx(
    STEREO_DFT_DEC_DATA_HANDLE hStereoDft /* i/o: Decoder DFT stereo handle      */
);
#endif
int16_t stereo_dft_sg_recovery(
    STEREO_DFT_DEC_DATA_HANDLE hStereoDft                       /* i/o: Decoder DFT stereo handle           */
);
+33 −0
Original line number Diff line number Diff line
@@ -507,7 +507,40 @@ ivas_error ivas_jbm_dec_tc(
        else if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) )
        {
            /* loudness correction */
#ifdef IVAS_FLOAT_FIXED
            Word32 *p_output_fx[12];
            for ( int lp = 0; lp < st_ivas->nchan_transport; lp++ )
            {
                if ( p_output[lp] != NULL )
                {
                    p_output_fx[lp] = (Word32 *) malloc( sizeof( Word32 ) * L_FRAME48k );
                }
            }
            Word16 Q_p_output = 31;
            for ( int i = 0; i< st_ivas->nchan_transport; i++ )
            {
                Q_p_output = s_min( Q_p_output, Q_factor_arrL( p_output[i], output_frame) );
            }
            for ( int i = 0; i < st_ivas->nchan_transport; i++ )
            {
                floatToFixed_arrL( p_output[i], p_output_fx[i], Q_p_output, output_frame);
            }
            ivas_dirac_dec_binaural_sba_gain_fx( p_output_fx, st_ivas->nchan_transport, output_frame );/*returns Q-1*/
            Q_p_output = Q_p_output - 1;
            for ( int i = 0; i < st_ivas->nchan_transport; i++ )
            {
                fixedToFloat_arrL( p_output_fx[i], p_output[i], Q_p_output, output_frame);
            }
            for ( int lp = 0; lp < st_ivas->nchan_transport; lp++ )
            {
                if ( p_output_fx[lp] != NULL )
                {
                    free( p_output_fx[lp] );
                }
            }
#else
            ivas_dirac_dec_binaural_sba_gain( p_output, st_ivas->nchan_transport, output_frame );
#endif // IVAS_FLOAT_FIXED
        }
    }
    else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT )
+9 −0
Original line number Diff line number Diff line
@@ -2299,13 +2299,22 @@ static int16_t ivas_param_mc_range_decoder_LC(
    /* Start Decoding */
    /* Initialize range decoder */
    cur_bit_pos = 0;
#ifdef IVAS_FLOAT_FIXED
    rc_uni_dec_init_fx( &rc_st_dec, bit_buffer, nbbits - 32 ); /* (nbbits + 30) entries are read by the decoder */
#else
    rc_uni_dec_init( &rc_st_dec, bit_buffer, nbbits - 32 ); /* (nbbits + 30) entries are read by the decoder */
#endif // IVAS_FLOAT_FIXED

    /* Main Loop through the indices */
    for ( k = 0; k < sz_seq; k++ )
    {
#ifdef IVAS_FLOAT_FIXED
        r = rc_uni_dec_read_symbol_fastS_fx( &rc_st_dec, cft, sft, sz_alphabet, tot_shift ); /*Alphabet size = 17 (2^4 = 16 MSB symbols + 1 ESC symbol) */
                                                                                          /* r is the symbol read, the possible values are {0,1,....alphabet_size - 1}  */
#else
        r = rc_uni_dec_read_symbol_fastS( &rc_st_dec, cft, sft, sz_alphabet, tot_shift ); /*Alphabet size = 17 (2^4 = 16 MSB symbols + 1 ESC symbol) */
                                                                                          /* r is the symbol read, the possible values are {0,1,....alphabet_size - 1}  */
#endif // IVAS_FLOAT_FIXED

        /* Update bitstream pointer */
        cur_bit_pos = rc_uni_dec_virtual_finish( &rc_st_dec );
+1 −1
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ UWord16 rc_uni_dec_read_symbol_fastS_fx(
    {
        sym_middle = shr(add( sym_begin , sym_end ) , 1);
        /* completely equvalent with low >= range * ((1 << tot_shift) - table[sym_middle]) */
        IF ( range * sub( shl( 1 , tot_shift ) , cum_freq_table[sym_middle] ) >= reversed_low )
        IF ( range * L_sub( L_shl( 1 , tot_shift ) , cum_freq_table[sym_middle] ) >= reversed_low )
        {
            sym_begin = sym_middle;
        }
+10 −0
Original line number Diff line number Diff line
@@ -3044,7 +3044,13 @@ void stereo_dft_dec_read_BS(

    if ( ivas_total_brate > IVAS_SID_5k2 )
    {
#ifdef IVAS_FLOAT_FIXED
        floatToFixed_arrL( hStereoDft->side_gain, hStereoDft->side_gain_fx, 31, 39 );
        hStereoDft->recovery_flg = stereo_dft_sg_recovery_fx( hStereoDft );
        hStereoDft->sg_mean = fixedToFloat( hStereoDft->sg_mean_fx, 31 );
#else
        hStereoDft->recovery_flg = stereo_dft_sg_recovery( hStereoDft );
#endif // IVAS_FLOAT_FIXED

        if ( hStereoDft->recovery_flg )
        {
@@ -3075,7 +3081,11 @@ void stereo_dft_dec_read_BS(
            ECSQ_init_instance( &ecsq_inst, 0 /*dummy index*/, &range_uni_dec_state );
#endif // IVAS_FLOAT_FIXED

#ifdef IVAS_FLOAT_FIXED
            rc_uni_dec_init_fx( &range_uni_dec_state, bit_stream_side + *nb_bits, max_bits - *nb_bits );
#else
            rc_uni_dec_init( &range_uni_dec_state, bit_stream_side + *nb_bits, max_bits - *nb_bits );
#endif // IVAS_FLOAT_FIXED

#ifdef IVAS_FLOAT_FIXED
            Word32 res_global_gain_fx;
Loading