12 #ifdef NEED_SHORT_EXTERNAL_NAMES 13 #define jpeg_make_d_derived_tbl jMkDDerived 14 #define jpeg_fill_bit_buffer jFilBitBuf 15 #define jpeg_huff_decode jHufDecode 21 #define HUFF_LOOKAHEAD 8 70 #define BIT_BUF_SIZE 32 99 #define BITREAD_STATE_VARS \ 100 bit_buf_type get_buffer; \ 102 bitread_working_state br_state 104 #define BITREAD_LOAD_STATE(cinfop,permstate) \ 105 br_state.cinfo = cinfop; \ 106 br_state.next_input_byte = cinfop->src->next_input_byte; \ 107 br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \ 108 get_buffer = permstate.get_buffer; \ 109 bits_left = permstate.bits_left; 111 #define BITREAD_SAVE_STATE(cinfop,permstate) \ 112 cinfop->src->next_input_byte = br_state.next_input_byte; \ 113 cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \ 114 permstate.get_buffer = get_buffer; \ 115 permstate.bits_left = bits_left 135 #define CHECK_BIT_BUFFER(state,nbits,action) \ 136 { if (bits_left < (nbits)) { \ 137 if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits)) \ 139 get_buffer = (state).get_buffer; bits_left = (state).bits_left; } } 141 #define GET_BITS(nbits) \ 142 (((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1)) 144 #define PEEK_BITS(nbits) \ 145 (((int) (get_buffer >> (bits_left - (nbits)))) & ((1<<(nbits))-1)) 147 #define DROP_BITS(nbits) \ 148 (bits_left -= (nbits)) 173 #define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \ 175 if (bits_left < HUFF_LOOKAHEAD) { \ 176 if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \ 177 get_buffer = state.get_buffer; bits_left = state.bits_left; \ 178 if (bits_left < HUFF_LOOKAHEAD) { \ 179 nb = 1; goto slowlabel; \ 182 look = PEEK_BITS(HUFF_LOOKAHEAD); \ 183 if ((nb = htbl->look_nbits[look]) != 0) { \ 185 result = htbl->look_sym[look]; \ 187 nb = HUFF_LOOKAHEAD+1; \ 189 if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \ 191 get_buffer = state.get_buffer; bits_left = state.bits_left; \
jpeg_huff_decode(bitread_working_state *state, bit_buf_type get_buffer, int bits_left, d_derived_tbl *htbl, int min_bits)
boolean int d_derived_tbl ** pdtbl
jpeg_fill_bit_buffer(bitread_working_state *state, bit_buf_type get_buffer, int bits_left, int nbits)
bit_buf_type int d_derived_tbl int min_bits
const JOCTET * next_input_byte
bit_buf_type int bits_left
EXTERN(void) jpeg_make_d_derived_tbl JPP((j_decompress_ptr cinfo
bit_buf_type int d_derived_tbl * htbl
bit_buf_type int int nbits
jpeg_make_d_derived_tbl(j_decompress_ptr cinfo, boolean isDC, int tblno, d_derived_tbl **pdtbl)