Commit 4a523053 authored by vaclav's avatar vaclav
Browse files

accept FIX_1119_SPLIT_RENDERING_VOIP

parent 2d9397dc
Loading
Loading
Loading
Loading
+2 −46
Original line number Diff line number Diff line
@@ -2057,11 +2057,7 @@ static ivas_error initOnFirstGoodFrame(

        for ( int16_t i = 0; i < numInitialBadFrames; ++i )
        {
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
            if ( isSplitRend )
#else
            if ( *splitRendWriter != NULL )
#endif
            {
                ISAR_SPLIT_REND_BITS_DATA splitRendBitsZero;
                splitRendBitsZero.bits_buf = NULL;
@@ -2079,12 +2075,7 @@ static ivas_error initOnFirstGoodFrame(
                    return error;
                }
            }

#ifdef FIX_1119_SPLIT_RENDERING_VOIP
            if ( !isSplitCoded )
#else
            else
#endif
            {
                if ( *pRemainingDelayNumSamples < *numOutSamples )
                {
@@ -2292,13 +2283,11 @@ static ivas_error decodeG192(
        return error;
    }

#ifdef FIX_1119_SPLIT_RENDERING_VOIP
    if ( !isSplitRend )
    {
        /* Ensure split rendering output struct is not used when not outputting to a split rendering output configuration */
        splitRendBits = NULL;
    }
#endif

    if ( ( error = IVAS_DEC_is_split_rendering_coded_out( hIvasDec, &isSplitCoded ) ) != IVAS_ERR_OK )
    {
@@ -2635,11 +2624,7 @@ static ivas_error decodeG192(
                }

                /* decode transport channels, do TSM and feed to renderer */
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
                if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, splitRendBits ) ) != IVAS_ERR_OK )
#else
                if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, isSplitRend, splitRendBits ) ) != IVAS_ERR_OK )
#endif
                {
                    return error;
                }
@@ -3232,7 +3217,6 @@ static ivas_error decodeVoIP(
    bool parametersAvailableForEditing = false;
    uint16_t nSamplesRendered = 0;

#ifdef FIX_1119_SPLIT_RENDERING_VOIP
    SplitFileReadWrite *splitRendWriter = NULL;
    int16_t isSplitRend, isSplitCoded;

@@ -3253,7 +3237,6 @@ static ivas_error decodeVoIP(
        fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_coded_out, code: %d\n", error );
        return error;
    }
#endif

    vec_pos_update = 0;
    if ( ( error = IVAS_DEC_GetRenderFramesizeMs( hIvasDec, &systemTimeInc_ms ) ) != IVAS_ERR_OK )
@@ -3582,7 +3565,6 @@ static ivas_error decodeVoIP(
                ivasRtp.nProcPiData += numPiData;
            }

#ifdef FIX_1119_SPLIT_RENDERING_VOIP
            if ( isSplitRend )
            {
#ifdef SUPPORT_JBM_TRACEFILE
@@ -3597,7 +3579,6 @@ static ivas_error decodeVoIP(
            }
            else
            {
#endif
#ifdef SUPPORT_JBM_TRACEFILE
                if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, &parametersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK )
#else
@@ -3607,9 +3588,7 @@ static ivas_error decodeVoIP(
                    fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
            }
#endif

            if ( bitstreamReadDone == true )
            {
@@ -3719,15 +3698,7 @@ static ivas_error decodeVoIP(
            /* Once good frame decoded, catch up */
            if ( decodedGoodFrame )
            {
#ifndef FIX_1119_SPLIT_RENDERING_VOIP
                SplitFileReadWrite *splitRendWriter = NULL;

#endif
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
                if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, &vec_pos_len, delayNumSamples_orig, &delayNumSamples, &delayTimeScale,
#else
                if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, NULL, delayNumSamples_orig, &delayNumSamples, &delayTimeScale,
#endif
                                                     &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, &srRtp, &splitRendWriter ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Error in initOnFirstGoodFrame(): %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -3743,7 +3714,6 @@ static ivas_error decodeVoIP(
        /* Write current frame */
        if ( !srRtp.hPack && decodedGoodFrame )
        {
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
            if ( isSplitRend )
            {
                if ( split_rend_write_bitstream_to_file( splitRendWriter, splitRendBits->bits_buf, &splitRendBits->bits_read, &splitRendBits->bits_written ) != IVAS_ERR_OK )
@@ -3752,10 +3722,8 @@ static ivas_error decodeVoIP(
                    goto cleanup;
                }
            }

            if ( !isSplitCoded )
            else
            {
#endif
                if ( delayNumSamples < nOutSamples )
                {
                    if ( ( error = AudioFileWriter_write( afWriter, &pcmBuf[delayNumSamples * nOutChannels], nOutSamples * nOutChannels - ( delayNumSamples * nOutChannels ) ) ) != IVAS_ERR_OK )
@@ -3769,9 +3737,7 @@ static ivas_error decodeVoIP(
                {
                    delayNumSamples -= nOutSamples;
                }
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
            }
#endif

            /* Write ISM metadata to external file(s) */
            if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
@@ -3876,11 +3842,7 @@ static ivas_error decodeVoIP(
        goto cleanup;
    }

#ifdef FIX_1119_SPLIT_RENDERING_VOIP
    if ( nSamplesFlushed && !isSplitCoded )
#else
    if ( nSamplesFlushed )
#endif
    {
        /* Write current frame */
        if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, nSamplesFlushed * nOutChannels ) ) != IVAS_ERR_OK )
@@ -3953,18 +3915,14 @@ static ivas_error decodeVoIP(

    memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) );

#ifdef FIX_1119_SPLIT_RENDERING_VOIP
    if ( afWriter != NULL )
    {
#endif
        if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) );
            goto cleanup;
        }
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
    }
#endif

    /*------------------------------------------------------------------------------------------*
     * Printouts after decoding has finished
@@ -4012,9 +3970,7 @@ cleanup:
    IVAS_RTP_Term( &srRtp );
    IVAS_RTP_Term( &ivasRtp );
    AudioFileWriter_close( &afWriter );
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
    split_rend_reader_writer_close( &splitRendWriter );
#endif
    JbmOffsetFileWriter_close( &jbmOffsetWriter );
#ifdef SUPPORT_JBM_TRACEFILE
    JbmTraceFileWriter_close( &jbmTraceWriter );
+0 −2
Original line number Diff line number Diff line
@@ -1310,7 +1310,6 @@ int main(
                    goto cleanup;
                }

#ifdef FIX_1119_SPLIT_RENDERING_VOIP
                /* Set BFI if frame is empty */
                int16_t frameEmpty = (int16_t) ( bitsBuffer.config.bitsWritten == 0 );
                if ( frameEmpty )
@@ -1321,7 +1320,6 @@ int main(
                        goto cleanup;
                    }
                }
#endif
            }
        }

+1 −3
Original line number Diff line number Diff line
@@ -5195,10 +5195,9 @@ void ivas_binaural_add_LFE(
    float *output_f[]                                           /* o  : synthesized core-coder transport channels/DirAC output  */
);

#ifdef FIX_1119_SPLIT_RENDERING_VOIP

/*---------------------------------------------------------------------------------*
 * Multi-pose ring buffer Prototypes
 * Multi-pose ring buffer Prototypes for split-rendering
*-----------------------------------------------------------------------------------*/

ivas_error ivas_CLDFB_RINGBUF_Open( 
@@ -5231,7 +5230,6 @@ void ivas_CLDFB_RINGBUF_GetByIdx(
    const int16_t idx 
);

#endif

/*----------------------------------------------------------------------------------*
 * renderer prototypes
+1 −3
Original line number Diff line number Diff line
@@ -163,7 +163,6 @@
/* only BE switches wrt selection floating point code */

/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define FIX_1119_SPLIT_RENDERING_VOIP                   /* FhG: Add split rendering support to decoder in VoIP mode */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define FIX_1413_IGF_INIT_PRINTOUT                      /* FhG: use correct variable for IGF initiliazation */
#define RENDERER_MD_SYNC_DELAY_TO_INTEGER               /* FhG: change data type of metadata sync delay in ext renderer to int16_t for better BASOP portability (and nicer code) */
@@ -176,8 +175,7 @@

/* #################### Start NON-BE switches ############################ */

/* any switch which is non-be wrt selection floating point code */
/* all switches in this category should start with "NONBE_" */
/* any switch which is non-be wrt last submitted floating point code */

#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ 
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
+1 −13
Original line number Diff line number Diff line
@@ -1637,9 +1637,6 @@ static void binRenderer_split(
    float Cldfb_ImagBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o  : Rotated Binaural signals                      */
    float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX],                                   /* i  : LS signals                                    */
    float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX],                                   /* i  : LS signals                                    */
#ifndef FIX_1119_SPLIT_RENDERING_VOIP
    const int16_t slot_idx_start,
#endif
    const int16_t num_freq_bands,
    const int16_t nchan_out )
{
@@ -1669,16 +1666,11 @@ static void binRenderer_split(
        {
            for ( ch = 0; ch < nchan_out; ch++ )
            {
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
                ivas_CLDFB_RINGBUF_Push(
                    hSplitBinRend->hMultiBinCldfbData[pos_idx * BINAURAL_CHANNELS + ch],
                    Cldfb_RealBuffer_Binaural_loc[pos_idx][ch][slot_idx],
                    Cldfb_ImagBuffer_Binaural_loc[pos_idx][ch][slot_idx],
                    num_freq_bands );
#else
                mvr2r( Cldfb_RealBuffer_Binaural_loc[pos_idx][ch][slot_idx], hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], num_freq_bands );
                mvr2r( Cldfb_ImagBuffer_Binaural_loc[pos_idx][ch][slot_idx], hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], num_freq_bands );
#endif
            }
        }
    }
@@ -2399,11 +2391,7 @@ void ivas_dirac_dec_render_sf(
        if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
        {
            binRenderer_split( st_ivas->hBinRenderer, st_ivas->hSplitBinRend, st_ivas->hCombinedOrientationData, hSpatParamRendCom->subframe_nbslots[subframe_idx],
                               Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer,
#ifndef FIX_1119_SPLIT_RENDERING_VOIP
                               slot_idx_start,
#endif
                               hSpatParamRendCom->num_freq_bands, st_ivas->hDecoderConfig->nchan_out );
                               Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer, hSpatParamRendCom->num_freq_bands, st_ivas->hDecoderConfig->nchan_out );
        }
        else
        {
Loading