Commit 109556e0 authored by vaclav's avatar vaclav
Browse files

Merge branch '735-hp20-filtering-bug-in-sba-osba-bitrate-switching' into 'main'

[non-BE] Resolve "HP20 filtering bug in SBA/OSBA bitrate switching"

See merge request !1013
parents f03f2c70 37c011dd
Loading
Loading
Loading
Loading
Loading

lib_com/options.h

100755 → 100644
+3 −1
Original line number Diff line number Diff line
@@ -181,8 +181,10 @@
#define NONBE_FIX_780_ISM_STARTS_WITH_SID                     /* VA: issue 780: fix Crash in ISM decoding when bitstream starts with an SID and output_config is not EXT */
#define NONBE_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE    /* FhG: fix for cng in ISM DTX on sudden silence periods - JBM addon (issue 552) */
#define NONBE_FIX_738_SBA_BR_SW_ASAN                       /* FhG: issue 738: fixes bug when switching to an MCT bitrate and previous frame was ACELP */
#define NONBE_CR_FIX_735_SBA_HP20_BRATE_SWITCHING       /* VA: Issue 735: Resolve "HP20 filtering bug in SBA/OSBA bitrate switching" */

/* ##################### End NON-BE switches ############################# */

/* ##################### End NON-BE switches ########################### */

/* ################## End DEVELOPMENT switches ######################### */

+21 −3
Original line number Diff line number Diff line
@@ -127,6 +127,23 @@ ivas_error ivas_enc(
    dbgwrite( data_f[LFE_CHANNEL], sizeof( float ), n_samples_chan, 1, "./res/lfe_input" );
#endif

#ifdef NONBE_CR_FIX_735_SBA_HP20_BRATE_SWITCHING
    if ( ivas_format == SBA_FORMAT )
    {
        if ( ( error = ivas_sba_enc_reconfigure( st_ivas ) ) != IVAS_ERR_OK )
        {
            return error;
        }
    }
    else if ( ivas_format == SBA_ISM_FORMAT )
    {
        if ( ( error = ivas_osba_enc_reconfig( st_ivas ) ) != IVAS_ERR_OK )
        {
            return error;
        }
    }
#endif

    /*----------------------------------------------------------------*
     * HP filtering
     *----------------------------------------------------------------*/
@@ -203,11 +220,12 @@ ivas_error ivas_enc(
        /* SBA/MASA configuration */
        if ( ivas_format == SBA_FORMAT )
        {
#ifndef NONBE_CR_FIX_735_SBA_HP20_BRATE_SWITCHING
            if ( ( error = ivas_sba_enc_reconfigure( st_ivas ) ) != IVAS_ERR_OK )
            {
                return error;
            }

#endif
            st = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0];

            /* Write SBA planar flag */
@@ -368,9 +386,9 @@ ivas_error ivas_enc(
    }
    else if ( ivas_format == SBA_ISM_FORMAT )
    {

#ifndef NONBE_CR_FIX_735_SBA_HP20_BRATE_SWITCHING
        ivas_osba_enc_reconfig( st_ivas );

#endif
        /* Analyze objects and determine needed audio signals */
        ivas_osba_enc( st_ivas->hOSba, st_ivas->hIsmMetaData, data_f, input_frame, hEncoderConfig->nchan_ism, st_ivas->ism_mode, st_ivas->sba_analysis_order,
                       hEncoderConfig->input_Fs );