Commit 0f48cf18 authored by vaclav's avatar vaclav
Browse files

fix in core_switch_lb_upsamp_fx()

parent 06229736
Loading
Loading
Loading
Loading
+18 −5
Original line number Diff line number Diff line
@@ -446,9 +446,7 @@ ivas_error core_switching_post_dec_fx(
                test();
                IF( ( ( NE_32( st_fx->last_core_brate, SID_2k40 ) && NE_32( st_fx->last_core_brate, FRAME_NO_DATA ) ) || ( NE_16( st_fx->element_mode, IVAS_CPE_DFT ) && NE_16( st_fx->element_mode, IVAS_CPE_TD ) ) || EQ_16( nchan_out, 1 ) ) && !( EQ_16( st_fx->element_mode, IVAS_CPE_MDCT ) && EQ_16( st_fx->idchan, 1 ) && ( EQ_16( nchan_out, 1 ) || EQ_16( last_element_mode, IVAS_CPE_DFT ) ) ) )
                {
#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
                    Scale_sig32( output_fx, st_fx->L_frame, Q10 - Q11 ); /* Q10 */
#else
#ifndef FIX_2280_REDUCTION_UNNECESSARY_SCALING
                    Scale_sig32( output_fx, L_FRAME48k, Q10 - Q4 ); /* Q10 */
#endif
                    core_switch_lb_upsamp_fx( st_fx, output_fx );
@@ -1000,7 +998,11 @@ void core_switching_hq_prepare_dec_fx(

static void core_switch_lb_upsamp_fx(
    Decoder_State *st, /* i/o: Decoder state                  */
#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
    Word32 *output /* i/o: LB synth/upsampled LB synth Q11*/
#else
    Word32 *output                                                                                                                                     /* i/o: LB synth/upsampled LB synth Q10*/
#endif
)
{
    Word16 i, no_col;
@@ -1008,6 +1010,13 @@ static void core_switch_lb_upsamp_fx(
    Word32 realBufferTmp_fx[CLDFB_OVRLP_MIN_SLOTS][CLDFB_NO_CHANNELS_MAX];
    Word32 imagBufferTmp_fx[CLDFB_OVRLP_MIN_SLOTS][CLDFB_NO_CHANNELS_MAX];

#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
    Word32 output_tmp[L_FRAME16k];

    Copy32( output, output_tmp, s_min( st->L_frame, L_FRAME16k ) );
    Scale_sig32( output, st->L_frame, Q10 - Q11 ); /* Q10 */
#endif

    /* open CLDFB buffer up to CLDFB_NO_CHANNELS_MAX bands for 48kHz */
    FOR( i = 0; i < CLDFB_OVRLP_MIN_SLOTS; i++ )
    {
@@ -1089,6 +1098,10 @@ static void core_switch_lb_upsamp_fx(
#endif
    }

#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
    Copy32( output_tmp, output, imult1616( no_col, st->cldfbSyn->no_channels ) ); /* Q11 */
#endif

    return;
}