Go to the Ascend samples repository on Gitee or GitHub and download the sample package that matches the required version. For the version mapping, see "Release Notes" in the README file. Find the sample in the cplusplus/level1_single_api/7_dvpp/jpegd_sample directory.
This sample implements .jpg, .jpeg, .JPG, and .JPEG image decoding.
The following table lists the key functions involved in this sample. For details about the APIs, see AscendCL API Reference.
Initialization |
|
|---|---|
Device Management |
|
Context Management |
|
Memory Management |
|
Data Transfer |
aclrtMemcpy:
Data transfer is not required if your app runs in the board environment. |
Media Data Processing V2 |
See the APIs provided in VDEC/JPEGD. |
The sample directory is organized as follows:
├── common //Directory of the sample code files
│ ├── sample_comm.h //Header file that declares functions related to decoding
│ ├── sample_comm_jpegd.cpp //Implementation file of functions related to decoding
├── smoke_vpc //Directory of the sample code files
│ ├── sample_jpegd.cpp //Implementation file of the main function
├── CMakeLists.txt //Build script