Commit b8fb16b3 authored by Nishant S Kulgod's avatar Nishant S Kulgod
Browse files

latest rebased

parent 39881aa8
Loading
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1266,7 +1266,8 @@ void stereo_mdct_core_dec_fx(
    Decoder_Struct *st_ivas,                       /* i/o: IVAS decoder structure                  */
    CPE_DEC_HANDLE hCPE,                           /* i/o: CPE decoder structure                   */
    Word32 *signal_out[CPE_CHANNELS],              /* o  : synthesis @internal_FS                  */
    Word16 signal_outFB[CPE_CHANNELS][L_FRAME48k] /* o  : synthesis @output_FS                    */
    Word16 signal_outFB[CPE_CHANNELS][L_FRAME48k], /* o  : synthesis @output_FS                    */
    Word16 e_sigFB[CPE_CHANNELS]                   /* o  : exponent of synthesis @output_FS        */
);

// ivas_stereo_mdct_stereo_com.c
+1 −1
Original line number Diff line number Diff line
@@ -9328,7 +9328,7 @@ void ivas_mdct_core_reconstruct_fx(
    Word16 fUseTns[CPE_CHANNELS][NB_DIV],          /* i  : flage TNS enabled                   */
    const Word16 MCT_flag,                         /* i  : hMCT handle allocated (1) or not (0)*/
    Word16 q_x,
    Word16 e_sig );
    Word16 e_sig[CPE_CHANNELS] );

void ari_start_encoding_14bits_ivas_fx(
    Tastat *s );
+17 −17
Original line number Diff line number Diff line
@@ -193,12 +193,12 @@ ivas_error acelp_core_dec_ivas_fx(
#endif
            ApplyFdCng_ivas_fx( NULL, 0, NULL, 0, NULL, NULL, NULL, st, 0, 0 );

            /*IF( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp < 0 )
            IF( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp < 0 )
            {
                Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, st->hFdCngDec->hFdCngCom->cngNoiseLevelExp );
                st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 0;
                move16();
            }*/
            }
        }
        ELSE
        {
@@ -696,7 +696,7 @@ ivas_error acelp_core_dec_ivas_fx(
                        move32();
                    }
#endif
                   /* Word16 new_sidNoiseEstExp = 31 - Q4;
                    Word16 new_sidNoiseEstExp = 31 - Q4;
                    move16();
                    Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEstLp, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, new_sidNoiseEstExp ) );
                    Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEst, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, new_sidNoiseEstExp ) );
@@ -706,16 +706,16 @@ ivas_error acelp_core_dec_ivas_fx(
                    move16();
                    Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, st->hFdCngDec->hFdCngCom->cngNoiseLevelExp - new_cngNoiseLevelExp );
                    st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = new_cngNoiseLevelExp;
                    move16();*/
                    move16();

                    ApplyFdCng_ivas_fx( psyn_fx, st->Q_syn, NULL, 0, realBuffer_fx, imagBuffer_fx, NULL, st, 0, ( st->coder_type == AUDIO && !st->GSC_noisy_speech ) );

                    /*IF( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp < 0 )
                    IF( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp < 0 )
                    {
                        Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, st->hFdCngDec->hFdCngCom->cngNoiseLevelExp );
                        st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 0;
                        move16();
                    }*/
                    }
                }

                IF( !read_sid_info )
@@ -1546,18 +1546,18 @@ ivas_error acelp_core_dec_ivas_fx(
            {
                /*Noise estimate*/

                //Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, sub( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp, Q27 ) );
                //st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 31 - Q4; // Q4
                //move16();
                Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, sub( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp, Q27 ) );
                st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 31 - Q4; // Q4
                move16();

                //Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEst, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, Q27 ) );
                //Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEstLp, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, Q27 ) );
                //st->hFdCngDec->hFdCngCom->sidNoiseEstExp = 31 - Q4; // Q4
                //move16();
                Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEst, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, Q27 ) );
                Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEstLp, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, Q27 ) );
                st->hFdCngDec->hFdCngCom->sidNoiseEstExp = 31 - Q4; // Q4
                move16();
                /*==========================================================*/
                ApplyFdCng_ivas_fx( psyn_fx, st->Q_syn, NULL, 0, realBuffer_fx, imagBuffer_fx, NULL, st, 0, ( st->coder_type == AUDIO && !st->GSC_noisy_speech ) );
                /*==========================================================*/
                /*IF( st->hFdCngDec->partNoiseShape_exp < 0 )
                IF( st->hFdCngDec->partNoiseShape_exp < 0 )
                {
                    Scale_sig32( st->hFdCngDec->partNoiseShape, NPART, st->hFdCngDec->partNoiseShape_exp );
                    st->hFdCngDec->partNoiseShape_exp = 0;
@@ -1568,7 +1568,7 @@ ivas_error acelp_core_dec_ivas_fx(
                    Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, st->hFdCngDec->hFdCngCom->cngNoiseLevelExp );
                    st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 0;
                    move16();
                }*/
                }
            }

            IF( !st->cna_dirac_flag )
@@ -1654,7 +1654,7 @@ ivas_error acelp_core_dec_ivas_fx(
                    IF( ( st->idchan == 0 ) && ( EQ_16( nchan_out, 2 ) || ( st->core_brate != FRAME_NO_DATA && NE_32( st->core_brate, SID_2k40 ) ) ) )
                    {
                        ApplyFdCng_ivas_fx( psyn_fx, st->Q_syn, NULL, 0, realBuffer_fx, imagBuffer_fx, NULL, st, 0, ( st->coder_type == AUDIO && !st->GSC_noisy_speech ) );
                        /*IF( st->hFdCngDec->partNoiseShape_exp < 0 )
                        IF( st->hFdCngDec->partNoiseShape_exp < 0 )
                        {
                            Scale_sig32( st->hFdCngDec->partNoiseShape, NPART, -st->hFdCngDec->partNoiseShape_exp );
                            st->hFdCngDec->partNoiseShape_exp = 0;
@@ -1671,7 +1671,7 @@ ivas_error acelp_core_dec_ivas_fx(
                            Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, st->hFdCngDec->hFdCngCom->cngNoiseLevelExp );
                            st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 0;
                            move16();
                        }*/
                        }
                    }
                }
            }
+8 −0
Original line number Diff line number Diff line
@@ -365,6 +365,8 @@ void open_decoder_LPD_fx(
            set16_fx( hTcxDec->syn_Overl, 0, shr( L_FRAME32k, 1 ) );

            set16_fx( hTcxDec->old_synth, 0, OLD_SYNTH_INTERNAL_DEC );
            hTcxDec->q_old_synth = 0;
            move16();
            set16_fx( hTcxDec->synth_history_fx, 0, add( L_PROT48k, L_FRAME_MAX ) );
            hTcxDec->q_synth_history_fx = 0;
            move16();
@@ -389,6 +391,8 @@ void open_decoder_LPD_fx(
        IF( st->hTcxDec != NULL && ( ( NE_16( st->L_frame, st->last_L_frame ) ) || ( EQ_16( st->last_codec_mode, MODE1 ) ) ) )
        {
            set16_fx( hTcxDec->old_synth, 0, OLD_SYNTH_INTERNAL_DEC );
            hTcxDec->q_old_synth = 0;
            move16();
        }

        /*Size of LPC syn memory*/
@@ -1478,6 +1482,8 @@ void open_decoder_LPD_ivas_fx(
            reset_tcx_overl_buf_fx( st->hTcxDec );
            set16_fx( hTcxDec->syn_OverlFB, 0, L_FRAME_MAX / 2 );
            set16_fx( hTcxDec->old_synth, 0, OLD_SYNTH_INTERNAL_DEC );
            hTcxDec->q_old_synth = 0;
            move16();
            set16_fx( hTcxDec->synth_history_fx, 0, L_PROT48k + L_FRAME_MAX );
            hTcxDec->q_synth_history_fx = 0;
            move16();
@@ -1501,6 +1507,8 @@ void open_decoder_LPD_ivas_fx(
        IF( st->hTcxDec != NULL && ( NE_16( st->L_frame, st->last_L_frame ) || ( EQ_16( st->last_codec_mode, MODE1 ) && EQ_16( st->element_mode, EVS_MONO ) ) ) )
        {
            set16_fx( hTcxDec->old_synth, 0, OLD_SYNTH_INTERNAL_DEC );
            hTcxDec->q_old_synth = 0;
            move16();
        }

        /*Compute size of old and new memories*/
+46 −0
Original line number Diff line number Diff line
@@ -3162,7 +3162,11 @@ void IMDCT_ivas_fx(
            {
                FOR( i = 0; i < sub( overlap, tcx_mdct_window_min_length ); i++ )
                {
#ifdef BASOP_NOGLOB
                    xn_buf_fx[add( i, sub( shr( overlap, 1 ), tcx_offset ) )] = add_sat( xn_buf_fx[add( i, sub( shr( overlap, 1 ), tcx_offset ) )], old_out_fx[add( i, nz )] );
#else
                    xn_buf_fx[add( i, sub( shr( overlap, 1 ), tcx_offset ) )] = add( xn_buf_fx[add( i, sub( shr( overlap, 1 ), tcx_offset ) )], old_out_fx[add( i, nz )] );
#endif
                    move16();
                }

@@ -3175,17 +3179,30 @@ void IMDCT_ivas_fx(
                    // tested
                    FOR( ; i < overlap; i++ ) /* perfectly reconstructing ALDO shortening */
                    {
#ifdef BASOP_NOGLOB
                        xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )] = add_sat( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], old_out_fx[add( i, nz )] );
#else
                        xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )] = add( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], old_out_fx[add( i, nz )] );

#endif
                        move16();
                    }
                    FOR( i = 0; i < shr( tcx_mdct_window_min_length, 1 ); i++ )
                    {
#ifdef BASOP_NOGLOB
                        xn_buf_fx[add( sub( add( i, shr( overlap, 1 ) ), tcx_offset ), overlap )] = add_sat( xn_buf_fx[add( sub( add( i, shr( overlap, 1 ) ), tcx_offset ), overlap )], mult_r( old_out_fx[add( add( i, nz ), overlap )], tcx_mdct_window_minimum_fx[i].v.re ) );
#else
                        xn_buf_fx[add( sub( add( i, shr( overlap, 1 ) ), tcx_offset ), overlap )] = add( xn_buf_fx[add( sub( add( i, shr( overlap, 1 ) ), tcx_offset ), overlap )], mult_r( old_out_fx[add( add( i, nz ), overlap )], tcx_mdct_window_minimum_fx[i].v.re ) );
#endif
                        move16();
                    }
                    FOR( ; i < tcx_mdct_window_min_length; i++ )
                    {
#ifdef BASOP_NOGLOB
                        xn_buf_fx[add( sub( add( i, shr( overlap, 1 ) ), tcx_offset ), overlap )] = add_sat( xn_buf_fx[add( sub( add( i, shr( overlap, 1 ) ), tcx_offset ), overlap )], mult_r( old_out_fx[add( add( i, nz ), overlap )], tcx_mdct_window_minimum_fx[sub( tcx_mdct_window_min_length, add( 1, i ) )].v.im ) );
#else
                        xn_buf_fx[add( sub( add( i, shr( overlap, 1 ) ), tcx_offset ), overlap )] = add( xn_buf_fx[add( sub( add( i, shr( overlap, 1 ) ), tcx_offset ), overlap )], mult_r( old_out_fx[add( add( i, nz ), overlap )], tcx_mdct_window_minimum_fx[sub( tcx_mdct_window_min_length, add( 1, i ) )].v.im ) );
#endif
                        move16();
                    }
                }
@@ -3193,12 +3210,20 @@ void IMDCT_ivas_fx(
                {
                    FOR( ; i < sub( overlap, shr( tcx_mdct_window_min_length, 1 ) ); i++ )
                    {
#ifdef BASOP_NOGLOB
                        xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )] = add_sat( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], mult_r( old_out_fx[add( i, nz )], tcx_mdct_window_minimum_fx[add( sub( tcx_mdct_window_min_length, overlap ), i )].v.re ) );
#else
                        xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )] = add( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], mult_r( old_out_fx[add( i, nz )], tcx_mdct_window_minimum_fx[add( sub( tcx_mdct_window_min_length, overlap ), i )].v.re ) );
#endif
                        move16();
                    }
                    FOR( ; i < overlap; i++ )
                    {
#ifdef BASOP_NOGLOB
                        xn_buf_fx[add( i, sub( shr( overlap, 1 ), tcx_offset ) )] = add_sat( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], mult_r( old_out_fx[add( i, nz )], tcx_mdct_window_minimum_fx[sub( overlap, add( 1, i ) )].v.im ) );
#else
                        xn_buf_fx[add( i, sub( shr( overlap, 1 ), tcx_offset ) )] = add( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], mult_r( old_out_fx[add( i, nz )], tcx_mdct_window_minimum_fx[sub( overlap, add( 1, i ) )].v.im ) );
#endif
                        move16();
                    }
                }
@@ -3211,12 +3236,21 @@ void IMDCT_ivas_fx(
                {
                    FOR( i = 0; i < shr( tcx_mdct_window_half_length, 1 ); i++ )
                    {
#ifdef BASOP_NOGLOB
                        xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )] = add_sat( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], mult_r( old_syn_overl_fx[i], tcx_mdct_window_half_fx[i].v.re ) );
#else
                        xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )] = add( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], mult_r( old_syn_overl_fx[i], tcx_mdct_window_half_fx[i].v.re ) );

#endif
                        move16();
                    }
                    FOR( ; i < tcx_mdct_window_half_length; i++ )
                    {
#ifdef BASOP_NOGLOB
                        xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )] = add_sat( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], mult_r( old_syn_overl_fx[i], tcx_mdct_window_half_fx[sub( tcx_mdct_window_half_length, add( 1, i ) )].v.im ) );
#else
                        xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )] = add( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], mult_r( old_syn_overl_fx[i], tcx_mdct_window_half_fx[sub( tcx_mdct_window_half_length, add( 1, i ) )].v.im ) );
#endif
                        move16();
                    }
                }
@@ -3232,7 +3266,11 @@ void IMDCT_ivas_fx(
                {
                    FOR( i = 0; i < overlap; i++ )
                    {
#ifdef BASOP_NOGLOB
                        xn_buf_fx[add( i, shr( overlap, 1 ) )] = add_sat( xn_buf_fx[add( i, shr( overlap, 1 ) )], old_syn_overl_fx[i] );
#else
                        xn_buf_fx[add( i, shr( overlap, 1 ) )] = add( xn_buf_fx[add( i, shr( overlap, 1 ) )], old_syn_overl_fx[i] );
#endif
                        move16();
                    }
                }
@@ -3309,14 +3347,22 @@ void IMDCT_ivas_fx(
            FOR( i = 0; i < shr( tcx_mdct_window_half_length, 1 ); i++ )
            {
                xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )] = mult_r( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], tcx_mdct_window_half_fx[i].v.im );
#ifdef BASOP_NOGLOB
                xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )] = add_sat( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], mult_r( mult_r( hTcxDec->syn_Overl[i], tcx_mdct_window_half_fx[i].v.re ), tcx_mdct_window_half_fx[i].v.re ) );
#else
                xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )] = add( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], mult_r( mult_r( hTcxDec->syn_Overl[i], tcx_mdct_window_half_fx[i].v.re ), tcx_mdct_window_half_fx[i].v.re ) );
#endif
                move16();
                move16();
            }
            FOR( ; i < tcx_mdct_window_half_length; i++ )
            {
                xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )] = mult_r( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], tcx_mdct_window_half_fx[sub( tcx_mdct_window_half_length, add( 1, i ) )].v.re );
#ifdef BASOP_NOGLOB
                xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )] = add_sat( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], mult_r( mult_r( hTcxDec->syn_Overl[i], tcx_mdct_window_half_fx[sub( tcx_mdct_window_half_length, add( 1, i ) )].v.im ), tcx_mdct_window_half_fx[sub( tcx_mdct_window_half_length, add( 1, i ) )].v.im ) );
#else
                xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )] = add( xn_buf_fx[sub( add( i, shr( overlap, 1 ) ), tcx_offset )], mult_r( mult_r( hTcxDec->syn_Overl[i], tcx_mdct_window_half_fx[sub( tcx_mdct_window_half_length, add( 1, i ) )].v.im ), tcx_mdct_window_half_fx[sub( tcx_mdct_window_half_length, add( 1, i ) )].v.im ) );
#endif
                move16();
                move16();
            }
Loading