diff --git a/lib_com/options.h b/lib_com/options.h index d3eb80da56533c257a3208b0ed8410455496489c..757452c71e2ad3154bf838f42e57de9556c30b2c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -170,6 +170,7 @@ #define FIX_264_AUDIO_CHANNELS_TO_HEAP /* VA: issue 243: Move audio channels memory from stack to heap */ #define FIX_691_OSBA_CRASH /* FhG: Fix for issue 691: Crash for OSBA Stereo out */ #define FIX_694_OMASA_EXTREME /* Nokia: fix for crash in OMASA on extreme sample */ +#define FIX_679_JBM_MC2SBA /* FhG: fix issue 679: check for transport vs. internal channel count in JBM prior to ivas_mc2sba() */ #define FIX_LARGE_RENDERER_DELAY_COMP /* Fix renderer delay compensation with delays greater than 1 frame */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index ae3277fbc97724861252e5ebac5a7f19a972f6e7..da8bf7fc574f21716a2f0475fdf6ae90fe40169a 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -462,7 +462,13 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) { - if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) <= ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ) ) + if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) +#ifdef FIX_679_JBM_MC2SBA + >= +#else + <= +#endif + ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ) ) { ivas_mc2sba( st_ivas->hTransSetup, p_output, p_output, output_frame, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); } @@ -1019,17 +1025,41 @@ ivas_error ivas_jbm_dec_render( { if ( st_ivas->mc_mode == MC_MODE_MCT ) { +#ifdef FIX_679_JBM_MC2SBA + int16_t crendInPlaceRotation = FALSE; +#endif *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) { - ivas_mc2sba( st_ivas->hTransSetup, p_tc, p_output, *nSamplesRendered, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); +#ifdef FIX_679_JBM_MC2SBA + if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) < ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ) ) + { +#endif + ivas_mc2sba( st_ivas->hTransSetup, p_tc, p_output, *nSamplesRendered, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); +#ifdef FIX_679_JBM_MC2SBA + } +#endif } /* Rendering */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { - if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, - &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, p_tc, p_output, *nSamplesRendered, output_Fs ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, + st_ivas->intern_config, + st_ivas->hOutSetup.output_config, + st_ivas->hDecoderConfig, + st_ivas->hCombinedOrientationData, + &st_ivas->hIntSetup, + st_ivas->hEFAPdata, + st_ivas->hTcBuffer, +#ifdef FIX_679_JBM_MC2SBA + crendInPlaceRotation ? p_output : p_tc, +#else + p_tc, +#endif + p_output, + *nSamplesRendered, + output_Fs ) ) != IVAS_ERR_OK ) { return error; } @@ -1696,7 +1726,13 @@ int16_t ivas_jbm_dec_get_num_tc_channels( /* do all static dmx already in the TC decoder if less channels than transported... */ if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) { - if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) > ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ) ) + if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) +#ifdef FIX_679_JBM_MC2SBA + >= +#else + > +#endif + ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ) ) { num_tc = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; } diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 8a48e0e2b82a2fb4f17758d5557a9b160c62ed60..64b2c9931db2f469cefc04a062e5d06ba6f9fa09 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1831,7 +1831,11 @@ ivas_error ivas_rend_crendProcessSubframe( { int16_t subframe_idx, subframe_len; int16_t nchan_out, nchan_in, ch, first_sf, last_sf, slot_size, slots_to_render; +#ifdef FIX_679_JBM_MC2SBA + float *tc_local[MAX_OUTPUT_CHANNELS]; +#else float *tc_local[MAX_TRANSPORT_CHANNELS]; +#endif float pcm_tmp[BINAURAL_CHANNELS][L_FRAME48k]; float *p_pcm_tmp[BINAURAL_CHANNELS]; IVAS_REND_AudioConfigType inConfigType;