#include "jinclude.h"
#include "jpeglib.h"
Go to the source code of this file.
|
| emit_byte (int val, j_compress_ptr cinfo) |
|
| finish_pass (j_compress_ptr cinfo) |
|
| arith_encode (j_compress_ptr cinfo, unsigned char *st, int val) |
|
| emit_restart (j_compress_ptr cinfo, int restart_num) |
|
| encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) |
|
| encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) |
|
| encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) |
|
| encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) |
|
| encode_mcu (j_compress_ptr cinfo, JBLOCKROW *MCU_data) |
|
| start_pass (j_compress_ptr cinfo, boolean gather_statistics) |
|
| jinit_arith_encoder (j_compress_ptr cinfo) |
|
◆ AC_STAT_BINS
◆ DC_STAT_BINS
◆ IRIGHT_SHIFT
#define IRIGHT_SHIFT |
( |
|
x, |
|
|
|
shft |
|
) |
| ((x) >> (shft)) |
◆ ISHIFT_TEMPS
◆ JPEG_INTERNALS
◆ arith_entropy_ptr
◆ arith_encode()
Definition at line 219 of file jcarith.c.
220{
222 register unsigned char nl, nm;
224 register int sv;
225
226
227
228
229 sv = *st;
231 nl = qe & 0xFF; qe >>= 8;
232 nm = qe & 0xFF; qe >>= 8;
233
234
236 if (
val != (sv >> 7)) {
237
239
240
241
242
245 }
246 *st = (sv & 0x80) ^ nl;
247 } else {
248
250 return;
252
253
254
257 }
258 *st = (sv & 0x80) ^ nm;
259 }
260
261
262 do {
266
269
270 if (
e->buffer >= 0) {
275 if (
e->buffer + 1 == 0xFF)
277 }
280
281
282
283
285 }
else if (
temp == 0xFF) {
287 } else {
288
291 else if (
e->buffer >= 0) {
296 }
301 do {
305 }
306
308 }
311 }
312 }
while (
e->a < 0x8000L);
313}
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
const INT32 jpeg_aritab[113+1]
emit_byte(int val, j_compress_ptr cinfo)
arith_entropy_encoder * arith_entropy_ptr
struct jpeg_entropy_encoder * entropy
Referenced by encode_mcu(), encode_mcu_AC_first(), encode_mcu_AC_refine(), encode_mcu_DC_first(), and encode_mcu_DC_refine().
◆ emit_byte()
◆ emit_restart()
Definition at line 321 of file jcarith.c.
322{
324 int ci;
326
328
331
332
335
336 if (cinfo->
Ss == 0 && cinfo->
Ah == 0) {
338
341 }
342
345 }
346 }
347
348
350 entropy->
a = 0x10000L;
355}
finish_pass(j_compress_ptr cinfo)
jpeg_component_info * compptr
int dc_context[MAX_COMPS_IN_SCAN]
unsigned char * ac_stats[NUM_ARITH_TBLS]
int last_dc_val[MAX_COMPS_IN_SCAN]
unsigned char * dc_stats[NUM_ARITH_TBLS]
jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]
#define MEMZERO(addr, type, size)
Referenced by encode_mcu(), encode_mcu_AC_first(), encode_mcu_AC_refine(), encode_mcu_DC_first(), and encode_mcu_DC_refine().
◆ encode_mcu()
Definition at line 694 of file jcarith.c.
695{
697 const int * natural_order;
699 unsigned char *st;
702 int blkn, ci;
704
705
712 }
714 }
715
717
718
720 block = MCU_data[blkn];
723
724
725
727
728
730
731
735 } else {
738
739
742 st += 2;
744 } else {
747 st += 3;
749 }
750
760 st += 1;
761 }
762 }
764
765 if (
m < (
int) ((1L << cinfo->
arith_dc_L[tbl]) >> 1))
767 else if (
m > (
int) ((1L << cinfo->
arith_dc_U[tbl]) >> 1))
769
770 st += 14;
773 }
774
775
776
777 if ((ke = cinfo->
lim_Se) == 0)
continue;
779
780
781 do {
782 if ((*
block)[natural_order[ke]])
break;
783 } while (--ke);
784
785
786 for (
k = 0;
k < ke;) {
789 while ((
v = (*
block)[natural_order[++
k]]) == 0) {
791 st += 3;
792 }
794
795
798 } else {
801 }
802 st += 2;
803
817 st += 1;
818 }
819 }
820 }
822
823 st += 14;
826 }
827
828 if (k < cinfo->lim_Se) {
831 }
832 }
833
835}
GLfloat GLfloat GLfloat v2
emit_restart(j_compress_ptr cinfo, int restart_num)
arith_encode(j_compress_ptr cinfo, unsigned char *st, int val)
unsigned char fixed_bin[4]
unsigned int restarts_to_go
const int * natural_order
unsigned int restart_interval
UINT8 arith_dc_U[NUM_ARITH_TBLS]
int MCU_membership[C_MAX_BLOCKS_IN_MCU]
UINT8 arith_dc_L[NUM_ARITH_TBLS]
UINT8 arith_ac_K[NUM_ARITH_TBLS]
static unsigned int block
Referenced by start_pass().
◆ encode_mcu_AC_first()
Definition at line 453 of file jcarith.c.
454{
456 const int * natural_order;
458 unsigned char *st;
461
462
469 }
471 }
472
474
475
478
479
480
481
483 do {
484
485
486
487
488 if ((
v = (*
block)[natural_order[ke]]) >= 0) {
489 if (
v >>= cinfo->
Al)
break;
490 } else {
492 if (
v >>= cinfo->
Al)
break;
493 }
494 } while (--ke);
495
496
497 for (
k = cinfo->
Ss - 1;
k < ke;) {
500 for (;;) {
501 if ((
v = (*
block)[natural_order[++
k]]) >= 0) {
502 if (
v >>= cinfo->
Al) {
505 break;
506 }
507 } else {
509 if (
v >>= cinfo->
Al) {
512 break;
513 }
514 }
516 st += 3;
517 }
518 st += 2;
519
533 st += 1;
534 }
535 }
536 }
538
539 st += 14;
542 }
543
544 if (k < cinfo->Se) {
547 }
548
550}
Referenced by start_pass().
◆ encode_mcu_AC_refine()
Definition at line 595 of file jcarith.c.
596{
598 const int * natural_order;
600 unsigned char *st;
603
604
611 }
613 }
614
616
617
620
621
622
623
625 do {
626
627
628
629
630 if ((
v = (*
block)[natural_order[ke]]) >= 0) {
631 if (
v >>= cinfo->
Al)
break;
632 } else {
634 if (
v >>= cinfo->
Al)
break;
635 }
636 } while (--ke);
637
638
639 for (kex = ke; kex > 0; kex--)
640 if ((
v = (*
block)[natural_order[kex]]) >= 0) {
641 if (
v >>= cinfo->
Ah)
break;
642 } else {
644 if (
v >>= cinfo->
Ah)
break;
645 }
646
647
648 for (
k = cinfo->
Ss - 1;
k < ke;) {
652 for (;;) {
653 if ((
v = (*
block)[natural_order[++
k]]) >= 0) {
654 if (
v >>= cinfo->
Al) {
657 else {
660 }
661 break;
662 }
663 } else {
665 if (
v >>= cinfo->
Al) {
668 else {
671 }
672 break;
673 }
674 }
676 st += 3;
677 }
678 }
679
680 if (k < cinfo->Se) {
683 }
684
686}
Referenced by start_pass().
◆ encode_mcu_DC_first()
Definition at line 364 of file jcarith.c.
365{
367 unsigned char *st;
368 int blkn, ci, tbl;
371
372
379 }
381 }
382
383
387
388
389
390
392
393
394
395
397
398
402 } else {
405
406
409 st += 2;
411 } else {
414 st += 3;
416 }
417
427 st += 1;
428 }
429 }
431
432 if (
m < (
int) ((1L << cinfo->
arith_dc_L[tbl]) >> 1))
434 else if (
m > (
int) ((1L << cinfo->
arith_dc_U[tbl]) >> 1))
436
437 st += 14;
440 }
441 }
442
444}
#define IRIGHT_SHIFT(x, shft)
Referenced by start_pass().
◆ encode_mcu_DC_refine()
Definition at line 560 of file jcarith.c.
561{
563 unsigned char *st;
564 int Al, blkn;
565
566
573 }
575 }
576
579
580
582
583 arith_encode(cinfo, st, (MCU_data[blkn][0][0] >> Al) & 1);
584 }
585
587}
Referenced by start_pass().
◆ finish_pass()
Definition at line 133 of file jcarith.c.
134{
137
138
139
140
141
142 if ((
temp = (
e->a - 1 +
e->c) & 0xFFFF0000L) <
e->c)
143 e->c =
temp + 0x8000L;
144 else
146
148 if (
e->c & 0xF8000000L) {
149
150 if (
e->buffer >= 0) {
155 if (
e->buffer + 1 == 0xFF)
157 }
160 } else {
163 else if (
e->buffer >= 0) {
168 }
173 do {
177 }
178 }
179
180 if (
e->c & 0x7FFF800L) {
184 emit_byte((
int) ((
e->c >> 19) & 0xFF), cinfo);
185 if (((
e->c >> 19) & 0xFF) == 0xFF)
187 if (
e->c & 0x7F800L) {
188 emit_byte((
int) ((
e->c >> 11) & 0xFF), cinfo);
189 if (((
e->c >> 11) & 0xFF) == 0xFF)
191 }
192 }
193}
Referenced by emit_restart(), and jinit_arith_encoder().
◆ jinit_arith_encoder()
Definition at line 926 of file jcarith.c.
927{
930
936
937
941 }
942
943
945}
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
start_pass(j_compress_ptr cinfo, boolean gather_statistics)
struct jpeg_common_struct * j_common_ptr
struct jpeg_entropy_encoder pub
Referenced by jinit_compress_master(), and transencode_master_selection().
◆ start_pass()
Definition at line 843 of file jcarith.c.
844{
846 int ci, tbl;
848
849 if (gather_statistics)
850
851
852
853
854 ERREXIT(cinfo, JERR_NOT_COMPILED);
855
856
857
858
860 if (cinfo->
Ah == 0) {
863 else
865 } else {
868 else
870 }
871 } else
873
874
877
878 if (cinfo->
Ss == 0 && cinfo->
Ah == 0) {
881 ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
883 entropy->
dc_stats[tbl] = (
unsigned char *) (*cinfo->mem->alloc_small)
886
889 }
890
894 ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
896 entropy->
ac_stats[tbl] = (
unsigned char *) (*cinfo->mem->alloc_small)
899#ifdef CALCULATE_SPECTRAL_CONDITIONING
901
903#endif
904 }
905 }
906
907
909 entropy->
a = 0x10000L;
914
915
918}
encode_mcu_AC_first(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
encode_mcu_DC_first(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
encode_mcu_DC_refine(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
encode_mcu(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
encode_mcu_AC_refine(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
#define ERREXIT1(cinfo, code, p1)
Referenced by jinit_arith_encoder().