Commit 5f12f841 authored by vaclav's avatar vaclav
Browse files

formal improvements

parent c5f14e3a
Loading
Loading
Loading
Loading
Loading
+60 −39
Original line number Diff line number Diff line
@@ -1835,6 +1835,7 @@ const int16_t Param_MC_index[MAX_CICP_CHANNELS] =
#define ivas_param_mc_dmx_scal_fac_CICP6_2tc_static     (2.0f + 2.f * INV_SQRT2)
#define ivas_param_mc_dmx_scal_fac_CICP6_2tc_static_inv (1.f / ivas_param_mc_dmx_scal_fac_CICP6_2tc_static)
#endif
const float ivas_param_mc_dmx_fac_CICP6_2tc[12] =
{
    1.0f, 0.0f, INV_SQRT2, INV_SQRT2, 1.0f, 0.0f, /*Lt*/
@@ -1845,6 +1846,7 @@ const float ivas_param_mc_dmx_fac_CICP6_2tc[12] =
#define ivas_param_mc_dmx_scal_fac_CICP12_2tc_static     (3.0f + 2.f * INV_SQRT2)
#define ivas_param_mc_dmx_scal_fac_CICP12_2tc_static_inv (1.f / ivas_param_mc_dmx_scal_fac_CICP12_2tc_static)
#endif
const float ivas_param_mc_dmx_fac_CICP12_2tc[16] =
{
    1.0f, 0.0f, INV_SQRT2, INV_SQRT2, 1.0f, 0.0f, 1.0f, 0.0f, /*Lt*/
@@ -1855,6 +1857,7 @@ const float ivas_param_mc_dmx_fac_CICP12_2tc[16] =
#define ivas_param_mc_dmx_scal_fac_CICP12_3tc_static     (3.0f)
#define ivas_param_mc_dmx_scal_fac_CICP12_3tc_static_inv (1.f / ivas_param_mc_dmx_scal_fac_CICP12_3tc_static)
#endif
const float ivas_param_mc_dmx_fac_CICP12_3tc[24] =
{
    1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, /*Lt*/
@@ -1866,6 +1869,7 @@ const float ivas_param_mc_dmx_fac_CICP12_3tc[24] =
#define ivas_param_mc_dmx_scal_fac_CICP14_2tc_static     (3.0f + 2.f * INV_SQRT2)
#define ivas_param_mc_dmx_scal_fac_CICP14_2tc_static_inv (1.f / ivas_param_mc_dmx_scal_fac_CICP14_2tc_static)
#endif
const float ivas_param_mc_dmx_fac_CICP14_2tc[16] =
{
    1.0f, 0.0f, INV_SQRT2, INV_SQRT2, 1.0f, 0.0f, 1.0f, 0.0f, /*Lt*/
@@ -1876,6 +1880,7 @@ const float ivas_param_mc_dmx_fac_CICP14_2tc[16] =
#define ivas_param_mc_dmx_scal_fac_CICP14_3tc_static     (3.0f)
#define ivas_param_mc_dmx_scal_fac_CICP14_3tc_static_inv (1.f / ivas_param_mc_dmx_scal_fac_CICP14_3tc_static)
#endif
const float ivas_param_mc_dmx_fac_CICP14_3tc[24] =
{
    1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, /*Lt*/
@@ -1887,6 +1892,7 @@ const float ivas_param_mc_dmx_fac_CICP14_3tc[24] =
#define ivas_param_mc_dmx_scal_fac_CICP16_3tc_static     (4.0f)
#define ivas_param_mc_dmx_scal_fac_CICP16_3tc_static_inv (1.f / ivas_param_mc_dmx_scal_fac_CICP16_3tc_static)
#endif
const float ivas_param_mc_dmx_fac_CICP16_3tc[30] =
{
    1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, /*Lt*/
@@ -1898,6 +1904,7 @@ const float ivas_param_mc_dmx_fac_CICP16_3tc[30] =
#define ivas_param_mc_dmx_scal_fac_CICP19_3tc_static     (5.0f)
#define ivas_param_mc_dmx_scal_fac_CICP19_3tc_static_inv (1.f / ivas_param_mc_dmx_scal_fac_CICP19_3tc_static)
#endif
const float ivas_param_mc_dmx_fac_CICP19_3tc[36] =
{
    1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, /*Lt*/
@@ -2168,11 +2175,12 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_ild_mapping_CICP6_2tc,
        &ivas_param_mc_icc_mapping_CICP6_2tc,
        &ivas_param_mc_dmx_fac_CICP6_2tc[0],
        &ivas_param_mc_ild_fac_CICP6_2tc[0]
#ifdef NONBE_FIX_1165_STATIC_SCAL_PARAMMC
        ,
        &ivas_param_mc_ild_fac_CICP6_2tc[0],
        ivas_param_mc_dmx_scal_fac_CICP6_2tc_static,
        ivas_param_mc_dmx_scal_fac_CICP6_2tc_static_inv
#else
        &ivas_param_mc_ild_fac_CICP6_2tc[0]
#endif
    },
    /* CICP6 64000 */
@@ -2184,11 +2192,12 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_ild_mapping_CICP6_2tc,
        &ivas_param_mc_icc_mapping_CICP6_2tc,
        &ivas_param_mc_dmx_fac_CICP6_2tc[0],        
        &ivas_param_mc_ild_fac_CICP6_2tc[0]
#ifdef NONBE_FIX_1165_STATIC_SCAL_PARAMMC
        ,
        &ivas_param_mc_ild_fac_CICP6_2tc[0],
        ivas_param_mc_dmx_scal_fac_CICP6_2tc_static,
        ivas_param_mc_dmx_scal_fac_CICP6_2tc_static_inv
#else
        &ivas_param_mc_ild_fac_CICP6_2tc[0]
#endif
    },
    /* CICP6 80000 */
@@ -2200,11 +2209,12 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_ild_mapping_CICP6_2tc,
        &ivas_param_mc_icc_mapping_CICP6_2tc,
        &ivas_param_mc_dmx_fac_CICP6_2tc[0],        
        &ivas_param_mc_ild_fac_CICP6_2tc[0]
#ifdef NONBE_FIX_1165_STATIC_SCAL_PARAMMC
        ,
        &ivas_param_mc_ild_fac_CICP6_2tc[0],
        ivas_param_mc_dmx_scal_fac_CICP6_2tc_static,
        ivas_param_mc_dmx_scal_fac_CICP6_2tc_static_inv
#else
        &ivas_param_mc_ild_fac_CICP6_2tc[0]
#endif
    },
    /* CICP12 48000 */
@@ -2216,11 +2226,12 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_ild_mapping_CICP12_2tc,
        &ivas_param_mc_icc_mapping_CICP12_2tc,
        &ivas_param_mc_dmx_fac_CICP12_2tc[0],        
        &ivas_param_mc_ild_fac_CICP12_2tc[0]
#ifdef NONBE_FIX_1165_STATIC_SCAL_PARAMMC
        ,
        &ivas_param_mc_ild_fac_CICP12_2tc[0],
        ivas_param_mc_dmx_scal_fac_CICP12_2tc_static,
        ivas_param_mc_dmx_scal_fac_CICP12_2tc_static_inv
#else
        &ivas_param_mc_ild_fac_CICP12_2tc[0]
#endif
    },
    /* CICP12 64000 */
@@ -2232,11 +2243,12 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_ild_mapping_CICP12_2tc,
        &ivas_param_mc_icc_mapping_CICP12_2tc,
        &ivas_param_mc_dmx_fac_CICP12_2tc[0],        
        &ivas_param_mc_ild_fac_CICP12_2tc[0]
#ifdef NONBE_FIX_1165_STATIC_SCAL_PARAMMC
        ,
        &ivas_param_mc_ild_fac_CICP12_2tc[0],
        ivas_param_mc_dmx_scal_fac_CICP12_2tc_static,
        ivas_param_mc_dmx_scal_fac_CICP12_2tc_static_inv
#else
        &ivas_param_mc_ild_fac_CICP12_2tc[0]
#endif
    },
    /* CICP12 80000 */
@@ -2248,11 +2260,12 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_ild_mapping_CICP12_2tc,
        &ivas_param_mc_icc_mapping_CICP12_2tc,
        &ivas_param_mc_dmx_fac_CICP12_2tc[0],
        &ivas_param_mc_ild_fac_CICP12_2tc[0]
#ifdef NONBE_FIX_1165_STATIC_SCAL_PARAMMC
        ,
        &ivas_param_mc_ild_fac_CICP12_2tc[0],
        ivas_param_mc_dmx_scal_fac_CICP12_2tc_static,
        ivas_param_mc_dmx_scal_fac_CICP12_2tc_static_inv
#else
        &ivas_param_mc_ild_fac_CICP12_2tc[0]
#endif
    },
    /* CICP12 96000 */
@@ -2264,11 +2277,12 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_ild_mapping_CICP12_3tc,
        &ivas_param_mc_icc_mapping_CICP12_3tc,
        &ivas_param_mc_dmx_fac_CICP12_3tc[0],        
        &ivas_param_mc_ild_fac_CICP12_3tc[0]
#ifdef NONBE_FIX_1165_STATIC_SCAL_PARAMMC
        ,
        &ivas_param_mc_ild_fac_CICP12_3tc[0],
        ivas_param_mc_dmx_scal_fac_CICP12_3tc_static,
        ivas_param_mc_dmx_scal_fac_CICP12_3tc_static_inv
#else
        &ivas_param_mc_ild_fac_CICP12_3tc[0]
#endif
    },
    /* CICP14 48000 */
@@ -2280,11 +2294,12 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_ild_mapping_CICP14_2tc,
        &ivas_param_mc_icc_mapping_CICP14_2tc,
        &ivas_param_mc_dmx_fac_CICP14_2tc[0],        
        &ivas_param_mc_ild_fac_CICP14_2tc[0]
#ifdef NONBE_FIX_1165_STATIC_SCAL_PARAMMC
        ,
        &ivas_param_mc_ild_fac_CICP14_2tc[0],
        ivas_param_mc_dmx_scal_fac_CICP14_2tc_static,
        ivas_param_mc_dmx_scal_fac_CICP14_2tc_static_inv
#else
        &ivas_param_mc_ild_fac_CICP14_2tc[0]
#endif
    },
    /* CICP14 64000 */
@@ -2296,11 +2311,12 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_ild_mapping_CICP14_2tc,
        &ivas_param_mc_icc_mapping_CICP14_2tc,
        &ivas_param_mc_dmx_fac_CICP14_2tc[0],        
        &ivas_param_mc_ild_fac_CICP14_2tc[0]
#ifdef NONBE_FIX_1165_STATIC_SCAL_PARAMMC
        ,
        &ivas_param_mc_ild_fac_CICP14_2tc[0],
        ivas_param_mc_dmx_scal_fac_CICP14_2tc_static,
        ivas_param_mc_dmx_scal_fac_CICP14_2tc_static_inv
#else
        &ivas_param_mc_ild_fac_CICP14_2tc[0]
#endif
    },
    /* CICP14 80000 */
@@ -2312,11 +2328,12 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_ild_mapping_CICP14_2tc,
        &ivas_param_mc_icc_mapping_CICP14_2tc,
        &ivas_param_mc_dmx_fac_CICP14_2tc[0],        
        &ivas_param_mc_ild_fac_CICP14_2tc[0]
#ifdef NONBE_FIX_1165_STATIC_SCAL_PARAMMC
        ,
        &ivas_param_mc_ild_fac_CICP14_2tc[0],
        ivas_param_mc_dmx_scal_fac_CICP14_2tc_static,
        ivas_param_mc_dmx_scal_fac_CICP14_2tc_static_inv
#else
        &ivas_param_mc_ild_fac_CICP14_2tc[0]
#endif
    },
    /* CICP14 96000 */
@@ -2328,11 +2345,12 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_ild_mapping_CICP14_3tc,
        &ivas_param_mc_icc_mapping_CICP14_3tc,
        &ivas_param_mc_dmx_fac_CICP14_3tc[0],
        &ivas_param_mc_ild_fac_CICP14_3tc[0]
#ifdef NONBE_FIX_1165_STATIC_SCAL_PARAMMC
        ,
        &ivas_param_mc_ild_fac_CICP14_3tc[0],
        ivas_param_mc_dmx_scal_fac_CICP14_3tc_static,
        ivas_param_mc_dmx_scal_fac_CICP14_3tc_static_inv
#else
        &ivas_param_mc_ild_fac_CICP14_3tc[0]
#endif
    },
    /* CICP16 96000 */
@@ -2344,11 +2362,12 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_ild_mapping_CICP16_3tc,
        &ivas_param_mc_icc_mapping_CICP16_3tc,
        &ivas_param_mc_dmx_fac_CICP16_3tc[0],        
        &ivas_param_mc_ild_fac_CICP16_3tc[0]
#ifdef NONBE_FIX_1165_STATIC_SCAL_PARAMMC
        ,
        &ivas_param_mc_ild_fac_CICP16_3tc[0],
        ivas_param_mc_dmx_scal_fac_CICP16_3tc_static,
        ivas_param_mc_dmx_scal_fac_CICP16_3tc_static_inv
#else
        &ivas_param_mc_ild_fac_CICP16_3tc[0]
#endif
    },
    /* CICP16 128000 */
@@ -2360,11 +2379,12 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_ild_mapping_CICP16_3tc,
        &ivas_param_mc_icc_mapping_CICP16_3tc,
        &ivas_param_mc_dmx_fac_CICP16_3tc[0],        
        &ivas_param_mc_ild_fac_CICP16_3tc[0]
#ifdef NONBE_FIX_1165_STATIC_SCAL_PARAMMC
        ,
        &ivas_param_mc_ild_fac_CICP16_3tc[0],
        ivas_param_mc_dmx_scal_fac_CICP16_3tc_static,
        ivas_param_mc_dmx_scal_fac_CICP16_3tc_static_inv
#else
        &ivas_param_mc_ild_fac_CICP16_3tc[0]
#endif
    },
    /* CICP19 128000 */
@@ -2376,11 +2396,12 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_ild_mapping_CICP19_3tc,
        &ivas_param_mc_icc_mapping_CICP19_3tc,
        &ivas_param_mc_dmx_fac_CICP19_3tc[0],       
        &ivas_param_mc_ild_fac_CICP19_3tc[0]
#ifdef NONBE_FIX_1165_STATIC_SCAL_PARAMMC
        ,
        &ivas_param_mc_ild_fac_CICP19_3tc[0],
        ivas_param_mc_dmx_scal_fac_CICP19_3tc_static,
        ivas_param_mc_dmx_scal_fac_CICP19_3tc_static_inv
#else
        &ivas_param_mc_ild_fac_CICP19_3tc[0]
#endif
    }
};
+2 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@
/* ################### Start DEBUGGING switches ########################### */

#ifndef RELEASE
/*#define DEBUGGING*/                           /* Activate debugging part of the code */
#define DEBUGGING                           /* Activate debugging part of the code */
#endif
/*#define WMOPS*/                               /* Activate complexity and memory counters */
/*#define WMOPS_PER_FRAME*/                     /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */
@@ -200,7 +200,7 @@


#define NONBE_FIX_1165_STATIC_SCAL_PARAMMC              /* FhG: add static scaling to ParamMC DMX */
/*#define NONBE_FIX_1165_APPLY_LIMITER_ON_ENCODER_DMX*/     /* FhG: apply the limiter before the core encoder for formats with downmixing where the signal could exceed the 16-bit value range */
#define NONBE_FIX_1165_APPLY_LIMITER_ON_ENCODER_DMX     /* FhG: apply the limiter before the core encoder for formats with downmixing where the signal could exceed the 16-bit value range */
#define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR            /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */

/* ##################### End NON-BE switches ########################### */
+2 −0
Original line number Diff line number Diff line
@@ -654,10 +654,12 @@ ivas_error ivas_jbm_dec_tc(
            }

#ifdef NONBE_FIX_1165_STATIC_SCAL_PARAMMC
            /* Revert scaling done to the downmix in the encoder */
            for ( n = 0; n < st_ivas->nchan_transport; n++ )
            {
                v_multc( p_output[n], st_ivas->hParamMC->static_dmx_fac, p_output[n], output_frame );
            }

#endif
            /* Rendering */
            if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO )
+1 −0
Original line number Diff line number Diff line
@@ -454,6 +454,7 @@ ivas_error ivas_masa_decode(
    {
#ifdef NONBE_FIX_1165_STATIC_SCAL_OMASA
        hMasa->config.input_ivas_format = MASA_FORMAT; /* Default in SID as OMASA does not support SID */

#endif
        if ( hQMetaData->q_direction == NULL )
        {
+6 −1
Original line number Diff line number Diff line
@@ -101,7 +101,12 @@ ivas_error ivas_mcmasa_dec_reconfig(

#ifdef NONBE_FIX_1165_STATIC_SCAL_MCMASA

/* Gain decoded signals to match the gains applied to the downmix signals in the encoder */
/*-------------------------------------------------------------------------
 * ivas_mcmasa_gain_umx()
 *
 * Gain decoded signals to match the gains applied to the downmix signals in the encoder
 *------------------------------------------------------------------------*/

void ivas_mcmasa_gain_umx(
    Decoder_Struct *st_ivas,   /* i/o: IVAS decoder structure          */
    float *data_f[],           /* i/o: output signals                  */
Loading