The JPEG decode sample demonstrates JPEG decode. If the decoder output is fd, video conversion is applied onto the output fd buffer.
Supported YUV formats are:
$ cd /usr/src/jetson_multimedia_api/samples/06_jpeg_decode $ make
$ ./jpeg_decode num_files <number of files to decode> \ <in-file1> <out-file1> ...<in-filen> <out-filen> [OPTIONS]
$ ./jpeg_decode num_files 1 ../../data/Picture/nvidia-logo.jpg ../../data/Picture/nvidia-logo.yuv
The following diagram shows the flow of data through the sample.
When calling decodeToFd, the data format matches Tegra hardware so that no format conversion is required. Calling decodeToBuffer requires converting the buffer to software format after hardware-accelerated JPEG decoding. The JPEG file format contains the standard software format.
This sample uses the following key structures and classes:
Element | Description |
---|---|
NvJpegDecoder | Contains elements and functions for decoding JPEG images. |
The NvJpegDecoder class contains all of the functions for JPEG image decoding. Key members used are:
Function | Description |
---|---|
decodeToFd | Decode to hardware buffer (at a file descriptor) where the data is available to other components. |
decodeToBuffer | Decode to a software buffer. |