]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ep-processor-libraries/dsplib.git/blobdiff - ti/dsplib/src/DSPF_sp_fircirc/c66/DSPF_sp_fircirc.c
Merge branch 'dsplib-fix-bugs-prsdk-5-3'
[ep-processor-libraries/dsplib.git] / ti / dsplib / src / DSPF_sp_fircirc / c66 / DSPF_sp_fircirc.c
index a734ebabec5b2d87c6142ccf2e368f68c3098b94..e0656585f23cecd5b0147ef292aeffd9e494baad 100644 (file)
@@ -51,7 +51,6 @@ void DSPF_sp_fircirc(const float *x, float *h, float *restrict y,
     int    i, j;
     /* Circular Buffer block size = ((2^(csize + 1)) / 4) floating point numbers */
     int    mod = (1 << (csize - 1)) - 1; 
-    float  *x_ptr = (float*)&x[index];
     __float2_t x_10, x_21, x_32, x_43, x_54, h_10;
     __float2_t sum1, sum2, sum3, sum4;
 
@@ -71,15 +70,15 @@ void DSPF_sp_fircirc(const float *x, float *h, float *restrict y,
         sum3 = 0;
         sum4 = 0;
 
-        x_10 = _amem8_f2_const(&x_ptr[(i) & (mod)]);
-        x_32 = _amem8_f2_const(&x_ptr[(i+2) & (mod)]);
+        x_10 = _amem8_f2_const(&x[(j+index) & (mod)]);
+        x_32 = _amem8_f2_const(&x[(j+2+index) & (mod)]);
         x_21 = _ftof2(_lof2(x_32), _hif2(x_10));
 
         /* note: h coeffs given in reverse order: { h[nh-1], h[nh-2], ..., h[0] } */
         #pragma MUST_ITERATE(1,,)
         for(i = 0; i < nh; i+=2) {
             h_10 = _amem8_f2_const(&h[i]);
-            x_54 = _amem8_f2_const(&x_ptr[(i+4) & (mod)]);
+            x_54 = _amem8_f2_const(&x[(j+i+4+index) & (mod)]);
             x_43 = _ftof2(_lof2(x_54), _hif2(x_32));
 
             sum1 = _daddsp(sum1, _dmpysp(x_10, h_10));
@@ -102,7 +101,6 @@ void DSPF_sp_fircirc(const float *x, float *h, float *restrict y,
     int    i, j;
     /* Circular Buffer block size = ((2^(csize + 1)) / 4) floating point numbers */
     int    mod = (1 << (csize - 1)) - 1; 
-    float  *x_ptr = (float*)&x[index];
     __float2_t x_01, x_12, x_23, x_34, x_45, h_01;
     __float2_t sum1, sum2, sum3, sum4;
 
@@ -122,15 +120,15 @@ void DSPF_sp_fircirc(const float *x, float *h, float *restrict y,
         sum3 = 0;
         sum4 = 0;
 
-        x_01 = _amem8_f2_const(&x_ptr[(i) & (mod)]);
-        x_23 = _amem8_f2_const(&x_ptr[(i+2) & (mod)]);
+        x_01 = _amem8_f2_const(&x[(j+index) & (mod)]);
+        x_23 = _amem8_f2_const(&x[(j+2+index) & (mod)]);
         x_12 = _ftof2(_lof2(x_01), _hif2(x_23));
 
         /* note: h coeffs given in reverse order: { h[nh-1], h[nh-2], ..., h[0] } */
         #pragma MUST_ITERATE(1,,)
         for(i = 0; i < nh; i+=2) {
             h_01 = _amem8_f2_const(&h[i]);
-            x_45 = _amem8_f2_const(&x_ptr[(i+4) & (mod)]);
+            x_45 = _amem8_f2_const(&x[(j+i+4+index) & (mod)]);
             x_34 = _ftof2(_lof2(x_23), _hif2(x_45));
 
             sum1 = _daddsp(sum1, _dmpysp(x_01, h_01));
@@ -153,4 +151,3 @@ void DSPF_sp_fircirc(const float *x, float *h, float *restrict y,
 /*            Copyright (c) 2011 Texas Instruments, Incorporated.          */
 /*                           All Rights Reserved.                          */
 /* ======================================================================= */
-