Commit 9eea17be authored by multrus's avatar multrus
Browse files

[cleanup] accept MC_BITRATE_SWITCHING

parent 5dc8dc73
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -879,12 +879,6 @@ static ivas_error write_indices_element(

        for ( n = 0; n < n_channels; n++ )
        {
#ifndef MC_BITRATE_SWITCHING
            if ( ( st_ivas->hEncoderConfig->ivas_format == MC_FORMAT ) && ( st_ivas->mc_mode == MC_MODE_MCT ) && ( element_id * CPE_CHANNELS + n == LFE_CHANNEL ) )
            {
                continue;
            }
#endif
            reset_indices_enc( sts[n]->hBstr, MAX_NUM_INDICES );
        }
    }
+0 −78
Original line number Diff line number Diff line
@@ -330,7 +330,6 @@ void ivas_param_mc_default_icc_map(
}


#ifdef MC_BITRATE_SWITCHING
/*-------------------------------------------------------------------------
 * ivas_param_mc_get_num_param_bands()
 *
@@ -422,7 +421,6 @@ static int16_t ivas_param_mc_get_num_param_bands(

    return num_parameter_bands;
}
#endif

/*-------------------------------------------------------------------------
 * Local functions
@@ -521,82 +519,6 @@ static void ivas_param_mc_set_coding_scheme(
            assert( 0 && "PARAM_MC: channel configuration not supported!" );
    }

#ifdef MC_BITRATE_SWITCHING
    hMetadataPMC->num_parameter_bands = ivas_param_mc_get_num_param_bands( mc_ls_setup, ivas_total_brate );
#else
    /* parameter bands */
    switch ( mc_ls_setup )
    {
        case MC_LS_SETUP_5_1:
            switch ( ivas_total_brate )
            {
                case IVAS_48k:
                    hMetadataPMC->num_parameter_bands = 10;
                    break;
                case IVAS_64k:
                case IVAS_80k:
                    hMetadataPMC->num_parameter_bands = 14;
                    break;
                default:
                    assert( 0 && "PARAM_MC: bitrate for CICP6 not supported!" );
            }
            break;

        case MC_LS_SETUP_7_1:
            switch ( ivas_total_brate )
            {
                case IVAS_48k:
                    hMetadataPMC->num_parameter_bands = 10;
                    break;
                case IVAS_64k:
                case IVAS_80k:
                    hMetadataPMC->num_parameter_bands = 14;
                    break;
                case IVAS_96k:
                    hMetadataPMC->num_parameter_bands = 20;
                    break;
            }
            break;
        case MC_LS_SETUP_5_1_2:
            switch ( ivas_total_brate )
            {
                case IVAS_48k:
                    hMetadataPMC->num_parameter_bands = 10;
                    break;
                case IVAS_64k:
                case IVAS_80k:
                    hMetadataPMC->num_parameter_bands = 14;
                    break;
                case IVAS_96k:
                    hMetadataPMC->num_parameter_bands = 20;
                    break;
            }
            break;
        case MC_LS_SETUP_5_1_4:
            switch ( ivas_total_brate )
            {
                case IVAS_96k:
                    hMetadataPMC->num_parameter_bands = 14;
                    break;
                case IVAS_128k:
                    hMetadataPMC->num_parameter_bands = 20;
                    break;
            }
            break;
        case MC_LS_SETUP_7_1_4:
            switch ( ivas_total_brate )
            {
                case IVAS_128k:
                    hMetadataPMC->num_parameter_bands = 20;
                    break;
                case IVAS_160k:
                    hMetadataPMC->num_parameter_bands = 20;
                    break;
            }
            break;
        default:
            assert( 0 && "PARAM_MC: channel configuration not supportet!" );
    }
#endif
    return;
}
+0 −24
Original line number Diff line number Diff line
@@ -92,29 +92,6 @@ void ivas_mcmasa_set_separate_channel_mode(
}


#ifndef MC_BITRATE_SWITCHING
/*--------------------------------------------------------------------------*
 * ivas_mcmasa_mono_brate()
 *
 * Set SCE bitrate for McMASA mono separated channel
 *--------------------------------------------------------------------------*/

/*! r: McMASA SCE bitrate */
int32_t ivas_mcmasa_mono_brate(
    const int32_t ivas_total_brate /* i  : IVAS total bitrate   */
)
{
    /* 25% of total bitrate is used for SCE below 96 kb/s (separated mono channel), otherwise 30% */
    if ( ivas_total_brate < IVAS_96k )
    {
        return (int32_t) ( MCMASA_MONOBITRATIO_64k * ivas_total_brate );
    }
    else
    {
        return (int32_t) ( MCMASA_MONOBITRATIO * ivas_total_brate );
    }
}
#else
/*--------------------------------------------------------------------------*
 * ivas_mcmasa_split_brate()
 *
@@ -152,4 +129,3 @@ void ivas_mcmasa_split_brate(

    return;
}
#endif
+0 −29
Original line number Diff line number Diff line
@@ -149,14 +149,10 @@ ivas_error ivas_corecoder_enc_reconfig(
    Encoder_Struct *st_ivas,                                    /* i/o: IVAS encoder structure                  */
    const int16_t nSCE_old,                                     /* i  : number of SCEs in previous frame        */
    const int16_t nCPE_old,                                     /* i  : number of CPEs in previous frame        */
#ifdef MC_BITRATE_SWITCHING
    const int16_t nchan_transport_old,                          /* i  : number of TCs in previous frame         */
    const int32_t brate_SCE,                                    /* i  : bitrate to be set for the SCEs          */
    const int32_t brate_CPE,                                    /* i  : bitrate to be set for the CPEs          */
    const MC_MODE last_mc_mode                                  /* i  : switching between MC modes: last mode   */
#else
    const int16_t nchan_transport_old                           /* i  : number of TCs in previous frame         */
#endif
);

ivas_error ivas_sce_enc(
@@ -358,7 +354,6 @@ void ivas_mct_dec_close(
);

ivas_error ivas_corecoder_dec_reconfig(
#ifdef MC_BITRATE_SWITCHING
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    const int16_t nSCE_old,                                     /* i  : number of SCEs in previous frame        */
    int16_t nCPE_old,                                           /* i  : number of CPEs in previous frame                          */
@@ -366,13 +361,6 @@ ivas_error ivas_corecoder_dec_reconfig(
    const int16_t sba_dirac_stereo_flag_old,                    /* i  : signal stereo rendering using DFT upmix in previous frame */
    const int32_t brate_SCE,                                    /* i  : bitrate to be set for the SCEs                            */
    const int32_t brate_CPE                                     /* i  : bitrate to be set for the CPEs                            */
#else
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    const int16_t nSCE_old,                                     /* i  : number of SCEs in previous frame        */
    const int16_t nCPE_old,                                     /* i  : number of CPEs in previous frame        */
    const int16_t nchan_transport_old,                          /* i  : number of TCs in previous frame         */
    const int16_t sba_dirac_stereo_flag_old                     /* i  : signal stereo output for SBA DirAC in previous frame */
#endif
);

ivas_error ivas_hp20_dec_reconfig(
@@ -2630,9 +2618,7 @@ ivas_error stereo_memory_dec(
    const int16_t nb_bits_metadata,                             /* i  : number of metadata bits                 */
    const int32_t output_Fs,                                    /* i  : output sampling rate                    */
    const IVAS_FORMAT ivas_format,                              /* i  : IVAS format                             */
#ifdef MC_BITRATE_SWITCHING
    const MC_MODE mc_mode,                                      /* i  : MC mode                                 */
#endif
    const int16_t nchan_transport                               /* i  : number of transport channels            */
);

@@ -3569,11 +3555,9 @@ ivas_error ivas_param_mc_enc_open(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder handle                                 */
);

#ifdef MC_BITRATE_SWITCHING
ivas_error ivas_param_mc_enc_reconfig(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder handle                                 */
);
#endif

void ivas_param_mc_enc_close(
    PARAM_MC_ENC_HANDLE hParamMC,                               /* i/o: Parametric MC encoder handle                        */
@@ -3591,11 +3575,9 @@ ivas_error ivas_param_mc_dec_open(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                              */
);

#ifdef MC_BITRATE_SWITCHING
ivas_error ivas_param_mc_dec_reconfig(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                              */
);
#endif

void ivas_param_mc_dec_close(
    PARAM_MC_DEC_HANDLE *hParamMC                               /* i/o: Parametric MC decoder handle                        */
@@ -4869,7 +4851,6 @@ void ivas_mcmasa_enc_close(
    const int32_t input_Fs                                      /* i  : input sampling rate                             */
);

#ifdef MC_BITRATE_SWITCHING
ivas_error ivas_mcmasa_enc_reconfig(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder handle                              */
);
@@ -4877,7 +4858,6 @@ ivas_error ivas_mcmasa_enc_reconfig(
ivas_error ivas_mcmasa_dec_reconfig(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder handle                              */
);
#endif

void ivas_mcmasa_setNumTransportChannels(
    int16_t* nchan_transport,                                   /* o  : Pointer to number of transport channels to be set */
@@ -4891,12 +4871,6 @@ void ivas_mcmasa_set_separate_channel_mode(
    const int32_t ivas_total_brate                              /* i  : Total bitrate of IVAS                             */
);

#ifndef MC_BITRATE_SWITCHING
/*! r: McMASA SCE bitrate */
int32_t ivas_mcmasa_mono_brate(
    const int32_t ivas_total_brate                              /* i  : IVAS total bitrate                                */
);
#else
void ivas_mcmasa_split_brate(
    const uint8_t separateChannelEnabled,                       /* i  : Transport running in "separate channel" mode      */
    const int32_t ivas_total_brate,                             /* i  : Total bitrate available to be split               */
@@ -4905,7 +4879,6 @@ void ivas_mcmasa_split_brate(
    int32_t *brate_sce,                                         /* o  : Pointer to SCE element bitrate                    */
    int32_t *brate_cpe                                          /* o  : Pointer to CPE element bitrate                    */
);
#endif

void ivas_mcmasa_enc(
    MCMASA_ENC_HANDLE hMcMasa,                                  /* i/o: Encoder McMASA handle                             */
@@ -4930,14 +4903,12 @@ void ivas_mcmasa_param_est_enc(
    const int16_t nchan_inp                                     /* i  : Number of input channels                          */
);

#ifdef MC_BITRATE_SWITCHING
void ivas_mcmasa_dmx_modify(
    const int16_t n_samples,                                        /* i  : input frame length in samples                        */
    float dmx[][L_FRAME48k + NS2SA( 48000, IVAS_FB_ENC_DELAY_NS )], /* i/o: downmix signal to be transformed into another format */
    const int16_t n_chnls_dmx_old,                                  /* i  : number of downmix channels in the old format         */
    const int16_t n_chnls_dmx_new                                   /* i  : number of downmix channels in the target format      */
);
#endif

void v_multc_acc(
    const float x[],                                            /* i  : Input vector                                    */
+0 −1
Original line number Diff line number Diff line
@@ -147,7 +147,6 @@
#endif
#define FIX_I59_DELAY_ROUNDING                          /* Issue 59: rounding in sample domain instead of nanosec for IVAS_ENC_GetDelay() and IVAS_DEC_GetDelay() */
#define FIX_FIX_I59                                     /* Issue 59:  small fix concerning LFE delay rounding */
#define MC_BITRATE_SWITCHING                            /* Issue 116: support bitrate switching in MC format  */
#define MC_JBM                                          /* FhG: extend JBM beyond mono for running IVAS in VoIP mode (contribution 19) */
#define FIX_265_MC_BRATE_SWITCHING                      /* Issue 265: fix use-of-uninitialized-value in MC bitrate switching */
#define FIX_ANGLE_WRAPPING                              /* Issue 244: Problems with angle wrapping*/
Loading