Commit 6ffa5d7e authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'main-pc' into 1604_basop_port_fl1391

parents 26225ecf ca9e88df
Loading
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -110,16 +110,25 @@

#endif

#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 */
#define FIX_983_DISC_ISM_DIGEST_NUM_OBJS                /* FhG: issue #983: the discrete ISM digest function uses the wrong number of objects */

#define NONBE_FIX_974_OSBA_JBM_MONO_RS_USAN             /* FhG : issue #974: usan in mono and stereo output in OSBA JBM RS */
#define NONBE_FIX_982_OMASA_DELAY_COMP_5MS              /* FhG : issue #982 : 5ms and 20ms output different for OMASA */
#define FIX_ACCESS_WITHIN_NULL_STRUCT_MC_BW_SWITCHING   /* FhG: fix usan error in MCT with bw swicthing */
#define NONBE_FIX_986_MC_BW_SWITCHING                   /* FhG: fix crash in bw and br switching with MC */
#define NONBE_FIX_975_JBM_USAN                          /* FhG: Fix issue #975, USAN in JBM decoding ad 13.2kbps */

#define NONBE_FIX_947_STEREO_DMX_EVS_POC                      /* Orange: Fix clicks on POC */
#ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC
#define NONBE_FIX_947_STEREO_DMX_ROMOPT                       /* Orange: ROM optimisation for POC*/  
#endif
#define NONBE_FIX_947_STEREO_DMX_EVS_PHA                      /* Orange: Fix issues on PHA */
#ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA
#define NONBE_FIX_947_STEREO_DMX_FADOPT                       /* Orange: Fading optimisation */  
#endif     

/* #################### End BASOP porting switches ############################ */

#endif
+23 −0
Original line number Diff line number Diff line
@@ -1140,6 +1140,28 @@ Word16 set_bw_mct_fx(

    bw_changed = 0;
    move16();
#ifdef NONBE_FIX_986_MC_BW_SWITCHING
    IF( NE_16( mct_bwidth, last_mct_bwidth ) )
    {
        bw_changed = 1;
        move16();
    }

    /*
     * always set bw for all CPEs even if it is the same value as before,
     * in case of bw + br switching when changing to MCT, this overwrites
     * potentially incorrect initial values
     */
    FOR( cpe_id = 0; cpe_id < nCPE; cpe_id++ )
    {
        FOR( ch = 0; ch < CPE_CHANNELS; ch++ )
        {
            st = hCPE[cpe_id]->hCoreCoder[ch];
            st->bwidth = mct_bwidth;
            move16();
        }
    }
#else
    IF( NE_16( mct_bwidth, last_mct_bwidth ) )
    {
        bw_changed = 1;
@@ -1155,5 +1177,6 @@ Word16 set_bw_mct_fx(
            }
        }
    }
#endif
    return bw_changed;
}
+12 −0
Original line number Diff line number Diff line
@@ -1019,7 +1019,19 @@ ivas_error ivas_cpe_enc_fx(
        IF( ( NE_32( hCPE->last_element_brate, hCPE->element_brate ) || NE_16( hCPE->element_mode, hCPE->last_element_mode ) || ( EQ_16( hCPE->element_mode, IVAS_CPE_TD ) && NE_16( sts[0]->bits_frame_nominal, last_bits_frame_nominal ) ) || NE_16( sts[n]->last_bwidth, sts[n]->bwidth ) ) && ( n == 0 || EQ_16( hCPE->element_mode, IVAS_CPE_MDCT ) ) )
        {
            Word16 igf;
#ifdef NONBE_FIX_986_MC_BW_SWITCHING
            Word16 bw;

            /* float uses ternary operator for this: bw = ( hCPE->element_mode == IVAS_CPE_MDCT ) ? sts[n]->bwidth : sts[n]->max_bwidth; */
            bw = sts[n]->max_bwidth;
            IF( EQ_16( hCPE->element_mode, IVAS_CPE_MDCT ) )
            {
                bw = sts[n]->bwidth;
            }
            igf = getIgfPresent_fx( sts[n]->element_mode, L_mult0( sts[n]->bits_frame_nominal, FRAMES_PER_SEC ), bw, sts[n]->rf_mode ); /* Q0 */
#else
            igf = getIgfPresent_fx( sts[n]->element_mode, L_mult0( sts[n]->bits_frame_nominal, FRAMES_PER_SEC ), sts[n]->max_bwidth, sts[n]->rf_mode ); /* Q0 */
#endif
            IF( ( error = IGF_Reconfig_fx( &sts[n]->hIGFEnc, igf, 0, L_mult0( sts[n]->bits_frame_nominal, FRAMES_PER_SEC ), sts[n]->max_bwidth, sts[n]->element_mode, sts[n]->rf_mode ) ) != IVAS_ERR_OK )
            {
                return error;
+21 −0
Original line number Diff line number Diff line
@@ -183,7 +183,9 @@ ivas_error ivas_mct_enc_fx(
    Word32 orig_spectrum_long_fx[MCT_MAX_BLOCKS][CPE_CHANNELS][L_FRAME48k];
    Word16 switch_bw;
    IVAS_FORMAT ivas_format;
#ifndef NONBE_FIX_986_MC_BW_SWITCHING
    Word16 max_bwidth;
#endif
    Word32 ivas_total_brate;
    ivas_error error;
    Word32 *pdata_fx[MAX_INPUT_CHANNELS];
@@ -198,7 +200,9 @@ ivas_error ivas_mct_enc_fx(
    hMCT->hBstr = st_ivas->hCPE[0]->hCoreCoder[0]->hBstr; /* pointer to write MCT side bits */

    ivas_format = st_ivas->hEncoderConfig->ivas_format;
#ifndef NONBE_FIX_986_MC_BW_SWITCHING
    max_bwidth = st_ivas->hEncoderConfig->max_bwidth;
#endif
    ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate;
    move32();
    move16();
@@ -248,6 +252,22 @@ ivas_error ivas_mct_enc_fx(
            cp_bitrate = L_shl( L_deposit_l( div_l( ivas_total_brate, st_ivas->nchan_transport ) ), 2 ); // a/b => div_l(a, b/2) or (2 * div_l(a, b))
        }

#ifdef NONBE_FIX_986_MC_BW_SWITCHING
        IF( st_ivas->hCPE[0]->hCoreCoder[0]->igf )
        {
            FOR( n = 0; n < shr( hMCT->nchan_out_woLFE, 1 ); n++ )
            {
                initMdctStereoEncData_fx( hMCT->hBlockData[n]->hStereoMdct, ivas_format, IVAS_CPE_MDCT, cp_bitrate, st_ivas->hCPE[0]->hCoreCoder[0]->bwidth, st_ivas->hCPE[0]->hCoreCoder[0]->igf, st_ivas->hCPE[0]->hCoreCoder[0]->hIGFEnc->igfData.igfInfo.grid, 0 );
            }
        }
        ELSE
        {
            FOR( n = 0; n < shr( hMCT->nchan_out_woLFE, 1 ); n++ )
            {
                initMdctStereoEncData_fx( hMCT->hBlockData[n]->hStereoMdct, ivas_format, IVAS_CPE_MDCT, cp_bitrate, st_ivas->hCPE[0]->hCoreCoder[0]->bwidth, st_ivas->hCPE[0]->hCoreCoder[0]->igf, NULL, 0 );
            }
        }
#else
        IF( st_ivas->hCPE[0]->hCoreCoder[0]->igf )
        {
            FOR( n = 0; n < shr( hMCT->nchan_out_woLFE, 1 ); n++ )
@@ -262,6 +282,7 @@ ivas_error ivas_mct_enc_fx(
                initMdctStereoEncData_fx( hMCT->hBlockData[n]->hStereoMdct, ivas_format, IVAS_CPE_MDCT, cp_bitrate, max_bwidth, st_ivas->hCPE[0]->hCoreCoder[0]->igf, NULL, 0 );
            }
        }
#endif
    }

    /* set coded audio band-width */
+6 −0
Original line number Diff line number Diff line
@@ -112,9 +112,15 @@ extern const UWord16 ECSQ_tab_vals[ECSQ_PARAM_COUNT - 1][1 + ECSQ_TAB_VALS_SIZE]
 * Stereo downmix to EVS ROM tables
 *----------------------------------------------------------------------------------*/
#ifdef NONBE_FIX_947_STEREO_DMX_EVS_POC
#ifdef NONBE_FIX_947_STEREO_DMX_ROMOPT
extern const Word32 Stereo_dmx_s_wnd_coef_16k_fx[L_FRAME16k >> 2];
extern const Word32 Stereo_dmx_s_wnd_coef_32k_fx[L_FRAME32k >> 2];
extern const Word32 Stereo_dmx_s_wnd_coef_48k_fx[L_FRAME48k >> 2];
#else
extern const Word32 Stereo_dmx_s_wnd_coef_16k_fx[L_FRAME16k >> 1];
extern const Word32 Stereo_dmx_s_wnd_coef_32k_fx[L_FRAME32k >> 1];
extern const Word32 Stereo_dmx_s_wnd_coef_48k_fx[L_FRAME48k >> 1];
#endif
#else
extern const Word32 Stereo_dmx_s_wnd_coef_16k_fx[L_FRAME16k >> 4];
extern const Word32 Stereo_dmx_s_wnd_coef_32k_fx[L_FRAME32k >> 4];
Loading