Commit 84dde289 authored by multrus's avatar multrus
Browse files

Harmonize apply_scale_ind(), apply_scale_ivas_fx()

parent 45b0764c
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -872,7 +872,11 @@ void cng_params_upd_fx(
            Word16 index = 0;
            move32();
            move16();
#ifdef HARM_2456_APPLY_SCALE
            index = apply_scale_ind( &att_fx, bwidth, last_active_brate, scaleTableStereo, SIZE_SCALE_TABLE_STEREO );
#else
            apply_scale_ivas_fx( &att_fx, bwidth, last_active_brate, scaleTableStereo, SIZE_SCALE_TABLE_STEREO, &index );
#endif
            att_fx = pow_10_q23[index]; // Q23
            move32();
            tmp = extract_h( att_fx ); // Q7
+3 −0
Original line number Diff line number Diff line
@@ -1751,9 +1751,11 @@ Word16 apply_scale_ind(
        *scale = L_add( *scale, L_deposit_h( scaleTable[i].scale ) );
        move32();
    }

    return i;
}

#ifndef HARM_2456_APPLY_SCALE
void apply_scale_ivas_fx(
    Word32 *scale,                 /* o  : scalefactor             */
    const Word16 bwmode,           /* i  : audio bandwidth         */
@@ -1780,6 +1782,7 @@ void apply_scale_ivas_fx(
    *index = i;
    move16();
}
#endif
/*-------------------------------------------------------------------
 * bandcombinepow()
 *
+1 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@
#define FIX_2431_AVOID_CALLOC                           /* VA: basp issue 2431: avoid use of calloc() */
#define FIX_2424_REMOVE_GAUSS_L2_ENC                    /* VA: basop issue 2424: Remove duplicated code in gauss_L2_ivas_fx() */
#define FIX_MDCT_STEREO_ENC_STACK                       /* VA: basop issue 2428: Move IGF temporary buffers out of the highest stack */
#define HARM_2456_APPLY_SCALE                           /* FHG basop issue 2456: Harmonize apply_scale_ind(), apply_scale_ivas_fx() */

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

+2 −0
Original line number Diff line number Diff line
@@ -4875,6 +4875,7 @@ Word16 apply_scale_ind(
    const SCALE_SETUP *scaleTable, /* i  : Scale table             */
    const Word16 scaleTableSize    /* i  : Size of scale table     */
);
#ifndef HARM_2456_APPLY_SCALE
void apply_scale_ivas_fx(
    Word32 *scale,                 /* o  : scalefactor             */
    const Word16 bwmode,           /* i  : audio bandwidth         */
@@ -4882,6 +4883,7 @@ void apply_scale_ivas_fx(
    const SCALE_SETUP *scaleTable, /* i  : Scale table             */
    const Word16 scaleTableSize,   /* i  : Size of scale table     */
    Word16 *index );
#endif

/* Compute the power for each partition */
void bandcombinepow(
+5 −0
Original line number Diff line number Diff line
@@ -1679,9 +1679,14 @@ static Word16 shb_DTX_fx(
    {
        Word32 att_fx32 = 0;
        move32();
#ifdef HARM_2456_APPLY_SCALE

        apply_scale( &att_fx32, st->hFdCngEnc->hFdCngCom->CngBandwidth, st->hFdCngEnc->hFdCngCom->CngBitrate, scaleTableStereo, SIZE_SCALE_TABLE_STEREO ); // Q23;
#else
        Word16 index;

        apply_scale_ivas_fx( &att_fx32, st->hFdCngEnc->hFdCngCom->CngBandwidth, st->hFdCngEnc->hFdCngCom->CngBitrate, scaleTableStereo, SIZE_SCALE_TABLE_STEREO, &index ); // Q23;
#endif

        att_fx = extract_l( L_shr( att_fx32, 15 ) ); // Q8
    }