55 0xFFFFFFFE, 0xFFFFFFFC, 0xFFFFFFF8, 0xFFFFFFF0, 0xFFFFFFE0, 0xFFFFFFC0,
56 0xFFFFFF80, 0xFFFFFF00, 0xFFFFFE00, 0xFFFFFC00, 0xFFFFF800, 0xFFFFF000,
57 0xFFFFE000, 0xFFFFC000, 0xFFFF8000, 0xFFFF0000, 0xFFFE0000, 0xFFFC0000,
58 0xFFF80000, 0xFFF00000
64 0x00000001, 0x00000002, 0x00000004, 0x00000008,
65 0x00000010, 0x00000020, 0x00000040, 0x00000080,
66 0x00000100, 0x00000200, 0x00000400, 0x00000800,
67 0x00001000, 0x00002000, 0x00004000, 0x00008000,
68 0x00010000, 0x00020000, 0x00040000, 0x00080000,
69 0x00100000, 0x00200000, 0x00400000, 0x00800000,
70 0x01000000, 0x02000000, 0x04000000, 0x08000000,
71 0x10000000, 0x20000000, 0x40000000, 0x80000000
75 0x00000001, 0x00000003, 0x00000007, 0x0000000f,
76 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff,
77 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff,
78 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff,
79 0x0001ffff, 0x0003ffff, 0x0007ffff, 0x000fffff,
80 0x001fffff, 0x003fffff, 0x007fffff, 0x00ffffff,
81 0x01ffffff, 0x03ffffff, 0x07ffffff, 0x0fffffff,
82 0x1fffffff, 0x3fffffff, 0x7fffffff, 0xffffffff
101 printf (
"Unanticipated marker detected.\n");
145 if (read_position > 23)
151 read_position = 7 - p;
152 return (rv &
lmask[n]);
169 read_position = p - 1;
180 int *p_dhtbl_maxcode,
int *p_dhtbl_mincode,
183 int i, j, p, code, size, l;
191 for (p = 0, i = 1; i < 17; i++)
193 for (j = 1; j <= p_xhtbl_bits[i]; j++)
209 huffcode[p++] = code++;
211 while ((huffsize[p] == size) && (p < 257));
223 while (huffsize[p] != size);
226 for (p_dhtbl_ml = 1, p = 0, l = 1; l <= 16; l++)
228 if (p_xhtbl_bits[l] == 0)
230 p_dhtbl_maxcode[l] = -1;
234 p_dhtbl_valptr[l] = p;
235 p_dhtbl_mincode[l] = huffcode[p];
236 p += p_xhtbl_bits[l] - 1;
237 p_dhtbl_maxcode[l] = huffcode[p];
242 p_dhtbl_maxcode[p_dhtbl_ml]++;
252 int *Dhuff_maxcode,
int *Dhuff_mincode,
int *Dhuff_valptr)
257 for (l = 1; code > Dhuff_maxcode[l]; l++)
262 if (code < Dhuff_maxcode[Dhuff_ml])
264 p = Dhuff_valptr[l] + code - Dhuff_mincode[l];
265 return (Xhuff_huffval[p]);
270 printf (
"Huffman read error\n");
283 int s, diff, tbl_no, *mptr,
k, n, r;
313 for (mptr = out_buf + 1; mptr < out_buf +
DCTSIZE2; mptr++)
int p_jinfo_dc_dhuff_tbl_mincode[NUM_HUFF_TBLS][36]
int p_jinfo_dc_dhuff_tbl_maxcode[NUM_HUFF_TBLS][36]
int DecodeHuffman(int *Xhuff_huffval, int Dhuff_ml, int *Dhuff_maxcode, int *Dhuff_mincode, int *Dhuff_valptr)
int huff_make_dhuff_tb(int *p_xhtbl_bits, int p_dhtbl_ml, int *p_dhtbl_maxcode, int *p_dhtbl_mincode, int *p_dhtbl_valptr)
static const int extend_mask[20]
const int bit_set_mask[32]
static unsigned int current_read_byte
int p_jinfo_ac_dhuff_tbl_maxcode[NUM_HUFF_TBLS][36]
static const uint32_t k[]
int p_jinfo_ac_dhuff_tbl_valptr[NUM_HUFF_TBLS][36]
unsigned char * CurHuffReadBuf
void DecodeHuffMCU(int *out_buf, int num_cmp)
int p_jinfo_dc_dhuff_tbl_ml[NUM_HUFF_TBLS]
int p_jinfo_ac_dhuff_tbl_mincode[NUM_HUFF_TBLS][36]
int p_jinfo_ac_xhuff_tbl_huffval[NUM_HUFF_TBLS][257]
char p_jinfo_comps_info_dc_tbl_no[NUM_COMPONENT]
int p_jinfo_ac_dhuff_tbl_ml[NUM_HUFF_TBLS]
int p_jinfo_dc_xhuff_tbl_huffval[NUM_HUFF_TBLS][257]
int p_jinfo_dc_dhuff_tbl_valptr[NUM_HUFF_TBLS][36]