Can pSrc and pDst function arguments in ARM DSP point to same memory?

81 Views Asked by At

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:

arm_biquad_cascade_df2T_f32

arm_fir_f32

arm_cmplx_mag_f32

1

There are 1 best solutions below

0
maestro On

Yes, for complex magnitude functions the output can be the input.

For another functions, developers have to review and document each one.