Commit 6a427126 authored by emerit's avatar emerit
Browse files

Merge branch 'main' into 1963_basop_portFltMR-1568-1471-1690

parents 43b671c4 854b4dd7
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -93,7 +93,9 @@
#define FIX_1996_MASKING_NOISE                               /* Dlb: Heavy precision loss in ola buffers causing discontinuity*/
#define FIX1998_APA_EXEC_SCALING                             /* FhG: fix scaling of apa_exec_ivas_fx(); avoid continuously worse scaling with previous data */
#define FIX2007_BASSPSFILTER_OVERFLOW                        /* FhG: use saturing operator, to avoid overflow in bass_psfilter_fx() */
#define FIX_ISSUE_2004_LPC_SHB_SAT                           /* Dolby: Issue 2004: prevent saturation of the LPC SHB filter */

#define FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC                 /* FhG: Corrected the q_input in the input of generate_masking_noise_dirac_ivas_fx() */
/* #################### Start BASOP porting switches ############################ */

#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */
+2 −0
Original line number Diff line number Diff line
@@ -913,7 +913,9 @@ void stereo_tcx_core_dec_fx(
                Word32 signal_out_32_fx[L_FRAME48k];
                Word16 exp;
                Copy_Scale_sig_16_32_no_sat( signal_out_fx, signal_out_32_fx, st->hFdCngDec->hFdCngCom->frameSize, Q6 );
#ifndef FIX_1996_MASKING_NOISE
                Copy_Scale_sig_16_32_no_sat( st->hFdCngDec->hFdCngCom->olapBufferSynth2, st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, shl( st->hFdCngDec->hFdCngCom->frameSize, 1 ), Q15 );
#endif
                generate_masking_noise_ivas_fx( signal_out_32_fx, &exp, st->hFdCngDec->hFdCngCom, st->hFdCngDec->hFdCngCom->frameSize, 0, 0, 0, st->element_mode, hStereoCng, nchan_out );
                Copy_Scale_sig_32_16( signal_out_32_fx, signal_out_fx, st->hFdCngDec->hFdCngCom->frameSize, negate( exp ) );                                                            // Q0
                Copy_Scale_sig_32_16( st->hFdCngDec->hFdCngCom->olapBufferSynth2_fx, st->hFdCngDec->hFdCngCom->olapBufferSynth2, shl( st->hFdCngDec->hFdCngCom->frameSize, 1 ), -Q15 ); // Q0
+33 −15
Original line number Diff line number Diff line
@@ -3161,7 +3161,25 @@ void swb_tbe_enc_ivas_fx(
        enerG = Enr_1_Az_fx( lpc_shb1, 2 * L_SUBFR ); /* Q3 */

        /* if the LP gain is greater than a threshold, avoid saturation */
#ifdef FIX_ISSUE_2004_LPC_SHB_SAT
        Word16 flag_sat = 0;
        Word16 lpc_shb_fx0_req_shift = sub( norm_s( lpc_shb_fx[0] ), 2 );
        IF( GT_16( lpc_shb_fx0_req_shift, 0 ) )
        {
            FOR( i = 1; i <= LPC_SHB_ORDER; i++ )
            {
                IF( LT_16( norm_s( lpc_shb_fx[i] ), lpc_shb_fx0_req_shift ) )
                {
                    flag_sat = 1;
                    break;
                }
            }
        }

        IF( GT_16( enerG, 256 /* 32.0 in Q3 */ ) || flag_sat )
#else
        IF( GT_16( enerG, 256 /*32 Q3*/ ) )
#endif
        {
            set16_fx( lpc_shb_fx, 0, LPC_SHB_ORDER + 1 );
            E_LPC_lev_dur( R_h, R_l, lpc_shb_fx, LepsP, 2, NULL ); /* LPC in Q14 */
+12 −1
Original line number Diff line number Diff line
@@ -818,7 +818,11 @@ static void ivas_dirac_dec_binaural_internal_fx(
                                                          slot,
                                                          st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->hSCE[0]->hCoreCoder[0]->flag_cna,
                                                          ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA || st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->cng_type == FD_CNG ) && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag,
#ifdef FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC
                                                          st_ivas->hTcBuffer->q_tc_fx, &q_cldfb[2][slot] );
#else
                                                          11, &q_cldfb[2][slot] );
#endif

                    generate_masking_noise_dirac_ivas_fx( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom,
                                                          st_ivas->cldfbAnaDec[1], /*nothing will be analyzed, just get cnst*/
@@ -853,11 +857,18 @@ static void ivas_dirac_dec_binaural_internal_fx(
                    {
                        Cldfb_RealBuffer_in_fx[0][slot][b] = Mpy_32_16_1( Cldfb_RealBuffer_in_fx[0][slot][b], 23170 );
                        Cldfb_RealBuffer_in_fx[1][slot][b] = L_add( L_add( Cldfb_RealBuffer_in_fx[0][slot][b], L_shr( Cldfb_RealBuffer_in_fx[1][slot][b], 1 ) ), Cldfb_RealBuffer_in_fx[0][slot][b] );
#ifdef FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC
                        Cldfb_RealBuffer_in_fx[0][slot][b] = L_add( Cldfb_RealBuffer_in_fx[0][slot][b], L_shr( Cldfb_RealBuffer_in_fx[2][slot][b], add( sub( q_cldfb[2][slot], q_input ), 6 ) ) );
#else
                        Cldfb_RealBuffer_in_fx[0][slot][b] = L_add( Cldfb_RealBuffer_in_fx[0][slot][b], L_shr( Cldfb_RealBuffer_in_fx[2][slot][b], 1 ) );

#endif
                        Cldfb_ImagBuffer_in_fx[0][slot][b] = Mpy_32_16_1( Cldfb_ImagBuffer_in_fx[0][slot][b], 23170 );
                        Cldfb_ImagBuffer_in_fx[1][slot][b] = L_add( Cldfb_ImagBuffer_in_fx[0][slot][b], L_shr( Cldfb_ImagBuffer_in_fx[1][slot][b], 1 ) );
#ifdef FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC
                        Cldfb_ImagBuffer_in_fx[0][slot][b] = L_add( Cldfb_ImagBuffer_in_fx[0][slot][b], L_shr( Cldfb_ImagBuffer_in_fx[2][slot][b], add( sub( q_cldfb[2][slot], q_input ), 6 ) ) );
#else
                        Cldfb_ImagBuffer_in_fx[0][slot][b] = L_add( Cldfb_ImagBuffer_in_fx[0][slot][b], L_shr( Cldfb_ImagBuffer_in_fx[2][slot][b], 1 ) );
#endif
                        move32();
                        move32();
                        move32();