Commit 6555a7b8 authored by sagnowski's avatar sagnowski
Browse files

Merge branch 'ivas-float-update' into 2102_ref_split-rendering-in-voip-mode

parents fe135f56 7a1c7c5b
Loading
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -319,8 +319,14 @@ 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 */
@@ -5877,8 +5883,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
@@ -199,12 +199,24 @@ 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
        }
    }

+1 −0
Original line number Diff line number Diff line
@@ -189,6 +189,7 @@
/*#define NONBE_1324_TC_BUFFER_MEMOERY_KEEP*/           /* VA: issue 1324: do not reset TSM memory in JBM bitrate switching */
#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 CODE_IMPROVEMENTS
#define NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Nokia: issue 1339: Apply scaling to the object-part of OMASA for binaural rendering in IVAS_rend. */
#define NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING         /* Nokia: Fix OMASA to MASA1 rendering in IVAS_rend */
+17 −3
Original line number Diff line number Diff line
@@ -1262,6 +1262,9 @@ 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;
@@ -2378,7 +2381,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 ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
@@ -2393,6 +2396,13 @@ 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
#ifdef FIX_NCHAN_BUFFERS
    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++ )
@@ -2411,7 +2421,7 @@ ivas_error ivas_init_decoder(
    {
        st_ivas->p_output_f[n] = NULL;
    }

#endif

    return error;
}
@@ -2884,11 +2894,15 @@ 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 */
+20 −1
Original line number Diff line number Diff line
@@ -60,7 +60,11 @@ 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;
@@ -70,7 +74,9 @@ 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 )
    {
@@ -284,6 +290,7 @@ static ivas_error ivas_ism_bitrate_switching_dec(
        return error;
    }

#ifndef FIX_1330_JBM_MEMORY
    /*-----------------------------------------------------------------*
     * floating-point output audio buffers
     *-----------------------------------------------------------------*/
@@ -294,7 +301,7 @@ static ivas_error ivas_ism_bitrate_switching_dec(
    {
        return error;
    }

#endif
    /*-----------------------------------------------------------------*
     * JBM TC buffers
     *-----------------------------------------------------------------*/
@@ -334,6 +341,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, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK )
    {
        return error;
    }
#endif

    return IVAS_ERR_OK;
}
Loading