Commit 641691d7 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

Merge remote-tracking branch 'origin/main' into 1680_basop_port_object_editing_implementation

parents 2ddaef28 b0129198
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1342,7 +1342,15 @@ int main(
        masaIds[i] = 0u;
    }
#ifdef NONBE_1377_REND_DIRATT_CONF
#ifdef FIX_1377_HANDLE_ERROR_CODE
    if ( ( error = IVAS_REND_SetObjectIDs( hIvasRend ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nIVAS_REND_SetObjectIDs: %s\n", ivas_error_to_string( error ) );
        goto cleanup;
    }
#else
    IVAS_REND_SetObjectIDs( hIvasRend );
#endif
#endif

    for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i )
+4 −0
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@
#define FIX_2602_NONBE_SAT_IN_SWB_TBE_SCALE                  /* Dolby/FhG: fix for issue 2026: Saturation in SWB TBE re-scaling function preventing StereoDownmix complexity job to complete */
#define FIX_2021_BANDWIDTH_EXTENSION_PROBLEM                 /* FhG: increase cldfb buffer precision*/

#define FIX_2083_FLOATING_POINT_LEFTOVERS                    /* FhG: convert floating-point leftovers in makeCustomLsSetup()*/
#define FIX_2085_FLOATING_POINT_LEFTOVERS                    /* FhG: convert floating-point leftovers in ivas_dirac_config_fx() */
/* #################### Start BASOP porting switches ############################ */

@@ -136,6 +137,7 @@
#define FIX_HRTF_LOAD                                   /* VA: issue 1187: fix memory issue when HRTFs are loaded from a binary file */
#endif
#define NONBE_1377_REND_DIRATT_CONF                     /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */
#define FIX_1377_HANDLE_ERROR_CODE                      /* Eri: Add missing error code handling from IVAS_REND_SetObjectIDs */
#define FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK       /* Eri: Issue 1999: Range check on float values of distance attenuation, while the float values are not propagated to this function. The test is not correct, but configurable distance attenuation is not used in Characterization.*/
#define ADJUST_MCT_CHANNELS_MAX                         /* FhG: set correct max mct channels constant*/
#define FIX_1053_REVERB_RECONFIGURATION
@@ -153,6 +155,8 @@
#define FIX_1349_TNS_CRASH                              /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */
#define NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING           /* Ericsson: issue 1180, corrected long term mute loop attnuation after 200ms  in PhECU-PLC  */
#define FIX_1179_USAN_PHASEECU                          /* Eri: issue 1179:  better handling of 16 bit wrap around for very long(>200ms) FER-bursts   */
#define NONBE_1200_ISM_JBM_BRATE_SW_FLUSH               /* VA: issue 1200: fix bug in renderer flush in ISM JBM bitrate switching */
#define FIX_1384_MSAN_stereo_tcx_core_enc               /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */

// object-editing feature porting
#define OBJ_EDITING_API                                 /* object editing changes related to the API */
+36 −10
Original line number Diff line number Diff line
@@ -149,7 +149,9 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx(
        ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->hDecoderConfig->output_config );
    }

#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH
    {
#endif
        test();
        test();
        /* transfer subframe info from DirAC or ParamMC to central tc buffer */
@@ -171,25 +173,40 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx(
                render what still fits in the new granularity */
        tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs );

        IF( LT_16( tc_granularity_new, st_ivas->hTcBuffer->n_samples_granularity ) ){
        IF( LT_16( tc_granularity_new, st_ivas->hTcBuffer->n_samples_granularity ) )
        {
#ifdef FIX_HRTF_LOAD
            /* flush already done in IVAS_DEC_ReadFormat() */
#else
            IF( NE_32( ( error = ivas_jbm_dec_flush_renderer_fx( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &hIntSetupOld, MC_MODE_NONE, last_ism_mode, nSamplesRendered, data ) ), IVAS_ERR_OK ) ){
#ifdef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH
        /* write back info for correct rendering of the flushable samples */
        int16_t nchan_transport_ref = st_ivas->nchan_transport;
        st_ivas->nchan_transport = nchan_transport_old;
        move16();

#endif
        IF( NE_32( ( error = ivas_jbm_dec_flush_renderer_fx( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &hIntSetupOld, MC_MODE_NONE, last_ism_mode, nSamplesRendered, data ) ), IVAS_ERR_OK ) )
        {
            return error;
        }
#ifdef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH

        st_ivas->nchan_transport = nchan_transport_ref;
        move16();
#endif
#endif
        }
        /* JBM: when granularity goes up set samples to discard at the beginning of the frame */
        ELSE
        IF( GT_16( tc_granularity_new, st_ivas->hTcBuffer->n_samples_granularity ) )
        ELSE IF( GT_16( tc_granularity_new, st_ivas->hTcBuffer->n_samples_granularity ) )
        {
            IF( NE_32( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ), IVAS_ERR_OK ) )
            {
                return error;
            }
        }
#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH
    }
#endif

    IF( NE_16( st_ivas->ism_mode, last_ism_mode ) )
    {
@@ -358,19 +375,26 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx(
     * floating-point output audio buffers
     *-----------------------------------------------------------------*/

#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH
    {
#endif
        nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 );

        IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) )
        {
            return error;
        }
#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH
    }
#endif

    /*-----------------------------------------------------------------*
     * JBM TC buffers
     *-----------------------------------------------------------------*/

#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH
    {
#endif
        Word16 tc_nchan_full_new;
        DECODER_TC_BUFFER_HANDLE hTcBuffer;

@@ -419,7 +443,9 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx(

            Copy( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS );
        }
#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH
    }
#endif

#ifdef FIX_HRTF_LOAD
    return IVAS_ERR_OK;
+35 −5
Original line number Diff line number Diff line
@@ -337,7 +337,7 @@ void stereo_tcx_core_dec_fx(
    }

    /*--------------------------------------------------------------------------------*
     * LPC PARAMETERS
     * LPC envelope decoding
     *--------------------------------------------------------------------------------*/

    st->acelp_cfg.midLpc = 0;
@@ -349,6 +349,10 @@ void stereo_tcx_core_dec_fx(
        {
            Word16 tcx_lpc_cdk;

#ifdef FIX_1384_MSAN_stereo_tcx_core_enc
            tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type );
            move16();
#else
            test();
            test();
            IF( bfi && st->use_partial_copy && EQ_16( st->rf_frame_type, RF_TCXFD ) )
@@ -361,6 +365,7 @@ void stereo_tcx_core_dec_fx(
                tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type ); /* Q0 */
                move16();
            }
#endif

            Copy( st->lsf_old_fx, &lsf_fx[0], M ); /* Q2.56 */
            Copy( st->lsp_old_fx, &lsp_fx[0], M ); /* Q15 */
@@ -485,13 +490,14 @@ void stereo_tcx_core_dec_fx(
        E_LPC_f_lsp_a_conversion( st->lsp_old_fx, st->old_Aq_12_8_fx, M );
    }

#ifndef FIX_1384_MSAN_stereo_tcx_core_enc
    test();
    if ( st->enablePlcWaveadjust && bfi )
    {
        st->hPlcInfo->nbLostCmpt = add( st->hPlcInfo->nbLostCmpt, 1 ); /* Q0 */
        move16();
    }

#endif
    /*--------------------------------------------------------------------------------*
     * TD-TCX concealment
     *--------------------------------------------------------------------------------*/
@@ -630,6 +636,7 @@ void stereo_tcx_core_dec_fx(
    test();
    IF( EQ_16( st->core, TCX_10_CORE ) || EQ_16( st->core, TCX_20_CORE ) )
    {
#ifndef FIX_1384_MSAN_stereo_tcx_core_enc
        test();
        test();
        IF( st->enablePlcWaveadjust ||                 /* bfi      */
@@ -660,7 +667,7 @@ void stereo_tcx_core_dec_fx(
                }
            }
        }

#endif
        IF( !bfi && st->hTonalMDCTConc != NULL )
        {
            TonalMDCTConceal_SaveTimeSignal_ivas_fx( st->hTonalMDCTConc, synthFB_fx, 0, hTcxDec->L_frameTCX );
@@ -828,12 +835,13 @@ void stereo_tcx_core_dec_fx(

    IF( !bfi )
    {
#ifndef FIX_1384_MSAN_stereo_tcx_core_enc
        if ( st->enablePlcWaveadjust )
        {
            st->hPlcInfo->nbLostCmpt = 0;
            move16();
        }

#endif
        IF( param[1 + NOISE_FILL_RANGES] != 0 )
        {
            Word32 tcxltp_pitch_tmp = L_add( L_deposit_h( hTcxLtpDec->tcxltp_pitch_int ), L_shl( L_deposit_l( div_s( hTcxLtpDec->tcxltp_pitch_fr, st->pit_res_max ) ), 1 ) ); /*15Q16*/
@@ -1017,8 +1025,12 @@ static void dec_prm_tcx_ivas_fx(
    getTCXMode_ivas_fx( st, st, 0 /* <- MCT_flag */ );

    /* last_core for error concealment */
#ifdef FIX_1384_MSAN_stereo_tcx_core_enc
    IF( NE_16( st->element_mode, IVAS_CPE_MDCT ) )
#else
    test();
    IF( !st->use_partial_copy && NE_16( st->element_mode, IVAS_CPE_MDCT ) )
#endif
    {
        st->last_core_from_bs = get_next_indice_fx( st, 1 ); /* Store decoder memory of last_core	Q0*/
        move16();
@@ -1063,8 +1075,10 @@ static void dec_prm_tcx_ivas_fx(
        }
    }

#ifndef FIX_1384_MSAN_stereo_tcx_core_enc
    IF( !st->use_partial_copy )
    {
#endif
        IF( NE_16( st->element_mode, IVAS_CPE_MDCT ) )
        {
            getTCXWindowing_ivas_fx( st->core, st->last_core, st->element_mode, st->hTcxCfg, st );
@@ -1077,8 +1091,9 @@ static void dec_prm_tcx_ivas_fx(
            st->dec_glr_idx = -1;
            move16();
        }
#ifndef FIX_1384_MSAN_stereo_tcx_core_enc
    }

#endif

    /*--------------------------------------------------------------------------------*
     * LPC parameters
@@ -1093,6 +1108,20 @@ static void dec_prm_tcx_ivas_fx(
     * TCX20/10 parameters
     *--------------------------------------------------------------------------------*/

#ifdef FIX_1384_MSAN_stereo_tcx_core_enc
    getTCXparam_fx( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 );

    IF( LT_16( sub( *total_nbbits, bitsRead[0] ), sub( st->next_bit_pos, start_bit_pos ) ) )
    {
        st->BER_detect = 1;
        move16();
        st->next_bit_pos = add( start_bit_pos, sub( *total_nbbits, bitsRead[0] ) ); /* Q0 */
        move16();
    }

    bitsRead[0] = sub( st->next_bit_pos, start_bit_pos ); /* Q0 */
    move16();
#else
    IF( st->use_partial_copy == 0 )
    {
        getTCXparam_fx( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 );
@@ -1111,6 +1140,7 @@ static void dec_prm_tcx_ivas_fx(
        bitsRead[0] = sub( st->next_bit_pos, start_bit_pos ); /* Q0 */
        move16();
    }
#endif

    return;
}
+6 −2
Original line number Diff line number Diff line
@@ -3726,8 +3726,12 @@ ivas_error IVAS_DEC_ReadFormat(
            render what still fits in the new granularity */
            Word16 tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs );

#ifdef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH
            st_ivas->nchan_transport = nchan_transport_old;
            move16();
#else
// st_ivas->nchan_transport = nchan_transport_old; // ToDo: temporarily deactivated to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue #1200

#endif
            if ( st_ivas->ivas_format == MASA_FORMAT )
            {
                st_ivas->nchan_ism = 0; // ToDo: temporary hack to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue #1199
Loading