diff --git a/src/lgfx/utility/lgfx_tjpgd.c b/src/lgfx/utility/lgfx_tjpgd.c index 0b07d1d9..15bd33c9 100644 --- a/src/lgfx/utility/lgfx_tjpgd.c +++ b/src/lgfx/utility/lgfx_tjpgd.c @@ -130,7 +130,7 @@ static inline int32_t BYTECLIP ( /*---------------------------------------------*/ #if JD_BAYER -static const int_fast8_t Bayer[16] = { 0, 4, 1, 5,-2, 2,-1, 3, 1, 5, 0, 4,-1, 3,-2, 2}; +static const int8_t Bayer[16] = { 0, 4, 1, 5,-2, 2,-1, 3, 1, 5, 0, 4,-1, 3,-2, 2}; #endif @@ -299,7 +299,7 @@ static int32_t huffext ( /* >=0: decoded data, <0: error code */ { const uint8_t* hb_end = hb + 16 + 1; uint_fast8_t msk = jd->dbit; - uint_fast16_t w = *jd->dptr & ((1ul << msk) - 1); + uint32_t w = *jd->dptr & ((1ul << msk) - 1); for (;;) { if (!msk) { /* Next byte? */ uint8_t *dp = jd->dptr; @@ -584,7 +584,7 @@ static JRESULT mcu_output ( iy = 0; do { #if JD_BAYER - const int_fast8_t* btbl = &Bayer[(iy & 3) << 2]; + const int8_t* btbl = &Bayer[(iy & 3) << 2]; #endif py = &jd->mcubuf[((iy & 8) + iy) << 3]; pc = &jd->mcubuf[((mx << iyshift) + (iy >> iyshift)) << 3]; @@ -596,10 +596,10 @@ static JRESULT mcu_output ( ++pc; /* Convert CbCr to RGB */ - uint_fast16_t rr = ((int32_t)(1.402 * (1<> FP_SHIFT; - uint_fast16_t gg = ((int32_t)(0.34414 * (1<> FP_SHIFT; + int32_t gg = ((int32_t)(0.34414 * (1<> FP_SHIFT; - uint_fast16_t bb = ((int32_t)(1.772 * (1<> FP_SHIFT; + int32_t bb = ((int32_t)(1.772 * (1<> FP_SHIFT; do { #if JD_BAYER yy = *py + btbl[ix & 3]; /* Get Y component */ diff --git a/src/lgfx/utility/lgfx_tjpgd.h b/src/lgfx/utility/lgfx_tjpgd.h index e8ecb23e..e4523b38 100644 --- a/src/lgfx/utility/lgfx_tjpgd.h +++ b/src/lgfx/utility/lgfx_tjpgd.h @@ -63,13 +63,13 @@ struct lgfxJdec { uint8_t* dptr; /* Current data read ptr */ uint8_t* dpend; /* data end ptr */ uint8_t* inbuf; /* Bit stream input buffer */ - uint_fast8_t dbit; /* Current bit in the current read byte */ - uint_fast8_t scale; /* Output scaling ratio */ - uint_fast8_t msx, msy; /* MCU size in unit of block (width, height) */ - uint_fast8_t qtid[3]; /* Quantization table ID of each component */ + uint8_t dbit; /* Current bit in the current read byte */ + uint8_t scale; /* Output scaling ratio */ + uint8_t msx, msy; /* MCU size in unit of block (width, height) */ + uint8_t qtid[3]; /* Quantization table ID of each component */ int32_t dcv[3]; /* Previous DC element of each component */ uint16_t nrst; /* Restart inverval */ - uint_fast16_t width, height;/* Size of the input image (pixel) */ + uint16_t width, height;/* Size of the input image (pixel) */ uint8_t* huffbits[2][2]; /* Huffman bit distribution tables [id][dcac] */ uint16_t* huffcode[2][2]; /* Huffman code word tables [id][dcac] */ uint8_t* huffdata[2][2]; /* Huffman decoded data tables [id][dcac] */ @@ -77,7 +77,7 @@ struct lgfxJdec { void* workbuf; /* Working buffer for IDCT and RGB output */ int16_t* mcubuf; /* Working buffer for the MCU */ uint8_t* pool; /* Pointer to available memory pool */ - uint_fast16_t sz_pool; /* Size of momory pool (bytes available) */ + uint16_t sz_pool; /* Size of momory pool (bytes available) */ uint32_t (*infunc)(void*, uint8_t*, uint32_t);/* Pointer to jpeg stream input function */ void* device; /* Pointer to I/O device identifiler for the session */ uint8_t comps_in_frame; /* 1=Y(grayscale) 3=YCrCb */