Commit 7f0c7462 authored by bayers's avatar bayers
Browse files

Merge branch '904-jbm-sba-rs-to-foa-decoding-triggers-assert' into 'main'

[Non-BE] Resolve "JBM: SBA RS to FOA decoding triggers assert"

See merge request !1227
parents 064ed4ee 7ca22f62
Loading
Loading
Loading
Loading
Loading

lib_com/options.h

100644 → 100755
+1 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@
#define NONBE_FIX_871_ACELP_CRASH_IN_OSBA                     /* FhG: isse 871: crash in ACELP core encoder with OSBA */
#define NONBE_FIX_906_SBA_LBR_SMOOTHING                       /* FhG: issue #906: fix SBA low bit rate smoothing for HOA2/HOA3 output */
#define NONBE_FIX_878_RS_FEC_STEREO_CNG                       /* Eri: Frame loss and Unified Stereo CNG may cause false BER detection which results in corrupt bitstream decoding */

#define NONBE_FIX_904_JBM_SBA_RS_FOA                          /* FhG: issue #904: fix JBM SBA RS to FOA decoding */
/* ##################### End NON-BE switches ########################### */

/* ################## End DEVELOPMENT switches ######################### */
+4 −0
Original line number Diff line number Diff line
@@ -894,6 +894,10 @@ void ivas_jbm_dec_feed_tc_to_renderer(
        }
        else
        {
#ifdef NONBE_FIX_904_JBM_SBA_RS_FOA
            ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas );

#endif
            ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available );
        }
    }
+24 −0
Original line number Diff line number Diff line
@@ -253,6 +253,15 @@ ivas_error ivas_sba_dec_reconfigure(
            {
                return error;
            }
#ifdef NONBE_FIX_904_JBM_SBA_RS_FOA

            /* make sure the changed number of slots in the last subframe is not lost in the following steps */
            if ( st_ivas->hSpatParamRendCom != NULL )
            {
                st_ivas->hSpatParamRendCom->subframe_nbslots[st_ivas->hSpatParamRendCom->nb_subframes - 1] = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1];
            }
            st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->nb_subframes - 1] = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1];
#endif
        }
    }

@@ -651,6 +660,17 @@ ivas_error ivas_sba_dec_reconfigure(
    }

    /* resync SPAR and DirAC JBM info from TC Buffer */
#ifdef NONBE_FIX_904_JBM_SBA_RS_FOA
    if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity )
    {
        mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS );
        st_ivas->hSpatParamRendCom->nb_subframes = st_ivas->hTcBuffer->nb_subframes;
        st_ivas->hSpatParamRendCom->subframes_rendered = st_ivas->hTcBuffer->subframes_rendered;
    }
    mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpar->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS );
    st_ivas->hSpar->nb_subframes = st_ivas->hTcBuffer->nb_subframes;
    st_ivas->hSpar->subframes_rendered = st_ivas->hTcBuffer->subframes_rendered;
#else
    if ( st_ivas->hSpatParamRendCom != NULL )
    {
        if ( st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity )
@@ -664,6 +684,7 @@ ivas_error ivas_sba_dec_reconfigure(
            st_ivas->hSpar->subframes_rendered = st_ivas->hTcBuffer->subframes_rendered;
        }
    }
#endif

    if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ism_mode == ISM_SBA_MODE_DISC )
    {
@@ -672,6 +693,9 @@ ivas_error ivas_sba_dec_reconfigure(
        for ( n = 0; n < MAX_JBM_SUBFRAMES_5MS; n++ )
        {
            st_ivas->hSpatParamRendCom->subframe_nbslots[n] = st_ivas->hTcBuffer->subframe_nbslots[n] * granularityMultiplier;
#ifdef NONBE_FIX_904_JBM_SBA_RS_FOA
            st_ivas->hSpar->subframe_nbslots[n] = st_ivas->hSpatParamRendCom->subframe_nbslots[n];
#endif
        }
    }