DRIVE 5.0 Linux Open Source Software

Development Guide Release

Image JPEG Encode (nvmimg_jpgenc)
Example Commands
Command Options
The NvMedia Image JPEG Encode application (nvmimg_jpgenc) demonstrates how to encode image surfaces into JPEG bitstreams using NvMedia JPEG encode APIs. It operates by parsing the command line with required parameter sets for JPEG encoder including:
input file name
output bitstream file name
quality, etc.
It then reads the input file into the image surface and sends the information to NvMedia JPEG encoder. The resulting bitstreams are saved into a set of output files. 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 encodes a set of 720 x 480 JPEG files with quality 75:
./nvmimg_jpgenc -f input.yuv -fr 720x480 -of output%d.jpg -q 75
The following command encodes with CRC generation:
./nvmimg_jpgenc -f input.yuv -fr 720x480 -of output%d.jpg -q 75 -crcgen crc.txt
The following command encodes with CRC checking:
./nvmimg_jpgenc -f input.yuv -fr 720x480 -of output%d.jpg -q 75 -crcchk crc.txt
Command Options
To run the Image Encode sample application, run the following command:
./nvmimg_jpgenc [options]
The command line options for the Image Encode application are as follows:
Default Settings
Prints the help menu.
Specifies the input YUV file name.
Specifies the input file resolution in width x height format.
Specifies the output file. If given as outputd.jpg, it generates a set of output .JPG files as output1,jpgoutput2.jpg, etc. Otherwise, the last JPEG bitstream is saved.
Specifies the encode quality where value is between [1..100].
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.