Separable convolution#

Applies a separable convolution to a tile.

Functions#

void pvaAplExecSepConv5x5S16(PvaAplSepConv5x5S16 *handle)

Execute the convolution algorithm with a given handle.

void pvaAplExecSepConv5x5S16Vpu(PvaAplSepConv5x5S16 *handle)

Execute the convolution algorithm with a given handle.

void pvaAplInitSepConv5x5S16(PvaAplSepConv5x5S16 *handle, int16_t *input, int16_t *coeff_h, int16_t *coeff_v, int32_t width, int32_t height, int32_t inputLinePitch, int32_t outputLinePitch, int32_t roundNBits, int16_t *output, int16_t *cbStart, int32_t cbSize, int16_t *scratch)

Initialize the 5x5 Separable Convolution algorithm parameters.

void pvaAplInitSepConv5x5S16Vpu(PvaAplSepConv5x5S16 *handle, int16_t *input, int16_t *coeff_h, int16_t *coeff_v, int32_t width, int32_t height, int32_t inputLinePitch, int32_t outputLinePitch, int32_t roundNBits, int16_t *output, int16_t *cbStart, int32_t cbSize, int16_t *scratch)

Initialize the 5x5 Separable Convolution algorithm parameters.

void pvaAplUpdateSepConv5x5S16(PvaAplSepConv5x5S16 *handle, int16_t *input, int16_t *output)

Update the input/output image buffer pointers and input image size for the 5x5 Separable Convolution algorithm.

void pvaAplUpdateSepConv5x5S16Vpu(PvaAplSepConv5x5S16 *handle, int16_t *input, int16_t *output)

Update the input/output image buffer pointers and input image size for the 5x5 Separable Convolution algorithm.

Functions#

inline void pvaAplExecSepConv5x5S16(PvaAplSepConv5x5S16 *handle)#

Execute the convolution algorithm with a given handle.

Parameters:

handle – Pointer to the convolution algorithm handle.

void pvaAplExecSepConv5x5S16Vpu(PvaAplSepConv5x5S16 *handle)#

Execute the convolution algorithm with a given handle.

This variant ensures synchronous execution on VPU, even on platforms supporting asynchronous acceleration. Do not call pvaAplWait() when using this variant.

Parameters:

handle – Pointer to the convolution algorithm handle.

inline void pvaAplInitSepConv5x5S16(
PvaAplSepConv5x5S16 *handle,
int16_t *input,
int16_t *coeff_h,
int16_t *coeff_v,
int32_t width,
int32_t height,
int32_t inputLinePitch,
int32_t outputLinePitch,
int32_t roundNBits,
int16_t *output,
int16_t *cbStart,
int32_t cbSize,
int16_t *scratch,
)#

Initialize the 5x5 Separable Convolution algorithm parameters.

Parameters:
  • handle – Pointer to the algorithm handle. Enough space for the handle should be allocated in VMEM before the call.

  • input – Pointer to the input image to be convolved with the kernel. Image pixel format should be int16_t.

  • coeff_h – Horizontal convolution kernel coefficients. Coefficient values should be in the [-31, 31] range, i.e., 6-bit signed. Sum of absolute coefficient values should be less than 256. The buffer should not be altered while the algorithm is executing.

  • coeff_v – Vertical convolution kernel coefficients. Coefficient values should be in the [-31, 31] range, i.e., 6-bit signed. Sum of absolute coefficient values should be less than 256.

  • width – Input image width in pixels, including the halo.

  • height – Input image height in pixels, including the halo.

  • inputLinePitch – Input image buffer line pitch in pixels.

  • outputLinePitch – Output image buffer line pitch in pixels.

  • roundNBits – Right shift amount for rounding the output after the horizontal convolution pass and vertical convolution pass. Default is 8. Smaller shift amount can be used depending on the sum of absolute coefficient values.

  • output – Pointer to the output image buffer where the result is written to. Output pixel format is int16_t.

  • cbStart – Start address of the input circular buffer.

  • cbSize – Size of the input circular buffer in bytes.

  • scratch – Pointer to the scratch buffer that will be used by the algorithm.

void pvaAplInitSepConv5x5S16Vpu(
PvaAplSepConv5x5S16 *handle,
int16_t *input,
int16_t *coeff_h,
int16_t *coeff_v,
int32_t width,
int32_t height,
int32_t inputLinePitch,
int32_t outputLinePitch,
int32_t roundNBits,
int16_t *output,
int16_t *cbStart,
int32_t cbSize,
int16_t *scratch,
)#

Initialize the 5x5 Separable Convolution algorithm parameters.

This variant ensures synchronous execution on VPU, even on platforms supporting asynchronous acceleration.

Parameters:
  • handle – Pointer to the algorithm handle. Enough space for the handle should be allocated in VMEM before the call.

  • input – Pointer to the input image to be convolved with the kernel. Image pixel format should be int16_t.

  • coeff_h – Horizontal convolution kernel coefficients. Coefficient values should be in the [-31, 31] range, i.e., 6-bit signed. Sum of absolute coefficient values should be less than 256. The buffer should not be altered while the algorithm is executing.

  • coeff_v – Vertical convolution kernel coefficients. Coefficient values should be in the [-31, 31] range, i.e., 6-bit signed. Sum of absolute coefficient values should be less than 256.

  • width – Input image width in pixels, including the halo.

  • height – Input image height in pixels, including the halo.

  • inputLinePitch – Input image buffer line pitch in pixels.

  • outputLinePitch – Output image buffer line pitch in pixels.

  • roundNBits – Right shift amount for rounding the output after the horizontal convolution pass and vertical convolution pass. Default is 8. Smaller shift amount can be used depending on the sum of absolute coefficient values.

  • output – Pointer to the output image buffer where the result is written to. Output pixel format is int16_t.

  • cbStart – Start address of the input circular buffer.

  • cbSize – Size of the input circular buffer in bytes.

  • scratch – Pointer to the scratch buffer that will be used by the algorithm.

inline void pvaAplUpdateSepConv5x5S16(
PvaAplSepConv5x5S16 *handle,
int16_t *input,
int16_t *output,
)#

Update the input/output image buffer pointers and input image size for the 5x5 Separable Convolution algorithm.

Parameters:
  • handle – Pointer to the algorithm handle.

  • input – Pointer to the input image to be convolved with the kernel. Image pixel format should be int16_t.

  • output – Pointer to the output image buffer where the result is written to. Output pixel format is int16_t.

void pvaAplUpdateSepConv5x5S16Vpu(
PvaAplSepConv5x5S16 *handle,
int16_t *input,
int16_t *output,
)#

Update the input/output image buffer pointers and input image size for the 5x5 Separable Convolution algorithm.

This variant ensures synchronous execution on VPU, even on platforms supporting asynchronous acceleration.

Parameters:
  • handle – Pointer to the algorithm handle.

  • input – Pointer to the input image to be convolved with the kernel. Image pixel format should be int16_t.

  • output – Pointer to the output image buffer where the result is written to. Output pixel format is int16_t.