42#ifndef JPEG_CONSTANTS_H
43#define JPEG_CONSTANTS_H
47const uint8_t _JPEG_MAX_CHANNELS = 3;
48const uint8_t _JPEG_MAX_BLOCKS = 6;
49const uint8_t _JPEG_MAX_HUFF_TABLES = 2;
50const uint8_t _JPEG_MAX_DATA_BUF_LEN = 128;
53const uint8_t _JPEG_SOF0 = 0xC0;
54const uint8_t _JPEG_DHT = 0xC4;
55const uint8_t _JPEG_SOI = 0xD8;
56const uint8_t _JPEG_EOI = 0xD9;
57const uint8_t _JPEG_SOS = 0xDA;
58const uint8_t _JPEG_DQT = 0xDB;
59const uint8_t _JPEG_DRI = 0xDD;
60const uint8_t _JPEG_APP0 = 0xE0;
61const uint8_t _JPEG_COM = 0xFE;
64const uint8_t _JPEG_TEM = 0x01;
65const uint8_t _JPEG_RST0 = 0xD0;
66const uint8_t _JPEG_RST1 = 0xD1;
67const uint8_t _JPEG_RST2 = 0xD2;
68const uint8_t _JPEG_RST3 = 0xD3;
69const uint8_t _JPEG_RST4 = 0xD4;
70const uint8_t _JPEG_RST5 = 0xD5;
71const uint8_t _JPEG_RST6 = 0xD6;
72const uint8_t _JPEG_RST7 = 0xD7;
74const uint8_t _JPEG_SAMPLE_1x1 = 0;
75const uint8_t _JPEG_SAMPLE_1x2 = 1;
76const uint8_t _JPEG_SAMPLE_2x1 = 2;
77const uint8_t _JPEG_SAMPLE_2x2 = 3;
80#define _JPEG_MAX_CHANNELS 3
81#define _JPEG_MAX_BLOCKS 6
82#define _JPEG_MAX_HUFF_TABLES 2
83#define _JPEG_MAX_DATA_BUF_LEN 128
86#define _JPEG_SOF0 0xC0
93#define _JPEG_APP0 0xE0
98#define _JPEG_RST0 0xD0
99#define _JPEG_RST1 0xD1
100#define _JPEG_RST2 0xD2
101#define _JPEG_RST3 0xD3
102#define _JPEG_RST4 0xD4
103#define _JPEG_RST5 0xD5
104#define _JPEG_RST6 0xD6
105#define _JPEG_RST7 0xD7
107#define _JPEG_SAMPLE_1x1 0
108#define _JPEG_SAMPLE_1x2 1
109#define _JPEG_SAMPLE_2x1 2
110#define _JPEG_SAMPLE_2x2 3
113const uint8_t _JPEG_ZIG_ZAG_8x8[64] =
115 0, 1, 8, 16, 9, 2, 3, 10,
116 17, 24, 32, 25, 18, 11, 4, 5,
117 12, 19, 26, 33, 40, 48, 41, 34,
118 27, 20, 13, 6, 7, 14, 21, 28,
119 35, 42, 49, 56, 57, 50, 43, 36,
120 29, 22, 15, 23, 30, 37, 44, 51,
121 58, 59, 52, 45, 38, 31, 39, 46,
122 53, 60, 61, 54, 47, 55, 62, 63