Menu

Bug in _soxr_deinterleave?

2016-10-23
2016-10-24
  • Alexander Hryzak

    Maybe I found a bug in _soxr_deinterleave (or did something wrong):

    #define DEINTERLEAVE_FROM(T,flag) do { \
      unsigned i; \
      size_t j; \
      T const * src = *src0; \
      if (ch > 1) \
        for (j = 0; j < n; ++j) for (i = 0; i < ch; ++i) dest[i][j] = (DEINTERLEAVE_TO)*src++; \
      else if (flag) memcpy(dest[0], src, n * sizeof(T)), src = &src[n]; \
      else for (j = 0; j < n; dest[0][j++] = (DEINTERLEAVE_TO)*src++); \
      *src0 = src; \
    } while (0)
    

    For stereo, shouldn't the for loop condition be: j < n/ch ? if I keep it like this, it writes into unallocated memory ...

    Thanks for any help,
    Alex

     
  • robs

    robs - 2016-10-24

    Hello Alexander, I don't think that there is a problem as you describe, since I would expect that either something would show up on the regression tests or that others would have noticed the problem. Maybe you did something wrong? If you can share a little of the code that you use to interface to the library, then I may be able to comment on that. Cheers, Rob.

     

Log in to post a comment.