bitbank2 / JPEGDEC

An optimized JPEG decoder for Arduino
Apache License 2.0
366 stars 47 forks source link

Make buffer size etc configurable via class methods #17

Closed JonRobo closed 3 years ago

JonRobo commented 3 years ago

Hello I found an improvement that could be made when using more capable controllers like the ESP32 in this issue here https://github.com/moononournation/Arduino_GFX/issues/20

By bringing the maximum buffer size and jpg file buffer size up to 4096 it cut the total time I had to display a 38KB jpg from an SD card to 0.137 seconds. Perhaps there are more optimizations to be made as well to get even faster results with the ESP32 etc.

So the thought is to allow the application code to increase the buffer sizes as needed.

bitbank2 commented 3 years ago

I see the value in doing that, but one of the things I wanted to keep out of the code is dynamic memory allocation. It's probably best to just tweak the constants in the H file for your needs.

JonRobo commented 3 years ago

Fair enough, and would you recommend to change anything else to enhance performance? For those who want to tweak some constants

bitbank2 commented 3 years ago

There's not much left to speed up JPEG decode besides SIMD instructions. When Arm Helium devices become available, I'll probably add support for the new capabilities.