Commit e8a6ab35 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

add FIX_PARAMMC_DEAD_CODE_FL901 - port float MR !1231

parent 463f0f18
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1385,9 +1385,17 @@ typedef enum
#define PARAM_MC_ICC_ERROR_BIAS_FAC              (1.15f)                    /* factor for favouring past ICC maps in the adaptive ICC map decision */
#define PARAM_MC_TRANSIENT_BAND_STEP             2                          /* Number of parameter bands combined in case of a transient frame*/
#define PARAM_MC_MAX_DECORR_CLDFB_BANDS         20                          /* Maximum number of CLDFB bands with decorrelation */
#ifdef FIX_PARAMMC_DEAD_CODE_FL901
#define PARAM_MC_MAX_TRANSPORT_CHANS             3                          /* Number of down mix channels */
#else
#define PARAM_MC_MAX_TRANSPORT_CHANS             4                          /* Number of down mix channels */
#endif
#define PARAM_MC_MAX_ILD_REF_CHANNELS            2                          /* Maximum number of reference channels for a coded ILD */
#ifdef FIX_PARAMMC_DEAD_CODE_FL901
#define PARAM_MC_NUM_CONFIGS                    14                          /* Number of available Parametric MC configurations */
#else
#define PARAM_MC_NUM_CONFIGS                    15                          /* Number of available Parametric MC configurations */
#endif
#define PARAM_MC_MAX_BAND_LFE                    1                          /* Number of parameter bands for LFE coding */
#define PARAM_MC_SZ_ICC_MAP                     11                          /* Maximum number of transmitted ICCs per parameter band */
#define PARAM_MC_SZ_ILD_MAP                     12                          /* Maximum number of transmitted channel energies per band*/
+20 −2
Original line number Diff line number Diff line
@@ -87,16 +87,22 @@ uint16_t ivas_param_mc_get_configuration_index(

void ivas_param_mc_metadata_open(
    const MC_LS_SETUP mc_ls_setup, /* i  : MC ls setup                                         */
#ifndef FIX_PARAMMC_DEAD_CODE_FL901
    const int16_t lfe_index, /* i  : channel index of LFE                                */
#endif
    const int32_t ivas_total_brate,            /* i  : IVAS total bitrate                                  */
    HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* o  : handle for the Parametric MC parameter coding state */
)
{
#ifndef FIX_PARAMMC_DEAD_CODE_FL901
    int16_t i;
#endif
    uint16_t config_index;
#ifndef FIX_PARAMMC_DEAD_CODE_FL901
    int16_t nchan_setup;

    nchan_setup = ivas_mc_ls_setup_get_num_channels( mc_ls_setup );
#endif

    /* get coding band mappings */
    set_s( hMetadataPMC->coding_band_mapping, 0, PARAM_MC_MAX_PARAMETER_BANDS );
@@ -129,21 +135,27 @@ void ivas_param_mc_metadata_open(
        assert( 0 && "nbands must be 20 or 14!" );
    }

#ifndef FIX_PARAMMC_DEAD_CODE_FL901
    /* create map of all possible ICCs */
    ivas_param_mc_create_full_icc_mapping( nchan_setup, lfe_index, hMetadataPMC->icc_map_full, &hMetadataPMC->icc_map_size_full );
#endif
    hMetadataPMC->icc_mapping_conf = ivas_param_mc_conf[config_index].icc_mapping_conf;
    hMetadataPMC->ild_mapping_conf = ivas_param_mc_conf[config_index].ild_mapping_conf;
    hMetadataPMC->ild_factors = ivas_param_mc_conf[config_index].ild_factors;

#ifndef FIX_PARAMMC_DEAD_CODE_FL901
    /* set default ICC maps */
    for ( i = 0; i < PARAM_MC_PARAMETER_FRAMES; i++ )
    {
        ivas_param_mc_default_icc_map( hMetadataPMC->icc_mapping_conf, hMetadataPMC->icc_mapping[i] );
    }
#endif

    /* init remaining flags and indices */
    hMetadataPMC->param_frame_idx = 0;
#ifndef FIX_PARAMMC_DEAD_CODE_FL901
    hMetadataPMC->flag_use_adaptive_icc_map = 0;
#endif
    hMetadataPMC->bAttackPresent = 0;
    hMetadataPMC->attackIndex = 0;
    hMetadataPMC->lfe_on = 1;
@@ -199,6 +211,7 @@ void ivas_param_mc_set_coded_bands(
}


#ifndef FIX_PARAMMC_DEAD_CODE_FL901
/*-------------------------------------------------------------------------
 * ivas_param_mc_metadata_close()
 *
@@ -223,6 +236,7 @@ void ivas_param_mc_metadata_close(

    return;
}
#endif


/*-------------------------------------------------------------------------
@@ -248,6 +262,7 @@ int16_t ivas_param_mc_getNumTransportChannels(
}


#ifndef FIX_PARAMMC_DEAD_CODE_FL901
/*-------------------------------------------------------------------------
 * ivas_param_mc_create_full_icc_mapping()
 *
@@ -326,6 +341,7 @@ void ivas_param_mc_default_icc_map(

    return;
}
#endif


/*-------------------------------------------------------------------------
@@ -408,9 +424,11 @@ static int16_t ivas_param_mc_get_num_param_bands(
                case IVAS_128k:
                    num_parameter_bands = 14;
                    break;
#ifndef FIX_PARAMMC_DEAD_CODE_FL901
                case IVAS_160k:
                    num_parameter_bands = 20;
                    break;
#endif
            }
            break;
        default:
+6 −2
Original line number Diff line number Diff line
@@ -3802,7 +3802,9 @@ void ivas_mc_paramupmix_dec_render(

void ivas_param_mc_metadata_open(
    const MC_LS_SETUP mc_ls_setup,                              /* i  : MC ls setup                                         */
#ifndef FIX_PARAMMC_DEAD_CODE_FL901
    const int16_t lfe_index,                                    /* i  : channel index of LFE                                */
#endif
    const int32_t ivas_total_brate,                             /* i  : IVAS total bitrate                                  */
    HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC                  /* o  : handle for the Parametric MC parameter coding state */
);
@@ -3811,6 +3813,7 @@ void ivas_param_mc_set_coded_bands(
    HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC                  /* i/o: handle for the Parametric MC parameter coding state */
);

#ifndef FIX_PARAMMC_DEAD_CODE_FL901
void ivas_param_mc_metadata_close(
    HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC                  /* i/o: handle for the Parametric MC parameter coding state */
);
@@ -3821,7 +3824,7 @@ void ivas_param_mc_create_full_icc_mapping(
    int16_t *icc_map[2],                                        /* o  : map of all possible ICCs                            */
    int16_t *icc_map_size_full                                  /* o  : number of all possible ICCs                         */
);

#endif
/*! r: number of IVAS transport channels */
int16_t ivas_param_mc_getNumTransportChannels(
    const int32_t ivas_total_bitrate,                           /* i  : IVAS total bitrate                                  */
@@ -3886,11 +3889,12 @@ void ivas_param_mc_dec(
    float *output_f[]                                           /* i/o: synthesized core-coder transport channels/DirAC output  */
);

#ifndef FIX_PARAMMC_DEAD_CODE_FL901
void ivas_param_mc_default_icc_map(
    const PARAM_MC_ICC_MAPPING * hIccMapping,                   /* i  : handle to ICC mapping configuration                 */
    int16_t icc_map[PARAM_MC_SZ_ICC_MAP][2]                     /* o  : copy of map from the configuration                  */
);

#endif
/*! r: number of cldfb synthesis instances */
int16_t param_mc_get_num_cldfb_syntheses( 
    Decoder_Struct *st_ivas                                     /* i  : IVAS decoder structure                              */
+10 −4
Original line number Diff line number Diff line
@@ -1973,6 +1973,7 @@ const float ivas_param_mc_ild_fac_CICP19_3tc[12] =
    0.5f
};
#ifndef FIX_PARAMMC_DEAD_CODE_FL901
const float ivas_param_mc_ild_fac_CICP19_4tc[12] =
{
    0.35f,
@@ -1988,7 +1989,7 @@ const float ivas_param_mc_ild_fac_CICP19_4tc[12] =
    0.5f,
    0.2f,
};
#endif
const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP6_2tc =
{
    5,
@@ -2052,6 +2053,7 @@ const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_3tc =
    {{0},{1},{0},{1},{0},{1},{0},{1},{0},{1},{2},{2}}
};
#ifndef FIX_PARAMMC_DEAD_CODE_FL901
const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_4tc =
{
    11,
@@ -2060,7 +2062,7 @@ const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_4tc =
    {1,1,2,1,1,1,1,1,1,1,1,2},
    {{0},{1},{0,1},{0},{1},{0},{1},{2},{3},{2},{3},{0,1}}
};
#endif
const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP6_2tc =
{
    4,
@@ -2161,6 +2163,7 @@ const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_3tc =
    }  
};
#ifndef FIX_PARAMMC_DEAD_CODE_FL901
const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_4tc =
{
    8,
@@ -2176,7 +2179,7 @@ const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_4tc =
        { 2, 3 }   /* C/LFE   */
    }  
};
#endif
const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] = 
{
    /* CICP6 48000 */
@@ -2332,7 +2335,9 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_icc_mapping_CICP19_3tc,
        &ivas_param_mc_dmx_fac_CICP19_3tc[0],
        &ivas_param_mc_ild_fac_CICP19_3tc[0]
    },
    }
#ifndef FIX_PARAMMC_DEAD_CODE_FL901
        ,
    /* CICP19 160000 */
    {
        MC_LS_SETUP_7_1_4,
@@ -2344,6 +2349,7 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] =
        &ivas_param_mc_dmx_fac_CICP19_4tc[0],
        &ivas_param_mc_ild_fac_CICP19_4tc[0]
    }
#endif
};
const float ivas_param_mc_quant_ild_5d1_48[PARAM_MC_SZ_ILD_QUANTIZER_4BITS] =
+4 −0
Original line number Diff line number Diff line
@@ -595,11 +595,15 @@ typedef struct ivas_parametric_mc_metadata_struct
{
    const PARAM_MC_ILD_MAPPING *ild_mapping_conf;
    const PARAM_MC_ICC_MAPPING *icc_mapping_conf;
#ifndef FIX_PARAMMC_DEAD_CODE_FL901
    int16_t icc_mapping[PARAM_MC_PARAMETER_FRAMES][PARAM_MC_SZ_ICC_MAP][2];
    int16_t *icc_map_full[2];
#endif
    int16_t icc_map_size_full;
    int16_t param_frame_idx;
#ifndef FIX_PARAMMC_DEAD_CODE_FL901
    int16_t flag_use_adaptive_icc_map;
#endif
    const float *ild_factors;
    int16_t coding_band_mapping[PARAM_MC_MAX_PARAMETER_BANDS];
    int16_t nbands_in_param_frame[PARAM_MC_PARAMETER_FRAMES];
Loading