Commit 4bdbd445 authored by multrus's avatar multrus
Browse files

Merge branch 'basop-2346-review-potentially-duplicated-igf-functions' into 'main'

Review potentially duplicated IGF functions

See merge request !2792
parents 07c2d911 de617c33
Loading
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -242,7 +242,6 @@
    <ClCompile Include="..\lib_enc\ivas_stereo_dft_td_itd_fx.c" />
    <ClCompile Include="..\lib_enc\ivas_stereo_dmx_evs_fx.c" />
    <ClCompile Include="..\lib_enc\cod4t64_fast_fx.c" />
    <ClCompile Include="..\lib_enc\igf_scf_enc.c" />
    <ClCompile Include="..\lib_enc\ivas_mcmasa_enc_fx.c" />
    <ClCompile Include="..\lib_enc\ivas_core_enc_fx.c" />
    <ClCompile Include="..\lib_enc\ivas_cpe_enc_fx.c" />
+0 −3
Original line number Diff line number Diff line
@@ -253,9 +253,6 @@
    <ClCompile Include="..\lib_enc\igf_enc_fx.c">
      <Filter>encoder_all_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_enc\igf_scf_enc.c">
      <Filter>encoder_all_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_enc\igf_scf_enc_fx.c">
      <Filter>encoder_all_c</Filter>
    </ClCompile>
+31 −2
Original line number Diff line number Diff line
@@ -381,6 +381,7 @@ Word16 IGF_MapBitRateToIndex(
    return bitRateIndex; /*Q0*/
}

#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
/**********************************************************************/ /*
IGF grid setup
**************************************************************************/
@@ -890,6 +891,12 @@ static void IGF_gridSetUp( H_IGF_GRID hGrid, /**< ou
    }
}
static void IGF_gridSetUp_ivas_fx(
#else
/**********************************************************************/ /*
IGF grid setup
**************************************************************************/
static void IGF_gridSetUp(
#endif
    H_IGF_GRID hGrid,        /* o  : IGF grid handle                                                    */
    Word16 bitRateIndex,     /* i  : IGF bitrate index                                                  */
    const Word32 sampleRate, /* i  : sample rate                                                        */
@@ -1148,7 +1155,12 @@ void IGFCommonFuncsMDCTSquareSpec( const Word16 sqrtBgn, /**< in
                                   const Word16 mdctSpec_e,              /**< in:     | exponent of mdctSpectrum       */
                                   Word32 *mdctSquareSpec,               /**< out:    | MDCT square spectrum           */
                                   Word16 *mdctSquareSpec_e,             /**< out:    | exponent of mdctSquareSpec     */
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
                                   Word16 indexOffset,       /**< in: Q0  | index offset                   */
                                   const Word16 element_mode /**< in:     | IVAS element mode type         */
#else
                                   Word16 indexOffset /**< in: Q0  | index offset                   */
#endif
)
{
    Word16 i;
@@ -1170,12 +1182,24 @@ void IGFCommonFuncsMDCTSquareSpec( const Word16 sqrtBgn, /**< in

    FOR( i = sqrtBgn; i < sqrtEnd; i++ )
    {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
        IF( EQ_16( element_mode, EVS_MONO ) )
        {
            tmp = round_fx_sat( L_shl_sat( mdctSpec[i], s1 ) ); /*(15 - mdctSpec_e)+ S1*/
        }
        ELSE
        {
            tmp = extract_h( L_shl( mdctSpec[i], s1 ) ); /*(15 - mdctSpec_e)+ S1*/
        }
#else
        tmp = round_fx_sat( L_shl_sat( mdctSpec[i], s1 ) ); /*(15 - mdctSpec_e)+ S1*/
#endif
        mdctSquareSpec[j++] = L_mult0( tmp, tmp ); /*31 - mdctSquareSpec_e*/
        move32();
    }
}

#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
/**********************************************************************/ /*
calculate the MDCT square spectrum in the IGF range (for IVAS)
**************************************************************************/
@@ -1212,6 +1236,7 @@ void IGFCommonFuncsMDCTSquareSpec_ivas( const Word16 sqrtBgn, /**< in
        move32();
    }
}
#endif


/**********************************************************************/ /*
@@ -1298,6 +1323,7 @@ Word16 IGFCommonFuncsIGFConfiguration(

    return retValue;
}
#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
Word16 IGFCommonFuncsIGFConfiguration_ivas_fx(
    const Word32 total_brate,  /* i  : bitrate in bs e.g. 9600 for 9.6kbs  */
    const Word16 bwidth,       /* i  : audio bandwidth                     */
@@ -1356,6 +1382,7 @@ Word16 IGFCommonFuncsIGFConfiguration_ivas_fx(
                               frameLength,
                               16384 /*1 Q14*/,
                               igfMinFq );

        /* set up IGF grid for CELP->TCX 20 transitions (transfac = 1.25) */
        hGrid = &hIGFInfo->grid[IGF_GRID_LB_TRAN];
        IGF_gridSetUp_ivas_fx( hGrid,
@@ -1364,6 +1391,7 @@ Word16 IGFCommonFuncsIGFConfiguration_ivas_fx(
                               frameLength,
                               20480 /*1.25 Q14*/,
                               igfMinFq );

        /* set up IGF grid for TCX 10 (transfac = 0.5) */
        hGrid = &hIGFInfo->grid[IGF_GRID_LB_SHORT];
        IGF_gridSetUp_ivas_fx( hGrid,
@@ -1376,6 +1404,7 @@ Word16 IGFCommonFuncsIGFConfiguration_ivas_fx(

    return retValue; /*Q0*/
}
#endif

/**********************************************************************/ /*
selects cumulative frequency tables and offsets for the IGF SCF arithmetic coder
+2 −1
Original line number Diff line number Diff line
@@ -1425,13 +1425,14 @@ void mdct_read_IGF_bits_fx(
    Decoder_State *st0                                          /* i  : pointer to handle where bitstream is read   */
);

#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
void IGFDecReadData_ivas_fx( 
    const IGF_DEC_INSTANCE_HANDLE hInstance,                    /* i  : instance handle of IGF Deccoder                      */
    Decoder_State *st,                                          /* i  : decoder state                                        */
    const Word16 igfGridIdx,                                    /* i  : in case of CELP->TCX switching, use 1.25 framelength */
    const Word16 isIndepFrame                                   /* i  : if 1: arith dec force reset, if 0: no reset          */
);

#endif
void stereo_tca_init_dec_fx(
    STEREO_TCA_DEC_HANDLE hStereoTCA                            /* i/o: Stereo TCA handle for Fixed             */
);
+1 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@
#define FIX_BASOP_2871_INIT_Q_SYN_FACTOR                /* FhG: make sure, st_fx->Q_syn_factor gets initialized during decoder startup */
#define FIX_BASOP_2470_POWER_SPEC_E_INIT                /* FhG: make sure powerSpec_e is always initialized in core_signal_analysis_high_bitrate_fx() */
#define FIX_BASOP_2475_ASSERT_IN_MASA2_REND_TO_MONO     /* Nokia: basop issue 2475: Fix MASA2 to MONO rendering within IVAS_rend */
#define FIX_2346_DUPLICATED_IGF_FUNCTIONS               /* FhG: basop issue 2346: Review potentially duplicated IGF functions */

/* #################### End BE switches ################################## */

Loading