hbVPJPEGEncode
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
Create the encoder context API and initialize context to nullptr in advance before creation.
- Parameter
- [out]
contextThe encoder context. - [in]
paramPointer to the encoding parameter.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
- Description of interface limitations
- When
imageFormatisHB_VP_IMAGE_FORMAT_NV12orHB_VP_IMAGE_FORMAT_YUV420, the width must be aligned to 16 and the height must be aligned to 8, with the encoder processing data in 16x16 units. - When
imageFormatisHB_VP_IMAGE_FORMAT_YUV444orHB_VP_IMAGE_FORMAT_YUV444_P, both the width and height must be aligned to 8, with the encoder processing data in 8x8 units. - Due to hardware limitations, for unaligned data, the encoder will add random padding to the final part of the data. These padding bytes will not affect the valid content or the encoded resolution but may cause differences in md5 checksum results, which should be noted.
- JPU supports the creation of contexts for the highest 64-way encoding or decoding for one core.
- JPU only support 8bit data encoding.
- When
Release the encoder context API.
- Parameter
- [in]
contextThe encoder context.
- [in]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
The API for calling the JPEG encoding.
- Parameter
- [out]
taskHandleTask handles are responsible for the interaction of the operator with the UCP architecture. - [in]
srcImgInput YUV Image. - [in]
contextThe encoder context.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
- Description of interface limitations
- Only asynchronous task creation is supported.
- To avoid wasting system resources and improve JPU encoding performance, it is recommended to reuse input addresses.
The API for calling the JPEG encoding output buffer.
- Parameter
- [out]
outBufOutput JPEG file. - [in]
taskHandleTask handles are responsible for the interaction of the operator with the UCP architecture.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
- Description of interface limitations
- The JPEG buffer
outBufis allocated internally by the JPU. - The buffer contains valid data upon the task is successfully completed, and is released during the task release phase.
- The JPEG buffer
