diff --git a/Source/FilteringFunctions/arm_conv_partial_fast_q15.c b/Source/FilteringFunctions/arm_conv_partial_fast_q15.c index 3ef651b3..bd43a984 100644 --- a/Source/FilteringFunctions/arm_conv_partial_fast_q15.c +++ b/Source/FilteringFunctions/arm_conv_partial_fast_q15.c @@ -526,7 +526,14 @@ arm_status arm_conv_partial_fast_q15( count++; /* Update the inputA and inputB pointers for next MAC calculation */ - px = pIn1 + count; + if ((int32_t)firstIndex - (int32_t)srcBLen + 1 > 0) + { + px = pIn1 + firstIndex - srcBLen + 1 + count; + } + else + { + px = pIn1 + count; + } py = pSrc2; /* Decrement the loop counter */ @@ -563,7 +570,14 @@ arm_status arm_conv_partial_fast_q15( count++; /* Update the inputA and inputB pointers for next MAC calculation */ - px = pIn1 + count; + if ((int32_t)firstIndex - (int32_t)srcBLen + 1 > 0) + { + px = pIn1 + firstIndex - srcBLen + 1 + count; + } + else + { + px = pIn1 + count; + } py = pSrc2; /* Decrement the loop counter */ diff --git a/Source/FilteringFunctions/arm_conv_partial_fast_q31.c b/Source/FilteringFunctions/arm_conv_partial_fast_q31.c index 1d9438b6..af3724dc 100644 --- a/Source/FilteringFunctions/arm_conv_partial_fast_q31.c +++ b/Source/FilteringFunctions/arm_conv_partial_fast_q31.c @@ -391,7 +391,14 @@ arm_status arm_conv_partial_fast_q31( count += 4U; /* Update the inputA and inputB pointers for next MAC calculation */ - px = pIn1 + count; + if ((int32_t)firstIndex - (int32_t)srcBLen + 1 > 0) + { + px = pIn1 + firstIndex - srcBLen + 1 + count; + } + else + { + px = pIn1 + count; + } py = pSrc2; /* Decrement the loop counter */ @@ -449,7 +456,14 @@ arm_status arm_conv_partial_fast_q31( count++; /* Update the inputA and inputB pointers for next MAC calculation */ - px = pIn1 + count; + if ((int32_t)firstIndex - (int32_t)srcBLen + 1 > 0) + { + px = pIn1 + firstIndex - srcBLen + 1 + count; + } + else + { + px = pIn1 + count; + } py = pSrc2; /* Decrement the loop counter */ @@ -487,7 +501,14 @@ arm_status arm_conv_partial_fast_q31( count++; /* Update the inputA and inputB pointers for next MAC calculation */ - px = pIn1 + count; + if ((int32_t)firstIndex - (int32_t)srcBLen + 1 > 0) + { + px = pIn1 + firstIndex - srcBLen + 1 + count; + } + else + { + px = pIn1 + count; + } py = pSrc2; /* Decrement the loop counter */ diff --git a/Source/FilteringFunctions/arm_conv_partial_q15.c b/Source/FilteringFunctions/arm_conv_partial_q15.c index 7b43c597..93864b78 100644 --- a/Source/FilteringFunctions/arm_conv_partial_q15.c +++ b/Source/FilteringFunctions/arm_conv_partial_q15.c @@ -488,7 +488,14 @@ arm_status arm_conv_partial_q15( count += 4U; /* Update the inputA and inputB pointers for next MAC calculation */ - px = pIn1 + count; + if ((int32_t)firstIndex - (int32_t)srcBLen + 1 > 0) + { + px = pIn1 + firstIndex - srcBLen + 1 + count; + } + else + { + px = pIn1 + count; + } py = pSrc2; /* Decrement the loop counter */ @@ -541,7 +548,14 @@ arm_status arm_conv_partial_q15( count++; /* Update the inputA and inputB pointers for next MAC calculation */ - px = pIn1 + count; + if ((int32_t)firstIndex - (int32_t)srcBLen + 1 > 0) + { + px = pIn1 + firstIndex - srcBLen + 1 + count; + } + else + { + px = pIn1 + count; + } py = pSrc2; /* Decrement the loop counter */ @@ -578,7 +592,14 @@ arm_status arm_conv_partial_q15( count++; /* Update the inputA and inputB pointers for next MAC calculation */ - px = pIn1 + count; + if ((int32_t)firstIndex - (int32_t)srcBLen + 1 > 0) + { + px = pIn1 + firstIndex - srcBLen + 1 + count; + } + else + { + px = pIn1 + count; + } py = pSrc2; /* Decrement the loop counter */ diff --git a/Source/FilteringFunctions/arm_conv_partial_q31.c b/Source/FilteringFunctions/arm_conv_partial_q31.c index e6770ab4..94999b93 100644 --- a/Source/FilteringFunctions/arm_conv_partial_q31.c +++ b/Source/FilteringFunctions/arm_conv_partial_q31.c @@ -361,7 +361,14 @@ arm_status arm_conv_partial_q31( count += 3U; /* Update the inputA and inputB pointers for next MAC calculation */ - px = pIn1 + count; + if ((int32_t)firstIndex - (int32_t)srcBLen + 1 > 0) + { + px = pIn1 + firstIndex - srcBLen + 1 + count; + } + else + { + px = pIn1 + count; + } py = pSrc2; /* Decrement the loop counter */ @@ -414,7 +421,14 @@ arm_status arm_conv_partial_q31( count++; /* Update the inputA and inputB pointers for next MAC calculation */ - px = pIn1 + count; + if ((int32_t)firstIndex - (int32_t)srcBLen + 1 > 0) + { + px = pIn1 + firstIndex - srcBLen + 1 + count; + } + else + { + px = pIn1 + count; + } py = pSrc2; /* Decrement the loop counter */ @@ -451,7 +465,14 @@ arm_status arm_conv_partial_q31( count++; /* Update the inputA and inputB pointers for next MAC calculation */ - px = pIn1 + count; + if ((int32_t)firstIndex - (int32_t)srcBLen + 1 > 0) + { + px = pIn1 + firstIndex - srcBLen + 1 + count; + } + else + { + px = pIn1 + count; + } py = pSrc2; /* Decrement the loop counter */ diff --git a/Source/FilteringFunctions/arm_conv_partial_q7.c b/Source/FilteringFunctions/arm_conv_partial_q7.c index 8f19e216..d4e0679d 100644 --- a/Source/FilteringFunctions/arm_conv_partial_q7.c +++ b/Source/FilteringFunctions/arm_conv_partial_q7.c @@ -449,7 +449,14 @@ arm_status arm_conv_partial_q7( count += 4U; /* Update the inputA and inputB pointers for next MAC calculation */ - px = pIn1 + count; + if ((int32_t)firstIndex - (int32_t)srcBLen + 1 > 0) + { + px = pIn1 + firstIndex - srcBLen + 1 + count; + } + else + { + px = pIn1 + count; + } py = pSrc2; @@ -524,7 +531,14 @@ arm_status arm_conv_partial_q7( count++; /* Update the inputA and inputB pointers for next MAC calculation */ - px = pIn1 + count; + if ((int32_t)firstIndex - (int32_t)srcBLen + 1 > 0) + { + px = pIn1 + firstIndex - srcBLen + 1 + count; + } + else + { + px = pIn1 + count; + } py = pSrc2; /* Decrement the loop counter */ @@ -561,7 +575,14 @@ arm_status arm_conv_partial_q7( count++; /* Update the inputA and inputB pointers for next MAC calculation */ - px = pIn1 + count; + if ((int32_t)firstIndex - (int32_t)srcBLen + 1 > 0) + { + px = pIn1 + firstIndex - srcBLen + 1 + count; + } + else + { + px = pIn1 + count; + } py = pSrc2; /* Decrement the loop counter */