DRIVE 5.0 Linux Open Source Software

Development Guide Release

Image JPEG Decode (nvmimg_jpgdec)
Example Commands
Command Options
The NvMedia Image JPEG Decode application (nvmimg_jpgdec) demonstrates how to decode a set of JPEG bitstreams into image surfaces using NvMedia JPEG decode APIs. It operates by parsing command line with required parameter sets for JPEG decoder including:
input bitstream file name
output file name
output resolution
output format, etc.
It then reads the input bitstream file into the local buffer frame by frame, and sends the information to NvMedia JPEG decoder. The resulting image surfaces are saved into the output YUV file. This chapter describes the platform set up and usage of the application.
The application also supports CRC generation and CRC checking modes. CRC generation is mainly for developers to provide the original CRC. It can be a different CRC for different Tegra chip versions. CRC checking mode is for QA to verify the application for new releases.
The following diagram describes the basic function flow.
Example Commands
The following command decodes 100 JPEG files into 720 x 480 images in RGB format:
./nvmimg_jpgdec -f input%d.jpg -of outputfile -fr 720x480 -fn 100
The following command decodes 100 JPEG files with CRC generation:
./nvmimg_jpgdec -f input%d.jpg -of outputfile -fr 720x480 -fn 100 -crcgen crc.txt
The following command decodes 100 JPEG files with CRC checking:
./nvmimg_jpgdec -f input%d.jpg -of outputfile -fr 720x480 -fn 100 -crcchk crc.txt
Command Options
To run the Image Decode sample application, run the following command:
./nvmimg_jpgdec [options]
The command line options for the Image Decode application are as follows:
Default Settings
Prints the help menu.
Specifies the input bitstream file name. If given as inputd.jpg, the application tries to decode a set of input JPG files as input1.jpginput2.jpg, etc. Otherwise, the one JPEG bitstream is decoded.
Specifies the output file resolution in width x height format.
Specifies the YUV file.
Specifies the decode frame number.
Specifies the output format:
0: yuv420
1: rgba
2: yuv422
3: yuv444
Specifies the decode output downscale factor [0..3].
0; no downscale
Sets the CRC generation mode; CRC is saved to the specified file.
Sets the CRC check mode. The result is checked against the specified CRC file.
Logging level =
0 (Errors)
1 (Warnings)
2 (Information)
3 (Debug)
If no level is provided, defaults to 3. If option is not provided, defaults to 0.