hbVPJPEGDecode

int32_t hbVPCreateJPEGDecContext(hbVPJPEGContext *context, uint32_t outBufCount, uint8_t imageFormat);

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

  • Parameter
    • [out] context The encoder context pointer.
    • [in] outBufCount The count of JPU internal output buffers. The range of values is [1, 31], default value 5.
    • [in] imageFormat Output picture format.
  • Return Value
    • Return 0 means the API was successfully executed, otherwise the execution failed.
  • Description of interface limitations
    • imageFormat supports HB_VP_IMAGE_FORMAT_NV12, HB_VP_IMAGE_FORMAT_YUV420, HB_VP_IMAGE_FORMAT_YUV444 and HB_VP_IMAGE_FORMAT_YUV444_P format.
    • Due to hardware limitations, the decoder does the decoding process internally in 16x16 units, so the decoded resolution changes to the 16x16 aligned resolution.
    • JPU supports the creation of contexts for the highest 64-way encoding or decoding.
    • JPU only support 8bit data decoding.
int32_t hbVPReleaseJPEGDecContext(hbVPJPEGContext context);

Release the encoder context API.

  • Parameter
    • [in] context The encoder context pointer.
  • 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.
    • [out] dstImg Pointer the memory address where the decoded picture is stored.
    • [in] srcBuf Pointer the memory address where JPEG data is stored.
    • [in] context The decoder context pointer.
  • 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.
    • Only asynchronous task creation is supported.
int32_t hbVPGetJPEGDecOutputBuffer(hbUCPTaskHandle_t taskHandle, hbVPImage *dstImg);

The API for calling the JPEG decoding output buffer.

  • Parameter
    • [in] taskHandle Task handles are responsible for the interaction of the operator with the UCP architecture.
    • [out] dstImg Pointer the memory address where the decoded picture is stored.
  • Return Value
    • Return 0 means the API was successfully executed, otherwise the execution failed.
  • Description of interface limitations
    • The Image buffer dstImg 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.