Commit 5f95717b authored by vaclav's avatar vaclav
Browse files

issue 1330: memory savings in the JBM decoder; under FIX_1330_JBM_MEMORY

parent a60dd45d
Loading
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -309,7 +309,13 @@ ivas_error ivas_init_decoder(
ivas_error ivas_output_buff_dec(
    float *p_output_f[],                                        /* i/o: output audio buffers                    */
    const int16_t nchan_out_buff_old,                           /* i  : previous frame number of output channels*/
#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                                /* i  : number of output channels               */
#endif
);

ivas_error stereo_dmx_evs_init_encoder(
@@ -5823,8 +5829,12 @@ 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(
+12 −0
Original line number Diff line number Diff line
@@ -198,12 +198,24 @@ void ivas_buffer_deinterleaved_to_interleaved(
)
{
    int16_t ch, m;
#ifdef FIX_1330_JBM_MEMORY
    float buffer[MAX_TRANSPORT_CHANNELS][L_FRAME48k];

    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
        }
    }

+2 −0
Original line number Diff line number Diff line
@@ -162,6 +162,8 @@

/*#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 FIX_1330_JBM_MEMORY                             /* VA: issue 1330: memory savings in the JBM decoder */


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

+30 −4
Original line number Diff line number Diff line
@@ -2363,7 +2363,7 @@ ivas_error ivas_init_decoder(
        }
    }

    if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->Opt_tsm )
    if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && hDecoderConfig->Opt_tsm )
    {
        if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
@@ -2378,7 +2378,18 @@ ivas_error ivas_init_decoder(
     * Allocate floating-point output audio buffers
     *-----------------------------------------------------------------*/

    k = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
    k = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate );
#ifdef FIX_1330_JBM_MEMORY
    for ( n = 0; n < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; n++ )
    {
        st_ivas->p_output_f[n] = NULL;
    }

    if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, 0, k, hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK )
    {
        return error;
    }
#else
    for ( n = 0; n < k; n++ )
    {
        /* note: these are intra-frame heap memories */
@@ -2392,7 +2403,7 @@ ivas_error ivas_init_decoder(
    {
        st_ivas->p_output_f[n] = NULL;
    }

#endif

    return error;
}
@@ -2849,12 +2860,27 @@ void ivas_destroy_dec(
    /* Limiter struct */
    ivas_limiter_close( &( st_ivas->hLimiter ) );

#ifdef FIX_1330_JBM_MEMORY
    /* JBM decoding: floating-point output audio buffers are shared with bufeers from 'hTcBuffer' */
    if ( st_ivas->hDecoderConfig->Opt_tsm )
    {
        int16_t nchan_tc_jbm = max( st_ivas->hTcBuffer->nchan_transport_jbm, st_ivas->hTcBuffer->nchan_buffer_full );

        for ( i = 0; i < nchan_tc_jbm; i++ )
        {
            st_ivas->p_output_f[i] = NULL;
        }
    }

    /* Decoder configuration structure */
#endif
    if ( st_ivas->hDecoderConfig != NULL )
    {
        free( st_ivas->hDecoderConfig );
        st_ivas->hDecoderConfig = NULL;
    }

    /* JBM TC buffer structure */
    ivas_jbm_dec_tc_buffer_close( &st_ivas->hTcBuffer );

    if ( st_ivas->hJbmMetadata != NULL )
+14 −2
Original line number Diff line number Diff line
@@ -266,17 +266,17 @@ 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
     *-----------------------------------------------------------------*/
@@ -316,6 +316,18 @@ 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
     *-----------------------------------------------------------------*/

    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, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK )
    {
        return error;
    }
#endif

    return IVAS_ERR_OK;
}
Loading