Commit de617c33 authored by multrus's avatar multrus
Browse files

merge from main

parents 506aaf1b 07c2d911
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@
#define FIX_FLOAT_1536_INIT_NO_PARAM_LPC                /* FhG: make sure no_param_lpc is initialized in core_encode_twodiv() */
#define FIX_BASOP_2871_INIT_Q_SYN_FACTOR                /* FhG: make sure, st_fx->Q_syn_factor gets initialized during decoder startup */
#define FIX_BASOP_2470_POWER_SPEC_E_INIT                /* FhG: make sure powerSpec_e is always initialized in core_signal_analysis_high_bitrate_fx() */
#define FIX_BASOP_2475_ASSERT_IN_MASA2_REND_TO_MONO     /* Nokia: basop issue 2475: Fix MASA2 to MONO rendering within IVAS_rend */
#define FIX_2346_DUPLICATED_IGF_FUNCTIONS               /* FhG: basop issue 2346: Review potentially duplicated IGF functions */

/* #################### End BE switches ################################## */
@@ -114,6 +115,7 @@
#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_BASOP_2472_IGF_SP_AUD_DEC_CHAN              /* FhG: always use channel 1 for sp_aud_decision0[] being passed to ProcessIGF_ivas_fx() */
#define FIX_BASOP_REMOVE_SYNTH2_FX                      /* FhG: Replace 32bit olapBufferSynth2_fx with 16bit olapBufferSynth2 buffer */
#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 ########################### */

+35 −3
Original line number Diff line number Diff line
@@ -351,6 +351,10 @@ ivas_error ivas_td_binaural_renderer_unwrap_fx(
    Word32 *output_fx[],                                  /* i/o: SCE channels / Binaural synthesis   Q11                      */
    const Word16 output_frame,                            /* i  : output frame length                                          */
    const Word16 num_subframes                            /* i  : number of subframes to render                                */
#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
    ,
    Word16 *metaSfCounter /* i/o: subframe counter for metadata update                         */
#endif
)
{
    Word16 subframe_length;
@@ -400,7 +404,8 @@ ivas_error ivas_td_binaural_renderer_unwrap_fx(

    FOR( subframe_idx = 0; subframe_idx < num_subframes; subframe_idx++ )
    {
        IF( EQ_16( subframe_idx, ism_md_subframe_update ) )
#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
        IF( EQ_16( *metaSfCounter, ism_md_subframe_update ) )
        {
            /* Update object position(s) */
            IF( NE_32( ( error = TDREND_Update_object_positions_fx( hBinRendererTd, num_src, ivas_format, hIsmMetaData ) ), IVAS_ERR_OK ) )
@@ -408,7 +413,24 @@ ivas_error ivas_td_binaural_renderer_unwrap_fx(
                return error;
            }
        }
#else
        IF( EQ_16( subframe_idx, ism_md_subframe_update ) ){
            /* Update object position(s) */
            IF( NE_32( ( error = TDREND_Update_object_positions_fx( hBinRendererTd, num_src, ivas_format, hIsmMetaData ) ), IVAS_ERR_OK ) ){
                return error;
    }
}
#endif

#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
        *metaSfCounter = add( *metaSfCounter, 1 );
        IF( EQ_16( *metaSfCounter, 4 ) )
        {
            *metaSfCounter = 0;
            move16();
        }

#endif
        /* Update the listener's location/orientation */
        Word16 tmp_headRotEnabled;
        tmp_headRotEnabled = 0;
@@ -884,7 +906,11 @@ ivas_error ivas_td_binaural_open_ext_fx(
 *---------------------------------------------------------------------*/

ivas_error ivas_td_binaural_renderer_ext_fx(
#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 */
@@ -1005,9 +1031,15 @@ ivas_error ivas_td_binaural_renderer_ext_fx(
        }
    }

#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
    IF( NE_32( ( error = ivas_td_binaural_renderer_unwrap_fx( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, *hCombinedOrientationData,
                                                              ism_md_subframe_update_ext, p_output_fx, output_frame, num_subframes, &pTDRend->metaSfCounter ) ),
               IVAS_ERR_OK ) )
#else
    IF( NE_32( ( error = ivas_td_binaural_renderer_unwrap_fx( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, *hCombinedOrientationData,
                                                              ism_md_subframe_update_ext, p_output_fx, output_frame, num_subframes ) ),
               IVAS_ERR_OK ) )
#endif
    {
        return error;
    }
+8 −0
Original line number Diff line number Diff line
@@ -671,10 +671,18 @@ ivas_error ivas_td_binaural_renderer_unwrap_fx(
    Word32 *output_fx[],                                        /* i/o: SCE channels / Binaural synthesis  Q11  */
    const Word16 output_frame,                                  /* i  : output frame length                     */
    const Word16 num_subframes                                  /* i  : number of subframes to render           */
#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
    ,
    Word16 *metaSfCounter                                       /* i/o: subframe counter for metadata update    */
#endif
);

ivas_error ivas_td_binaural_renderer_ext_fx(
#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
@@ -1278,6 +1278,9 @@ typedef struct
    Word32 binaural_latency_ns;
    BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd;
    TDREND_HRFILT_FiltSet_t **hHrtfTD;
#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
    Word16 metaSfCounter;
#endif

} TDREND_WRAPPER, *TDREND_WRAPPER_HANDLE;

+16 −0
Original line number Diff line number Diff line
@@ -1511,6 +1511,10 @@ static TDREND_WRAPPER defaultTdRendWrapper(
    move32();
    w.hBinRendererTd = NULL;
    w.hHrtfTD = NULL;
#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION
    w.metaSfCounter = 0;
    move16();
#endif

    return w;
}
@@ -6609,7 +6613,11 @@ static ivas_error rotateFrameSba_fx(


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 )
{
    Word32 tmpTDRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k];
@@ -11513,7 +11521,11 @@ static void intermidiate_ext_dirac_render(
            hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_prev_q[1] = add( tmp, hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_prev_q[1] );
            move16();
        }
#ifdef FIX_BASOP_2475_ASSERT_IN_MASA2_REND_TO_MONO
        IF( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx != NULL && GT_16( hDirACRend->h_output_synthesis_psd_params.max_band_decorr, 0 ) )
#else
        IF( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx != NULL )
#endif
        {

            tmp = L_norm_arr( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_len );
@@ -11522,7 +11534,11 @@ static void intermidiate_ext_dirac_render(
            move16();
        }

#ifdef FIX_BASOP_2475_ASSERT_IN_MASA2_REND_TO_MONO
        IF( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx != NULL && GT_16( hDirACRend->h_output_synthesis_psd_params.max_band_decorr, 0 ) )
#else
        IF( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx != NULL )
#endif
        {
            tmp = L_norm_arr( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len );
            scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len, tmp ); /* Q(hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q + tmp) */