Commit 944c7622 authored by PLAINSI's avatar PLAINSI
Browse files

Merge branch '471-integrate-the-multichannel-parametric-upmix-into-the-jbm-path' into 'main'

[Non-BE] Resolve "Integrate the Multichannel Parametric Upmix into the JBM path"

See merge request !767
parents 31b31ddd 948486df
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2237,11 +2237,13 @@ enum
    VOIP_RTPDUMP
};

#ifndef JBM_PARAMUPMIX
typedef enum _COV_SMOOTHING_TYPE
{
    COV_SMOOTH_SPAR,
    COV_SMOOTH_MC
} COV_SMOOTHING_TYPE;
#endif

/* clang-format on */
#endif /* CNST_H */
+8 −0
Original line number Diff line number Diff line
@@ -1335,6 +1335,14 @@ typedef enum
#define MC_PARAMUPMIX_NCH                  2           /* number of channels to combine into 1 */
#define MC_PARAMUPMIX_MIN_CLDFB            8

#ifdef JBM_PARAMUPMIX
typedef enum _COV_SMOOTHING_TYPE
{
    COV_SMOOTH_SPAR,
    COV_SMOOTH_MC
} COV_SMOOTHING_TYPE;
#endif

typedef struct {
    const int32_t *value;
    const uint16_t *length;
+37 −2
Original line number Diff line number Diff line
@@ -837,6 +837,10 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode(
/*! r: render granularity */
int16_t ivas_jbm_dec_get_render_granularity(
    const RENDERER_TYPE rendererType,                           /* i  : renderer type                                               */
#ifdef JBM_PARAMUPMIX
    const IVAS_FORMAT ivas_format,                              /* i  : ivas format                                                 */
    const MC_MODE mc_mode,                                      /* i  : MC mode                                                     */
#endif
   const int32_t output_Fs                                     /* i  : sampling rate                                               */
);

@@ -3877,6 +3881,23 @@ void ivas_mc_paramupmix_dec_read_BS(
    int16_t *nb_bits                                            /* o  : number of bits written                          */
);

#ifdef JBM_PARAMUPMIX
void ivas_mc_paramupmix_dec_digest_tc(
    Decoder_Struct *st_ivas,                                        /* i/o: IVAS decoder handle                            */
    const uint8_t nCldfbSlots,                                      /* i : number of CLFBS slots in the transport channels */
    const int16_t nSamplesForRendering                              /* i  : number of samples provided   */
);

void ivas_mc_paramupmix_dec_render(
    Decoder_Struct *st_ivas,                                        /* i/o: IVAS decoder handle                       */
    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 *input_f[],                                               /* i: core-coder transport channels  */
    float *output_f[]                                               /* i/o: synthesized core-coder transport channels */
);
#endif

void ivas_param_mc_metadata_open(
    const MC_LS_SETUP mc_ls_setup,                              /* i  : MC ls setup                                         */
    const int16_t lfe_index,                                    /* i  : channel index of LFE                                */
@@ -5144,6 +5165,19 @@ void ivas_binRenderer_close(
    BINAURAL_RENDERER_HANDLE *hBinRenderer                      /* i/o: decoder binaural renderer handle                */
);

#ifdef JBM_PARAMUPMIX
void ivas_binaural_cldfb(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                  */
    float *output_f[]                                           /* i/o: synthesized core-coder transport channels/DirAC output  */
);

void ivas_binaural_cldfb_sf(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                  */
    const int16_t n_samples_to_render,                          /* i  : output frame length per channel                         */
    const int16_t slot_size,                                    /* i  : JBM slot size                                           */
    float *output_f[]                                           /* i/o: synthesized core-coder transport channels/DirAC output  */
);
#else
#ifdef DEBUGGING
void ivas_binaural_cldfb(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                  */
@@ -5156,8 +5190,9 @@ void ivas_binaural_cldfb_sf(
    float *output_f[]                                           /* i/o: synthesized core-coder transport channels/DirAC output  */

);

#endif
#endif

void ivas_binRenderer(
    BINAURAL_RENDERER_HANDLE hBinRenderer,                      /* i/o: fastconv binaural renderer handle                       */
    COMBINED_ORIENTATION_HANDLE hCombinedOrientationData,       /* i  : combined head and external orientation handle           */
+1 −0
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@
#define NONBE_FIX_589_JBM_TC_OFFSETS                    /* FhG: issue 589: wrong offset into the TC buffers is used in some rendering paths in the JBM main rendering function */
#define FIX_MEM_REALLOC_IND_LIST                        /* VA: issue 601: failure of the automatic memory re-allocation mechanism when ind_list[] buffer is depleted in MASA mode with 2 TC*/
#define FIX_581_CLANG_OFFSET_TO_NULL                    /* FhG: issue 581: fix CLANG error about applying an offset to a NULL pointer */
#define JBM_PARAMUPMIX                                  /* Dlb: Issue 471: Integrate the Multichannel Parametric Upmix into the JBM path */

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

+10 −3
Original line number Diff line number Diff line
@@ -985,7 +985,6 @@ void ivas_binaural_add_LFE(
}


#ifdef DEBUGGING
/*-------------------------------------------------------------------------*
 * ivas_binaural_cldfb()
 *
@@ -1070,6 +1069,9 @@ void ivas_binaural_cldfb(
void ivas_binaural_cldfb_sf(
    Decoder_Struct *st_ivas,           /* i/o: IVAS decoder structure                                  */
    const int16_t n_samples_to_render, /* i  : output frame length per channel                         */
#ifdef JBM_PARAMUPMIX
    const int16_t slot_size, /* i  : JBM slot size                                           */
#endif
    float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output  */
)
{
@@ -1078,12 +1080,18 @@ void ivas_binaural_cldfb_sf(
    float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
    float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
    int16_t slot_idx, subframeIdx, index_slot, idx_in, idx_lfe, maxBand, ch;
#ifdef JBM_PARAMUPMIX
    int16_t slots_to_render, first_sf, last_sf;
#else
    int16_t slot_size, slots_to_render, first_sf, last_sf;
#endif
    int16_t slot_index_start, slot_index_start_cldfb;

    /* Implement a 5 msec loops */
    maxBand = (int16_t) ( ( CLDFB_NO_CHANNELS_MAX * st_ivas->hDecoderConfig->output_Fs ) / 48000 );
#ifndef JBM_PARAMUPMIX
    slot_size = st_ivas->hTcBuffer->nb_subframes;
#endif

    /* loop for synthesis, assume we always have to render in multiples of 5ms subframes with spills */
    slots_to_render = min( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered, n_samples_to_render / slot_size );
@@ -1153,7 +1161,6 @@ void ivas_binaural_cldfb_sf(

    return;
}
#endif


/*-------------------------------------------------------------------------
Loading