Commit e4762298 authored by jtorr's avatar jtorr
Browse files

Merge branch '527-mono-signal-embedded-in-ambisonics-input' into 'main'

[non-BE] Adding in mono detection and processing to stop leakage

See merge request !878
parents fdb1a583 b6393b9c
Loading
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1018,6 +1018,13 @@ typedef enum
#define DIRAC_SLOT_NS                           1250000L                    /* time duration of a time slot, 1.25ms (==DELAY_RENERER_NS/MAX_PARAM_SPATIAL_SUBFRAMES) */
#define DIRAC_SLOT_ENC_NS                       5000000L

#define DIRAC_MONO_THRESH_SILENCE				3e4f
#define DIRAC_MONO_NORM_FACTOR					1e13f
#define DIRAC_MONO_ONE_ON_NORM_FACTOR			(1.f / 1e13f)
#define DIRAC_MONO_MAX_THRESH					1e6f
#define DIRAC_MONO_MIN_THRESH					1e2f
#define DIRAC_MONO_FRAME_THRESH					15 /* 30ms */

typedef enum
{
    DIRAC_OPEN,                                 /* initialize to default value              */
+18 −0
Original line number Diff line number Diff line
@@ -3433,6 +3433,11 @@ void ivas_dirac_param_est_enc(
    const IVAS_FORMAT ivas_format ,
   const int16_t hodirac_flag,
   const int16_t nchan_fb_in
#ifdef FIX_527_SBA_MONO_INPUT
    ,
    int16_t *mono_frame_count,
    int16_t *dirac_mono_flag
#endif
 );


@@ -4385,6 +4390,9 @@ ivas_error ivas_spar_md_enc_process(
    const int16_t nchan_inp,
    const int16_t sba_order,                                    /* i  : Ambisonic (SBA) order                   */
    float *prior_mixer[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH]                                  /* i  : prior mixer_matrix     */
#ifdef FIX_527_SBA_MONO_INPUT
    ,const int16_t dirac_mono_flag
#endif
);

void ivas_compute_spar_params(
@@ -4524,6 +4532,11 @@ void ivas_spar_update_md_hist(
    ivas_spar_md_dec_state_t *hMdDec                            /* i/o: SPAR MD decoder handle                  */
);

int16_t ivas_spar_chk_zero_coefs(
    Decoder_Struct *st_ivas,     /* i/o: IVAS decoder handle                                */
    const int16_t sba_order      /* i  : Ambisonic (SBA) order                              */
);

void ivas_spar_smooth_md_dtx(
    ivas_spar_md_dec_state_t *hMdDec,                           /* i/o: SPAR MD decoder handle                  */
    const int16_t num_bands_out,                                /* i  : number of output bands                  */
@@ -5527,6 +5540,11 @@ void computeReferencePower_enc(
    const IVAS_FORMAT ivas_format,                              /* i  : ivas_format                                     */
    int16_t ref_power_w,                                        /* i  : use 0 if hodirac is enabled                     */
    const int16_t nchan_ana                                     /* i  : number of analysis channels                     */
#ifdef FIX_527_SBA_MONO_INPUT
    ,
    int16_t *mono_frame_count,
    int16_t *dirac_mono_flag
#endif
);

ivas_error ivas_mono_dmx_renderer_open(
+3 −0
Original line number Diff line number Diff line
@@ -149,6 +149,9 @@ ivas_error ivas_qmetadata_allocate_memory(
                {
                    set_zero( hQMetaData->q_direction[dir].band_data[j].elevation, MAX_PARAM_SPATIAL_SUBFRAMES );
                    set_zero( hQMetaData->q_direction[dir].band_data[j].azimuth, MAX_PARAM_SPATIAL_SUBFRAMES );
#ifdef FIX_527_SBA_MONO_INPUT
                    set_zero( hQMetaData->q_direction[dir].band_data[j].energy_ratio, MAX_PARAM_SPATIAL_SUBFRAMES );
#endif
                }
            }

+3 −0
Original line number Diff line number Diff line
@@ -558,6 +558,9 @@ typedef struct ivas_masa_qmetadata_frame_struct
    int16_t metadata_max_bits; /* maximum allowed number of bits for metadata per frame */
    uint8_t useLowerRes;
    uint8_t useLowerBandRes;
#ifdef FIX_527_SBA_MONO_INPUT
    int16_t dirac_mono_flag;
#endif
    IVAS_SURROUND_COHERENCE_BAND_DATA *surcoh_band_data;

    /* Additional helper values to include all data required for writing to output file */
+2 −0
Original line number Diff line number Diff line
@@ -222,6 +222,8 @@
#define FIX_647_SILENT_W_PARAMBIN                       /* Nokia: Issue #647: Fix silent W SH inputs in parametric binauralizer */

#define MASA_AND_OBJECTS                                /* Nokia: Combination of MASA and objects */

#define FIX_527_SBA_MONO_INPUT                          /* Dlb : Fix for mono content in a HOA input format */
#define FIX_653_BUG_IN_SKIP_MATRIX                      /* Dlb: fix for issue #653, bug in the ivas_spar_get_skip_mat function*/
#define FIX_663_PARAM_ISM_EXT                           /* FhG: Issue 663: ParamISM EXT output improvement */
#define FIX_673_OMASA_OBJ_MD_SYNC                       /* Nokia: Fix issue 673 by updating metadata in the third subframe to account for audio delay. */
Loading