Skip to content

Commit 5978c4e

Browse files
committed
add patch1 to tjpgd
1 parent 6ee98f9 commit 5978c4e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/tjpgd/src/tjpgd.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*----------------------------------------------------------------------------/
2-
/ TJpgDec - Tiny JPEG Decompressor R0.03 (C)ChaN, 2021
2+
/ TJpgDec - Tiny JPEG Decompressor R0.03 w/patch1 (C)ChaN, 2021
33
/-----------------------------------------------------------------------------/
44
/ The TJpgDec is a generic JPEG decompressor module for tiny embedded systems.
55
/ This is a free software that opened for education, research and commercial
@@ -850,7 +850,11 @@ static JRESULT mcu_output (
850850
if (mx == 16) { /* Double block width? */
851851
if (ix == 8) py += 64 - 8; /* Jump to next block if double block height */
852852
}
853-
*pix++ = (uint8_t)*py++; /* Get and store a Y value as grayscale */
853+
if (JD_FASTDECODE >= 1) {
854+
*pix++ = BYTECLIP(*py++); /* Get and store a Y value as grayscale */
855+
} else {
856+
*pix++ = *py++; /* Get and store a Y value as grayscale */
857+
}
854858
}
855859
}
856860
}

0 commit comments

Comments
 (0)