Commit 19f56b04 authored by vaclav's avatar vaclav
Browse files

accept CODE_IMPROVEMENTS, NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS,...

accept CODE_IMPROVEMENTS, NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS, NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING, NONBE_1360_LFE_DELAY
parent b514ac6d
Loading
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -68,9 +68,7 @@
#define IVAS_MAX16B_FLT 32767.0f
#define IVAS_MIN16B_FLT ( -32768.0f )

#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
#define OMASA_TDREND_MATCHING_GAIN_DB ( -2.0f )
#endif

#if !defined( DEBUGGING ) && !defined( WMOPS )
static
@@ -1164,29 +1162,21 @@ int main(
        }
    }

#ifndef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
    /* Set the total number of objects */
#endif
    if ( args.inConfig.numAudioObjects > 0 )
    {
#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
        /* Set the total number of objects */
#endif
        if ( ( error = IVAS_REND_SetTotalNumberOfObjects( hIvasRend, args.inConfig.numAudioObjects ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in IVAS_REND_SetTotalNumberOfObjects(): %s\n", ivas_error_to_string( error ) );
            goto cleanup;
        }

#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
        /* Set the metadata delay for objects */
#endif
        if ( ( error = IVAS_REND_SetIsmMetadataDelay( hIvasRend, args.syncMdDelay ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in IVAS_REND_SetIsmMetadataDelay(): %s\n", ivas_error_to_string( error ) );
            goto cleanup;
        }
#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS

        /* For OMASA input and BINAURAL output, apply a gain to objects to match the loudness with MASA part */
        if ( args.inConfig.numMasaBuses > 0 && args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL )
@@ -1196,7 +1186,6 @@ int main(
                args.inConfig.audioObjects[i].gain_dB += OMASA_TDREND_MATCHING_GAIN_DB;
            }
        }
#endif
    }

    IVAS_REND_LfePanMtx lfePanMatrix;
+0 −4
Original line number Diff line number Diff line
@@ -163,7 +163,6 @@

/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define TMP_FIX_1119_SPLIT_RENDERING_VOIP               /* FhG: Add error check for unsupported config: split rendering with VoIP mode */
#define CODE_IMPROVEMENTS                               /* FhG: Small code improvements that do not change the functionality */

/* #################### End BE switches ################################## */

@@ -174,9 +173,6 @@

#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 */ 
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Nokia: issue 1339: Apply scaling to the object-part of OMASA for binaural rendering in IVAS_rend. */
#define NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING         /* Nokia: Fix OMASA to MASA1 rendering in IVAS_rend */
#define NONBE_1360_LFE_DELAY                           /* Dlb: LFE delay alignment when rendering in CLDFB domain*/
#define	NONBE_SVD_OPTIMIZATION

/* ##################### End NON-BE switches ########################### */
+0 −16
Original line number Diff line number Diff line
@@ -1742,27 +1742,11 @@ double anint(
int16_t is_numeric_float(
    float x )
{
#ifdef CODE_IMPROVEMENTS
    int16_t retval;
#define WMC_TOOL_SKIP
    retval = (int16_t) ( !isnan( x ) && !isinf( x ) );
#undef WMC_TOOL_SKIP
    return retval;
#else
#ifndef BASOP_NOGLOB
    union float_int
#else  /* BASOP_NOGLOB */
    union float_int
#endif /* BASOP_NOGLOB */
    {
        float float_val;
        int32_t int_val;
    } float_int;

    float_int.float_val = x;

    return ( ( float_int.int_val & 0x7f800000 ) != 0x7f800000 );
#endif
}

/*-------------------------------------------------------------------*
+1 −4
Original line number Diff line number Diff line
@@ -2305,7 +2305,6 @@ ivas_error ivas_init_decoder(

    if ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX )
    {
#ifdef NONBE_1360_LFE_DELAY
        if ( st_ivas->hIntSetup.index_lfe[0] != -1 )
        {
            delay_ns = st_ivas->binaural_latency_ns;
@@ -2314,9 +2313,7 @@ ivas_error ivas_init_decoder(
        {
            delay_ns = 0;
        }
#else
        int32_t delay_ns = st_ivas->binaural_latency_ns;
#endif

        if ( st_ivas->hBinRenderer != NULL )
        {
            if ( st_ivas->hBinRenderer->render_lfe )
+0 −27
Original line number Diff line number Diff line
@@ -380,11 +380,7 @@ ivas_error ivas_create_lfe_dec(
    LFE_DEC_HANDLE hLFE;
    float lfe_addl_delay_s;
    int16_t i, j;
#ifndef NONBE_1360_LFE_DELAY
    int16_t add_delay_sa;
#else
    float lfe_block_delay_s;
#endif

    low_pass_delay_dec_out = 0;
    block_offset_s = 0;
@@ -422,11 +418,7 @@ ivas_error ivas_create_lfe_dec(
    hLFE->cum_freq_models[1][3] = &ivas_str_lfe_freq_models.entropy_coder_model_coarse_sg4;

    /* delay calculation */
#ifndef NONBE_1360_LFE_DELAY
    hLFE->lfe_block_delay_s = ( IVAS_LFE_FADE_NS / 1000000000.f ) + ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3];
#else
    lfe_block_delay_s = ( IVAS_LFE_FADE_NS / 1000000000.f ) + ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3];
#endif

    block_offset_s = BLOCK_OFFSET_MS * 0.001f;
    filt_order = 0;
@@ -434,40 +426,21 @@ ivas_error ivas_create_lfe_dec(
    if ( ( delay_ns / 1000000000.f ) > ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3] )
    {
        filt_order = 4;
#ifdef NONBE_1360_LFE_DELAY
        low_pass_delay_dec_out = ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3];
#else
        low_pass_delay_dec_out = ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3] * 1000000000.f;
#endif
        ivas_create_lfe_lpf_dec( &( hLFE->filter_state ), output_Fs );
    }

    hLFE->filter_state.order = filt_order;
#ifndef NONBE_1360_LFE_DELAY
    hLFE->lfe_block_delay_s = hLFE->lfe_block_delay_s + low_pass_delay_dec_out;
#else
    lfe_block_delay_s = lfe_block_delay_s + low_pass_delay_dec_out;
#endif
    hLFE->lfe_prior_buf_len = NS2SA( output_Fs, IVAS_LFE_FADE_NS );

    hLFE->bfi_count = 0;
#ifdef NONBE_1360_LFE_DELAY
    block_offset_s += delay_ns / 1000000000.f;
    lfe_addl_delay_s = block_offset_s - lfe_block_delay_s;
#else
    lfe_addl_delay_s = block_offset_s - hLFE->lfe_block_delay_s;
#endif

    lfe_addl_delay_s = max( 0.0f, lfe_addl_delay_s );
#ifndef NONBE_1360_LFE_DELAY
    add_delay_sa = (int16_t) roundf( (float) delay_ns * output_Fs / 1000000000.f );
    hLFE->lfe_addl_delay = (int16_t) ( lfe_addl_delay_s * output_Fs ) + add_delay_sa;
    hLFE->lfe_block_delay_s += lfe_addl_delay_s + add_delay_sa / output_Fs;
    hLFE->lfe_block_delay_s += lfe_addl_delay_s;
#else
    hLFE->lfe_addl_delay = (int16_t) ( lfe_addl_delay_s * output_Fs );
    hLFE->delay_ns = delay_ns;
#endif

    if ( hLFE->lfe_addl_delay > 0 )
    {
Loading