Commit 5416dc53 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[cleanup] accept FIX_1330_JBM_MEMORY

parent 14d1191e
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -310,14 +310,9 @@ ivas_error ivas_init_decoder(

ivas_error ivas_output_buff_dec(
    float *p_output_f[],                                        /* i/o: output audio buffers                    */
#ifdef FIX_1330_JBM_MEMORY
    const int16_t nchan_out_buff,                               /* i  : number of output channels               */
    const int16_t Opt_tsm,                                      /* i  : TSM option flag                         */
    DECODER_TC_BUFFER_HANDLE hTcBuffer                          /* i  : TSM buffer handle                       */
#else
    const int16_t nchan_out_buff_old,                           /* i  : previous frame number of output channels*/
    const int16_t nchan_out_buff                                /* i  : number of output channels               */
#endif
);

/*! r: flag to indicate if split rendering is enabled */
@@ -5866,12 +5861,7 @@ void ivas_omasa_separate_object_render_jbm(
    const uint16_t nSamplesRendered,                            /* i  : number of samples rendered              */
    float input_f[][L_FRAME48k],                                /* i  : separated object signal                 */
    float *output_f[],                                          /* o  : rendered time signal                    */
#ifdef FIX_1330_JBM_MEMORY
    const int16_t subframes_rendered                            /* i  : number of subframes rendered            */
#else
    const int16_t subframes_rendered,                           /* i  : number of subframes rendered            */
    const int16_t slots_rendered                                /* i  : number of CLDFB slots rendered          */
#endif
);

void ivas_omasa_encode_masa_to_total(
+0 −6
Original line number Diff line number Diff line
@@ -198,24 +198,18 @@ void ivas_buffer_deinterleaved_to_interleaved(
)
{
    int16_t ch, m;
#ifdef FIX_1330_JBM_MEMORY
    float buffer[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; /* temp buffer needed when "*audio[]" and "*audio_out[]" are the same */

    for ( ch = 0; ch < n_channels; ch++ )
    {
        mvr2r( audio[ch], buffer[ch], frame_length );
    }
#endif

    for ( ch = 0; ch < n_channels; ch++ )
    {
        for ( m = 0; m < frame_length; m++ )
        {
#ifdef FIX_1330_JBM_MEMORY
            audio_out[m * n_channels + ch] = buffer[ch][m];
#else
            audio_out[m * n_channels + ch] = audio[ch][m];
#endif
        }
    }

+0 −1
Original line number Diff line number Diff line
@@ -178,7 +178,6 @@
#define FIX_1388_MSAN_ivas_init_decoder                 /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */
#define FIX_1370_EXTERNAL_ORIENTATION_CHECK             /* Nokia: add sanity check for Euler angles for external orientations */
#define FIX_1413_IGF_INIT_PRINTOUT                      /* FhG: use correct variable for IGF initiliazation */
#define FIX_1330_JBM_MEMORY                             /* VA: issue 1330: memory savings in the JBM decoder */
#define FIX_1330_JBM_MEMORY_FIX                         /* VA: basop issue: 2179 fix non-BE difference in FIX_1330_JBM_MEMORY */
#define FIX_1383_HEAD_TRACK_SANITIZER                   /* Nok: issue 1383: Fix head tracking struc values reading in renderer */
#define FIX_1411_IGF_CRASH_BW_SWITCHING                 /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/
+0 −27
Original line number Diff line number Diff line
@@ -1260,9 +1260,7 @@ ivas_error ivas_init_decoder(
    int16_t sce_id, cpe_id;
    int16_t numCldfbAnalyses, numCldfbSyntheses;
    int16_t granularity, n_channels_transport_jbm;
#ifdef FIX_1330_JBM_MEMORY
    int16_t nchan_out_buff;
#endif
    int32_t output_Fs, ivas_total_brate;
    int32_t delay_ns;
    AUDIO_CONFIG output_config;
@@ -2468,28 +2466,11 @@ ivas_error ivas_init_decoder(
     * Allocate floating-point output audio buffers
     *-----------------------------------------------------------------*/

#ifdef FIX_1330_JBM_MEMORY
    nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate );
    if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff, hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK )
    {
        return error;
    }
#else
    k = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
    for ( n = 0; n < k; n++ )
    {
        /* note: these are intra-frame heap memories */
        if ( ( st_ivas->p_output_f[n] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL )
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point output audio buffer!\n" ) );
        }
    }

    for ( ; n < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; n++ )
    {
        st_ivas->p_output_f[n] = NULL;
    }
#endif

    return error;
}
@@ -2962,15 +2943,7 @@ void ivas_destroy_dec(
    /* floating-point output audio buffers */
    for ( i = 0; i < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; i++ )
    {
#ifdef FIX_1330_JBM_MEMORY
        st_ivas->p_output_f[i] = NULL;
#else
        if ( st_ivas->p_output_f[i] != NULL )
        {
            free( st_ivas->p_output_f[i] );
            st_ivas->p_output_f[i] = NULL;
        }
#endif
    }

    /* main IVAS handle */
+0 −21
Original line number Diff line number Diff line
@@ -60,11 +60,7 @@ static ivas_error ivas_ism_bitrate_switching_dec(
    int16_t tc_nchan_tc_new;
    int16_t tc_nchan_allocate_new;
    int16_t tc_granularity_new;
#ifdef FIX_1330_JBM_MEMORY
    int16_t nchan_out_buff;
#else
    int16_t nchan_out_buff, nchan_out_buff_old;
#endif

    nCPE_old = st_ivas->nCPE;
    nSCE_old = st_ivas->nSCE;
@@ -74,9 +70,6 @@ static ivas_error ivas_ism_bitrate_switching_dec(
    st_ivas->ism_mode = last_ism_mode;
    ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old );
    st_ivas->ism_mode = ism_mode;
#ifndef FIX_1330_JBM_MEMORY
    nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
#endif

    if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->nchan_ism, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ) ) != IVAS_ERR_OK )
    {
@@ -290,18 +283,6 @@ static ivas_error ivas_ism_bitrate_switching_dec(
        return error;
    }

#ifndef FIX_1330_JBM_MEMORY
    /*-----------------------------------------------------------------*
     * floating-point output audio buffers
     *-----------------------------------------------------------------*/

    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 )
    {
        return error;
    }
#endif
    /*-----------------------------------------------------------------*
     * JBM TC buffers
     *-----------------------------------------------------------------*/
@@ -341,7 +322,6 @@ static ivas_error ivas_ism_bitrate_switching_dec(

        mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS );
    }
#ifdef FIX_1330_JBM_MEMORY

    /*-----------------------------------------------------------------*
     * floating-point output audio buffers
@@ -352,7 +332,6 @@ static ivas_error ivas_ism_bitrate_switching_dec(
    {
        return error;
    }
#endif

    return IVAS_ERR_OK;
}
Loading