typedefstruct {
size_t put_buffer; /* current bit accumulation buffer */ int free_bits; /* # of bits available in it */ int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
} savable_state;
typedefstruct {
JOCTET *next_output_byte; /* => next byte to write in buffer */
size_t free_in_buffer; /* # of byte spaces remaining in buffer */
savable_state cur; /* Current bit buffer & DC state */
j_compress_ptr cinfo; /* dump_buffer needs access to this */ int simd;
} working_state;
/* Outputting bits to the file */
/* Output byte b and, speculatively, an additional 0 byte. 0xFF must be encoded *as0xFF0x00,sotheoutputbufferpointerisadvancedby2ifthebyteis *0xFF.Otherwise,theoutputbufferpointerisadvancedby1,andthe *speculative0bytewillbeoverwrittenbythenextbyte.
*/ #define EMIT_BYTE(b) { \
buffer[0] = (JOCTET)(b); \
buffer[1] = 0; \
buffer -= -2 + ((JOCTET)(b) < 0xFF); \
}
/* Output the entire bit buffer. If there are no 0xFF bytes in it, then write *directlytotheoutputbuffer.Otherwise,usetheEMIT_BYTE()macroto *encode0xFFas0xFF0x00.
*/ #ifdefined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
/* Fill the bit buffer to capacity with the leading bits from code, then output *thebitbufferandputtheremainingbitsfromcodeintothebitbuffer.
*/ #define PUT_AND_FLUSH(code, size) { \
put_buffer = (put_buffer << (size + free_bits)) | (code >> -free_bits); \
FLUSH() \
free_bits += BIT_BUF_SIZE; \
put_buffer = code; \
}
/* Insert code into the bit buffer and output the bit buffer if needed. *NOTE:Wecan'tflushwithfree_bits==0,sincetheleftshiftin *PUT_AND_FLUSH()wouldhaveundefinedbehavior.
*/ #define PUT_BITS(code, size) { \
free_bits -= size; \ if (free_bits < 0) \
PUT_AND_FLUSH(code, size) \ else \
put_buffer = (put_buffer << size) | code; \
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.