Commit 205739d5 authored by vaclav's avatar vaclav
Browse files

port CR

parent 445cb5ec
Loading
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -185,11 +185,6 @@ ivas_error IVAS_REND_GetDelay_fx(
    Word16 *nSamples,                               /* o  : Renderer delay in samples                                         */
    Word32 *timeScale                               /* o  : Time scale of the delay, equal to renderer output sampling rate   */
);
ivas_error IVAS_REND_GetDelay(
    IVAS_REND_CONST_HANDLE hIvasRend,               /* i  : Renderer handle                                     */
    int16_t *nSamples,                              /* o  : Renderer delay in samples                           */
    int32_t *timeScale                              /* o  : Time scale of the delay, equal to renderer output sampling rate */
);

/*! r: error code */
ivas_error IVAS_REND_GetHrtfHandle( 
+27 −11
Original line number Diff line number Diff line
@@ -4428,11 +4428,13 @@ ivas_error IVAS_REND_GetNumAllObjects(
    return IVAS_ERR_OK;
}


/*-------------------------------------------------------------------*
 * IVAS_REND_GetDelay()
 *
 *
 *-------------------------------------------------------------------*/

ivas_error IVAS_REND_GetDelay_fx(
    IVAS_REND_CONST_HANDLE hIvasRend, /* i  : Renderer state                                                    */
    Word16 *nSamples,                 /* o  : Renderer delay in samples                                         */
@@ -4515,25 +4517,40 @@ ivas_error IVAS_REND_GetDelay_fx(
    {
        IF( NE_32( hIvasRend->inputsSba[i].base.inConfig, IVAS_AUDIO_CONFIG_INVALID ) )
        {
            if ( hIvasRend->splitRendWrapper->hBinHrSplitPreRend != NULL )
#ifdef FIX_1135_EXT_RENDERER_HANDLES
            test();
            IF( hIvasRend->splitRendWrapper != NULL && hIvasRend->splitRendWrapper->hBinHrSplitPreRend != NULL )
#else
            IF( hIvasRend->splitRendWrapper->hBinHrSplitPreRend != NULL )
#endif
            {
                if ( hIvasRend->hRendererConfig->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV )
                IF( hIvasRend->hRendererConfig->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV )
                {
                    latency_ns = hIvasRend->inputsSba[i].cldfbRendWrapper.binaural_latency_ns;
                    move32();
                }
                else
                ELSE
                {
                    IF( ( hIvasRend->inputsSba[i].crendWrapper != NULL ) )
                    {
                    latency_ns = ( hIvasRend->inputsSba[i].crendWrapper != NULL ) ? hIvasRend->inputsSba[i].crendWrapper->binaural_latency_ns : 0;
                        latency_ns = hIvasRend->inputsSba[i].crendWrapper->binaural_latency_ns;
                    }
                max_latency_ns = max( max_latency_ns, latency_ns );
                    ELSE
                    {
                        latency_ns = 0;
                    }
                    move32();
                }
            else if ( hIvasRend->inputsSba[i].cldfbRendWrapper.hCldfbRend != NULL )
                max_latency_ns = L_max( max_latency_ns, latency_ns );
            }
            ELSE IF( hIvasRend->inputsSba[i].cldfbRendWrapper.hCldfbRend != NULL )
            {
                latency_ns = hIvasRend->inputsSba[i].cldfbRendWrapper.binaural_latency_ns;
                latency_ns += IVAS_FB_DEC_DELAY_NS;
                max_latency_ns = max( max_latency_ns, latency_ns );
                move32();
                latency_ns = L_add( latency_ns, IVAS_FB_DEC_DELAY_NS );
                max_latency_ns = L_max( max_latency_ns, latency_ns );
            }
            else
            ELSE
            {
                IF( hIvasRend->inputsSba[i].crendWrapper != NULL )
                {
@@ -4549,7 +4566,6 @@ ivas_error IVAS_REND_GetDelay_fx(
        }
    }


    FOR( i = 0; i < RENDERER_MAX_MASA_INPUTS; i++ )
    {
        IF( NE_32( hIvasRend->inputsMasa[i].base.inConfig, IVAS_AUDIO_CONFIG_INVALID ) )
@@ -4560,7 +4576,6 @@ ivas_error IVAS_REND_GetDelay_fx(
        }
    }


    //*nSamples = (Word16) roundf( (float) max_latency_ns * *timeScale / 1000000000.f );
    Word32 temp = Mpy_32_32( *timeScale, 268436 ); // Q0 + Q31 - Q31 -> Q0, ( 1 / 8000 ) * 2 ^ 31
    *nSamples = extract_l( Mpy_32_32_r( max_latency_ns, timescale_by_ns[temp] ) );
@@ -4569,6 +4584,7 @@ ivas_error IVAS_REND_GetDelay_fx(
    return IVAS_ERR_OK;
}


/*-------------------------------------------------------------------*
 * IVAS_REND_FeedInputAudio()
 *