diff --git a/lib_dec/ivas_stereo_cng_dec.c b/lib_dec/ivas_stereo_cng_dec.c index e6e65575522e10dd416583ce2964b11bacb1842d..aaf3b7575a9b6b54a9ff75b87530464c89c4e8c5 100644 --- a/lib_dec/ivas_stereo_cng_dec.c +++ b/lib_dec/ivas_stereo_cng_dec.c @@ -1294,10 +1294,8 @@ static void stereo_dft_generate_comfort_noise_fx( FOR( i = 0; i < shr( sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ), 1 ); i++ ) { /* Real part in FFT bins */ - tmp = *ptr_level++; - move32(); - tmp = L_add( tmp, *ptr_level++ ); - tmp = L_shr( tmp, 1 ); + tmp = L_shr( *ptr_level++, 1 ); + tmp = L_add( tmp, L_shr( *ptr_level++, 1 ) ); rand_gauss_fx( ptr_r, &st->hTdCngDec->cng_seed, q_dft ); q_sqrt = sub( Q31, q_cngNoiseLevel ); tmp = Sqrt32( tmp, &q_sqrt ); diff --git a/lib_rend/ivas_vbap.c b/lib_rend/ivas_vbap.c index c68ba03fc4f9bb66968d673746a5f04a5cea159c..d84dcba565828114d6b0e1bc22ea214a83751bec 100644 --- a/lib_rend/ivas_vbap.c +++ b/lib_rend/ivas_vbap.c @@ -956,7 +956,7 @@ void vbap_determine_gains_fx( { FOR( ch2 = 0; ch2 < num_speaker_nodes; ch2++ ) { - gains_fx[ch2] = L_add( gains_fx[ch2], L_shl( Mpy_32_16_1( gain_triplet_fx[ch], bottom_virtual_speaker_node_division_gains_fx[ch2] ), 13 ) ); // Q29 + gains_fx[ch2] = L_add( gains_fx[ch2], L_shl( Mpy_32_16_1( gain_triplet_fx[ch], bottom_virtual_speaker_node_division_gains_fx[ch2] ), 12 ) ); // Q29 move32(); } } @@ -964,7 +964,7 @@ void vbap_determine_gains_fx( { FOR( ch2 = 0; ch2 < num_speaker_nodes; ch2++ ) { - gains_fx[ch2] = L_add( gains_fx[ch2], L_shl( Mpy_32_16_1( gain_triplet_fx[ch], top_virtual_speaker_node_division_gains_fx[ch2] ), 13 ) ); // Q29 + gains_fx[ch2] = L_add( gains_fx[ch2], L_shl( Mpy_32_16_1( gain_triplet_fx[ch], top_virtual_speaker_node_division_gains_fx[ch2] ), 12 ) ); // Q29 move32(); } } @@ -972,7 +972,7 @@ void vbap_determine_gains_fx( { FOR( ch2 = 0; ch2 < num_speaker_nodes; ch2++ ) { - gains_fx[ch2] = L_add( gains_fx[ch2], L_shl( Mpy_32_16_1( gain_triplet_fx[ch], back_virtual_speaker_node_division_gains_fx[ch2] ), 13 ) ); // Q29 + gains_fx[ch2] = L_add( gains_fx[ch2], L_shl( Mpy_32_16_1( gain_triplet_fx[ch], back_virtual_speaker_node_division_gains_fx[ch2] ), 12 ) ); // Q29 move32(); } } @@ -1521,7 +1521,7 @@ static void determine_virtual_speaker_node_division_gains_fx( /* The second condition allows division gains only to actual loudspeakers */ test(); - IF( connection_node > 0 && ( LT_16( connection_node, num_speaker_nodes ) ) ) + IF( connection_node >= 0 && ( LT_16( connection_node, num_speaker_nodes ) ) ) { virtual_node_division_gains_fx[connection_node] = ONE_IN_Q14; move16();