Elementwise clipping

void riscv_clip_f16(const float16_t *pSrc, float16_t *pDst, float16_t low, float16_t high, uint32_t numSamples)
void riscv_clip_f32(const float32_t *pSrc, float32_t *pDst, float32_t low, float32_t high, uint32_t numSamples)
void riscv_clip_q15(const q15_t *pSrc, q15_t *pDst, q15_t low, q15_t high, uint32_t numSamples)
void riscv_clip_q31(const q31_t *pSrc, q31_t *pDst, q31_t low, q31_t high, uint32_t numSamples)
void riscv_clip_q7(const q7_t *pSrc, q7_t *pDst, q7_t low, q7_t high, uint32_t numSamples)
group BasicClip

Element-by-element clipping of a value.

The value is constrained between 2 bounds.

There are separate functions for floating-point, Q7, Q15, and Q31 data types.

Functions

void riscv_clip_f16(const float16_t *pSrc, float16_t *pDst, float16_t low, float16_t high, uint32_t numSamples)

Elementwise floating-point clipping.

Parameters
  • pSrc[in] points to input values

  • pDst[out] points to output clipped values

  • low[in] lower bound

  • high[in] higher bound

  • numSamples[in] number of samples to clip

Returns

none

void riscv_clip_f32(const float32_t *pSrc, float32_t *pDst, float32_t low, float32_t high, uint32_t numSamples)

Elementwise floating-point clipping.

Parameters
  • pSrc[in] points to input values

  • pDst[out] points to output clipped values

  • low[in] lower bound

  • high[in] higher bound

  • numSamples[in] number of samples to clip

Returns

none

void riscv_clip_q15(const q15_t *pSrc, q15_t *pDst, q15_t low, q15_t high, uint32_t numSamples)

Elementwise fixed-point clipping.

Parameters
  • pSrc[in] points to input values

  • pDst[out] points to output clipped values

  • low[in] lower bound

  • high[in] higher bound

  • numSamples[in] number of samples to clip

Returns

none

void riscv_clip_q31(const q31_t *pSrc, q31_t *pDst, q31_t low, q31_t high, uint32_t numSamples)

Elementwise fixed-point clipping.

Parameters
  • pSrc[in] points to input values

  • pDst[out] points to output clipped values

  • low[in] lower bound

  • high[in] higher bound

  • numSamples[in] number of samples to clip

Returns

none

void riscv_clip_q7(const q7_t *pSrc, q7_t *pDst, q7_t low, q7_t high, uint32_t numSamples)

Elementwise fixed-point clipping.

Parameters
  • pSrc[in] points to input values

  • pDst[out] points to output clipped values

  • low[in] lower bound

  • high[in] higher bound

  • numSamples[in] number of samples to clip

Returns

none