update lib JPEGDEC to v1.8.4 (#24120)

This commit is contained in:
Jason2866 2025-11-15 15:32:38 +01:00 committed by GitHub
parent c126fb3181
commit 01dfb76d36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 82 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "JPEGDEC",
"version": "1.8.3",
"version": "1.8.4",
"description": "A fast JPEG library with a unique set of functions to make viewing image on microcontrollers easy. Includes fast downscaling options and the ability to view Exif embedded thumbnails. Supports baseline grayscale and color images with Huffman encoding.",
"repository":
{

View File

@ -1,5 +1,5 @@
name=JPEGDEC
version=1.8.3
version=1.8.4
author=Larry Bank
maintainer=Larry Bank
sentence=Optimized JPEG decoder for MCUs with 32K+ RAM.

View File

@ -0,0 +1,13 @@
CFLAGS=-ggdb -D__LINUX__ -Wall -O2 -I../../
LIBS=-g -lJPEGDEC
all: jpeg_perf_test
jpeg_perf_test: main.o
$(CXX) main.o $(LIBS) -o jpeg_perf_test
main.o: main.cpp
$(CXX) $(CFLAGS) -c main.cpp
clean:
rm -rf *.o jpeg_perf_test

View File

@ -0,0 +1,62 @@
//
// Perf Test
//
#include <JPEGDEC.h>
#include <time.h>
#include "../../../test_images/tulips.h" // 640x480 56k byte test image
JPEGDEC jpeg;
long micros(void)
{
int iTime;
struct timespec res;
clock_gettime(CLOCK_MONOTONIC, &res);
iTime = 1000000*res.tv_sec + res.tv_nsec/1000;
return (long)iTime;
} /* micros() */
int JPEGDraw(JPEGDRAW *pDraw)
{
// do nothing
return 1; // continue decode
} /* JPEGDraw() */
int main(int argc, char *argv[]) {
long lTime;
if (jpeg.openFLASH((uint8_t *)tulips, sizeof(tulips), JPEGDraw)) {
lTime = micros();
if (jpeg.decode(0,0,0)) { // full sized decode
lTime = micros() - lTime;
printf("full sized decode in %d us\n", (int)lTime);
}
jpeg.close();
}
if (jpeg.openFLASH((uint8_t *)tulips, sizeof(tulips), JPEGDraw)) {
lTime = micros();
if (jpeg.decode(0,0,JPEG_SCALE_HALF)) { // 1/2 sized decode
lTime = micros() - lTime;
printf("half sized decode in %d us\n", (int)lTime);
}
jpeg.close();
}
if (jpeg.openFLASH((uint8_t *)tulips, sizeof(tulips), JPEGDraw)) {
lTime = micros();
if (jpeg.decode(0,0,JPEG_SCALE_QUARTER)) { // 1/4 sized decode
lTime = micros() - lTime;
printf("quarter sized decode in %d us\n", (int)lTime);
}
jpeg.close();
}
if (jpeg.openFLASH((uint8_t *)tulips, sizeof(tulips), JPEGDraw)) {
lTime = micros();
if (jpeg.decode(0,0,JPEG_SCALE_EIGHTH)) { // 1/8 sized decode
lTime = micros() - lTime;
printf("eighth sized decode in %d us\n", (int)lTime);
}
jpeg.close();
}
return 0;
} /* main() */

View File

@ -3766,6 +3766,7 @@ static void JPEGPutMCU22(JPEGIMAGE *pJPEG, int x, int iPitch)
#endif // ESP32S3_SIMD
#ifdef HAS_NEON
if (x+8 <= iPitch && (iPitch & 15) == 0) { // only for non-clipped MCUs
if (pJPEG->ucPixelType == RGB8888) {
int8x8_t i88Cr, i88Cb;
uint8x16_t u816YL, u816YR;
@ -3998,6 +3999,7 @@ static void JPEGPutMCU22(JPEGIMAGE *pJPEG, int x, int iPitch)
} // for each row
return;
} // 16bpp
} // not clipped
#endif // HAS_NEON
#ifdef HAS_SSE
@ -5124,7 +5126,9 @@ static int DecodeJPEG(JPEGIMAGE *pJPEG)
}
for (x = 0; x < cx && bContinue && iErr == 0; x++)
{
pJPEG->usPixels = &pAlignedPixels[iDMAOffset]; // make sure output is correct offset for DMA
if (pJPEG->pFramebuffer == NULL) {
pJPEG->usPixels = &pAlignedPixels[iDMAOffset]; // make sure output is correct offset for DMA
}
iSkipMask = 0; // assume not skipping
if (bSkipRow || x*mcuCX < pJPEG->iCropX || x*mcuCX > pJPEG->iCropX+pJPEG->iCropCX) {