hbVPJPEGEncode operator and the context description handle for the hbVPJPEGDecode operator, the handle contains the necessary description information to run on the JPU and can be reused.
Encoding parameter for JPEG coding.
Member
| Member Name | Description |
|---|---|
extendedSequential | Only 8bit encoding is supported, default value 0. |
imageFormat | Input 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. |
width | The width of the input picture. The range of values is [16, 32768]. |
height | The height of the input picture. The range of values is [16, 32768]. |
qualityFactor | The encoding quality takes values in the range [0, 100], default value 50, the smaller the value the worse the picture quality. |
outBufCount | The count of JPU internal output buffers. The range of values is [1, 65536], default value 5. |
Create the encoder context API and initialize context to nullptr in advance before creation.
context The encoder context pointer.param Pointer to the encoding parameter.0 means the API was successfully executed, otherwise the execution failed.imageFormat is in HB_VP_IMAGE_FORMAT_NV12 or HB_VP_IMAGE_FORMAT_YUV420 format, it is required that width satisfies 16 alignment and height satisfies 8 alignment.imageFormat is in HB_VP_IMAGE_FORMAT_YUV444 or HB_VP_IMAGE_FORMAT_YUV444_P format, it is required that width satisfies 8 alignment and height satisfies 8 alignment.16x16 units. When the data to be encoded is not 16x16 aligned, there will be a difference in the last part of the encoded data that is randomly filled, but it will not affect the valid data, and the encoded data resolution will not be changed.
So you need to pay attention to this point when doing md5 comparison.Release the encoder context API.
context The encoder context pointer.0 means the API was successfully executed, otherwise the execution failed.The API for calling the JPEG encoding.
taskHandle Task handles are responsible for the interaction of the operator with the UCP architecture.srcImg The memory address pointer where the encoded picture is stored.context The encoder context pointer.0 means the API was successfully executed, otherwise the execution failed.The API for calling the JPEG encoding output buffer.
taskHandle Task handles are responsible for the interaction of the operator with the UCP architecture.dstBuf The memory address pointer where the encoded JPEG data is stored.0 means the API was successfully executed, otherwise the execution failed.dstBuf is allocated internally by the JPU.