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 20 #define HUFF_LOOKAHEAD 8 69 #define BIT_BUF_SIZE 32 101 #define BITREAD_STATE_VARS \ 102 bit_buf_type get_buffer; \ 104 bitread_working_state br_state 106 #define BITREAD_LOAD_STATE(cinfop, permstate) \ 107 br_state.cinfo = cinfop; \ 108 br_state.next_input_byte = cinfop->src->next_input_byte; \ 109 br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \ 110 get_buffer = permstate.get_buffer; \ 111 bits_left = permstate.bits_left; 113 #define BITREAD_SAVE_STATE(cinfop, permstate) \ 114 cinfop->src->next_input_byte = br_state.next_input_byte; \ 115 cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \ 116 permstate.get_buffer = get_buffer; \ 117 permstate.bits_left = bits_left 137 #define CHECK_BIT_BUFFER(state, nbits, action) \ 139 if (bits_left < (nbits)) \ 141 if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \ 145 get_buffer = (state).get_buffer; \ 146 bits_left = (state).bits_left; \ 150 #define GET_BITS(nbits) \ 151 (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1)) 153 #define PEEK_BITS(nbits) \ 154 (((int)(get_buffer >> (bits_left - (nbits)))) & ((1 << (nbits)) - 1)) 156 #define DROP_BITS(nbits) (bits_left -= (nbits)) 181 #define HUFF_DECODE(result, state, htbl, failaction, slowlabel) \ 184 if (bits_left < HUFF_LOOKAHEAD) \ 186 if (!jpeg_fill_bit_buffer(&state, get_buffer, bits_left, 0)) \ 190 get_buffer = state.get_buffer; \ 191 bits_left = state.bits_left; \ 192 if (bits_left < HUFF_LOOKAHEAD) \ 198 look = PEEK_BITS(HUFF_LOOKAHEAD); \ 199 if ((nb = htbl->look_nbits[look]) != 0) \ 202 result = htbl->look_sym[look]; \ 206 nb = HUFF_LOOKAHEAD + 1; \ 208 if ((result = jpeg_huff_decode( \ 209 &state, get_buffer, bits_left, htbl, nb)) < 0) \ 213 get_buffer = state.get_buffer; \ 214 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)
jpeg_fill_bit_buffer(bitread_working_state *state, bit_buf_type get_buffer, int bits_left, int nbits)
const JOCTET * next_input_byte
jpeg_make_d_derived_tbl JPP((j_decompress_ptr cinfo, boolean isDC, int tblno, d_derived_tbl **pdtbl))
jpeg_make_d_derived_tbl(j_decompress_ptr cinfo, boolean isDC, int tblno, d_derived_tbl **pdtbl)