Closed modi12jin closed 10 months ago
I'll take a look.
It's very fast - but unfortunately it doesn't seem to work with all image sizes.
It works ok with the 320x240 image and a 160x120 image. But doesn't seem to work with some other size. Any idea what could be going on?
It looks like the width has to be a multiple of 16 for some reason.
Some pretty interesting results.
Library | Decode+Draw Time | Decode Time |
---|---|---|
Bodmer/JPEGDecoder | 117ms | 109ms |
bitbank2/JPEGDEC | 38ms | 32ms |
ESP32_JPEG | 33ms | 17ms |
What can we conclude....
The ESP32 based decoding is really fast. But, the limiting factor is the DMA transfer to draw the image. Which is why we get a similar time for decode+draw to the JPEGDEC library.
The JPEGDEC library interleaves decoding and drawing, so while it's drawing one section of the image using DMA it's decoding the next section.
The ESP32_JPEG would use about half the CPU time so it's still quite interesting.
My only problem is the need to have the width of the image a multiple of 16 which doesn't seem to match what the header says is possible.
@cgreening You are right, 16-byte alignment is indeed required. Only the whole frame, not parts.
Partial decoding will be available in the near future. This is the information I got from the official
If you want to use it in IDF, you can refer to this link https://github.com/espressif/esp-dev-kits/tree/master/esp32-s3-lcd-ev-board%2Fexamples%2Fusb_camera_lcd%2Fcomponents%2Fesp_jpeg
Chen Liang test video https://x.com/moononournation/status/1705953255979888696?s=20
https://github.com/moononournation/ESP32-S3-BOX-3/tree/main/ImgViewerMjpeg_SIMD
The perfect combination of SIMD full screen decoding + RGB screen
Questions I asked before JPEGDEC https://github.com/bitbank2/JPEGDEC/issues/56
As an aside, SIMD can be used to speed up some LVGL drawing processes. https://github.com/espressif/esp-bsp/issues/154
@cgreening Thanks for the explainer video! I got the news that ESP32_JPEG will add relevant usage instructions, such as 16-byte alignment issues
@cgreening The JPEGDEC author has an update on this issue https://bitbanksoftware.blogspot.com/2024/01/surprise-esp32-s3-has-few-simd.html?m=1
@cgreening This is jpeg SIMD decoding, which is now partially supported. Sir, you can try it and see how it works
@cgreening JPEG decoding with SIMD, currently the whole frame, cannot be partial, there will be more in the future
https://github.com/esp-arduino-libs/ESP32_JPEG/blob/master/examples/DecodeTest/DecodeTest.ino