Commit 7d5e6d25 authored by vaillancour's avatar vaillancour Committed by Sandesh Venkatesh
Browse files

replace problematic scaling Copy_Scale_sig_16_32 with the...

replace problematic scaling Copy_Scale_sig_16_32 with the Copy_Scale_sig_16_32_no_sat, plus comments directed to Ittiam
parent 1629a6c9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -136,4 +136,5 @@
#define FIX_1010_OPT_SEC_SINGLE_RESCALE         /* FhG: SVD complexity optimizations (non-be) */
#define NONBE_1211_DTX_BR_SWITCHING             /* VA: port float issue 1211: fix crash in MASA DTX bitrate switching */
#define FIX_1189_GSC_IVAS_OMASA                 /* VA: Fix for issue 1189: Bitstream desynchornization due to reading/writing of the GSC_IVAS_mode parameter */
#define FIX_ISSUE_1237                          /* VA: replacement of Copy_Scale_sig_16_32_DEPREC() that are doing 16 bits left shift by Copy_Scale_sig_16_32_no_sat() */
#endif
+10 −0
Original line number Diff line number Diff line
@@ -784,6 +784,16 @@ void Copy_Scale_sig_16_32_DEPREC(
        }
        return;
    }
#ifdef FIX_ISSUE_1237
#ifdef DEBUGGING
    if (exp0>= 16)
    {
        printf( "Issue in Copy_Scale_sig_16_32_DEPREC at frame %d\n", frame);
    }
#else
    assert( exp0 < 16 );
#endif
#endif
    tmp = shl_o( 1, exp0, &Overflow );
    FOR( i = 0; i < lg; i++ )
    {
+24 −8
Original line number Diff line number Diff line
@@ -1590,8 +1590,12 @@ static void ivas_spec_ana_fx(
        test();
        IF( n > 0 && *pPlocs == 0 ) /* Very 1st peak position possible to have a peak at 0/DC index position. */
        {
#ifdef FIX_ISSUE_1237
            Copy_Scale_sig_16_32_no_sat( &xfp[*pPlocs], xfp_32, 3, Q16 ); // Q + 16
#else
            Copy_Scale_sig_16_32_DEPREC( &xfp[*pPlocs], xfp_32, 3, Q16 );           // Q + 16
            acc = L_deposit_h( *pPlocs );                                           // Q16
#endif
            acc = L_deposit_h( *pPlocs );                                           // Q16                     // VA2ITTIAM -> this and the lines below need to be checked
            *pPlocsi++ = L_add( acc, L_shl( imax_pos_fx( xfp_32 ) /* Q15 */, 1 ) ); // Q16
            move32();
            pPlocs++;
@@ -1601,8 +1605,12 @@ static void ivas_spec_ana_fx(
        test();
        IF( n > 0 && EQ_16( *pPlocs, 1 ) ) /* Also 2nd peak position uses DC which makes jacobsen unsuitable. */
        {
#ifdef FIX_ISSUE_1237
            Copy_Scale_sig_16_32_no_sat( &xfp[*pPlocs - 1], xfp_32, 3, Q16 );       // Q + 16
#else
            Copy_Scale_sig_16_32_DEPREC( &xfp[*pPlocs - 1], xfp_32, 3, Q16 );       // Q + 16
            acc = L_deposit_h( sub( *pPlocs, 1 ) );                                 // Q16
#endif
            acc = L_deposit_h( sub( *pPlocs, 1 ) );                                 // Q16                      // VA2ITTIAM -> this and the lines below need to be checked
            *pPlocsi++ = L_add( acc, L_shl( imax_pos_fx( xfp_32 ) /* Q15 */, 1 ) ); // Q16
            move32();
            currPlocs = *pPlocs++; // Q16
@@ -1647,8 +1655,12 @@ static void ivas_spec_ana_fx(

            IF( EQ_16( currPlocs, ( sub( Lprot2_1, DELTA_CORR_F0_INT ) ) ) ) /* Also 2nd last peak position uses fs/2  which makes jacobsen less suitable. */
            {
#ifdef FIX_ISSUE_1237
                Copy_Scale_sig_16_32_no_sat( &xfp[currPlocs - 1], xfp_32, 3, Q16 );     // Q + 16
#else
                Copy_Scale_sig_16_32_DEPREC( &xfp[currPlocs - 1], xfp_32, 3, Q16 );     // Q + 16
                acc = L_deposit_h( sub( currPlocs, 1 ) );                               // Q16
#endif
                acc = L_deposit_h( sub( currPlocs, 1 ) );                               // Q16          // VA2ITTIAM -> this and the lines below need to be checked
                *pPlocsi++ = L_add( acc, L_shl( imax_pos_fx( xfp_32 ) /* Q15 */, 1 ) ); // Q16
                move32();
                currPlocs = *pPlocs++; // Q16
@@ -1661,8 +1673,12 @@ static void ivas_spec_ana_fx(
             * whould point */
            IF( n > 0 ) /* fs/2 which makes special case . */
            {
#ifdef FIX_ISSUE_1237
                Copy_Scale_sig_16_32_no_sat( &xfp[currPlocs - 2], xfp_32, 3, Q16 );     // Q + 16
#else
                Copy_Scale_sig_16_32_DEPREC( &xfp[currPlocs - 2], xfp_32, 3, Q16 );     // Q + 16
                acc = L_deposit_h( sub( currPlocs, 2 ) );                               // Q16
#endif
                acc = L_deposit_h( sub( currPlocs, 2 ) );                               // Q16       // VA2ITTIAM -> this and the lines below need to be checked
                *pPlocsi++ = L_add( acc, L_shl( imax_pos_fx( xfp_32 ) /* Q15 */, 1 ) ); // Q16
                move32();
                currPlocs = *pPlocs++; // Q16
+4 −0
Original line number Diff line number Diff line
@@ -2157,7 +2157,11 @@ ivas_error acelp_core_dec_ivas_fx(
        test();
        IF( !st->ppp_mode_dec && ( st->idchan == 0 || NE_16( st->element_mode, IVAS_CPE_TD ) || ( EQ_16( st->idchan, 1 ) && EQ_16( st->element_mode, IVAS_CPE_TD ) && st->tdm_LRTD_flag ) ) )
        {
#ifdef FIX_ISSUE_1237
            Copy_Scale_sig_16_32_no_sat( st->hBWE_TD->old_bwe_exc_extended_fx, bwe_exc_extended_fx, NL_BUFF_OFFSET, ( sub( shl( st->Q_exc, 1 ), sub( st->prev_Q_bwe_exc, 16 ) ) ) ); // prev_Q_bwe_exc
#else
            Copy_Scale_sig_16_32_DEPREC( st->hBWE_TD->old_bwe_exc_extended_fx, bwe_exc_extended_fx, NL_BUFF_OFFSET, ( sub( shl( st->Q_exc, 1 ), sub( st->prev_Q_bwe_exc, 16 ) ) ) ); // prev_Q_bwe_exc
#endif
            non_linearity_ivas_fx( bwe_exc_fx, bwe_exc_extended_fx + NL_BUFF_OFFSET, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale_fx, st->Q_exc, st->coder_type, voice_factors_fx, st->L_frame );
            Copy_Scale_sig_32_16( bwe_exc_extended_fx + L_FRAME32k, st->hBWE_TD->old_bwe_exc_extended_fx, NL_BUFF_OFFSET, negate( sub( shl( st->Q_exc, 1 ), sub( st->prev_Q_bwe_exc, 16 ) ) ) ); // prev_Q_bwe_exc
        }
+1 −0
Original line number Diff line number Diff line
@@ -674,6 +674,7 @@ void generate_stereo_masking_noise_fx(

        IF( !fadeOut )
        {

            Copy_Scale_sig_16_32_DEPREC( hStereoCng->olapBufferSynth22_fx, hStereoCng->olapBufferSynth22_32fx, hFdCngCom->fftlen, sub( Q15, st->Q_syn ) ); /*Q15*/

            generate_masking_noise_ivas_fx( N1_fx, &N1_fx_exp, hFdCngCom, hFdCngCom->frameSize, 0, 1, 0, st->element_mode, hStereoCng, nchan_out ); // N1_fx Q6
Loading