Commit 72f6a053 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_I1_113

parent baa5d9ca
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -2660,10 +2660,8 @@ void ivas_mct_core_enc(
    const int32_t ivas_total_brate,                             /* i  : IVAS total bitrate                      */
    const int16_t switch_bw,                                    /* i  : flag bandwidth switch occurance         */
    const int16_t lfe_bits                                      /* i  : bits spent for LFE                      */
#ifdef FIX_I1_113
    ,
    const int16_t sba_order                                     /* i  : Ambisonic (SBA) order                   */
#endif
);

void ivas_mdct_quant_coder(
@@ -3919,7 +3917,6 @@ void ivas_spar_set_bitrate_config(
	const int16_t num_bands                                     /* i  : number of bands                         */
);

#ifdef FIX_I1_113
void ivas_spar_bitrate_dist(
    int32_t core_brates_act[],                                  /* o  : bitrates per core-coder                 */
    const int16_t nAvailBits,                                   /* i  : number of available bits                */
@@ -3927,7 +3924,6 @@ void ivas_spar_bitrate_dist(
    const int16_t sba_order,                                    /* i  : Ambisonic (SBA) order                   */
    const int16_t bwidth                                        /* i  : audio bandwidth                         */
);
#endif

void ivas_mdct( const float *pIn, float *pOut, const int16_t length );
void ivas_dct_windowing( const int16_t fade_len, const int16_t full_len, const int16_t dct_len, const int16_t zero_pad_len, const float *pWindow_coeffs, const int16_t frame_len, float *pOut_buf, float *pBuffer_prev, float *pTemp_lfe );
+0 −2
Original line number Diff line number Diff line
@@ -2149,7 +2149,6 @@ void ivas_spar_set_bitrate_config(
}


#ifdef FIX_I1_113
/*-----------------------------------------------------------------------------------------*
 * Function ivas_spar_bitrate_dist()
 *
@@ -2239,4 +2238,3 @@ void ivas_spar_bitrate_dist(

    return;
}
#endif
+0 −1
Original line number Diff line number Diff line
@@ -144,7 +144,6 @@
#define DISABLE_ADAP_RES_COD_TMP                        /* temporary fix for IVAS-403, disables adaptive residual coding */
/*#define ITD_WINNER_GAIN_MODIFY */                     /* ITD optimization - WORK IN PROGRESS */
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define FIX_I1_113                                      /* under review : MCT bit distribution optimization for SBA high bitrates*/
#define FIX_124_DONT_ALLOC_PLCINFO_IN_IVAS              /* Issue 124: do not allocate unused plc struct in IVAS modes which is only used in EVS mono */
#define SBA_BR_SWITCHING_2                              /* Issue 114: Changes for sba bit rate switching with reconfigurations*/
#define SBA_BR_SWITCHING                                /* Issue 114: Changes for sba bit rate switching*/
+0 −22
Original line number Diff line number Diff line
@@ -115,27 +115,17 @@ static void FindChannelRatio(
static void AdjustChannelRatios(
    int16_t chBitRatios[MCT_MAX_CHANNELS], /* o  : bit-disctribution channel ratios */
    const int16_t nChannels                /* i/o: number of channels               */
#ifdef FIX_I1_113
    ,
    const int32_t ivas_total_brate, /* i  : IVAS total bitrate               */
    const int16_t nAvailBits,       /* i  : number of available bits         */
    const int16_t sba_order         /* i  : Ambisonic (SBA) order            */
#endif
)
{
    int16_t force_ch_bit_ratios[IVAS_SPAR_MAX_DMX_CHS];
#ifdef FIX_I1_113
    int32_t temp_brs[IVAS_SPAR_MAX_DMX_CHS];
#endif
    float cur_ratio, tar_ratio, sum_ratio, sum_tar_ratio;
    int16_t ratio_diff, i;

#ifndef FIX_I1_113
    force_ch_bit_ratios[0] = 9;
    force_ch_bit_ratios[1] = 7;
    force_ch_bit_ratios[2] = 5;
    force_ch_bit_ratios[3] = 3;
#else
    ivas_spar_bitrate_dist( temp_brs, nAvailBits, ivas_total_brate, sba_order, (int16_t) FB );

    sum_ratio = 0.0f;
@@ -148,7 +138,6 @@ static void AdjustChannelRatios(
        cur_ratio = temp_brs[i] / sum_ratio;
        force_ch_bit_ratios[i] = min( BITRATE_MCT_RATIO_RANGE - 1, max( 1, (uint16_t) ( BITRATE_MCT_RATIO_RANGE * cur_ratio + 0.5f ) ) );
    }
#endif

    /* adjust the ratios further based on received chBitRatios[]*/
    ratio_diff = 0;
@@ -208,10 +197,8 @@ void ivas_mct_core_enc(
    const int32_t ivas_total_brate,      /* i  : IVAS total bitrate              */
    const int16_t switch_bw,             /* i  : flag bandwidth switch occurance */
    const int16_t lfe_bits               /* i  : bits spent for LFE              */
#ifdef FIX_I1_113
    ,
    const int16_t sba_order /* i  : Ambisonic (SBA) order           */
#endif
)
{
    int16_t ch, ch_core, nSubframes, L_subframeTCX;
@@ -477,13 +464,6 @@ void ivas_mct_core_enc(

    FindChannelRatio( hMCT, sts, chBitRatios, nChannels );

#ifndef FIX_I1_113
    if ( hMCT->hbr_mct )
    {
        assert( ivas_total_brate >= IVAS_256k );
        AdjustChannelRatios( chBitRatios, nChannels );
    }
#endif

    nAvailBits = (int16_t) ( ( ivas_total_brate / FRAMES_PER_SEC ) - NBITS_BWIDTH - hMCT->nBitsMCT - lfe_bits );

@@ -523,13 +503,11 @@ void ivas_mct_core_enc(
    dbgwrite( &nAvailBits, sizeof( int16_t ), 1, 1, "./res/availBits" );
#endif

#ifdef FIX_I1_113
    if ( hMCT->hbr_mct )
    {
        assert( ivas_total_brate >= IVAS_256k );
        AdjustChannelRatios( chBitRatios, nChannels, ivas_total_brate, nAvailBits, sba_order );
    }
#endif

    for ( ch = 0; ch < nChannels; ch++ )
    {
+0 −2
Original line number Diff line number Diff line
@@ -168,10 +168,8 @@ ivas_error ivas_mct_enc(
    /* joint MCT encoding */
    ivas_mct_core_enc( ivas_format, hMCT, st_ivas->hCPE, hMCT->nchan_out_woLFE + hMCT->num_lfe, ivas_total_brate, switch_bw,
                       ivas_format == MC_FORMAT ? (int16_t) st_ivas->hLFE->lfe_bits : 0
#ifdef FIX_I1_113
                       ,
                       st_ivas->hEncoderConfig->sba_order
#endif
    );

    /* Spectrum quantization and coding */