Skip to content

feat: replace picojpeg with JPEGDEC for JPEG image decoding#1136

Merged
daveallie merged 4 commits into
crosspoint-reader:masterfrom
martinbrook:mbrook-jpegdec
Mar 1, 2026
Merged

feat: replace picojpeg with JPEGDEC for JPEG image decoding#1136
daveallie merged 4 commits into
crosspoint-reader:masterfrom
martinbrook:mbrook-jpegdec

Conversation

@martinbrook
Copy link
Copy Markdown
Contributor

@martinbrook martinbrook commented Feb 23, 2026

Summary

Replaces the picojpeg library with bitbank2/JPEGDEC for JPEG decoding in the EPUB image pipeline. JPEGDEC provides built-in coarse scaling (1/2, 1/4, 1/8), 8-bit grayscale output, and streaming block-based decoding via callbacks.

Includes a pre-build patch script for two JPEGDEC changes affecting progressive JPEG support and EIGHT_BIT_GRAYSCALE mode.

Closes #912

Additional Context

Example progressive jpeg

Good performance increase from JPEGDEC over picojpeg cc @bitbank2 thanks

Baseline JPEG Decode Performance: picojpeg vs JPEGDEC (float in callback) vs JPEGDEC (fixed-point in callback)

Tested with test_jpeg_images.epub on device (ESP32-C3), first decode (no cache).

Image Source Output picojpeg JPEGDEC float JPEGDEC fixed-point vs picojpeg vs float
jpeg_format.jpg 350x250 350x250 313 ms 256 ms 104 ms 3.0x 2.5x
grayscale_test.jpg 400x600 400x600 768 ms 661 ms 246 ms 3.1x 2.7x
gradient_test.jpg 400x500 400x500 707 ms 597 ms 247 ms 2.9x 2.4x
centering_test.jpg 350x400 350x400 502 ms 412 ms 169 ms 3.0x 2.4x
scaling_test.jpg 1200x1500 464x580 5487 ms 1114 ms 668 ms 8.2x 1.7x
wide_scaling_test.jpg 1807x736 464x188 4237 ms 642 ms 497 ms 8.5x 1.3x
cache_test_1.jpg 400x300 400x300 422 ms 348 ms 141 ms 3.0x 2.5x
cache_test_2.jpg 400x300 400x300 424 ms 349 ms 142 ms 3.0x 2.5x

Summary


AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? < PARTIALLY >

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace use of picojpeg with jpegdec

8 participants