hbVPJPEGDecode

typedef struct {
  uint8_t imageFormat;
  uint32_t outBufCount;
  uint64_t backend;
} hbVPJPEGDecParam;

Parameter for JPEG decoding.

  • Member

    Member NameDescription
    imageFormatOutput image format. Currently supports HB_VP_IMAGE_FORMAT_NV12, HB_VP_IMAGE_FORMAT_YUV420, HB_VP_IMAGE_FORMAT_YUV444 and HB_VP_IMAGE_FORMAT_YUV444_P format.
    outBufCountThe count of JPU internal output buffers. The range of values is [1, 31], recommended value 5.
    backendSpecifies the execution backend for JPEG decoding tasks. Only supports configuration to a single specific core backend, and does not support multiple backends or ANY-type backends.
int32_t hbVPCreateJPEGDecContext(hbVPJPEGContext *context, hbVPJPEGDecParam const *param);

Creates the decoder context API and initialize context to nullptr in advance before creation.

  • Parameter
    • [out] context The decoder context.
    • [in] param Pointer to the decoding parameter.
  • Return Value
    • Return 0 means the API was successfully executed, otherwise the execution failed.
  • Description of interface limitations
    • Due to hardware limitations, encoding requires alignment, and the decoded data will also follow the alignment requirements used during encoding. Specifically, the alignment method used during encoding (16x16 or 8x8) directly determines the decoded resolution, aligning it to multiples of 16x16 or 8x8.
    • JPU supports the creation of contexts for the highest 64-way encoding or decoding for one core.
    • JPU only support 8bit data decoding.
int32_t hbVPReleaseJPEGDecContext(hbVPJPEGContext context);

Release the decoder context API.

  • Parameter
    • [in] context The decoder context.
  • Return Value
    • Return 0 means the API was successfully executed, otherwise the execution failed.
int32_t hbVPJPEGDecode(hbUCPTaskHandle_t *taskHandle,
                       hbVPArray const *srcBuf,
                       hbVPJPEGContext context);

The API for calling the JPEG decoding.

  • Parameter
    • [out] taskHandle Task handles are responsible for the interaction of the operator with the UCP architecture.
    • [in] srcBuf Input JPEG file.
    • [in] context The decoder context.
  • Return Value
    • Return 0 means the API was successfully executed, otherwise the execution failed.
  • Description of interface limitations
    • When JPEG decoding, if the decoding format is HB_VP_IMAGE_FORMAT_YUV444, the input JPEG data is required to be in the format of HB_VP_IMAGE_FORMAT_YUV444 or HB_VP_IMAGE_FORMAT_YUV444_P.
    • When decoding JPEG images, the supported resolution range is 32x32 to 8192x8192 pixels, and the input image size must fall within the range of [1024, 10 * 1024 * 1024] bytes.
    • Only asynchronous task creation is supported.
    • To avoid wasting system resources and improve JPU decoding performance, it is recommended to reuse input addresses.
int32_t hbVPGetJPEGDecOutputBuffer(hbVPImage *outImg, 
                                   hbUCPTaskHandle_t taskHandle);

The API for calling the JPEG decoding output buffer.

  • Parameter
    • [out] outImg Output YUV Image.
    • [in] taskHandle Task handles are responsible for the interaction of the operator with the UCP architecture.
  • Return Value
    • Return 0 means the API was successfully executed, otherwise the execution failed.
  • Description of interface limitations
    • The Image buffer outImg is allocated internally by the JPU.
    • The buffer contains valid data upon the task is successfully completed, and is released during the task release phase.