Commit 5f0f350b authored by bayers's avatar bayers
Browse files

5ms API

Squashed commit of the following:

commit a019f87f
Merge: 1a5757ea daca8536
Author: Stefan Bayer <stefan.bayer@iis.fraunhofer.de>
Date:   Tue Jun 20 08:39:14 2023 +0200

    Merge remote-tracking branch 'remotes/origin/main' into b_20230601_API_5ms_rendering_bay

commit 1a5757ea
Author: Stefan Bayer <stefan.bayer@iis.fraunhofer.de>
Date:   Tue Jun 20 08:26:50 2023 +0200

    try to fix BE for the external orientation, did not succeed, seems to be a deeper problem. Make self test summary more verbous

commit b61cb898
Author: Stefan Bayer <stefan.bayer@iis.fraunhofer.de>
Date:   Thu Jun 15 16:12:09 2023 +0200

    disable unused code

commit de03fd1e
Author: Stefan Bayer <stefan.bayer@iis.fraunhofer.de>
Date:   Thu Jun 15 15:41:27 2023 +0200

    fix external orientation update rate

commit d4c03c2e
Author: Stefan Bayer <stefan.bayer@iis.fraunhofer.de>
Date:   Thu Jun 15 15:08:55 2023 +0200

    make sure 7.1.4 br does not crash any longer, still ParamUpmix needs to be fully implemented in the JBM path

commit f104d3bb
Author: Stefan Bayer <stefan.bayer@iis.fraunhofer.de>
Date:   Thu Jun 15 14:30:43 2023 +0200

    fix asan, put out at least zeroes for ParamUpmix in the JBM path

commit 52b54897
Author: Stefan Bayer <stefan.bayer@iis.fraunhofer.de>
Date:   Thu Jun 15 13:55:13 2023 +0200

    fix compiling issues with API_5MS inactive

commit 8d73b36a
Author: Stefan Bayer <stefan.bayer@iis.fraunhofer.de>
Date:   Thu Jun 15 13:06:03 2023 +0200

    fix compiling, re-add all 5ms API stuff that got lost in the latest merge from main

commit 61245536
Merge: fde3a293 96ad022e
Author: Stefan Bayer <stefan.bayer@iis.fraunhofer.de>
Date:   Thu Jun 15 08:38:42 2023 +0200

    Merge remote-tracking branch 'remotes/origin/main' into b_20230601_API_5ms_rendering_bay

commit fde3a293
Author: Stefan Bayer <stefan.bayer@iis.fraunhofer.de>
Date:   Thu Jun 15 08:07:25 2023 +0200

    temp fix for orientation tracking init

commit 3a9743d0
Author: Stefan Bayer <stefan.bayer@iis.fraunhofer.de>
Date:   Wed Jun 14 07:11:37 2023 +0200

    5ms API first step, not completely BE yet
parent daca8536
Loading
Loading
Loading
Loading
Loading
+748 −114

File changed.

Preview size limit exceeded, changes collapsed.

+5 −0
Original line number Diff line number Diff line
@@ -94,6 +94,11 @@ typedef enum
#ifdef VARIABLE_SPEED_DECODING
    IVAS_ERR_VS_FRAME_NEEDED,
#endif
#ifdef API_5MS
    IVAS_ERR_TSM_NOT_ENABLED,
    IVAS_ERR_FETCH_SIZE_NO_MULTIPLE_OF_5MS,
    IVAS_ERR_NEED_NEW_FRAME,
#endif
#endif

    /*----------------------------------------*
+5 −1
Original line number Diff line number Diff line
@@ -311,10 +311,12 @@ void stereo_dmx_evs_close_encoder(
    STEREO_DMX_EVS_ENC_HANDLE *hStereoDmxEVS                    /* i/o: Stereo downmix for EVS encoder handle   */
);

#ifndef API_5MS
ivas_error ivas_dec(
    Decoder_Struct *st_ivas,                                    /* i  : IVAS decoder structure                  */
    int16_t *data                                               /* o  : output synthesis signal                 */
);
#endif

ivas_error ivas_dec_setup(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
@@ -5172,8 +5174,10 @@ void ivas_binaural_cldfb_sf(
void ivas_binRenderer(
    BINAURAL_RENDERER_HANDLE hBinRenderer,                      /* i/o: fastconv binaural renderer handle                       */
    COMBINED_ORIENTATION_HANDLE hCombinedOrientationData,       /* i  : combined head and external orientation handle           */
#ifndef API_5MS
    int16_t subframe_idx,                                       /* i  : subframe index                                          */
    const int16_t numTimeSlots,                                 /* i  : number of time slots to process                         */
#endif
    const int16_t numTimeSlots,                                 /* i: : number of time slots to process                         */
    float Cldfb_RealBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o  : Binaural signals             */
    float Cldfb_ImagBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o  : Binaural signals             */
    float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX],                /* i  : LS signals                   */

lib_com/options.h

100755 → 100644
+5 −0
Original line number Diff line number Diff line
@@ -166,6 +166,11 @@
#define FIX_558_PLC_DISCONT                             /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */
#define FIX_564                                         /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */
#define FIX_566_2DIR_MASA_384K                          /* Nokia: Issued 566:  Bugfix in 384k MASA metadata encoding of second direction */
#define FIX_XXX_JITTER_SBA_BINAURAL_GAIN
#define FIX_XXX_HEADTRACKER_INIT
#define FIX_XXX_TDOBJRENDERER_INPUT
#define FIX_XXX_ISM_SBA_ASAN
#define API_5MS

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+27 −3
Original line number Diff line number Diff line
@@ -994,7 +994,11 @@ void ivas_binaural_cldfb(
        }

        /* Implement binaural rendering */
#ifdef API_5MS
        ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, JBM_CLDFB_SLOTS_IN_SUBFRAME, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
#else
        ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, subframeIdx, JBM_CLDFB_SLOTS_IN_SUBFRAME, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
#endif

        /* Implement CLDFB synthesis */
        for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
@@ -1086,8 +1090,11 @@ void ivas_binaural_cldfb_sf(
        }

        /* Implement binaural rendering */
#ifdef API_5MS
        ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
#else
        ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, subframeIdx, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );

#endif
        /* Implement CLDFB synthesis */
        for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
        {
@@ -1122,7 +1129,9 @@ void ivas_binaural_cldfb_sf(
void ivas_binRenderer(
    BINAURAL_RENDERER_HANDLE hBinRenderer,                                                 /* i/o: binaural renderer handle                     */
    COMBINED_ORIENTATION_HANDLE hCombinedOrientationData,                                  /* i  : combined head and external orientation handle*/
#ifndef API_5MS
    int16_t subframe_idx,                                                                  /* i  : subframe index                               */
#endif
    const int16_t numTimeSlots,                                                            /* i  : number of time slots to render               */
    float Cldfb_RealBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o  : Binaural signals                             */
    float Cldfb_ImagBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o  : Binaural signals                             */
@@ -1146,25 +1155,40 @@ void ivas_binRenderer(
    }

    /* Head rotation in HOA3 or CICPx */
    if (
        hCombinedOrientationData != NULL && hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && hBinRenderer->rotInCldfb )
#ifdef API_5MS
    if ( hCombinedOrientationData != NULL && hCombinedOrientationData->enableCombinedOrientation && hBinRenderer->rotInCldfb )
#else
    if ( hCombinedOrientationData != NULL && hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && hBinRenderer->rotInCldfb )
#endif
    {
        if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 )
        {
            /* Rotation in SHD (HOA3) */
            if ( hCombinedOrientationData->shd_rot_max_order == -1 )
            {
#ifdef API_5MS
                rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat, hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, 3 );
#else
                rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat[subframe_idx], hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, 3 );
#endif
            }
            else if ( hCombinedOrientationData->shd_rot_max_order > 0 )
            {
#ifdef API_5MS
                rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat, hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, hCombinedOrientationData->shd_rot_max_order );
#else
                rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat[subframe_idx], hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, hCombinedOrientationData->shd_rot_max_order );
#endif
            }
        }
        else
        {
            /* Rotation in SD (CICPx) */
#ifdef API_5MS
            rotateFrame_sd_cldfb( hCombinedOrientationData->Rmat, RealBuffer, ImagBuffer, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, numTimeSlots, hBinRenderer->conv_band );
#else
            rotateFrame_sd_cldfb( hCombinedOrientationData->Rmat[subframe_idx], RealBuffer, ImagBuffer, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, numTimeSlots, hBinRenderer->conv_band );
#endif
        }
    }

Loading