Commit 1a9fd9fa authored by bayers's avatar bayers
Browse files

correct size of ParamMC cldfb buffers for non-TSM mode

parent 1dd207fb
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@
#define NONBE_FIX_589_JBM_TC_OFFSETS
#define API_5MS
#ifdef API_5MS
/*#define JITTER_MEM_OPTIM_RENDERING*/
#define JITTER_MEM_OPTIM_RENDERING
#endif

/* ################## End DEVELOPMENT switches ######################### */
+3 −6
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@ static void ivas_jbm_masa_sf_to_slot_map( Decoder_Struct *st_ivas, const int16_t
 *
 * Principal IVAS JBM decoder routine, decoding of metadata and transport channels
 *--------------------------------------------------------------------------*/

ivas_error ivas_jbm_dec_tc(
    Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure         */
    float *data /* o  : transport channel signals      */
@@ -81,7 +80,6 @@ ivas_error ivas_jbm_dec_tc(
    AUDIO_CONFIG output_config;
    ivas_error error;
    float *p_output[MAX_TRANSPORT_CHANNELS];

    error = IVAS_ERR_OK;

    push_wmops( "ivas_jbm_dec_tc" );
@@ -112,7 +110,7 @@ ivas_error ivas_jbm_dec_tc(
        /* zero output when first frame(s) is lost */
        for ( n = 0; n < nchan_out; n++ )
        {
            set_f( output[n], 0.0f, output_frame );
            set_f( p_output[n], 0.0f, output_frame );
        }

#ifdef DEBUG_MODE_INFO
@@ -125,7 +123,6 @@ ivas_error ivas_jbm_dec_tc(
    else if ( st_ivas->ivas_format == STEREO_FORMAT )
    {
        st_ivas->hCPE[0]->element_brate = ivas_total_brate;

        if ( ( error = ivas_cpe_dec( st_ivas, 0, output, output_frame, 0 ) ) != IVAS_ERR_OK )
        {
            return error;
+21 −1
Original line number Diff line number Diff line
@@ -465,6 +465,26 @@ ivas_error ivas_param_mc_dec_open(
    if ( st_ivas->hDecoderConfig->voip_active && hParamMC->synthesis_conf != PARAM_MC_SYNTH_MONO_STEREO )
#endif
    {
#ifdef API_5MS
        int16_t n_cldfb_slots;

        n_cldfb_slots = DEFAULT_JBM_CLDFB_TIMESLOTS;
        if ( st_ivas->hDecoderConfig->tsm_active )
        {
            n_cldfb_slots = MAX_JBM_CLDFB_TIMESLOTS;
        }
        if ( ( hParamMC->Cldfb_RealBuffer_tc = (float *) malloc( n_cldfb_slots * nchan_transport * hParamMC->num_freq_bands * sizeof( float ) ) ) == NULL )
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Parametric MC JBM\n" ) );
        }
        set_zero( hParamMC->Cldfb_RealBuffer_tc, n_cldfb_slots * nchan_transport * hParamMC->num_freq_bands );

        if ( ( hParamMC->Cldfb_ImagBuffer_tc = (float *) malloc( n_cldfb_slots * nchan_transport * hParamMC->num_freq_bands * sizeof( float ) ) ) == NULL )
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Parametric MC JBM\n" ) );
        }
        set_zero( hParamMC->Cldfb_ImagBuffer_tc, n_cldfb_slots * nchan_transport * hParamMC->num_freq_bands );
#else
        if ( ( hParamMC->Cldfb_RealBuffer_tc = (float *) malloc( MAX_JBM_CLDFB_TIMESLOTS * nchan_transport * hParamMC->num_freq_bands * sizeof( float ) ) ) == NULL )
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Parametric MC JBM\n" ) );
@@ -476,7 +496,7 @@ ivas_error ivas_param_mc_dec_open(
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Parametric MC JBM\n" ) );
        }
        set_zero( hParamMC->Cldfb_ImagBuffer_tc, MAX_JBM_CLDFB_TIMESLOTS * nchan_transport * hParamMC->num_freq_bands );

#endif
        if ( st_ivas->hTcBuffer == NULL )
        {
            if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, nchan_transport, nchan_transport, 0, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK )