Commit 9ee14699 authored by vaclav's avatar vaclav
Browse files

fix

parent 0cb7ff36
Loading
Loading
Loading
Loading
+29 −8
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@
 *--------------------------------------------------------------------------*/

static void subband_gain_bits_fx(
#ifdef HARM_HQ_CORE
    const Word16 element_mode, /* i  : element mode               */
#endif
    const Word16 *Rk,     /* i  : bit allocation per band Q3 */
    const Word16 N,       /* i  : number of bands         */
    Word16 *bits,         /* o  : gain bits per band      */
@@ -31,7 +34,17 @@ static void subband_gain_bits_fx(
    FOR( i = 0; i < N; i++ )
    {
        /*bps = (short)(Rk[i]*((word16)min(32767, ceil(32767.0f/sfmsize[i]);  inexact C-integer division approx. */
#ifdef HARM_HQ_CORE
        if ( element_mode > EVS_MONO )
        {
            bps = extract_l( L_shr( L_mult0( Rk[i], fg_inv_tbl_fx[sfmsize[i] >> 3] ), 18 ) ); /* 3+15 */
        }
        ELSE
#endif
        {
            bps = extract_l( L_shr( L_mult0( Rk[i], inv_tbl_fx[sfmsize[i]] ), 18 ) ); /* 3+15 */
        }

        if ( EQ_32( L_shl( L_mult0( sfmsize[i], add( bps, 1 ) ), 3 ), Rk[i] ) )
        {
            bps = add( bps, 1 );
@@ -61,7 +74,11 @@ static void subband_gain_bits_fx(
 * Assign gain adjustment bits and update bit budget
 *--------------------------------------------------------------------------*/

Word16 assign_gain_bits_fx(                           /* o  : Number of assigned gain bits          */
/* o  : Number of assigned gain bits */
Word16 assign_gain_bits_fx(
#ifdef HARM_HQ_CORE
    const Word16 element_mode, /* i  : element mode               */
#endif
    const Word16 core,        /* i  : HQ core                               */
    const Word16 BANDS,       /* i  : Number of bands                       */
    const Word16 *band_width, /* i  : Sub band bandwidth                    */
@@ -76,7 +93,11 @@ Word16 assign_gain_bits_fx( /* o : Number of assigned
    /* Allocate gain bits for every subband used, based on bit rate and bandwidth */
    IF( EQ_16( core, HQ_CORE ) )
    {
#ifdef HARM_HQ_CORE
        subband_gain_bits_fx( element_mode, Rk, BANDS, gain_bits_array, band_width );
#else
        subband_gain_bits_fx( Rk, BANDS, gain_bits_array, band_width );
#endif
    }
    ELSE
    {
+0 −4
Original line number Diff line number Diff line
@@ -2129,11 +2129,7 @@ void hq_bwe_fx(

    Copy32( &coeff_out[n_swb_overlap_offset], hq_swb_overlap_buf_fx, sub( add( n_swb_overlap, sfm_end[( num_sfm - 1 )] ), sfm_end[( num_env_bands - 1 )] ) ); /*Q12*/

#ifdef HARM_HQ_CORE
    hq_generic_decoding_fx( EVS_MONO, HQ_mode, coeff_out1, hq_generic_fenv, coeff_out, hq_generic_offset, prev_L_swb_norm, hq_generic_exc_clas, R );
#else
    hq_generic_decoding_fx( HQ_mode, coeff_out1, hq_generic_fenv, coeff_out, hq_generic_offset, prev_L_swb_norm, hq_generic_exc_clas, R );
#endif

    overlap_hq_bwe_fx( hq_swb_overlap_buf_fx, coeff_out, n_swb_overlap_offset, n_swb_overlap, R, num_env_bands, num_sfm, sfm_end );

+3 −6
Original line number Diff line number Diff line
@@ -1749,14 +1749,12 @@ void ivas_fill_spectrum_fx(
    const Word16 num_env_bands,
    const Word16 element_mode 
);
#endif
#ifndef HARM_HQ_CORE

void ivas_de_interleave_spectrum_fx(
    Word32 *coefs,                                              /* i/o: input and output coefficients   Q12 */
    const Word16 length                                         /* i  : length of spectrum              Q0  */
);
#endif
#ifndef HARM_HQ_CORE

void ivas_harm_bwe_fx(
    const Word16 *coeff_fine,                                   /* i  : fine structure for BWE                  */
    const Word16 *coeff,                                        /* i  : coded/noisefilled normalized spectrum   */
@@ -1773,8 +1771,7 @@ void ivas_harm_bwe_fx(
    Word32 *coeff_out,                                          /* o  : coded/noisefilled spectrum              */
    const Word16 element_mode                                   /* i  : IVAS element mode                       */
);
#endif
#ifndef HARM_HQ_CORE

void ivas_hq_pred_hb_bws_fx(
    Decoder_State *st_fx,                                       /* i/o: decoder state structure                 */
    const Word16 *ynrm,                                         /* i  : norm quantization index vector          */
+5 −3
Original line number Diff line number Diff line
@@ -688,8 +688,7 @@ Word16 calc_nor_delta_hf_ivas_fx(
    const Word16 *sfm_start,    /* i  : Start index of bands           */
    const Word16 core_sfm       /* i  : index of the end band for core */
);
#endif
#ifndef HARM_HQ_CORE

void hq_bwe_fx(
    const Word16 HQ_mode,             /* i  : HQ mode                                     */
    Word32 *coeff_out1,               /* i/o: BWE i   & temporary buffer                  */
@@ -4712,6 +4711,9 @@ void fine_gain_dec_fx(

/* o  : Number of assigned gain bits */
Word16 assign_gain_bits_fx(
#ifdef HARM_HQ_CORE
    const Word16 element_mode, /* i  : element mode                          */
#endif
    const Word16 core,        /* i  : HQ core                               */
    const Word16 BANDS,       /* i  : Number of bands                       */
    const Word16 *band_width, /* i  : Sub band bandwidth                    */
+15 −8
Original line number Diff line number Diff line
@@ -1827,11 +1827,7 @@ static void spec_ana_fx(
        sel = mult_r( sub( Xmax, Xmin ), CMPLMNT_PFIND_SENS_FX );
    }

#ifdef HARM_HQ_CORE
    peakfinder_fx( xfp, Lprot2_1, plocs, num_plocs, sel, TRUE );
#else
    peakfinder_fx( xfp, Lprot2_1, plocs, num_plocs, sel );
#endif

    {
        /* Refine peaks */
@@ -3063,11 +3059,7 @@ static void rec_frame_fx(
    }
    Scale_sig( X, Lprot, -Q );

#ifdef HARM_HQ_CORE
    rec_wtda_fx( X, ecu_rec, output_frame, Lprot, fs, EVS_MONO, NULL, NULL );
#else
    rec_wtda_fx( X, ecu_rec, output_frame, Lprot, fs );
#endif

    return;
}
@@ -5038,6 +5030,21 @@ void ivas_hq_ecu_fx(
#ifdef HARM_HQ_CORE_KEEP_EVS_BE
    IF( st_fx->element_mode == EVS_MONO )
    {
        test();
        test();
        test();
        test();
        test();
        test();
        test();
        test();
        test();
        test();
        test();
        test();
        test();
        test();
        test();
        evs_mode_selection = ( GE_32( st_fx->total_brate, 48000 ) && ( GE_16( output_frame, L_FRAME16k ) && !prev_bfi && ( !old_is_transient[0] || old_is_transient[1] ) && ( NE_16( ph_ecu_HqVoicing, 0 ) || ( ( ( NE_16( st_fx->hHQ_core->env_stab_plc_fx, 0 ) ) && ( LT_16( corr, 19661 ) ) ) || ( !( NE_16( st_fx->hHQ_core->env_stab_plc_fx, 0 ) ) && ( GT_16( corr, 27853 ) ) ) ) ) ) ) ||
                             ( LT_32( st_fx->total_brate, 48000 ) && ( ( ph_ecu_HqVoicing || GT_16( corr, 27853 ) ) && !prev_bfi && ( !old_is_transient[0] || old_is_transient[1] ) ) );
    }
Loading