Commit b853be0b authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Add switches

parent 1db0efae
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -86,6 +86,8 @@
#define FIX_2166_ASSERT_OSBA_PLC_STEREO_OUT                  /* FhG: fix for issue 2166 - add missing averaging factor 0.5 in for the sum of energies in function stereo_dft_dmx_swb_nrg_fx()*/

#define FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE                /* FhG: Use dynamic Q factor for synth_fx and synthFB_fx to prevent overflow */
#define FIX_2174_JBM_BASOP_ALIGNMENT                         /* VoiceAge, Nokia: Fixes to JBM BASOP implementation and alignment to float */

/* ################### End FIXES switches ########################### */

/* #################### Start BASOP porting switches ############################ */
+12 −1
Original line number Diff line number Diff line
@@ -2549,7 +2549,11 @@ ivas_error ivas_jbm_dec_flush_renderer_fx(
        {
            /* move it at the beginning of the TC buffer with zero padding */
            Copy32( hTcBuffer->tc_buffer_old_fx[ch_idx], hTcBuffer->tc_fx[ch_idx], n_samples_to_render );
#ifdef FIX_2174_JBM_BASOP_ALIGNMENT
            set_zero_fx( hTcBuffer->tc_fx[ch_idx] + n_samples_to_render, sub( hTcBuffer->n_samples_granularity, n_samples_to_render ) );
#else
            set_zero_fx( hTcBuffer->tc_fx[ch_idx] + n_samples_to_render, hTcBuffer->n_samples_granularity - n_samples_to_render );
#endif
        }
#else
        /* render what is still there with zero padding */
@@ -3369,7 +3373,11 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate_fx(
        move16();
    }

#ifdef FIX_2174_JBM_BASOP_ALIGNMENT
    nsamp_to_allocate = imult1616( s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ), n_samp_full );
#else
    nsamp_to_allocate = s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ) * n_samp_full;
#endif

    IF( Opt_tsm )
    {
@@ -3382,7 +3390,11 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate_fx(

        offset = 0;
        move16();
#ifdef FIX_2174_JBM_BASOP_ALIGNMENT
        FOR( ch_idx = 0; ch_idx < s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ )
#else
        FOR( ch_idx = 0; ch_idx < max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ )
#endif
        {
            hTcBuffer->tc_fx[ch_idx] = &hTcBuffer->tc_buffer_fx[offset];
            offset = add( offset, n_samp_full );
@@ -3462,7 +3474,6 @@ static void ivas_jbm_dec_tc_audio_deallocate_fx(

    return;
}

#endif

/*--------------------------------------------------------------------------*
+1 −1
Original line number Diff line number Diff line
@@ -1217,7 +1217,7 @@ ivas_error IVAS_DEC_GetSamplesRenderer(
        hIvasDec->hasBeenFedFrame = false;

        /* check for possible flushed samples from a rate switch */
#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP
#ifdef FIX_2174_JBM_BASOP_ALIGNMENT
        IF( GT_16( hIvasDec->nSamplesFlushed, 0 ) )
#else
        IF( GE_16( hIvasDec->nSamplesFlushed, 0 ) )