42 unsigned char fixed_bin[4];
60#define DC_STAT_BINS 64
61#define AC_STAT_BINS 256
70 if (
src->bytes_in_buffer == 0)
71 if (! (*
src->fill_input_buffer) (cinfo))
72 ERREXIT(cinfo, JERR_CANT_SUSPEND);
73 src->bytes_in_buffer--;
109 register unsigned char nl, nm;
111 register int sv,
data;
117 if (cinfo->unread_marker)
123 while (
data == 0xFF);
133 cinfo->unread_marker =
data;
138 e->c = (
e->c << 8) |
data;
139 if ((
e->ct += 8) < 0)
153 nl = qe & 0xFF; qe >>= 8;
154 nm = qe & 0xFF; qe >>= 8;
165 *st = (sv & 0x80) ^ nm;
168 *st = (sv & 0x80) ^ nl;
171 }
else if (
e->a < 0x8000L) {
174 *st = (sv & 0x80) ^ nl;
177 *st = (sv & 0x80) ^ nm;
197 if (! (*cinfo->marker->read_restart_marker) (cinfo))
198 ERREXIT(cinfo, JERR_CANT_SUSPEND);
201 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
202 compptr = cinfo->cur_comp_info[ci];
203 if (! cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
209 if ((! cinfo->progressive_mode && cinfo->lim_Se) ||
210 (cinfo->progressive_mode && cinfo->Ss)) {
247 int blkn, ci, tbl,
sign;
251 if (cinfo->restart_interval) {
257 if (entropy->
ct == -1)
return TRUE;
261 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
262 block = MCU_data[blkn];
263 ci = cinfo->MCU_membership[blkn];
264 tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;
283 if ((
m <<= 1) == (
int) 0x8000U) {
284 WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
292 if (
m < (
int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))
294 else if (
m > (
int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))
328 const int * natural_order;
331 if (cinfo->restart_interval) {
337 if (entropy->
ct == -1)
return TRUE;
339 natural_order = cinfo->natural_order;
343 tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
356 if (
k >= cinfo->Se) {
357 WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
371 (
k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
373 if ((
m <<= 1) == (
int) 0x8000U) {
374 WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
389 (*block)[natural_order[
k]] = (
JCOEF) (
v << cinfo->Al);
390 }
while (k < cinfo->Se);
411 if (cinfo->restart_interval) {
422 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
425 MCU_data[blkn][0][0] |= p1;
445 const int * natural_order;
448 if (cinfo->restart_interval) {
454 if (entropy->
ct == -1)
return TRUE;
456 natural_order = cinfo->natural_order;
460 tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
468 if ((*
block)[natural_order[kex]])
break;
477 thiscoef = *
block + natural_order[++
k];
495 if (
k >= cinfo->Se) {
496 WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
501 }
while (k < cinfo->Se);
518 int blkn, ci, tbl,
sign,
k;
520 const int * natural_order;
523 if (cinfo->restart_interval) {
529 if (entropy->
ct == -1)
return TRUE;
531 natural_order = cinfo->natural_order;
535 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
536 block = MCU_data[blkn];
537 ci = cinfo->MCU_membership[blkn];
538 compptr = cinfo->cur_comp_info[ci];
559 if ((
m <<= 1) == (
int) 0x8000U) {
560 WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
568 if (
m < (
int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))
570 else if (
m > (
int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))
587 if (cinfo->lim_Se == 0)
continue;
599 if (
k >= cinfo->lim_Se) {
600 WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
614 (
k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
616 if ((
m <<= 1) == (
int) 0x8000U) {
617 WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
631 (*block)[natural_order[
k]] = (
JCOEF)
v;
632 }
while (k < cinfo->lim_Se);
650 if (cinfo->progressive_mode) {
652 if (cinfo->Ss == 0) {
657 if (cinfo->Se < cinfo->Ss || cinfo->Se > cinfo->lim_Se)
660 if (cinfo->comps_in_scan != 1)
663 if (cinfo->Ah != 0) {
665 if (cinfo->Ah-1 != cinfo->Al)
668 if (cinfo->Al > 13) {
670 ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
671 cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);
677 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
678 int coefi, cindex = cinfo->cur_comp_info[ci]->component_index;
679 int *coef_bit_ptr = & cinfo->coef_bits[cindex][0];
680 if (cinfo->Ss && coef_bit_ptr[0] < 0)
681 WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
682 for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {
683 int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
685 WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);
686 coef_bit_ptr[coefi] = cinfo->Al;
690 if (cinfo->Ah == 0) {
705 if (cinfo->Ss != 0 || cinfo->Ah != 0 || cinfo->Al != 0 ||
706 (cinfo->Se <
DCTSIZE2 && cinfo->Se != cinfo->lim_Se))
707 WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);
713 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
714 compptr = cinfo->cur_comp_info[ci];
715 if (! cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
718 ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
720 entropy->
dc_stats[tbl] = (
unsigned char *) (*cinfo->mem->alloc_small)
727 if ((! cinfo->progressive_mode && cinfo->lim_Se) ||
728 (cinfo->progressive_mode && cinfo->Ss)) {
731 ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
733 entropy->
ac_stats[tbl] = (
unsigned char *) (*cinfo->mem->alloc_small)
772 cinfo->entropy = &entropy->
pub;
785 if (cinfo->progressive_mode) {
787 int *coef_bit_ptr, ci;
788 cinfo->coef_bits = (
int (*)[
DCTSIZE2]) (*cinfo->mem->alloc_small)
791 coef_bit_ptr = & cinfo->coef_bits[0][0];
792 for (ci = 0; ci < cinfo->num_components; ci++)
794 *coef_bit_ptr++ = -1;
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
const INT32 jpeg_aritab[113+1]
arith_decode(j_decompress_ptr cinfo, unsigned char *st)
start_pass(j_decompress_ptr cinfo)
decode_mcu_DC_refine(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
decode_mcu(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
finish_pass(j_decompress_ptr cinfo)
decode_mcu_AC_refine(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
process_restart(j_decompress_ptr cinfo)
arith_entropy_decoder * arith_entropy_ptr
decode_mcu_AC_first(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
decode_mcu_DC_first(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
jinit_arith_decoder(j_decompress_ptr cinfo)
jpeg_component_info * compptr
#define WARNMS2(cinfo, code, p1, p2)
#define ERREXIT4(cinfo, code, p1, p2, p3, p4)
#define ERREXIT1(cinfo, code, p1)
#define WARNMS(cinfo, code)
struct jpeg_common_struct * j_common_ptr
#define MAX_COMPS_IN_SCAN
unsigned int restarts_to_go
unsigned char fixed_bin[4]
int dc_context[MAX_COMPS_IN_SCAN]
unsigned char * ac_stats[NUM_ARITH_TBLS]
int last_dc_val[MAX_COMPS_IN_SCAN]
struct jpeg_entropy_encoder pub
unsigned int restarts_to_go
unsigned char * dc_stats[NUM_ARITH_TBLS]
#define MEMZERO(addr, type, size)
static unsigned int block