Commit 37809ee3 authored by vaclav's avatar vaclav
Browse files

port FIX_1330_JBM_MEMORY

parent 5850090b
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1072,8 +1072,12 @@ void ivas_omasa_separate_object_render_jbm_fx(
    const UWord16 nSamplesRendered,                             /* i  : number of samples rendered              */
    Word32 input_fx_in[][L_FRAME48k],                           /* i  : separated object signal                 */
    Word32 *output_fx[],                                        /* o  : rendered time signal                    */
#ifdef FIX_1330_JBM_MEMORY
    const Word16 subframes_rendered                             /* i  : number of subframes rendered            */
#else
    const Word16 subframes_rendered,                            /* i  : number of subframes rendered            */
    const Word16 slots_rendered                                 /* i  : number of CLDFB slots rendered          */
#endif
);

void get_panning_gain_fx(
@@ -4041,8 +4045,14 @@ ivas_error ivas_init_encoder_fx(

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

ivas_error ivas_dec_get_format_fx(
+13 −0
Original line number Diff line number Diff line
@@ -202,12 +202,25 @@ void ivas_buffer_deinterleaved_to_interleaved_fx(
)
{
    Word16 ch, m;
#ifdef FIX_1330_JBM_MEMORY
    Word32 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++ )
    {
        Copy32( 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
            move32();
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@
#define FIX_1370_EXTERNAL_ORIENTATION_CHECK             /* Nokia: add sanity check for Euler angles for external orientations */
#define NONBE_FIX_1197_OMASA_META_BUFFER                /* Nokia: OMASA ISM_MASA_MODE_PARAM_ONE_OBJ history zero in rateswitching - port 251 */
#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 */

// object-editing feature porting
#define TMP_FIX_SPLIT_REND                              // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions)
+16 −1
Original line number Diff line number Diff line
@@ -1494,6 +1494,9 @@ ivas_error ivas_init_decoder_fx(
    Word16 sce_id, cpe_id;
    Word16 numCldfbAnalyses, numCldfbSyntheses;
    Word16 granularity, n_channels_transport_jbm;
#ifdef FIX_1330_JBM_MEMORY
    Word16 nchan_out_buff;
#endif
    Word32 output_Fs, ivas_total_brate, tmp_br, tmp32;
    Word32 delay_ns;
    AUDIO_CONFIG output_config;
@@ -2938,7 +2941,7 @@ ivas_error ivas_init_decoder_fx(

    test();
    test();
    IF( ( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) || EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) && st_ivas->hDecoderConfig->Opt_tsm )
    IF( ( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) || EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) && hDecoderConfig->Opt_tsm )
    {
        IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) )
        {
@@ -2953,6 +2956,13 @@ ivas_error ivas_init_decoder_fx(
     * Allocate output audio buffers
     *-----------------------------------------------------------------*/

#ifdef FIX_1330_JBM_MEMORY
    nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate );
    IF( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff, hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK )
    {
        return error;
    }
#else
#ifdef FIX_NCHAN_BUFFERS
    k = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate );
    FOR( n = 0; n < k; n++ )
@@ -2971,6 +2981,7 @@ ivas_error ivas_init_decoder_fx(
    {
        st_ivas->p_output_fx[n] = NULL;
    }
#endif

    return error;
}
@@ -3453,11 +3464,15 @@ void ivas_destroy_dec_fx(
    /* output audio buffers */
    FOR( i = 0; i < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; i++ )
    {
#ifdef FIX_1330_JBM_MEMORY
        st_ivas->p_output_fx[i] = NULL;
#else
        IF( st_ivas->p_output_fx[i] != NULL )
        {
            free( st_ivas->p_output_fx[i] );
            st_ivas->p_output_fx[i] = NULL;
        }
#endif
    }

    /* main IVAS handle */
+20 −1
Original line number Diff line number Diff line
@@ -59,7 +59,11 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx(
    Word16 tc_nchan_tc_new;
    Word16 tc_nchan_allocate_new;
    Word16 tc_granularity_new;
#ifdef FIX_1330_JBM_MEMORY
    Word16 nchan_out_buff;
#else
    Word16 nchan_out_buff, nchan_out_buff_old;
#endif

    nCPE_old = st_ivas->nCPE;
    move16();
@@ -74,7 +78,9 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx(
    ivas_init_dec_get_num_cldfb_instances_fx( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old );
    st_ivas->ism_mode = ism_mode;
    move16();
#ifndef FIX_1330_JBM_MEMORY
    nchan_out_buff_old = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 );
#endif

    IF( NE_32( ( error = ivas_ism_config_fx( 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 ) )
    {
@@ -307,6 +313,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx(
        return error;
    }

#ifndef FIX_1330_JBM_MEMORY
    /*-----------------------------------------------------------------*
     * output audio buffers
     *-----------------------------------------------------------------*/
@@ -317,7 +324,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx(
    {
        return error;
    }

#endif
    /*-----------------------------------------------------------------*
     * JBM TC buffers
     *-----------------------------------------------------------------*/
@@ -370,6 +377,18 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx(

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

    /*-----------------------------------------------------------------*
     * output audio buffers
     *-----------------------------------------------------------------*/

    nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 );
    IF( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK )
    {
        return error;
    }
#endif

    return IVAS_ERR_OK;
}
Loading