Commit e5649283 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

Merge branch...

Merge branch '679-checks-for-mc-and-number-of-channels-transport-channels-in-jbm-are-wrong' into 'main'

[Non-BE] Resolve "Checks for MC and number of channels transport channels in JBM are wrong"

See merge request !969
parents 400450d8 10aed140
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 */

+41 −5
Original line number Diff line number Diff line
@@ -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 ) )
            {
#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;
                }
+4 −0
Original line number Diff line number Diff line
@@ -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;