Function cvcudaAdvCvtColorSubmit

Function Documentation

NVCVStatus cvcudaAdvCvtColorSubmit(NVCVOperatorHandle handle, cudaStream_t stream, NVCVTensorHandle in, NVCVTensorHandle out, NVCVColorConversionCode code, NVCVColorSpec spec)

Executes the AdvCvtColor operation on the given cuda stream. This operation does not wait for completion. Advanced color conversion from one color space to another from YUV420(NV12/21)YUV to RGB.

Limitations:

Input: Data Layout: [kNHWC, kHWC] Channels: [1, 3] kNWHC/KHWC semi planar 420 tensors are allowed

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kNHWC, kHWC] Channels: [1, 3] kNWHC/KHWC semi planar 420 tensors are allowed

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | No
 Data Type     | Yes
 Number        | Yes
 Channels      | Yes (No for semi planar 420 tensors conversion)
 Width         | Yes
 Height        | Yes (No for semi planar 420 tensors conversion)
Interleaved Y,U,V <-> R,G,B tensors are (n)HWC with C = 3 for YUV/RGB components NVCV_COLOR_YUV2BGR NVCV_COLOR_YUV2RGB NVCV_COLOR_BGR2YUV NVCV_COLOR_RGB2YUV

Semi planar Y,U,V <-> R,G,B tensors are (n)HWC with C = 3 for RGB and C = 1. For YUV NV12/21 tensors H = (pixel height) * 3/2, w = (pixel width) and bottom 1/3 of the tensor contains interlaced VU data. NVCV_COLOR_YUV2RGB_NV12 NVCV_COLOR_YUV2BGR_NV12 NVCV_COLOR_YUV2RGB_NV21 NVCV_COLOR_YUV2BGR_NV21 NVCV_COLOR_RGB2YUV_NV12 NVCV_COLOR_BGR2YUV_NV12 NVCV_COLOR_RGB2YUV_NV21 NVCV_COLOR_BGR2YUV_NV21

Parameters:
  • handle[in] Handle to the operator.

    • Must not be NULL.

  • stream[in] Handle to a valid CUDA stream.

  • in[in] input tensor.

  • out[out] output tensor.

  • code[in] color conversion code see NVCVColorConversionCode group. The following conversion codes are available for this operator:

  • spec[in] color conversion spec see NVCVColorSpec group. The following spec codes are available for this operator: NVCV_COLOR_SPEC_BT601 // Color specification for SDTV (Standard Definition TV) - BT.601 NVCV_COLOR_SPEC_BT709 // Color specification for HDTV (High Definition TV) - BT.709 NVCV_COLOR_SPEC_BT2020 // Color specification for UHDTV (Ultra High Definition TV) - BT.2020

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some parameter is outside valid range.

  • NVCV_ERROR_INTERNAL – Internal error in the operator, invalid types passed in.

  • NVCV_SUCCESS – Operation executed successfully.