Commit aba18db5 authored by sagnowski's avatar sagnowski
Browse files

Add a temporary workaround to fix IVAS_DEC_Flush with BINAURAL_SPLIT_PCM output

parent a4c646df
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -161,6 +161,7 @@
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define UNIFIED_DECODING_PATHS_LEFTOVERS                /* VA: issue 880: remove leftovers after NONBE_UNIFIED_DECODING_PATHS */
#define FIX_1119_SPLIT_RENDERING_VOIP                   /* FhG: Add split rendering support to decoder in VoIP mode */
#define TMP_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR           /* FhG: Workaround for incorrect implementation of decoder flush with split rendering */


/* #################### End BE switches ################################## */
+6 −0
Original line number Diff line number Diff line
@@ -1467,6 +1467,12 @@ ivas_error ivas_jbm_dec_render(
    if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        nchan_out_syn_output = BINAURAL_CHANNELS * st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses;
#ifdef TMP_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR
        if ( st_ivas->flushing )
        {
            nchan_out_syn_output = BINAURAL_CHANNELS;
        }
#endif
    }
    else
    {
+4 −0
Original line number Diff line number Diff line
@@ -1146,6 +1146,10 @@ typedef struct Decoder_Struct
    int16_t ism_extmeta_active;                                /* Extended metadata active in decoder */
    int16_t ism_extmeta_cnt;                                   /* Change frame counter for extended metadata */

#ifdef TMP_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR
    int16_t flushing;
#endif

} Decoder_Struct;

/* clang-format on */
+8 −0
Original line number Diff line number Diff line
@@ -4134,6 +4134,10 @@ ivas_error IVAS_DEC_Flush(
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

#ifdef TMP_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR
    hIvasDec->st_ivas->flushing = 1;
#endif

    *nSamplesFlushed = min( nSamplesPerChannel, hIvasDec->nSamplesAvailableNext );

    nSamplesToRender = (uint16_t) *nSamplesFlushed;
@@ -4149,6 +4153,10 @@ ivas_error IVAS_DEC_Flush(
        *nSamplesFlushed = 0;
    }

#ifdef TMP_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR
    hIvasDec->st_ivas->flushing = 0;
#endif

    return error;
}