Commit 85ec9dfe authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

Merge branch 'b_20230817_jbm-for-osba' into 'main'

[non BE] Implement JBM for OSBA

See merge request !1057
parents eb805eab 04171966
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -185,7 +185,12 @@ typedef enum
#define MAX_JBM_L_FRAME48k                      1920
#define MAX_JBM_L_FRAME_NS                      40000000L
#define MAX_SPAR_INTERNAL_CHANNELS              IVAS_SPAR_MAX_CH
#ifdef JBM_FOR_OSBA
#define MAX_CLDFB_DIGEST_CHANNELS               (FOA_CHANNELS + MAX_NUM_OBJECTS)
#else
#define MAX_CLDFB_DIGEST_CHANNELS               4
#endif

#define MASA_JBM_RINGBUFFER_FRAMES              3

typedef enum
+22 −0
Original line number Diff line number Diff line
@@ -3480,6 +3480,16 @@ void ivas_sba_set_cna_cng_flag(

ivas_error ivas_sba_dec_reconfigure(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                  */
#ifdef JBM_FOR_OSBA
    ,
    uint16_t *nSamplesFlushed,            /* o  : number of samples flushed */
#if defined SPLIT_REND_WITH_HEAD_ROT
    const PCM_RESOLUTION pcm_resolution, /* i  : type for the decoded PCM resolution */
    void *data                           /* o  : output synthesis signal     */
#else
    int16_t *data /* o  : output synthesis signal                 */
#endif
#endif
);

ivas_error ivas_sba_digest_tc(
@@ -5719,6 +5729,18 @@ ivas_error ivas_sba_ism_separate_object_renderer_open(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder structure      */
);
#endif

#ifdef JBM_FOR_OSBA
ivas_error ivas_osba_dirac_td_binaural_jbm(
    Decoder_Struct *st_ivas,      /* i/o: IVAS decoder structure          */
    const uint16_t nSamplesAsked, /* i  : number of CLDFB slots requested           */
    uint16_t *nSamplesRendered,   /* o  : number of CLDFB slots rendered            */
    uint16_t *nSamplesAvailable,  /* o  : number of CLDFB slots still to render     */
    float *output_f[]             /* o  : rendered time signal                      */
);
#endif


ivas_error ivas_osba_dirac_td_binaural(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    float *output[],                                            /* o  : output synthesis signal                 */
+9 −2
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@
#endif

#define FIX_705_REND_CONF_FALSE_WARNING                 /* Eri: Bug in MSVC ftell() for UNIX-style line endings trigger false warning messages in renderer configuration. */

#define IGF_MEMORY_ALLOC_OPT                            /* FhG: Issue 157: allocate IGF encoder structure only when needed */
#define FIX_732_PLANAR_SBA_OSBA                         /* Dlb : issue 732: fix for crash in planar mode in OSBA format*/
#define FIX_708_DPID_COMMAND_LINE                       /* issue 708: sanity checks for '-dpid' command-line */
@@ -181,7 +182,6 @@
#define LIB_REND_FIX_HRTFPARAMBIN_MEMLEAK               /* fix 755 */
#define FIX_803_SCE_MD_HANDLE                           /* VA: issue 803: Resolve "MD handle needed only for one SCE" */


/* #################### End BE switches ################################## */

/* #################### Start NON-BE switches ############################ */
@@ -189,6 +189,7 @@
/* all switches in this category should start with "NONBE_" */

#define NONBE_FIX_751_MASA_TD_BITRATE_CHECK                   /* Nokia: issue 751: prevents secondary channel to take reserved bitrate if not DTX mode */

#define NONBE_FIX_736_FOA_BR_SWITCH                           /* FhG/Dlb : Issue 736: FOA bitrate switching decoding crashes in in ivas_spar_to_dirac */
#define NONBE_FIX_746_NONDIEGETIC_MD                          /* Eri: Issue 746: The non-diegetic panning flag affects the encoder bitstream even if extended metadata is not enabled. Crashes the decoder.*/
#define NONBE_FIX_723_SBA_BR_SWITCH_MSAN                      /* Dlb: issue 723: Uninitialised value used after BR switching*/
@@ -214,6 +215,12 @@
#define NONBE_FIX_798_OSBA_MC_DEC_CRASH
#define NONBE_FIX_806_OMASA_ONE_SEP_TRANSPORT_MIX             /* Nokia: issue 806: fix one separated object mode transport mix of the separated object */

#define JBM_FOR_OSBA                                          /* FhG: implement OSBA format in the JBM path */

#ifdef JBM_FOR_OSBA
#define OSBA_ROOM_IR
#endif

/* ##################### End NON-BE switches ########################### */

/* ################## End DEVELOPMENT switches ######################### */
+9 −0
Original line number Diff line number Diff line
@@ -159,6 +159,15 @@ ivas_error ivas_corecoder_dec_reconfig(
            st_ivas->hSCE[sce_id] = NULL;
        }

#ifdef JBM_FOR_OSBA
        if ( sba_dirac_stereo_flag_old && nCPE_old == 0 && st_ivas->hCPE[0] )
        {
            st_ivas->hCPE[0]->hCoreCoder[0] = 0; /* this has been deallocated as part of the SCE it actually belongs to */
            destroy_cpe_dec( st_ivas->hCPE[0] );
            st_ivas->hCPE[0] = NULL;
        }
#endif

        for ( cpe_id = st_ivas->nCPE; cpe_id < nCPE_old; cpe_id++ )
        {
            /* don't deallocate first CPE in case of mono/stereo output of 1 TC SBA, only deallocate core coder */
+7 −1
Original line number Diff line number Diff line
@@ -692,7 +692,9 @@ ivas_error ivas_dec(
        }

        /* Loudspeakers, Ambisonics or Binaural rendering */
        if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
        if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ||
             st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ||
             st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
        {
            ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, &p_output[sba_ch_idx], nchan_remapped, MAX_PARAM_SPATIAL_SUBFRAMES );
        }
@@ -760,8 +762,12 @@ ivas_error ivas_dec(
#endif
                }
            }
#ifdef JBM_FOR_OSBA
            if ( ( error = ivas_sba_upmixer_renderer( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK )
#else

            if ( ( error = ivas_sba_upmixer_renderer( st_ivas, &p_output[sba_ch_idx], output_frame ) ) != IVAS_ERR_OK )
#endif
            {
                return error;
            }
Loading