From 785a82d847d2392f26490bfbcf1c0d207bb09c2a Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Mon, 26 Feb 2024 14:35:15 +0100 Subject: [PATCH] fix for #1012, #1013, fix JBM flush output buffer, use also the global output buffer instead of a local one. --- lib_com/options.h | 1 + lib_dec/ivas_jbm_dec.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index f79b346839..87fdfed11d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -184,6 +184,7 @@ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin */ #define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ #define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */ +#define NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER /* FhG: issues #1012, 1013: JBM flush function uses wrong output buffer */ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 89aa3f8d4c..a7ebc61a2c 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1586,8 +1586,12 @@ ivas_error ivas_jbm_dec_flush_renderer( int16_t n_slots_still_available; int16_t n_samples_to_render; DECODER_TC_BUFFER_HANDLE hTcBuffer; +#ifdef NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER + float *p_output[MAX_CICP_CHANNELS + MAX_NUM_OBJECTS]; +#else float output[MAX_CICP_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; float *p_output[MAX_CICP_CHANNELS]; +#endif if ( !st_ivas->hDecoderConfig->Opt_tsm ) { @@ -1632,10 +1636,17 @@ ivas_error ivas_jbm_dec_flush_renderer( hTcBuffer->n_samples_flushed = n_samples_to_render; hTcBuffer->n_samples_rendered = 0; +#ifdef NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER + for ( ch_idx = 0; ch_idx < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) + { + p_output[ch_idx] = st_ivas->p_output_f[ch_idx]; + } +#else for ( ch_idx = 0; ch_idx < MAX_CICP_CHANNELS; ch_idx++ ) { p_output[ch_idx] = output[ch_idx]; } +#endif if ( st_ivas->ivas_format == ISM_FORMAT ) { -- GitLab