Commit 1350c688 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

Merge remote-tracking branch 'origin/ivas-float-update' into...

Merge remote-tracking branch 'origin/ivas-float-update' into 1680_ref_port_object_editing_implementation
parents b4fce766 c841d5d2
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -1250,7 +1250,15 @@ int main(
        masaIds[i] = 0u;
        masaIds[i] = 0u;
    }
    }
#ifdef NONBE_1377_REND_DIRATT_CONF
#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 );
    IVAS_REND_SetObjectIDs( hIvasRend );
#endif
#endif
#endif


    for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i )
    for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i )
+3 −0
Original line number Original line Diff line number Diff line
@@ -189,6 +189,7 @@
#define NONBE_FIX_1220_OMASA_JBM_EXT_USAN               /* Nokia: fix issue 1220 OMASA EXT JBM USAN, also fix similar cases of free to avoid future problems */
#define NONBE_FIX_1220_OMASA_JBM_EXT_USAN               /* Nokia: fix issue 1220 OMASA EXT JBM USAN, also fix similar cases of free to avoid future problems */
#define NONBE_FIX_1376_MDCT_CONCEALMENT                 /* FhG: fix concealment artifact in MDCT Stereo with DTX, in case transition frame gets lost */
#define NONBE_FIX_1376_MDCT_CONCEALMENT                 /* FhG: fix concealment artifact in MDCT Stereo with DTX, in case transition frame gets lost */
#define NONBE_1377_REND_DIRATT_CONF                     /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */
#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_ISSUE_2008_MISSING_CODE_FROM_PORTING        /* FhG: Issue 2008: Code deleted while porting float-main MR !1504 (BASOP issue 1565)*/
#define FIX_ISSUE_2008_MISSING_CODE_FROM_PORTING        /* FhG: Issue 2008: Code deleted while porting float-main MR !1504 (BASOP issue 1565)*/
#define ADJUST_MCT_CHANNELS_MAX                         /* FhG: set correct max mct channels constant*/
#define ADJUST_MCT_CHANNELS_MAX                         /* FhG: set correct max mct channels constant*/
#define FIX_1053_REVERB_RECONFIGURATION
#define FIX_1053_REVERB_RECONFIGURATION
@@ -207,6 +208,8 @@
#define NONBE_1296_TDREND_ITD_OUT_OF_BOUNDS_ACCESS      /* Eri: issue 1296: ITD resampling can occasionally read out of bounds, especially when the requested subframes are short (1.25 ms). Seen for headtracking+JBM. */
#define NONBE_1296_TDREND_ITD_OUT_OF_BOUNDS_ACCESS      /* Eri: issue 1296: ITD resampling can occasionally read out of bounds, especially when the requested subframes are short (1.25 ms). Seen for headtracking+JBM. */
#define FIX_1349_TNS_CRASH                              /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */
#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 NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING           /* Ericsson: issue 1180, corrected long term mute loop attnuation after 200ms  in PhECU-PLC  */ 
#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
// object-editing feature porting
#define OBJ_EDITING_API                                 /* object editing changes related to the API */
#define OBJ_EDITING_API                                 /* object editing changes related to the API */
+4 −0
Original line number Original line Diff line number Diff line
@@ -2155,7 +2155,11 @@ static void hq_phase_ecu(
    }
    }
    else
    else
    {
    {
#ifdef FIX_1179_USAN_PHASEECU
        *time_offs = (int16_t) ( *time_offs + output_frame ); /* cast added for USAN, "+=" avoided as it may creat a truncation from int to int16_t  */
#else
        *time_offs += output_frame;
        *time_offs += output_frame;
#endif
        if ( *time_offs <= 0 )
        if ( *time_offs <= 0 )
        {
        {
            /* detect wrap around  of st->time_offs */
            /* detect wrap around  of st->time_offs */
+27 −4
Original line number Original line Diff line number Diff line
@@ -132,7 +132,9 @@ static ivas_error ivas_ism_bitrate_switching_dec(
        ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->hDecoderConfig->output_config );
        ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->hDecoderConfig->output_config );
    }
    }


#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH
    {
    {
#endif
        /* transfer subframe info from DirAC or ParamMC to central tc buffer */
        /* transfer subframe info from DirAC or ParamMC to central tc buffer */
        /* only do this if we are not having done everything already in the TC decoding part and having only played out from the TC buffer */
        /* only do this if we are not having done everything already in the TC decoding part and having only played out from the TC buffer */
        if ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hSpatParamRendCom != NULL && st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER )
        if ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hSpatParamRendCom != NULL && st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER )
@@ -153,10 +155,19 @@ static ivas_error ivas_ism_bitrate_switching_dec(
#ifdef FIX_HRTF_LOAD
#ifdef FIX_HRTF_LOAD
            /* flush already done in IVAS_DEC_ReadFormat() */
            /* flush already done in IVAS_DEC_ReadFormat() */
#else
#else
#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;

#endif
        if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &hIntSetupOld, MC_MODE_NONE, last_ism_mode, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK )
        if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &hIntSetupOld, MC_MODE_NONE, last_ism_mode, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK )
        {
        {
            return error;
            return error;
        }
        }
#ifdef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH
        st_ivas->nchan_transport = nchan_transport_ref;
#endif
#endif
#endif
        }
        }
        /* JBM: when granularity goes up set samples to discard at the beginning of the frame */
        /* JBM: when granularity goes up set samples to discard at the beginning of the frame */
@@ -167,7 +178,9 @@ static ivas_error ivas_ism_bitrate_switching_dec(
                return error;
                return error;
            }
            }
        }
        }
#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH
    }
    }
#endif


    if ( st_ivas->ism_mode != last_ism_mode )
    if ( st_ivas->ism_mode != last_ism_mode )
    {
    {
@@ -334,19 +347,26 @@ static ivas_error ivas_ism_bitrate_switching_dec(
     * floating-point output audio buffers
     * floating-point output audio buffers
     *-----------------------------------------------------------------*/
     *-----------------------------------------------------------------*/


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


        if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK )
        if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK )
        {
        {
            return error;
            return error;
        }
        }
#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH
    }
    }
#endif


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

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


@@ -382,7 +402,9 @@ static ivas_error ivas_ism_bitrate_switching_dec(


            mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS );
            mvs2s( 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
#ifdef FIX_HRTF_LOAD
    return IVAS_ERR_OK;
    return IVAS_ERR_OK;
@@ -475,6 +497,7 @@ ivas_error ivas_ism_dec_config(
        /* ISM mode switching */
        /* ISM mode switching */
        if ( st_ivas->ism_mode != last_ism_mode )
        if ( st_ivas->ism_mode != last_ism_mode )
        {
        {

#ifdef FIX_HRTF_LOAD
#ifdef FIX_HRTF_LOAD
            if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode ) ) != IVAS_ERR_OK )
            if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode ) ) != IVAS_ERR_OK )
#else
#else
+31 −4
Original line number Original line Diff line number Diff line
@@ -285,7 +285,7 @@ void stereo_tcx_core_dec(
    }
    }


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


    st->acelp_cfg.midLpc = 0;
    st->acelp_cfg.midLpc = 0;
@@ -296,6 +296,9 @@ void stereo_tcx_core_dec(
        {
        {
            int16_t tcx_lpc_cdk;
            int16_t tcx_lpc_cdk;


#ifdef FIX_1384_MSAN_stereo_tcx_core_enc
            tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type );
#else
            if ( bfi && st->use_partial_copy && st->rf_frame_type == RF_TCXFD )
            if ( bfi && st->use_partial_copy && st->rf_frame_type == RF_TCXFD )
            {
            {
                tcx_lpc_cdk = tcxlpc_get_cdk( GENERIC );
                tcx_lpc_cdk = tcxlpc_get_cdk( GENERIC );
@@ -304,6 +307,7 @@ void stereo_tcx_core_dec(
            {
            {
                tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type );
                tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type );
            }
            }
#endif


            mvr2r( st->lsf_old, &lsf[0], M );
            mvr2r( st->lsf_old, &lsf[0], M );
            mvr2r( st->lsp_old, &lsp[0], M );
            mvr2r( st->lsp_old, &lsp[0], M );
@@ -402,11 +406,12 @@ void stereo_tcx_core_dec(
        lsp2a_stab( st->lsp_old, st->old_Aq_12_8, M );
        lsp2a_stab( st->lsp_old, st->old_Aq_12_8, M );
    }
    }


#ifndef FIX_1384_MSAN_stereo_tcx_core_enc
    if ( st->enablePlcWaveadjust && bfi )
    if ( st->enablePlcWaveadjust && bfi )
    {
    {
        st->hPlcInfo->nbLostCmpt++;
        st->hPlcInfo->nbLostCmpt++;
    }
    }

#endif
    /*--------------------------------------------------------------------------------*
    /*--------------------------------------------------------------------------------*
     * TD-TCX concealment
     * TD-TCX concealment
     *--------------------------------------------------------------------------------*/
     *--------------------------------------------------------------------------------*/
@@ -528,6 +533,7 @@ void stereo_tcx_core_dec(


    if ( st->core == TCX_10_CORE || st->core == TCX_20_CORE )
    if ( st->core == TCX_10_CORE || st->core == TCX_20_CORE )
    {
    {
#ifndef FIX_1384_MSAN_stereo_tcx_core_enc
        if ( st->enablePlcWaveadjust ||          /* bfi      */
        if ( st->enablePlcWaveadjust ||          /* bfi      */
             ( st->last_total_brate >= HQ_48k && /* recovery */
             ( st->last_total_brate >= HQ_48k && /* recovery */
               st->last_codec_mode == MODE2 ) )
               st->last_codec_mode == MODE2 ) )
@@ -545,7 +551,7 @@ void stereo_tcx_core_dec(
                }
                }
            }
            }
        }
        }

#endif
        if ( !bfi && st->hTonalMDCTConc != NULL )
        if ( !bfi && st->hTonalMDCTConc != NULL )
        {
        {
            TonalMDCTConceal_SaveTimeSignal( st->hTonalMDCTConc, synthFB, hTcxDec->L_frameTCX );
            TonalMDCTConceal_SaveTimeSignal( st->hTonalMDCTConc, synthFB, hTcxDec->L_frameTCX );
@@ -669,11 +675,12 @@ void stereo_tcx_core_dec(


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

#endif
        if ( param[1 + NOISE_FILL_RANGES] != 0 )
        if ( param[1 + NOISE_FILL_RANGES] != 0 )
        {
        {
            set_f( pitch_buf, hTcxLtpDec->tcxltp_pitch_int + (float) hTcxLtpDec->tcxltp_pitch_fr / (float) st->pit_res_max, NB_SUBFR16k );
            set_f( pitch_buf, hTcxLtpDec->tcxltp_pitch_int + (float) hTcxLtpDec->tcxltp_pitch_fr / (float) st->pit_res_max, NB_SUBFR16k );
@@ -830,7 +837,11 @@ static void dec_prm_tcx(
    getTCXMode( st, st, 0 /* <- MCT_flag */ );
    getTCXMode( st, st, 0 /* <- MCT_flag */ );


    /* last_core for error concealment */
    /* last_core for error concealment */
#ifdef FIX_1384_MSAN_stereo_tcx_core_enc
    if ( st->element_mode != IVAS_CPE_MDCT )
#else
    if ( !st->use_partial_copy && st->element_mode != IVAS_CPE_MDCT )
    if ( !st->use_partial_copy && st->element_mode != IVAS_CPE_MDCT )
#endif
    {
    {
        st->last_core_from_bs = get_next_indice( st, 1 ); /* Store decoder memory of last_core */
        st->last_core_from_bs = get_next_indice( st, 1 ); /* Store decoder memory of last_core */
        if ( st->last_core == ACELP_CORE && st->last_core_from_bs != ACELP_CORE )
        if ( st->last_core == ACELP_CORE && st->last_core_from_bs != ACELP_CORE )
@@ -856,8 +867,10 @@ static void dec_prm_tcx(
        }
        }
    }
    }


#ifndef FIX_1384_MSAN_stereo_tcx_core_enc
    if ( !st->use_partial_copy )
    if ( !st->use_partial_copy )
    {
    {
#endif
        if ( st->element_mode != IVAS_CPE_MDCT )
        if ( st->element_mode != IVAS_CPE_MDCT )
        {
        {
            getTCXWindowing( st->core, st->last_core, st->element_mode, st->hTcxCfg, st );
            getTCXWindowing( st->core, st->last_core, st->element_mode, st->hTcxCfg, st );
@@ -868,7 +881,9 @@ static void dec_prm_tcx(
        {
        {
            st->dec_glr_idx = -1;
            st->dec_glr_idx = -1;
        }
        }
#ifndef FIX_1384_MSAN_stereo_tcx_core_enc
    }
    }
#endif


#ifdef DEBUG_MODE_TCX
#ifdef DEBUG_MODE_TCX
    fprintf( pF, "\t TCX Header: %d bits: %d %d %d %d\n", st->next_bit_pos - start_bit_pos, st->tcxonly, st->core, st->tcxonly ? st->clas_dec : st->hTcxCfg->coder_type, st->hTcxCfg->tcx_curr_overlap_mode );
    fprintf( pF, "\t TCX Header: %d bits: %d %d %d %d\n", st->next_bit_pos - start_bit_pos, st->tcxonly, st->core, st->tcxonly ? st->clas_dec : st->hTcxCfg->coder_type, st->hTcxCfg->tcx_curr_overlap_mode );
@@ -891,6 +906,17 @@ static void dec_prm_tcx(
     * TCX20/10 parameters
     * TCX20/10 parameters
     *--------------------------------------------------------------------------------*/
     *--------------------------------------------------------------------------------*/


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

    if ( *total_nbbits - bitsRead[0] < ( st->next_bit_pos - start_bit_pos ) )
    {
        st->BER_detect = 1;
        st->next_bit_pos = start_bit_pos + *total_nbbits - bitsRead[0];
    }

    bitsRead[0] = st->next_bit_pos - start_bit_pos;
#else
    if ( st->use_partial_copy == 0 )
    if ( st->use_partial_copy == 0 )
    {
    {
        getTCXparam( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 );
        getTCXparam( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 );
@@ -906,6 +932,7 @@ static void dec_prm_tcx(


        bitsRead[0] = st->next_bit_pos - start_bit_pos;
        bitsRead[0] = st->next_bit_pos - start_bit_pos;
    }
    }
#endif


    return;
    return;
}
}
Loading