I use the following functions from ARM DSP library:
void arm_fir_f32(const arm_fir_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize);void arm_biquad_cascade_df2T_f32(const arm_biquad_cascade_df2T_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize);void arm_cmplx_mag_f32(const float32_t *pSrc, float32_t pDst, uint32_t numSamples);
The question is can pointers pSrc, pDst point to same memory? Official documentation doesn't contain such information.
The input pointer is marked with const attribute, so that these funcitons don't modify input array internally. But what will happen if pSrc[k-1] is modified when function process pSrc[k] value? It seems to be OK, because filter instance structures have pState member...
Additionally, I can say that pSrc and pDst is not marked with restrict attribute, so that functions developers assume pSrc could be equal to pDst...
Sources of these functions:
restrictkeyword if the pointers are not allowed to be the same. This would give the compiler more opportunity to optimize. The code has a comment The current stage output is given as the input to the next stage. So, I think the answer depends on the way you chain the filters.pSrcvalues can't be altered because of theconstkeyword. Also, this means that the compiler won't let you do something likeconst float_32* in; float_32* out = in;. For the same reason you can't modifypSrc[k-1](orpSrc[anything], for that matter). You can cast away theconstness without changing the register of the pointer, but then you wouldn't be able to pass it to a function withconstin the signature. The API makes it hard to violate its design principles, which is a good thing.constfrom a pointer and feed it to a signature withconst <type>*. There are probably compiler flags to set to at least throw a warning when you do that. So, yes, you can spoof your pointers to do in place DSP. But, it seems like the API designers do not want you to.