From 4a1d4635c78e841b84b6892ee83f4539c2fa78b6 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Sun, 18 Aug 2024 14:33:12 +0530 Subject: [PATCH] LTV crash fix and high mld fixes for multichannel files [x] MLD improvements for Multi-channel 5_1 at 384 kbps, 48kHz in, 48kHz out, 7_1_4 out [x] Crash fix for LTV stream: ltv-stereo at 24.4 kbps, 48kHz in, 48kHz out, DTX on --- lib_dec/ivas_stereo_cng_dec.c | 6 ++---- lib_rend/ivas_vbap.c | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib_dec/ivas_stereo_cng_dec.c b/lib_dec/ivas_stereo_cng_dec.c index e6e655755..aaf3b7575 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 c68ba03fc..d84dcba56 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(); -- GitLab