Function: dvpp_vpc_convert_color_async

C Prototype

aclError acldvppVpcConvertColorAsync(acldvppChannelDesc *channelDesc, acldvppPicDesc *inputDesc, acldvppPicDesc *outputDesc, aclrtStream stream)

Python Function

ret = acl.media.dvpp_vpc_convert_color_async(dvpp_channel_desc, input_dvpp_pic_desc, output_dvpp_pic_desc, stream)

Function Usage

Converts the image format. The width and height of the output image must be the same as those of the input image. This API is asynchronous.

The Atlas 200/300/500 Inference Product does not support this API in the current version.

The Atlas Training Series Product does not support this API in the current version.

Input Description

dvpp_channel_desc: int, pointer address of the channel description. It must be the same as the dvpp_channel_desc argument passed to the acl.media.dvpp_create_channel call.

input_dvpp_pic_desc: int, pointer address of the input image information.
  • Call acl.media.dvpp_create_pic_desc to create an image description.
  • Call the acl.media.dvpp_set_pic_desc APIs to set the image description (including the buffer address, buffer size, image format, and image resolution).

output_dvpp_pic_desc: int, pointer address of the output image information.

When this argument is used as an input, the user needs to:
  • Call acl.media.dvpp_create_pic_desc to create an image description.
  • Call the acl.media.dvpp_set_pic_desc APIs to set the image description (including the buffer address, buffer size, image format, and image resolution).

    You must specify the width, height, width stride, height stride, buffer address, buffer size, and format of the output image.

    • The width and height of the output image must be the same as those of the input image. Otherwise, an error is reported.

      If the width or height of the output image is set to 0, VPC uses the width and height of the input image as the width and height of the output image respectively. In addition, VPC calculates the width stride and height stride based on the alignment requirements, which vary with the image format. For details, see Restrictions on Image Formats, Width and Height Alignment, and Buffers.

    • The width stride and height stride of the output image must meet the alignment requirements, which vary with the image format. For details, see Restrictions on Image Formats, Width and Height Alignment, and Buffers.

stream: int, stream object.

Return Value

ret: int, error code.

  • 0 indicates the success of task delivery.
  • Other values indicate the failure of task delivery.

Restrictions