DvppJpegEncode

Function Usage

Encodes JPEG formats. Before calling this API, call Init() or Init(MxbaseDvppChannelMode dvppChannelMode) to initialize this function.

Prototype

APP_ERROR DvppJpegEncode (  
    DvppDataInfo& inputDataInfo ,  
    DvppDataInfo& outputDataInfo ,  
    uint32_t encodeLevel  
); 
 
APP_ERROR DvppJpegEncode (  
    DvppDataInfo& inputDataInfo ,  
    std::string outputPicPath ,  
    std::string outputPicName ,  
    uint32_t encodeLevel
);

Parameter Description

Parameter

Input/Output

Description

inputDataInfo

Input

Input data to be encoded

outputDataInfo

Output

Output data after encoding

outputPicPath

Input

Generated image path

outputPicName

Input

Generated image name

The .jpg extension is automatically generated for the finally generated image. If a .jpg file with the same name already exists in the target path, the generated image will overwrite the original one.

encodeLevel

Input

Encoding quality level. Must be in the range of [0, 100]. The quality of level 0 is similar to that of level 100. A smaller value in the range of [1, 100] indicates poorer output image quality.

Return Parameter Description

Data Structure

Description

APP_ERROR

Error code returned during program execution. For details, see the MxBase/ErrorCode/ErrorCode.h file.