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.
The architecture is followed: NXP logo is put in FetchLayer0 with RGB565 format, after LayerBlend0, it will be the prim layer for LayberBlend1 (FetchLayer0 can't be used as prim layer for LayerBlend), the JPEG decoder output is put to FetchDecoder0. RGB888 format, and it will be resize to 640*480, and put to x=100, y=100 of the display. (Only the sec layer of LayerBlend can be window mode).

Some limitation for layer selection in LayerBlend:
