Commit 142040d7 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

Merge branch '1587_basop_port_fl1318' into 'main-pc'

[non-BE] [allow-regression] Port Float MR !1318 to BASOP main-pc

See merge request !1589
parents 2204d825 9e9fc097
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -4999,13 +4999,9 @@ void generate_masking_noise_lb_dirac_fx(
    HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */
    Word32 *tdBuffer,            /* i/o: time-domain signal, if NULL no LB-CNA                 */
    const Word16 nCldfbTs,       /* i  : number of CLDFB slots that will be rendered           */
    const Word16 cna_flag        /* i  : CNA flag for LB and HB                                */
);

void generate_masking_noise_lb_dirac_fx(
    HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */
    Word32 *tdBuffer,            /* i/o: time-domain signal, if NULL no LB-CNA                 */
    const Word16 nCldfbTs,       /* i  : number of CLDFB slots that will be rendered           */
#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING
    SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom,       /* i  : common spatial rendering parameters handle            */
#endif
    const Word16 cna_flag        /* i  : CNA flag for LB and HB                                */
);

+1 −0
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@

#define NONBE_FIX_947_STEREO_DMX_EVS_POC                /* Orange: Fix clicks on POC */  
#define NONBE_FIX_947_STEREO_DMX_EVS_PHA                /* Orange: Fix issues on PHA */      
#define NONBE_FIX_951_MCMASA_5MS_RENDERING              /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps to BINAURAL */
#define NONBE_FIX_979_OSBA_STEREO_5MS                   /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */

/* #################### End BASOP porting switches ############################ */
+36 −2
Original line number Diff line number Diff line
@@ -5447,6 +5447,9 @@ void generate_masking_noise_lb_dirac_fx(
    HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */
    Word32 *tdBuffer,            /* i/o: time-domain signal, if NULL no LB-CNA                 Q11*/
    const Word16 nCldfbTs,       /* i  : number of CLDFB slots that will be rendered           Q0*/
#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING
    SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i  : common spatial rendering parameters handle            */
#endif
    const Word16 cna_flag /* i  : CNA flag for LB and HB                                Q0*/
)
{
@@ -5465,7 +5468,7 @@ void generate_masking_noise_lb_dirac_fx(
    /* Init */
    scale = 0;
    move32();
    n_samples_out = i_mult( shr( hFdCngCom->frameSize, 4 ), nCldfbTs );
    n_samples_out = i_mult( shr( hFdCngCom->frameSize, 4 /* DEFAULT_JBM_CLDFB_TIMESLOTS */ ), nCldfbTs );
    n_samples_start = 0;
    move16();
    Word16 exp_out = Q11;
@@ -5498,6 +5501,13 @@ void generate_masking_noise_lb_dirac_fx(
    test();
    IF( cna_flag && tdBuffer != NULL )
    {
#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING
        Word16 cur_subframe;
        Word16 cur_subframe_start_outfs;
        Word16 cur_subframe_start_cngfs;
        Word16 slot_size_cng;
#endif

        WHILE( n_samples_out > 0 )
        {
            n_samples_out_loop = s_min( hFdCngCom->frameSize, n_samples_out );
@@ -5569,6 +5579,30 @@ void generate_masking_noise_lb_dirac_fx(
            n_samples_out = sub( n_samples_out, hFdCngCom->frameSize );
            n_samples_start = add( n_samples_start, hFdCngCom->frameSize );
        }

#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING
        /* move generated noise to the 5ms subframe starts in the tc buffer according to the output sampling frequency to avoid
           overwriting it with the synthesis in case of shared tc and synth channel memory, i.e. non-TSM mode */
        slot_size_cng = shr( hFdCngCom->frameSize, 4 /* DEFAULT_JBM_CLDFB_TIMESLOTS */ );
        /* move start indices forward to the end of the last subframe */
        cur_subframe_start_outfs = mult( nCldfbTs, hSpatParamRendCom->slot_size );
        cur_subframe_start_cngfs = mult( nCldfbTs, slot_size_cng );

        /* go from the last subframe back and move the LB noise */
        FOR( cur_subframe = sub( hSpatParamRendCom->nb_subframes, 1 ); cur_subframe >= 0; cur_subframe-- )
        {
            Word16 move_size, subframe_size_outfs;
            move_size = mult( slot_size_cng, hSpatParamRendCom->subframe_nbslots[cur_subframe] );
            subframe_size_outfs = mult( hSpatParamRendCom->subframe_nbslots[cur_subframe], hSpatParamRendCom->slot_size );
            cur_subframe_start_outfs = sub( cur_subframe_start_outfs, mult( hSpatParamRendCom->subframe_nbslots[cur_subframe], hSpatParamRendCom->slot_size ) );
            cur_subframe_start_cngfs = sub( cur_subframe_start_cngfs, mult( hSpatParamRendCom->subframe_nbslots[cur_subframe], slot_size_cng ) );
            /* move cna */
            Copy32( tdBuffer + cur_subframe_start_cngfs, tdBuffer + cur_subframe_start_outfs, move_size );

            /* set everything else to zero */
            set_zero_fx( tdBuffer + cur_subframe_start_outfs + move_size, sub( subframe_size_outfs, move_size ) );
        }
#endif
    }

    pop_wmops();
+8 −0
Original line number Diff line number Diff line
@@ -2871,10 +2871,18 @@ void ivas_dirac_dec_render_sf_fx(
            test();
            generate_masking_noise_dirac_ivas_fx( st->hFdCngDec->hFdCngCom,
                                                  st_ivas->cldfbAnaDec[1],
#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING
                                                  &st_ivas->hTcBuffer->tc_fx[1][hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->slots_rendered],
#else
                                                  st_ivas->hTcBuffer->tc_fx[1],
#endif
                                                  Cldfb_RealBuffer_fx[1][0],
                                                  Cldfb_ImagBuffer_fx[1][0],
#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING
                                                  slot_idx,
#else
                                                  index_slot,
#endif
                                                  st->cna_dirac_flag && st->flag_cna,
                                                  ( ( ( st->core_brate == FRAME_NO_DATA ) || EQ_32( st->core_brate, SID_2k40 ) ) ) && EQ_16( st->cng_type, FD_CNG ) && st->cng_sba_flag, Q_input, &q_temp_cldfb );
            Scale_sig32( Cldfb_RealBuffer_fx[1][0], CLDFB_NO_CHANNELS_MAX, sub( Q6, q_temp_cldfb ) ); // Q6
+4 −0
Original line number Diff line number Diff line
@@ -894,7 +894,11 @@ void ivas_sba_dec_digest_tc_fx(
        Decoder_State *st = st_ivas->hSCE[0]->hCoreCoder[0];
        Scale_sig( st->hFdCngDec->hFdCngCom->A_cng, M + 1, sub( norm_s( sub( st->hFdCngDec->hFdCngCom->A_cng[0], 1 ) ), 2 ) ); /*Q12 -> Q13*/

#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING
        generate_masking_noise_lb_dirac_fx( st->hFdCngDec->hFdCngCom, st_ivas->hTcBuffer->tc_fx[1], nCldfbSlots, st_ivas->hSpatParamRendCom, st->cna_dirac_flag && st->flag_cna );
#else
        generate_masking_noise_lb_dirac_fx( st->hFdCngDec->hFdCngCom, st_ivas->hTcBuffer->tc_fx[1], nCldfbSlots, st->cna_dirac_flag && st->flag_cna );
#endif
    }

    return;
Loading