diff --git a/lib_com/ivas_dirac_com.c b/lib_com/ivas_dirac_com.c index adfe5b666ff2287e5e881b11c241128474e58eba..c810923c119eaa98bcfb62eb14a7c9276ec545e7 100644 --- a/lib_com/ivas_dirac_com.c +++ b/lib_com/ivas_dirac_com.c @@ -2218,7 +2218,7 @@ static UWord16 deindex_sph_idx_general_fx( IF( GE_32( *theta_dec_fx, 90 << Q22 ) ) { - *theta_dec_fx = 90 << 22 * sign_theta; + *theta_dec_fx = ( 90 << 22 ) * sign_theta; move32(); *phi_dec_fx = 0; move32(); diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index 85a301239474b0c6ce0a8e8a1204005262df662a..383b3ca8714a58679ce01376425a976ad0d4baa3 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -1694,6 +1694,13 @@ ivas_error core_switching_post_dec_ivas_fx( } /* delay HQ synthesis to synchronize with ACELP synthesis */ /* rescaling to the min exp of the 2 */ + if ( hHQ_core->Q_old_postdec ) + { + Scale_sig( st_fx->delay_buf_out_fx, delay_comp, negate( hHQ_core->Q_old_postdec ) ); + } + + hHQ_core->Q_old_postdec = 0; + move16(); Qtmp = s_min( *Qsynth, hHQ_core->Q_old_postdec ); Scale_sig( synth, output_frame, sub( Qtmp, *Qsynth ) ); *Qsynth = Qtmp; @@ -1816,7 +1823,6 @@ ivas_error core_switching_post_dec_ivas_fx( L_tmp2 = L_mac0( L_tmp2, div_s( sub( tmpDelta, i ), tmpDelta ), tmp ); L_tmp2 = L_shl( L_tmp2, 1 ); synth[i + delay_comp] = round_fx( L_add( L_tmp, L_tmp2 ) ); - move16(); } test(); test(); diff --git a/lib_dec/ivas_stereo_switching_dec.c b/lib_dec/ivas_stereo_switching_dec.c index 82b3b0a667dc6fe95d49d56250822a55e621d205..1e3198b0e07e291d34503b008c67b85da62e0fa3 100644 --- a/lib_dec/ivas_stereo_switching_dec.c +++ b/lib_dec/ivas_stereo_switching_dec.c @@ -3222,7 +3222,7 @@ void stereo_switching_dec( // fix need to do correctly set32_fx( sts[1]->old_pitch_buf_fx, L_deposit_h( L_SUBFR ), 2 * NB_SUBFR16k ); - sts[1]->old_fpitchFB = 2 * L_SUBFR; + sts[1]->old_fpitchFB = L_deposit_h( 2 * L_SUBFR ); move32(); /* reset CLDFB memories */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 606f003cac00787d2188484a79c3cb0580cbe557..55dfd98082cde954f1609b39939b0a329df73ed6 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -10148,7 +10148,7 @@ static void renderIsmToMasa( FOR( i = 0; i < MAX_NUM_OBJECTS; i++ ) { - input_e[i] = sub( 31, add( getScaleFactor32( tmpRendBuffer_fx[i], L_FRAME48k ), 8 ) ); + input_e[i] = sub( 31, add( getScaleFactor32( tmpRendBuffer_fx[i], L_FRAME48k ), *outAudio.pq_fact ) ); move16(); } @@ -10167,7 +10167,7 @@ static void renderIsmToMasa( { FOR( j = 0; j < L_FRAME48k; j++ ) { - tmpRendBuffer_fx[i][j] = L_shr( tmpRendBuffer_fx[i][j], add( sub( max_e, sub( 31, Q8 ) ), guard_bits ) ); + tmpRendBuffer_fx[i][j] = L_shr( tmpRendBuffer_fx[i][j], add( sub( max_e, sub( 31, *outAudio.pq_fact ) ), guard_bits ) ); move32(); } } diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 12ec67502c80cf9273485733e71b9bf9766e8bbd..beb2af28948b8439e4d588b077eb12fb69924fd1 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -83,7 +83,7 @@ typedef struct Word16 q_factor; Word16 *pq_fact; Word32 *data_fx; - Word16 Q_data; + // Word16 Q_data; } IVAS_REND_AudioBuffer; #endif