Commit 873dd04b authored by vaclav's avatar vaclav
Browse files

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

Merge remote-tracking branch 'remotes/origin/main' into float-1525-format-switching-reading-of-uninitialized-memory-in-ivas_dec_readformat
parents 350cbf3a 7c02c866
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@
/* any switch which is non-be wrt. TS 26.258 V3.0 */
#define FIX_FLOAT_1493_MASA_ENCODE_STABILITY_IMPROVE    /* Nokia: float issue 1493: Improves float decision stability in MASA encoding by adjusting reduction code */
#define FIX_BASOP_2436_REUSED_CLDFB_IN_OMASA_SR         /* FhG: basop issue 2436 (related to basop 2283): fix garbage output for >1 object OMASA with extrend as ISAR prerenderer */
#define FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION  /* Nokia: float issue 1528: Fixes incorrect compensation for ISM metadata delay in 5ms TD rendering */


/* ##################### End NON-BE switches ########################### */
+22 −1
Original line number Diff line number Diff line
@@ -318,6 +318,10 @@ ivas_error ivas_td_binaural_renderer_unwrap(
    float *output[],                                      /* i/o: SCE channels / Binaural synthesis    */
    const int16_t output_frame,                           /* i  : output frame length                  */
    const int16_t num_subframes                           /* i  : number of subframes to render */
#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
    ,
    int16_t *metaSfCounter /* i/o: subframe counter for metadata update */
#endif
)
{
    int16_t subframe_length;
@@ -361,7 +365,11 @@ ivas_error ivas_td_binaural_renderer_unwrap(

    for ( subframe_idx = 0; subframe_idx < num_subframes; subframe_idx++ )
    {
#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
        if ( *metaSfCounter == ism_md_subframe_update )
#else
        if ( subframe_idx == ism_md_subframe_update )
#endif
        {
            /* Update object position(s) */
            if ( ( error = TDREND_Update_object_positions( hBinRendererTd, num_src, ivas_format, hIsmMetaData ) ) != IVAS_ERR_OK )
@@ -370,6 +378,10 @@ ivas_error ivas_td_binaural_renderer_unwrap(
            }
        }

#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
        *metaSfCounter = ( *metaSfCounter + 1 ) % 4;

#endif
        /* Update the listener's location/orientation */
        if ( ( error = TDREND_Update_listener_orientation( hBinRendererTd, ( enableCombinedOrientation != NULL ) ? enableCombinedOrientation[hCombinedOrientationData->subframe_idx] : 0, ( Quaternions != NULL ) ? &Quaternions[hCombinedOrientationData->subframe_idx] : NULL, ( Pos != NULL ) ? &Pos[hCombinedOrientationData->subframe_idx] : NULL ) ) != IVAS_ERR_OK )
        {
@@ -722,7 +734,11 @@ ivas_error ivas_td_binaural_open_ext(
 *---------------------------------------------------------------------*/

ivas_error ivas_td_binaural_renderer_ext(
#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
    TDREND_WRAPPER *pTDRend, /* i/o: TD Renderer wrapper structure           */
#else
    const TDREND_WRAPPER *pTDRend, /* i  : TD Renderer wrapper structure           */
#endif
    const AUDIO_CONFIG inConfig,                                 /* i  : Input audio configuration               */
    const LSSETUP_CUSTOM_HANDLE customLsInput,                   /* i  : Input custom loudspeaker layout         */
    const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i  : Combined head and external orientations */
@@ -790,8 +806,13 @@ ivas_error ivas_td_binaural_renderer_ext(
        hIsmMetaData[0]->non_diegetic_flag = currentPos->non_diegetic_flag;
    }

#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
    if ( ( error = ivas_td_binaural_renderer_unwrap( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, *hCombinedOrientationData,
                                                     ism_md_subframe_update_ext, p_output, output_frame, (int16_t) ( ( output_frame * FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) / output_Fs ), &( pTDRend->metaSfCounter ) ) ) != IVAS_ERR_OK )
#else
    if ( ( error = ivas_td_binaural_renderer_unwrap( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, *hCombinedOrientationData,
                                                     ism_md_subframe_update_ext, p_output, output_frame, (int16_t) ( ( output_frame * FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) / output_Fs ) ) ) != IVAS_ERR_OK )
#endif
    {
        return error;
    }
+8 −0
Original line number Diff line number Diff line
@@ -641,10 +641,18 @@ ivas_error ivas_td_binaural_renderer_unwrap(
    float *output[],                                            /* i/o: SCE channels / Binaural synthesis       */
    const int16_t output_frame,                                 /* i  : output frame length                     */
    const int16_t num_subframes                                 /* i  : number of subframes to render           */
#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
    ,
    int16_t *metaSfCounter                                      /* i/o: subframe counter for metadata update    */
#endif
);

ivas_error ivas_td_binaural_renderer_ext(
#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
    TDREND_WRAPPER *pTDRend,                                    /* i/o: TD Renderer wrapper structure           */
#else
    const TDREND_WRAPPER *pTDRend,                              /* i  : TD Renderer wrapper structure           */
#endif
    const AUDIO_CONFIG inConfig,                                /* i  : Input audio configuration               */
    const LSSETUP_CUSTOM_HANDLE customLsInput,                  /* i  : Input custom loudspeaker layout         */
    const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData,/* i  : Combined head and external orientations */
+3 −0
Original line number Diff line number Diff line
@@ -1141,6 +1141,9 @@ typedef struct
    int32_t binaural_latency_ns;
    BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd;
    TDREND_HRFILT_FiltSet_t **hHrtfTD;
#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
    int16_t metaSfCounter;
#endif

} TDREND_WRAPPER, *TDREND_WRAPPER_HANDLE;

+7 −0
Original line number Diff line number Diff line
@@ -1313,6 +1313,9 @@ static TDREND_WRAPPER defaultTdRendWrapper(
    w.binaural_latency_ns = 0;
    w.hBinRendererTd = NULL;
    w.hHrtfTD = NULL;
#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
    w.metaSfCounter = 0;
#endif

    return w;
}
@@ -5739,7 +5742,11 @@ static ivas_error rotateFrameSba(


static ivas_error renderIsmToBinaural(
#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
    input_ism *ismInput,
#else
    const input_ism *ismInput,
#endif
    IVAS_REND_AudioBuffer outAudio )
{
    float tmpTDRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k];