From 449c37e9ea176c018212eea53791d6703f5d71ce Mon Sep 17 00:00:00 2001 From: "Christian R. Helmrich" Date: Mon, 13 Apr 2020 01:00:16 +0200 Subject: [PATCH] fix HF TNS bug --- src/lib/exhaleEnc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/exhaleEnc.cpp b/src/lib/exhaleEnc.cpp index cbd2f56..0a6eaa8 100644 --- a/src/lib/exhaleEnc.cpp +++ b/src/lib/exhaleEnc.cpp @@ -433,7 +433,7 @@ unsigned ExhaleEncoder::applyTnsToWinGroup (TnsData& tnsData, SfbGroupData& grpD while (grpSO[tnsStartSfb] < tnsStartOffs) tnsStartSfb++; // start band for TNS filter } - tnsMaxBands = __min (tnsMaxBands, maxSfb); + if ((tnsMaxBands = __min (tnsMaxBands, maxSfb)) <= tnsStartSfb) tnsStartSfb = numSwbWin; if ((tnsData.filterLength[0] = __max (0, numSwbWin - tnsStartSfb)) > 0) {