Commit 26a34518 authored by vaclav's avatar vaclav
Browse files

- use native instead of wrapper functions for TD renderer

- re-activate FIX_350_MASA_DELAY_COMP and FIX_382_MASA_META_FRAMING_ASYNC
- compilation fixes when MASA_AND_OBJECTS is disabled
parent f9afcb54
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -144,12 +144,12 @@
#define FIX_103_RA_PARAMS_PARAM_BIN_REND                /* Issue 103: Digest room acoustics parameters for Parametric Binaural Renderer*/
/*#define SBA_HPF_TUNING_DEC*/

//#define FIX_350_MASA_DELAY_COMP                         /* Nokia: Issue 350: MASA audio/meta delay compensation */
#define FIX_350_MASA_DELAY_COMP                         /* Nokia: Issue 350: MASA audio/meta delay compensation */
#define FIX_MDCT_BASED_BWD                              /* FhG: fixes for BWD for issues with reaction to transients for MDCT-stereo and MCT */
#define DISCRETE_ISM_DTX_CNG                            /* FhG/VA: contribution 15 - DTX/CNG for (discrete) ISM */
#define NCHAN_ISM_PARAMETER                             /* VA: make 'nchan_ism' parameter part of st_ivas/hEncoderConfig */

//#define FIX_382_MASA_META_FRAMING_ASYNC                 /* Nokia: Issue 382: detect potential MASA metadata framing offset */
#define FIX_382_MASA_META_FRAMING_ASYNC                 /* Nokia: Issue 382: detect potential MASA metadata framing offset */

#define MASA_AND_OBJECTS                                /* Nokia: Combination of MASA and objects */
#ifdef MASA_AND_OBJECTS
+1 −3
Original line number Diff line number Diff line
@@ -607,9 +607,7 @@ ivas_error ivas_dec(

                ivas_dirac_dec_binaural( st_ivas, output, st_ivas->nchan_transport );

                if ( ( error = ivas_td_binaural_renderer_unwrap( st_ivas->hReverb, st_ivas->transport_config, st_ivas->hBinRendererTd, st_ivas->nchan_ism, LFE_CHANNEL, st_ivas->ivas_format,
                                                                 st_ivas->hIsmMetaData, st_ivas->hDecoderConfig->Opt_Headrotation, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Quaternions : NULL,
                                                                 ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Pos : NULL, data_separated_objects, output_frame ) ) != IVAS_ERR_OK )
                if ( ( error = ivas_td_binaural_renderer( st_ivas, data_separated_objects, output_frame ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
+1 −7
Original line number Diff line number Diff line
@@ -1518,9 +1518,7 @@ ivas_error ivas_init_decoder(
    if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL )
    {
        /* Allocate TD renderer for the objects in DISC mode */
        error = ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_ism, st_ivas->ivas_format,
                                              st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns );
        if ( ( error ) != IVAS_ERR_OK )
        if ( ( error = ivas_td_binaural_open( st_ivas ) ) != IVAS_ERR_OK )
        {
            return error;
        }
@@ -1865,11 +1863,7 @@ void ivas_destroy_dec(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder handle      */
)
{
#ifdef OMASA_BRATE_SW
    int16_t i;
#else
    int16_t i, n;
#endif

    /* CLDFB handles */
    for ( i = 0; i < MAX_INTERN_CHANNELS; i++ )
+2 −0
Original line number Diff line number Diff line
@@ -180,7 +180,9 @@ ivas_error ivas_ism_metadata_dec(
#ifdef DISCRETE_ISM_DTX_CNG
    int16_t md_diff_flag[MAX_NUM_OBJECTS];
#endif
#ifdef MASA_AND_OBJECTS
    ivas_error error;
#endif

    push_wmops( "ism_meta_dec" );

+31 −6
Original line number Diff line number Diff line
@@ -53,8 +53,22 @@ ivas_error ivas_td_binaural_open(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder structure  */
)
{
#ifdef MASA_AND_OBJECTS
    int16_t num_src;

    num_src = st_ivas->nchan_transport;
    if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC )
    {
        num_src = st_ivas->nchan_ism;
    }

    return ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, num_src, st_ivas->ivas_format,
                                         st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns );
#else

    return ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_transport, st_ivas->ivas_format,
                                         st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns );
#endif
}


@@ -71,10 +85,21 @@ ivas_error ivas_td_binaural_renderer(
    const int16_t output_frame  /* i  : output frame length               */
)
{
    return ivas_td_binaural_renderer_unwrap(
        st_ivas->hReverb,
        st_ivas->transport_config,
        st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format,
#ifdef MASA_AND_OBJECTS
    int16_t num_src;

    num_src = st_ivas->nchan_transport;
    if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC )
    {
        num_src = st_ivas->nchan_ism;
    }

    return ivas_td_binaural_renderer_unwrap( st_ivas->hReverb, st_ivas->transport_config, st_ivas->hBinRendererTd, num_src, LFE_CHANNEL, st_ivas->ivas_format,
                                             st_ivas->hIsmMetaData, st_ivas->hDecoderConfig->Opt_Headrotation, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Quaternions : NULL,
                                             ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Pos : NULL, output, output_frame );
#else
    return ivas_td_binaural_renderer_unwrap( st_ivas->hReverb, st_ivas->transport_config, st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format,
                                             st_ivas->hIsmMetaData, st_ivas->hDecoderConfig->Opt_Headrotation, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Quaternions : NULL,
                                             ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Pos : NULL, output, output_frame );
#endif
}
Loading