49 #ifndef LE_IMAGEDECODER_JPEG_COMMON_H 50 #define LE_IMAGEDECODER_JPEG_COMMON_H 54 #if LE_ENABLE_JPEG_DECODER == 1 59 #define JPEG_SendError(x) pJpegDecoder->bError = x; return(x); 61 #define JPEG_SAMPLE_1x1 0 62 #define JPEG_SAMPLE_1x2 1 63 #define JPEG_SAMPLE_2x1 2 64 #define JPEG_SAMPLE_2x2 3 66 #define MAX_CHANNELS 3 68 #define MAX_HUFF_TABLES 2 69 #define MAX_DATA_BUF_LEN 512 71 #define EXIF_2_2_ORIENTATION_OFFSET 0x2E 76 IMAGE_FILE_NOT_AVAILABLE
104 typedef struct _JPEGDECODER JPEGDECODER;
106 typedef uint32_t (*JPEG_Read_FnPtr)(
void*, uint32_t, uint32_t, JPEGDECODER*);
108 typedef void (*JPEG_Blit_FnPtr)(JPEGDECODER* state,
121 typedef struct _JPEGDECODER
125 JPEG_Read_FnPtr readPtr;
126 JPEG_Blit_FnPtr blitPtr;
129 uint32_t globalAlpha;
132 #if LE_STREAMING_ENABLED == 1 145 uint8_t bOrientation;
152 uint8_t abChannelType[MAX_CHANNELS];
153 uint8_t abChannelHSampFactor[MAX_CHANNELS];
154 uint8_t abChannelVSampFactor[MAX_CHANNELS];
155 uint8_t abChannelQuantTableMap[MAX_CHANNELS];
158 uint8_t blQuantUses16bits;
159 uint16_t awQuantTable[MAX_CHANNELS][64];
162 uint16_t wRestartInterval;
166 uint8_t abHuffAcSymLen[MAX_HUFF_TABLES][16];
167 uint8_t abHuffAcSymbol[MAX_HUFF_TABLES][256];
168 uint8_t abHuffDcSymLen[MAX_HUFF_TABLES][16];
169 uint8_t abHuffDcSymbol[MAX_HUFF_TABLES][16];
171 uint16_t awHuffAcSymStart[MAX_HUFF_TABLES][16];
172 uint16_t awHuffDcSymStart[MAX_HUFF_TABLES][16];
175 uint8_t abChannelHuffAcTableMap[MAX_CHANNELS];
176 uint8_t abChannelHuffDcTableMap[MAX_CHANNELS];
182 uint8_t bBitsAvailable;
183 uint8_t bBlocksInOnePass;
184 short asOneBlock[MAX_BLOCKS][64];
185 uint16_t wBlockNumber;
186 uint8_t abChannelMap[MAX_BLOCKS];
187 uint8_t bSubSampleType;
188 short asPrevDcValue[MAX_CHANNELS];
189 uint8_t *pbCurrentHuffSymLenTable;
190 uint8_t *pbCurrentHuffSymbolTable;
191 uint16_t *pwCurrentHuffSymStartTable;
192 uint16_t *pwCurrentQuantTable;
193 uint8_t abDataBuffer[MAX_DATA_BUF_LEN];
195 uint16_t wBufferIndex;
224 void JPEG_vResetDecoder(JPEGDECODER *decoder);
238 uint8_t JPEG_bReadHeader(JPEGDECODER *pJpegDecoder);
252 uint8_t JPEG_bGenerateHuffmanTables(JPEGDECODER *pJpegDecoder);
265 void JPEG_vInitDisplay(JPEGDECODER *pJpegDecoder);
279 uint8_t JPEG_bDecodeOneBlock(JPEGDECODER *pJpegDecoder);
293 uint8_t JPEG_bPaintOneBlock(JPEGDECODER *pJpegDecoder);
300 static const uint8_t abZigzag[64] =
302 0, 1, 8, 16, 9, 2, 3, 10,
303 17, 24, 32, 25, 18, 11, 4, 5,
304 12, 19, 26, 33, 40, 48, 41, 34,
305 27, 20, 13, 6, 7, 14, 21, 28,
306 35, 42, 49, 56, 57, 50, 43, 36,
307 29, 22, 15, 23, 30, 37, 44, 51,
308 58, 59, 52, 45, 38, 31, 39, 46,
309 53, 60, 61, 54, 47, 55, 62, 63
314 #endif // LE_IMAGEDECODER_JPEG_COMMON_H Common macros and definitions used by Legato.
Image functions and defintions.
Definition: legato_image.h:181
This struct represents a rectangle.
Definition: legato_common.h:394
Definition: legato_pixelbuffer.h:90
Defines a common header for all stream operations.