123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- typedef struct {
-
- INT32 mincode[17]
- INT32 maxcode[18]
-
- int valptr[17]
-
- JHUFF_TBL *pub
-
- int look_nbits[1<<HUFF_LOOKAHEAD]
- UINT8 look_sym[1<<HUFF_LOOKAHEAD]
- } d_derived_tbl
- EXTERN void jpeg_make_d_derived_tbl JPP((j_decompress_ptr cinfo,
- JHUFF_TBL * htbl, d_derived_tbl ** pdtbl))
- typedef INT32 bit_buf_type;
- typedef struct {
- bit_buf_type get_buffer
- int bits_left;
- boolean printed_eod
- } bitread_perm_state;
- typedef struct {
-
- const JOCTET * next_input_byte
- size_t bytes_in_buffer;
- int unread_marker
-
- bit_buf_type get_buffer
- int bits_left;
-
- j_decompress_ptr cinfo
- boolean * printed_eod_ptr
- } bitread_working_state;
- register bit_buf_type get_buffer
- register int bits_left; \
- bitread_working_state br_state
- br_state.cinfo = cinfop
- br_state.next_input_byte = cinfop->src->next_input_byte
- br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \
- br_state.unread_marker = cinfop->unread_marker
- get_buffer = permstate.get_buffer
- bits_left = permstate.bits_left; \
- br_state.printed_eod_ptr = & permstate.printed_eod
- cinfop->src->next_input_byte = br_state.next_input_byte; \
- cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \
- cinfop->unread_marker = br_state.unread_marker; \
- permstate.get_buffer = get_buffer
- permstate.bits_left = bits_left
- { if (bits_left < (nbits)) { \
- if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits)) \
- { action
- get_buffer = (state).get_buffer
- (((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1))
- (((int) (get_buffer >> (bits_left - (nbits)))) & ((1<<(nbits))-1))
- (bits_left -= (nbits))
- EXTERN boolean jpeg_fill_bit_buffer JPP((bitread_working_state * state,
- register bit_buf_type get_buffer, register int bits_left,
- int nbits))
- { register int nb, look
- if (bits_left < HUFF_LOOKAHEAD) { \
- if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction
- get_buffer = state.get_buffer
- if (bits_left < HUFF_LOOKAHEAD) { \
- nb = 1
- } \
- } \
- look = PEEK_BITS(HUFF_LOOKAHEAD)
- if ((nb = htbl->look_nbits[look]) != 0) { \
- DROP_BITS(nb)
- result = htbl->look_sym[look]
- } else { \
- nb = HUFF_LOOKAHEAD+1
- slowlabel: \
- if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \
- { failaction
- get_buffer = state.get_buffer
- } \
- }
- EXTERN int jpeg_huff_decode JPP((bitread_working_state * state,
- register bit_buf_type get_buffer, register int bits_left,
- d_derived_tbl * htbl, int min_bits))
|