From 3f5d85e226caf9770c95b1c839608eaf33296bd0 Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Wed, 11 Oct 2023 11:10:55 +0200 Subject: [PATCH] fix length of filtering for the decreasing gain filter of fucntion tcx_ltp_synth_filter_11_unequal_pitch() --- lib_com/options.h | 1 + lib_com/tcx_ltp.c | 10 ++++++++++ 2 files changed, 11 insertions(+) mode change 100644 => 100755 lib_com/tcx_ltp.c diff --git a/lib_com/options.h b/lib_com/options.h index 9348bf96aa..ea9d3c0f29 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,6 +164,7 @@ #define BE_FIX_832_ASAN_ERROR_EFAP_OSBA /* FhG: issue #832: fix ASAN error caused by re-allocating EFAP memories in OSBA*/ #define NONBE_FIX_819_DOUBLE_PREC_COMB_FORMATS /* VA: issue 820: Double precision arithmetic in combined formats */ #define NONBE_FIX_849_OMASA_BFI_CRASH /* VA: issue 849: fix OMASA 2TC and FEC crashes */ +#define NONBE_FIX_856_TCX_LTP_SYNTH_FILTER /* FhG: issue 856: correct filtering length for tcx-ltp synth filtering*/ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_com/tcx_ltp.c b/lib_com/tcx_ltp.c old mode 100644 new mode 100755 index 90dcb1515c..502328348d --- a/lib_com/tcx_ltp.c +++ b/lib_com/tcx_ltp.c @@ -740,7 +740,11 @@ static void tcx_ltp_synth_filter_11_unequal_pitch( gain = prev_gain; gain_step = -prev_gain / length; +#ifdef NONBE_FIX_856_TCX_LTP_SYNTH_FILTER + for ( j = 0; j < length; j++ ) +#else for ( j = 0; j < length + L; j++ ) +#endif { s = 0; s2 = 0; @@ -761,8 +765,14 @@ static void tcx_ltp_synth_filter_11_unequal_pitch( gain += gain_step; } +#ifdef NONBE_FIX_856_TCX_LTP_SYNTH_FILTER + mvr2r( out - L, temp_buf, length + L ); + mvr2r( in + length, temp_buf + length + L, L ); + temp_ptr = &temp_buf[0] + L; +#else mvr2r( out - MAX_TCX_LTP_FILTER_LEN, temp_buf, MAX_TRANSITION_LEN + 2 * MAX_TCX_LTP_FILTER_LEN ); temp_ptr = &temp_buf[0] + MAX_TCX_LTP_FILTER_LEN; +#endif m0 = temp_ptr; m1 = temp_ptr - 1; -- GitLab