Commit 00b63e8b authored by vaclav's avatar vaclav
Browse files

restore bit-exactness

parent 2f2aac95
Loading
Loading
Loading
Loading
Loading
+6 −17
Original line number Diff line number Diff line
@@ -446,7 +446,9 @@ 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 ) ) ) )
                {
#ifndef FIX_2280_REDUCTION_UNNECESSARY_SCALING
#ifdef FIX_2280_REDUCTION_UNNECESSARY_SCALING
                    Scale_sig32( output_fx, L_FRAME48k, Q10 - Q11 ); /* Q10 */
#else
                    Scale_sig32( output_fx, L_FRAME48k, Q10 - Q4 );                                         /* Q10 */
#endif
                    core_switch_lb_upsamp_fx( st_fx, output_fx );
@@ -998,11 +1000,7 @@ 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;
@@ -1010,15 +1008,6 @@ 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];

    /* save the original output "buffer" to ensure that it is not overwritten in this function */
    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++ )
    {
@@ -1101,7 +1090,7 @@ static void core_switch_lb_upsamp_fx(
    }

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

    return;