RPP data exchange operations#

RppStatus rppt_copy(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, rppHandle_t rppHandle, RppBackend executionBackend)#

Copy operation on HIP/HOST backend for a NCHW/NHWC layout tensor.

The copy operation runs a buffer copy for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).

  • dstPtr depth ranges - Will be same depth as srcPtr.

    Sample Input

    Sample Input#

    Sample Output

    Sample Output#

Parameters:
  • srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)

  • dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)

  • rppHandle – [in] RPP HIP/HOST handle created with rppCreate()

  • executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)

Return values:
  • RPP_SUCCESS – Successful completion.

  • RPP_ERROR* – Unsuccessful completion.

Returns:

A RppStatus enumeration.

RppStatus rppt_channel_permute(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32u *permutationTensor, rppHandle_t rppHandle, RppBackend executionBackend)#

Channel permute operation on HIP/HOST backend for a NCHW/NHWC layout tensor.

This function performs one of six possible channel permutations (R-G-B, R-B-G, G-R-B, G-B-R, B-R-G, B-G-R) for an image in a batch of RGB(3 channel) images with an NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).

  • dstPtr depth ranges - Will be same depth as srcPtr.

    Sample Input

    Sample Input#

    Sample Output

    Sample Output#

Parameters:
  • srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 3)

  • dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)

  • permutationTensor – [in] A tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend) specifying the channel permutation for each image. Size: 3 × srcDescPtr->n. Each value must satisfy: 0 ≤ permutationTensor[i] ≤ 2.

  • rppHandle – [in] RPP HIP/HOST handle created with rppCreate()

  • executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)

Return values:
  • RPP_SUCCESS – Successful completion.

  • RPP_ERROR* – Unsuccessful completion.

Returns:

A RppStatus enumeration.

RppStatus rppt_color_to_greyscale(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptSubpixelLayout srcSubpixelLayout, rppHandle_t rppHandle, RppBackend executionBackend)#

Color to greyscale operation on HIP/HOST backend for a NCHW/NHWC layout tensor.

The color to greyscale operation runs for a batch of RGB(3 channel) images with an NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).

  • dstPtr depth ranges - Will be same depth as srcPtr.

    Sample Input

    Sample Input#

    Sample Output

    Sample Output#

Parameters:
  • srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 3)

  • dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)

  • srcSubpixelLayout – [in] A RpptSubpixelLayout type enum to specify source subpixel layout (RGBtype or BGRtype)

  • rppHandle – [in] RPP HIP/HOST handle created with rppCreate()

  • executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)

Return values:
  • RPP_SUCCESS – Successful completion.

  • RPP_ERROR* – Unsuccessful completion.

Returns:

A RppStatus enumeration.

RppStatus rppt_yuv_to_rgb(RppPtr_t srcYPtr, RppPtr_t srcUVPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32u src_y_pitch, Rpp32u src_uv_pitch, Rpp32u dst_pitch, Rpp32u width, Rpp32u height, RpptColorStandard col_standard, RpptColorRange color_range, rppHandle_t rppHandle, RppBackend executionBackend)#

YUV to RGB color conversion on HIP backend (NV12 8-bit only)

Converts semi-planar NV12 (separate Y and interleaved UV planes) to packed RGB24.

  • Source: srcYPtr = luma plane, srcUVPtr = interleaved UV

  • src_y_pitch / src_uv_pitch: row strides in bytes

  • Destination: packed RGB at dstPtr (RGB24, Rpp8u) with row stride dst_pitch bytes.

  • Supported execution backend: RppBackend::RPP_HIP_BACKEND only.

Parameters:
  • srcYPtr – [in] pointer to Y plane in HIP memory

  • srcUVPtr – [in] pointer to interleaved UV plane in HIP memory

  • srcDescPtr – [in] source tensor descriptor (dataType must be U8)

  • dstPtr – [out] pointer to RGB output buffer in HIP memory

  • dstDescPtr – [in] destination tensor descriptor (dataType must be U8)

  • src_y_pitch – [in] row pitch of Y plane in bytes

  • src_uv_pitch – [in] row pitch of UV plane in bytes

  • dst_pitch – [in] row pitch of RGB output in bytes

  • width – [in] image width in pixels

  • height – [in] image height in pixels

  • col_standard – [in] Luma/matrix family: RpptColorStandard (unknown values use BT.709).

  • color_range – [in] Luma range: RpptColorRange_STUDIO or RpptColorRange_FULL (other values behave like studio).

  • rppHandle – [in] RPP HIP handle created with rppCreate()

  • executionBackend – [in] must be RppBackend::RPP_HIP_BACKEND

Return values:
  • RPP_SUCCESS – Successful completion.

  • RPP_ERROR* – Unsuccessful completion (e.g. RPP_ERROR_INCOMPATIBLE_BACKEND if executionBackend is not HIP).

Returns:

A RppStatus enumeration.

RppStatus rppt_yuv_to_rgb_cubic_v(RppPtr_t srcYPtr, RppPtr_t srcUVPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32u src_y_pitch, Rpp32u src_uv_pitch, Rpp32u dst_pitch, Rpp32u width, Rpp32u height, RpptColorStandard col_standard, RpptColorRange color_range, rppHandle_t rppHandle, RppBackend executionBackend)#

YUV to RGB color conversion with cubic vertical chroma upsampling on HIP backend (NV12 8-bit only)

Converts semi-planar NV12 (separate Y and interleaved UV planes) to packed RGB24, using Mitchell-Netravali cubic interpolation (B=0, C=0.6) to vertically upsample chroma. Odd luma rows pass through chroma unchanged (identity); even luma rows use a symmetric 4-tap filter. Horizontal chroma upsampling remains nearest-neighbor.

  • Source: srcYPtr = luma plane, srcUVPtr = interleaved UV

  • src_y_pitch / src_uv_pitch: row strides in bytes

  • Destination: packed RGB at dstPtr (RGB24, Rpp8u) with row stride dst_pitch bytes.

  • Supported execution backend: RppBackend::RPP_HIP_BACKEND only.

Parameters:
  • srcYPtr – [in] pointer to Y plane in HIP memory

  • srcUVPtr – [in] pointer to interleaved UV plane in HIP memory

  • srcDescPtr – [in] source tensor descriptor (dataType must be U8)

  • dstPtr – [out] pointer to RGB output buffer in HIP memory

  • dstDescPtr – [in] destination tensor descriptor (dataType must be U8)

  • src_y_pitch – [in] row pitch of Y plane in bytes

  • src_uv_pitch – [in] row pitch of UV plane in bytes

  • dst_pitch – [in] row pitch of RGB output in bytes

  • width – [in] image width in pixels

  • height – [in] image height in pixels

  • col_standard – [in] Luma/matrix family: RpptColorStandard (unknown values use BT.709).

  • color_range – [in] Luma range: RpptColorRange_STUDIO or RpptColorRange_FULL (other values behave like studio).

  • rppHandle – [in] RPP HIP handle created with rppCreate()

  • executionBackend – [in] must be RppBackend::RPP_HIP_BACKEND

Return values:
  • RPP_SUCCESS – Successful completion.

  • RPP_ERROR* – Unsuccessful completion (e.g. RPP_ERROR_INCOMPATIBLE_BACKEND if executionBackend is not HIP).

Returns:

A RppStatus enumeration.

RppStatus rppt_yuv_to_rgb_linear_v(RppPtr_t srcYPtr, RppPtr_t srcUVPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32u src_y_pitch, Rpp32u src_uv_pitch, Rpp32u dst_pitch, Rpp32u width, Rpp32u height, RpptColorStandard col_standard, RpptColorRange color_range, rppHandle_t rppHandle, RppBackend executionBackend)#

YUV to RGB color conversion with linear vertical chroma upsampling on HIP backend (NV12 8-bit only)

Converts semi-planar NV12 (separate Y and interleaved UV planes) to packed RGB24, using linear interpolation to vertically upsample chroma. Odd luma rows pass through chroma unchanged (identity); even luma rows average the two nearest chroma rows (frac=0.5). Horizontal chroma upsampling remains nearest-neighbor.

  • Source: srcYPtr = luma plane, srcUVPtr = interleaved UV

  • src_y_pitch / src_uv_pitch: row strides in bytes

  • Destination: packed RGB at dstPtr (RGB24, Rpp8u) with row stride dst_pitch bytes.

  • Supported execution backend: RppBackend::RPP_HIP_BACKEND only.

Parameters:
  • srcYPtr – [in] pointer to Y plane in HIP memory

  • srcUVPtr – [in] pointer to interleaved UV plane in HIP memory

  • srcDescPtr – [in] source tensor descriptor (dataType must be U8)

  • dstPtr – [out] pointer to RGB output buffer in HIP memory

  • dstDescPtr – [in] destination tensor descriptor (dataType must be U8)

  • src_y_pitch – [in] row pitch of Y plane in bytes

  • src_uv_pitch – [in] row pitch of UV plane in bytes

  • dst_pitch – [in] row pitch of RGB output in bytes

  • width – [in] image width in pixels

  • height – [in] image height in pixels

  • col_standard – [in] Luma/matrix family: RpptColorStandard (unknown values use BT.709).

  • color_range – [in] Luma range: RpptColorRange_STUDIO or RpptColorRange_FULL (other values behave like studio).

  • rppHandle – [in] RPP HIP handle created with rppCreate()

  • executionBackend – [in] must be RppBackend::RPP_HIP_BACKEND

Return values:
  • RPP_SUCCESS – Successful completion.

  • RPP_ERROR* – Unsuccessful completion (e.g. RPP_ERROR_INCOMPATIBLE_BACKEND if executionBackend is not HIP).

Returns:

A RppStatus enumeration.

RppStatus rppt_bayer_to_rgb(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptBayerPattern bayerPattern, RpptImageBorderType borderType, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#

Bayer to RGB (demosaic) operation on HOST only backend.

Reconstructs an RGB image from a single-channel Bayer colour filter array mosaic by bilinear interpolation. At each pixel the colour sampled by the sensor is copied, and each missing colour is the mean of the nearest pixels of that colour in the 3x3 neighbourhood:

  • G at an R or B pixel: the 4 edge neighbours.

  • R/B at a G pixel: the 2 neighbours in the row or column that holds that colour.

  • B at an R pixel (R at a B pixel): the 4 diagonal neighbours.

    The pattern is anchored at the ROI’s top-left pixel: bayerPattern names the colours of the 2x2 block starting at (roi.x, roi.y). For an ROI at an odd x or y offset, pass the pattern as seen from that pixel. Neighbours outside the ROI are mirrored without repeating the edge pixel (RpptImageBorderType::REFLECT_NO_EDGE), which keeps every neighbour on its own colour.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).

  • dstPtr depth ranges - Will be same depth as srcPtr.

Parameters:
  • srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW, c = 1)

  • dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = same as that of srcDescPtr, layout = NCHW/NHWC, c = 3, channel order R, G, B)

  • bayerPattern – [in] colour filter array pattern of the source (a single RpptBayerPattern that applies to all images in the batch)

  • borderType – [in] border type for neighbours outside the ROI (Restrictions - RpptImageBorderType::REFLECT_NO_EDGE only mode supported)

  • roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y)), with roiWidth >= 2 and roiHeight >= 2

  • roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)

  • rppHandle – [in] RPP HIP/HOST handle created with rppCreate()

  • executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)

Return values:
  • RPP_SUCCESS – Successful completion.

  • RPP_ERROR* – Unsuccessful completion.

Returns:

A RppStatus enumeration.