Commit 42cf0da8 authored by vaclav's avatar vaclav
Browse files

accept NONBE_1293_CRASH_FIRST_FRAME_LOST

parent bda4efb2
Loading
Loading
Loading
Loading
+3 −19
Original line number Diff line number Diff line
@@ -985,9 +985,7 @@ int main(

    while ( 1 )
    {
#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
        int16_t bfi = 0;
#endif
        int16_t num_in_channels;
        num_in_channels = inBuffer.config.numChannels;

@@ -995,12 +993,10 @@ int main(
        if ( ( hSplitRendFileReadWrite != NULL ) && splitBinNeedsNewFrame )
        {
            ivas_error error_tmp;

            numSamplesRead = (int16_t) inBufferSize;
#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST

            error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten, &bfi );
#else
            error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten );
#endif
            if ( error_tmp != IVAS_ERR_OK )
            {
                if ( error_tmp == IVAS_ERR_END_OF_FILE )
@@ -1067,24 +1063,13 @@ int main(
        /* Read from split renderer bfi file if specified */
        if ( splitRendBFIReader != NULL && splitBinNeedsNewFrame )
        {
#ifndef NONBE_1293_CRASH_FIRST_FRAME_LOST
            int16_t bfi;
#endif
            if ( ( error = SplitRendBFIFileReading( splitRendBFIReader, &bfi ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError in SplitRendBFIFileReading(): %s\n", ivas_error_to_string( error ) );
                goto cleanup;
            }

#ifndef NONBE_1293_CRASH_FIRST_FRAME_LOST
            if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, bfi ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "Error in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) );
                exit( -1 );
            }
#endif
        }
#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST

        if ( splitBinNeedsNewFrame )
        {
            if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, bfi ) ) != IVAS_ERR_OK )
@@ -1093,7 +1078,6 @@ int main(
                goto cleanup;
            }
        }
#endif

        for ( i = 0; i < args.inConfig.numBinBuses; ++i )
        {
+0 −1
Original line number Diff line number Diff line
@@ -170,7 +170,6 @@
/* all switches in this category should start with "NONBE_" */

#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_1293_CRASH_FIRST_FRAME_LOST               /* VA: issue 1293: fix G.192 decoder crash when first frame is lost */
#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.  */
#define NONBE_1118_EVS_LR_HQ_BITERROR                   /* VA: issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors */
#define NONBE_1303_REND_GRANULARITY                     /* VA: issue 1303: Renderer granularity revision */
+0 −36
Original line number Diff line number Diff line
@@ -1192,12 +1192,10 @@ ivas_error IVAS_DEC_GetSamplesDecoder(
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
    if ( !hIvasDec->hasBeenFedFirstGoodFrame && !hIvasDec->isInitialized ) /* note: 'isInitialized' is related to EVS decoder */
    {
        return IVAS_ERR_OK;
    }
#endif

    st_ivas = hIvasDec->st_ivas;
    isInitialized_voip = hIvasDec->apaExecBuffer != NULL;
@@ -1361,14 +1359,12 @@ ivas_error IVAS_DEC_GetEditableParameters(
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
    if ( !hIvasDec->hasBeenFedFirstGoodFrame )
    {
        hIvasEditableParameters->num_obj = 0;

        return IVAS_ERR_OK;
    }
#endif

    st_ivas = hIvasDec->st_ivas;
    ism_mode = st_ivas->ism_mode;
@@ -1509,12 +1505,10 @@ ivas_error IVAS_DEC_SetEditableParameters(
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
    if ( !hIvasDec->hasBeenFedFirstGoodFrame )
    {
        return IVAS_ERR_OK;
    }
#endif

    st_ivas = hIvasDec->st_ivas;
    ism_mode = st_ivas->ism_mode;
@@ -1761,9 +1755,7 @@ ivas_error IVAS_DEC_PrepareRenderer(
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
    if ( hIvasDec->hasBeenFedFirstGoodFrame || hIvasDec->isInitialized ) /* note: 'isInitialized' is related to EVS decoder */
#endif
    {
        ivas_dec_prepare_renderer( hIvasDec->st_ivas );
    }
@@ -1848,20 +1840,8 @@ ivas_error IVAS_DEC_GetSamplesRenderer(
    {
        hIvasDec->hasBeenFedFrame = false;
        set_s( pcmBuf, 0, st_ivas->hDecoderConfig->nchan_out * nSamplesAsked );
#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
        nSamplesRendered = nSamplesAsked;
#else
        hIvasDec->nSamplesRendered += nSamplesAsked;
        *nOutSamples = nSamplesAsked;
#endif
        hIvasDec->nSamplesAvailableNext -= nSamplesAsked;
#ifndef NONBE_1293_CRASH_FIRST_FRAME_LOST
        if ( hIvasDec->nSamplesAvailableNext == 0 )
        {
            hIvasDec->needNewFrame = true;
            *needNewFrame = true;
        }
#endif
    }
    else
    {
@@ -1900,21 +1880,8 @@ ivas_error IVAS_DEC_GetSamplesRenderer(
        }

        nSamplesRendered += nSamplesRendered_loop;
#ifndef NONBE_1293_CRASH_FIRST_FRAME_LOST
        nSamplesToRender -= nSamplesRendered_loop;
        if ( hIvasDec->nSamplesAvailableNext == 0 )
        {
            *needNewFrame = true;
            hIvasDec->needNewFrame = true;
        }
        else
        {
            *needNewFrame = false;
        }
#endif
    }

#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
    if ( hIvasDec->nSamplesAvailableNext == 0 )
    {
        *needNewFrame = true;
@@ -1925,7 +1892,6 @@ ivas_error IVAS_DEC_GetSamplesRenderer(
        *needNewFrame = false;
    }

#endif
    *nOutSamples = nSamplesRendered;

    return IVAS_ERR_OK;
@@ -2030,12 +1996,10 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(
        return error;
    }

#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
    if ( !hIvasDec->hasBeenFedFirstGoodFrame )
    {
        return IVAS_ERR_OK;
    }
#endif

    /* change buffer layout */
    for ( i = 0; i < numSamplesPerChannelToDecode; ++i )
+1 −2
Original line number Diff line number Diff line
@@ -1539,7 +1539,6 @@ static ivas_error renderSplitBinauralWithPostRot(
    }
    else
    {
#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
        if ( splitBinInput->numCachedSamples == 0 )
        {
            numSamplesPerChannelCacheSize = (int16_t) ( *splitBinInput->base.ctx.pOutSampleRate * bits.isar_frame_size_ms / 1000 ) - outAudio.config.numSamplesPerChannel;
@@ -1549,7 +1548,7 @@ static ivas_error renderSplitBinauralWithPostRot(
        {
            splitBinInput->numCachedSamples -= outAudio.config.numSamplesPerChannel;
        }
#endif

        if ( splitBinInput->base.inConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
        {
            for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ )
+1 −10
Original line number Diff line number Diff line
@@ -331,20 +331,12 @@ ivas_error split_rend_write_bitstream_to_file(
 *
 *-----------------------------------------------------------------------------------------*/

#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
ivas_error split_rend_read_bits_from_file(
    SplitFileReadWrite *hSplitRendFileReadWrite,
    uint8_t *bits,
    int32_t *bits_read,
    int32_t *bits_written,
    int16_t *bfi )
#else
ivas_error split_rend_read_bits_from_file(
    SplitFileReadWrite *hSplitRendFileReadWrite,
    uint8_t *bits,
    int32_t *bits_read,
    int32_t *bits_written )
#endif
{
    char header[SPLIT_RENDERER_FRAME_HEADER_LEN] = "SPLIT_FRAME";
    char header_read[SPLIT_RENDERER_FRAME_HEADER_LEN];
@@ -407,13 +399,12 @@ ivas_error split_rend_read_bits_from_file(

    *bits_read = 0;
    *bits_written = bit_len;
#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST

    *bfi = 0;
    if ( bit_len == 0 )
    {
        *bfi = 1;
    }
#endif

    return IVAS_ERR_OK;
}
Loading