Home | History | Annotate | Download | only in jpeg

Lines Matching full:state

12  * back up to the start of the current MCU.  To do this, we copy state
58 savable_state saved; /* Bit buffer & DC state at start of MCU */
60 /* These fields are NOT loaded into local working state. */
76 /* Working state while writing an MCU.
83 savable_state cur; /* Current bit buffer & DC state */
270 #define emit_byte(state,val,action) \
271 { *(state)->next_output_byte++ = (JOCTET) (val); \
272 if (--(state)->free_in_buffer == 0) \
273 if (! dump_buffer(state)) \
278 dump_buffer (working_state * state)
281 struct jpeg_destination_mgr * dest = state->cinfo->dest;
283 if (! (*dest->empty_output_buffer) (state->cinfo))
286 state->next_output_byte = dest->next_output_byte;
287 state->free_in_buffer = dest->free_in_buffer;
302 emit_bits (working_state * state, unsigned int code, int size)
307 register int put_bits = state->cur.put_bits;
311 ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE);
319 put_buffer |= state->cur.put_buffer; /* and merge with old buffer contents */
324 emit_byte(state, c, return FALSE);
326 emit_byte(state, 0, return FALSE);
332 state->cur.put_buffer = put_buffer; /* update state variables */
333 state->cur.put_bits = put_bits;
340 flush_bits (working_state * state)
342 if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */
344 state->cur.put_buffer = 0; /* and reset bit-buffer to empty */
345 state->cur.put_bits = 0;
353 encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
381 ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
384 if (! emit_bits(state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits]))
390 if (! emit_bits(state, (unsigned int) temp2, nbits))
403 if (! emit_bits(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0]))
421 ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
425 if (! emit_bits(state, actbl->ehufco[i], actbl->ehufsi[i]))
430 if (! emit_bits(state, (unsigned int) temp2, nbits))
439 if (! emit_bits(state, actbl->ehufco[0], actbl->ehufsi[0]))
451 emit_restart (working_state * state, int restart_num)
455 if (! flush_bits(state))
458 emit_byte(state, 0xFF, return FALSE);
459 emit_byte(state, JPEG_RST0 + restart_num, return FALSE);
462 for (ci = 0; ci < state->cinfo->comps_in_scan; ci++)
463 state->cur.last_dc_val[ci] = 0;
479 working_state state;
483 /* Load up working state */
484 state.next_output_byte = cinfo->dest->next_output_byte;
485 state.free_in_buffer = cinfo->dest->free_in_buffer;
486 ASSIGN_STATE(state.cur, entropy->saved);
487 state.cinfo = cinfo;
492 if (! emit_restart(&state, entropy->next_restart_num))
500 if (! encode_one_block(&state,
501 MCU_data[blkn][0], state.cur.last_dc_val[ci],
506 state.cur.last_dc_val[ci] = MCU_data[blkn][0][0];
509 /* Completed MCU, so update state */
510 cinfo->dest->next_output_byte = state.next_output_byte;
511 cinfo->dest->free_in_buffer = state.free_in_buffer;
512 ASSIGN_STATE(entropy->saved, state.cur);
514 /* Update restart-interval state too */
536 working_state state;
538 state ... flush_bits needs it */
539 state.next_output_byte = cinfo->dest->next_output_byte;
540 state.free_in_buffer = cinfo->dest->free_in_buffer;
541 ASSIGN_STATE(state.cur, entropy->saved);
542 state.cinfo = cinfo;
545 if (! flush_bits(&state))
548 /* Update state */
549 cinfo->dest->next_output_byte = state.next_output_byte;
550 cinfo->dest->free_in_buffer = state.free_in_buffer;
551 ASSIGN_STATE(entropy->saved, state.cur);
657 /* Update restart state */