Commit 926dddd7 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Consolidate switches within OMASA

parent 54b8bada
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ enum{
enum
{
    IND_IVAS_FORMAT,
#ifdef FIX_OMASA_STEREO_SWITCHING
#ifdef MASA_AND_OBJECTS
    IND_SMODE_OMASA,
#endif
    IND_SMODE,
+2 −2
Original line number Diff line number Diff line
@@ -363,7 +363,7 @@ typedef enum
#ifdef MASA_AND_OBJECTS
#define BRATE_ISM_INACTIVE                      2450 /* CoreCoder bitrate in ISM no meta / inactive frames */
#define BITS_ISM_INACTIVE                       ( BRATE_ISM_INACTIVE / FRAMES_PER_SEC )
#ifdef OMASA_ENERGIES
#ifdef MASA_AND_OBJECTS
#define ADJUST_ISM_BRATE_NEG                    6000
#define ADJUST_ISM_BRATE_POS                    8000
#endif
@@ -1280,7 +1280,7 @@ enum
#define MASA_STEREO_MIN_BITRATE                 IVAS_24k4
#ifdef MASA_AND_OBJECTS
#define MAXIMUM_OMASA_FREQ_BANDS                8                           /* Corresponds to maximum number of coding bands at 32 kbps */
#ifdef FIX_OMASA_STEREO_SWITCHING
#ifdef MASA_AND_OBJECTS
#define OMASA_STEREO_SW_CNT_MAX                 100
#define OMASA_STEREO_SW_CNT_MAX2                5
#endif
+9 −22
Original line number Diff line number Diff line
@@ -969,7 +969,7 @@ ivas_error ivas_ism_enc(
    float data[MAX_NUM_OBJECTS][L_FRAME48k],                    /* i  : input signal                                */
    const int16_t input_frame,                                  /* i  : input frame length per channel              */
    int16_t *nb_bits_metadata                                   /* i  : number of metadata bits                     */
#ifdef OMASA_ENERGIES
#ifdef MASA_AND_OBJECTS
     ,
     const int16_t flag_omasa_ener_brate                        /* i  : less bitrate for objects in OMASA flag      */
#endif
@@ -992,14 +992,10 @@ ivas_error ivas_ism_metadata_enc(
    const PARAM_ISM_CONFIG_HANDLE hParamIsm,                    /* i  : Param ISM Config Handle                     */
    const int16_t ism_extended_metadata_flag                    /* i  : Extended metadata flag                      */
#ifdef MASA_AND_OBJECTS
   ,const float lp_noise_CPE                                    /* i  : LP filterend total noise estimation         */
#ifdef OMASA_ENERGIES
    ,
    const int16_t flag_omasa_ener_brate                         /* i  : less bitrate for objects in OMASA flag      */
#endif
#ifdef FIX_OMASA_STEREO_SWITCHING
   ,int16_t *omasa_stereo_sw_cnt
#endif
    const float lp_noise_CPE,                                   /* i  : LP filterend total noise estimation         */
    const int16_t flag_omasa_ener_brate,                        /* i  : less bitrate for objects in OMASA flag      */
    int16_t *omasa_stereo_sw_cnt
#endif
);

@@ -1988,9 +1984,7 @@ void stereo_td_init_dec(
void tdm_configure_dec(
#ifdef MASA_AND_OBJECTS
    const int16_t ivas_format,                                  /* i  : IVAS format                             */
#ifdef FIX_OMASA_24_4k
    const int16_t ism_mode,                                     /* i  : ISM mode in combined format             */
#endif
#endif
    CPE_DEC_HANDLE hCPE,                                        /* i/o: CPE decoder structure                   */
    int16_t *tdm_ratio_idx,                                     /* o  : ratio index                             */
@@ -2043,9 +2037,7 @@ void tdm_ol_pitch_comparison(
void tdm_configure_enc(
#ifdef MASA_AND_OBJECTS
    const int16_t ivas_format,                                  /* i  : IVAS format                             */
#ifdef FIX_OMASA_24_4k
    const int16_t ism_mode,                                     /* i  : ISM mode in combined format             */
#endif
#endif
    CPE_ENC_HANDLE hCPE,                                        /* i  : CPE encoder structure                   */
    const float Etot_last[CPE_CHANNELS],                        /* i/o: Energy of last frame                    */
@@ -2065,9 +2057,7 @@ ivas_error signaling_enc_secondary(
void tdm_bit_alloc(
#ifdef MASA_AND_OBJECTS
    const int16_t ivas_format,                                  /* i  : IVAS format                             */
#ifdef FIX_OMASA_24_4k
    const int16_t ism_mode,                                     /* i  : ISM mode in combined format             */
#endif
#endif
    const int32_t element_brate_wo_meta,                        /* i  : element bitrate without metadata        */
    const int16_t tdm_lp_reuse_flag,                            /* i  : LPC reusage flag                        */
@@ -5108,12 +5098,9 @@ ivas_error ivas_masa_encode(
    ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS],          /* i  : ISM metadata handle                             */
    const int16_t idx_separated_object,                         /* i  : index of the separated object                   */
    OMASA_ENC_HANDLE hOMasa,                                    /* i  : OMASA encoder handle                            */
    const int16_t ism_imp                                       /* i  : importance of separated object                  */
#ifdef OMASA_ENERGIES
    ,
    const int16_t ism_imp,                                      /* i  : importance of separated object                  */
    const int16_t flag_omasa_ener_brate                         /* i  : less bitrate for objects in OMASA flag          */
#endif
#endif
);

void ivas_masa_estimate_energy(
@@ -5761,7 +5748,7 @@ void set_ism_importance_interformat(
    int16_t ism_imp[]                                           /* o  : ISM importance flags                    */
);

#ifdef OMASA_ENERGIES
#ifdef MASA_AND_OBJECTS
/*! r: flag for using less bitrate for objects in OMASA */
int16_t ivas_omasa_ener_brate(
    const int16_t nchan_ism,                                    /* i  : number of ISMs                          */
+0 −6
Original line number Diff line number Diff line
@@ -76,9 +76,7 @@
void tdm_bit_alloc(
#ifdef MASA_AND_OBJECTS
    const int16_t ivas_format, /* i  : IVAS format                         */
#ifdef FIX_OMASA_24_4k
    const int16_t ism_mode, /* i: ISM mode in combined format           */
#endif
#endif
    const int32_t element_brate_wo_meta, /* i  : element bitrate without metadata    */
    const int16_t tdm_lp_reuse_flag,     /* i  : LPC reusage flag                    */
@@ -143,11 +141,7 @@ void tdm_bit_alloc(

    /* secondary channel bitrate allocation based on the energy scaling ratio */
#ifdef MASA_AND_OBJECTS
#ifdef FIX_OMASA_24_4k
    if ( ( ( ivas_format != MASA_ISM_FORMAT || ism_mode == ISM_MODE_NONE ) && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) || ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE && coder_type > UNVOICED ) )
#else
    if ( ( ivas_format != MASA_ISM_FORMAT && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) || ( ivas_format == MASA_ISM_FORMAT && coder_type > UNVOICED ) )
#endif
#else
    if ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 )
#endif
+0 −4
Original line number Diff line number Diff line
@@ -172,11 +172,7 @@
#define MASA_AND_OBJECTS                                /* Nokia: Combination of MASA and objects */
#ifdef MASA_AND_OBJECTS
#define MASAISM_EDIT_OBJECTS                            /* Nokia: Temporary command line editing of object directions in the decoder */
#define OMASA_ENERGIES
#define FIX_OMASA_STEREO_SWITCHING                      /* VA: introduce  Unified/MDCT stereo switching for 3ISM @96 kbps and 4ISM @128 kbps */
#define FIX_OMASA_BRSW                                  /* Nokia + VA: Fix missing init of OMASA metadata delay buffers, brsw-related init fixes */
#define FIX_356_ISM_METADATA_SYNC_OMASA // temp. fix
#define FIX_OMASA_24_4k                                 /* Nokia: fix OMASA in TD mode at 24.4k */
#endif

/* ################## End DEVELOPMENT switches ######################### */
Loading