iMX8QXP: Use JPEG decoder in M4 SDK

Document created by Qiang Li - Mpu Se Employee on Jul 31, 2019Last modified by Qiang Li - Mpu Se Employee on Sep 23, 2019
Version 4Show Document
  • View in full screen mode

iMX8QXP/iMX8QM have hardware JPEG decoder: The JPEG-D-X core. This is the example code to use this hw decoder in M4 SDK to decode JPEG files.

 

 

M4_JPEG_DECODER_SDK_2.5.1.7z

The attached "rear_view_camera_jpegdec.tar.bz2" is the updated source code for "SDK\boards\mekmimx8qx\demo_apps\rear_view_camera". It is based on SDK 2.5.1 for iMX8QXP MEK.

The "rear_view_camera_jpegdec.patch" is the modified code, it hasn't included the added "fsl_jpeg_dec.c" and "fsl_jpeg_dec.h".

 

The testing used two 256*256 JPEG files, they are RGB color space. We used followed commands to build them into flash.bin:

./mkimage_imx8 -soc QX -rev B0 -append ahab-container.img -c -scfw scfw_tcm.bin -m4 m4_rear_view_camera.bin 0 0x34FE0000 --data demo_rgb.jpg 0x84000000 --data demo_rgb2.jpg 0x84008000 -out flash.bin

 

If customer need change the JPEG resoluion, they can change them in file "fsl_jpeg_dec.h", APP_JPEG_SIZE_OF_KB is the JPEG file length in memory, aligned in KB.
 

#define APP_JPEG_WIDTH (256)
#define APP_JPEG_HEIGHT (256)
#define APP_JPEG_SIZE_OF_KB (32)
#define APP_JPEG_FORMAT JPEG_RGB

#define APP_JPEG_BUFFER (0x84000000)

 

To created RGB format JPEG file from RGB data, the customer can use linux unit test application "/unit_tests/JPEG/encoder_test.out".

 

M4_JPEG_DECODER_WINDOW_MODE_SDK_2.5.1.7z

Based on JEPG decoder, added DPU CSC support and render JEPG decoded video in overlay window.

4 people found this helpful

Outcomes