Commit 74fcdac2 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh Committed by Manuel Jander
Browse files

Fix for 3GPP issue 1037: Wrong variable type used in the fixed-point code - 1

Link #1037
parent 10647563
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -3830,6 +3830,15 @@ void ivas_compute_spar_params_fx(
                        move32();
                    }
                }
#else
                for ( i = 0; i < IVAS_SPAR_MAX_CH - IVAS_SPAR_MAX_DMX_CHS; i++ )
                {
                    for ( j = 0; j < IVAS_SPAR_MAX_DMX_CHS - 1; j++ )
                    {
                        hSparMd->band_coeffs[b + i_ts * IVAS_MAX_NUM_BANDS].C_re_fx[i][j] = L_shr( hSparMd->band_coeffs[b + i_ts * IVAS_MAX_NUM_BANDS].C_re_fx[i][j], sub( q_tmp, 22 ) );
                    }
                }
#endif
                hSparMd->band_coeffs[b + ( i_ts * IVAS_MAX_NUM_BANDS )].q_C_re_fx = Q22;
                move16();
            }
+0 −4
Original line number Diff line number Diff line
@@ -72,10 +72,6 @@
#define max( x, y ) ( ( x ) > ( y ) ? ( x ) : ( y ) )
#endif
#ifndef TRUNC
#define TRUNC( x ) ( (int16_t) ( ( ( x ) >= 32767. ? 32767 : ( ( x ) <= -32768. ? -32768 : ( x ) ) ) + 0.5 ) )
#endif
#define log_base_2( x ) ( (double) log( (double) ( x ) ) * 1.4426950408889634074f )
#define round_f( x )    ( ( ( x ) > 0 ) ? (int32_t) ( ( x ) + 0.5f ) : ( -(int32_t) ( ( -x ) + 0.5f ) ) )
+4 −2
Original line number Diff line number Diff line
@@ -59,6 +59,8 @@ typedef struct
    const Word16 *filter_fx; /* resampling filter coefficients    Q14	*/

    Word16 filt_len_fx; /* number of filter coeff.			Q0	*/

    UWord16 flags;    /* flags from config. table          */
    UWord16 flags_fx; /* flags from config. table          Q0	*/
                      // UNS_Word16 flags_fx;     /* flags from config. table          Q0	*/

+1 −8
Original line number Diff line number Diff line
@@ -838,14 +838,7 @@ ivas_error acelp_core_switch_dec_bfi_ivas_fx(
    move16();
    Copy_Scale_sig_16_32_DEPREC( synth_out, synth32, L_FRAME48k, 5 ); /*11-5-1*/

    cldfbSynthesis_ivas_fx( realBuffer, imagBuffer, synth32, extract_l( Mpy_32_16_1( st_fx->output_Fs, 328 ) ), 0, st_fx->cldfbSyn );
#else  /* OPT_AVOID_STATE_BUF_RESCALE */
    Word16 out_len = extract_l( Mpy_32_16_1( st_fx->output_Fs, 328 ) );
    cldfbSynthesis_ivas_fx( realBuffer, imagBuffer, synth32, out_len, -1, 0, st_fx->cldfbSyn );
    Copy_Scale_sig_32_16( synth32, synth_out, out_len, -4 );
#endif /* OPT_AVOID_STATE_BUF_RESCALE */

#ifndef OPT_AVOID_STATE_BUF_RESCALE
    cldfbSynthesis_ivas_fx( realBuffer, imagBuffer, synth32, extract_l( Mpy_32_16_1( st_fx->output_Fs, 328 ) ), st_fx->cldfbSyn );
    Scale_sig32( st_fx->cldfbSyn->cldfb_state_fx, st_fx->cldfbSyn->cldfb_state_length, -1 ); // Q_cldfb_state-1
    st_fx->cldfbSyn->Q_cldfb_state = sub( st_fx->cldfbSyn->Q_cldfb_state, 1 );
    move16();
+2 −0
Original line number Diff line number Diff line
@@ -507,6 +507,7 @@ ivas_error ivas_jbm_dec_tc_fx(
                    hCPE->q_output_mem_fx[ii] = hCPE->hStereoDft->q_dft;
                    move16();
                }
#ifdef MSAN_FIX
                FOR( ii = 0; ii < CPE_CHANNELS; ii++ )
                {
                    Scale_sig32( &hCPE->prev_synth_fx[ii][0], NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, IVAS_DEC_DELAY_NS - STEREO_DFT32MS_OVL_NS ), sub( hCPE->q_prev_synth_fx, Q11 ) ); // q_prev_synth_fx
@@ -518,6 +519,7 @@ ivas_error ivas_jbm_dec_tc_fx(
                {
                    Scale_sig32( p_output_fx[i], L_FRAME48k, negate( s ) );
                }
#ifdef MSAN_FIX
                FOR( ii = 0; ii < CPE_CHANNELS; ii++ )
                {
                    Scale_sig32( &hCPE->prev_synth_fx[ii][0], NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, IVAS_DEC_DELAY_NS - STEREO_DFT32MS_OVL_NS ), sub( Q11, hCPE->q_prev_synth_fx ) ); // Q11
Loading