home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume34 / jpeg / part12 < prev    next >
SHell self-extracting ARchive  |  1992-12-17  |  58.0 KB

view JSON data     |     view as text     |     open on a Mac     |     open on a PC

This file was processed as: SHell self-extracting ARchive (archive/shar).

You can browse this item here: part12

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file ASCII text default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 73 6f 75 72 63 65 73 | 2e 6d 69 73 63 0a 46 72 |.sources|.misc.Fr|
|00000020| 6f 6d 3a 20 6a 70 65 67 | 2d 69 6e 66 6f 40 75 75 |om: jpeg|-info@uu|
|00000030| 6e 65 74 2e 75 75 2e 6e | 65 74 20 28 49 6e 64 65 |net.uu.n|et (Inde|
|00000040| 70 65 6e 64 65 6e 74 20 | 4a 50 45 47 20 47 72 6f |pendent |JPEG Gro|
|00000050| 75 70 29 0a 53 75 62 6a | 65 63 74 3a 20 20 76 33 |up).Subj|ect: v3|
|00000060| 34 69 30 36 36 3a 20 20 | 6a 70 65 67 20 2d 20 4a |4i066: |jpeg - J|
|00000070| 50 45 47 20 69 6d 61 67 | 65 20 63 6f 6d 70 72 65 |PEG imag|e compre|
|00000080| 73 73 69 6f 6e 2c 20 50 | 61 72 74 31 32 2f 31 38 |ssion, P|art12/18|
|00000090| 0a 4d 65 73 73 61 67 65 | 2d 49 44 3a 20 3c 31 39 |.Message|-ID: <19|
|000000a0| 39 32 44 65 63 31 37 2e | 31 36 34 39 31 39 2e 36 |92Dec17.|164919.6|
|000000b0| 35 38 33 40 73 70 61 72 | 6b 79 2e 69 6d 64 2e 73 |583@spar|ky.imd.s|
|000000c0| 74 65 72 6c 69 6e 67 2e | 63 6f 6d 3e 0a 58 2d 4d |terling.|com>.X-M|
|000000d0| 64 34 2d 53 69 67 6e 61 | 74 75 72 65 3a 20 35 64 |d4-Signa|ture: 5d|
|000000e0| 64 37 37 37 64 38 37 37 | 34 30 32 63 65 36 38 31 |d777d877|402ce681|
|000000f0| 62 66 30 39 30 61 33 66 | 38 32 32 66 62 33 0a 44 |bf090a3f|822fb3.D|
|00000100| 61 74 65 3a 20 54 68 75 | 2c 20 31 37 20 44 65 63 |ate: Thu|, 17 Dec|
|00000110| 20 31 39 39 32 20 31 36 | 3a 34 39 3a 31 39 20 47 | 1992 16|:49:19 G|
|00000120| 4d 54 0a 41 70 70 72 6f | 76 65 64 3a 20 6b 65 6e |MT.Appro|ved: ken|
|00000130| 74 40 73 70 61 72 6b 79 | 2e 69 6d 64 2e 73 74 65 |t@sparky|.imd.ste|
|00000140| 72 6c 69 6e 67 2e 63 6f | 6d 0a 0a 53 75 62 6d 69 |rling.co|m..Submi|
|00000150| 74 74 65 64 2d 62 79 3a | 20 6a 70 65 67 2d 69 6e |tted-by:| jpeg-in|
|00000160| 66 6f 40 75 75 6e 65 74 | 2e 75 75 2e 6e 65 74 20 |fo@uunet|.uu.net |
|00000170| 28 49 6e 64 65 70 65 6e | 64 65 6e 74 20 4a 50 45 |(Indepen|dent JPE|
|00000180| 47 20 47 72 6f 75 70 29 | 0a 50 6f 73 74 69 6e 67 |G Group)|.Posting|
|00000190| 2d 6e 75 6d 62 65 72 3a | 20 56 6f 6c 75 6d 65 20 |-number:| Volume |
|000001a0| 33 34 2c 20 49 73 73 75 | 65 20 36 36 0a 41 72 63 |34, Issu|e 66.Arc|
|000001b0| 68 69 76 65 2d 6e 61 6d | 65 3a 20 6a 70 65 67 2f |hive-nam|e: jpeg/|
|000001c0| 70 61 72 74 31 32 0a 45 | 6e 76 69 72 6f 6e 6d 65 |part12.E|nvironme|
|000001d0| 6e 74 3a 20 55 4e 49 58 | 2c 20 56 4d 53 2c 20 4d |nt: UNIX|, VMS, M|
|000001e0| 53 2d 44 4f 53 2c 20 4d | 61 63 2c 20 41 6d 69 67 |S-DOS, M|ac, Amig|
|000001f0| 61 2c 20 41 74 61 72 69 | 2c 20 43 72 61 79 0a 53 |a, Atari|, Cray.S|
|00000200| 75 70 65 72 73 65 64 65 | 73 3a 20 6a 70 65 67 3a |upersede|s: jpeg:|
|00000210| 20 56 6f 6c 75 6d 65 20 | 32 39 2c 20 49 73 73 75 | Volume |29, Issu|
|00000220| 65 20 31 2d 31 38 0a 0a | 23 21 20 2f 62 69 6e 2f |e 1-18..|#! /bin/|
|00000230| 73 68 0a 23 20 54 68 69 | 73 20 69 73 20 61 20 73 |sh.# Thi|s is a s|
|00000240| 68 65 6c 6c 20 61 72 63 | 68 69 76 65 2e 20 20 52 |hell arc|hive. R|
|00000250| 65 6d 6f 76 65 20 61 6e | 79 74 68 69 6e 67 20 62 |emove an|ything b|
|00000260| 65 66 6f 72 65 20 74 68 | 69 73 20 6c 69 6e 65 2c |efore th|is line,|
|00000270| 20 74 68 65 6e 20 66 65 | 65 64 20 69 74 0a 23 20 | then fe|ed it.# |
|00000280| 69 6e 74 6f 20 61 20 73 | 68 65 6c 6c 20 76 69 61 |into a s|hell via|
|00000290| 20 22 73 68 20 66 69 6c | 65 22 20 6f 72 20 73 69 | "sh fil|e" or si|
|000002a0| 6d 69 6c 61 72 2e 20 20 | 54 6f 20 6f 76 65 72 77 |milar. |To overw|
|000002b0| 72 69 74 65 20 65 78 69 | 73 74 69 6e 67 20 66 69 |rite exi|sting fi|
|000002c0| 6c 65 73 2c 0a 23 20 74 | 79 70 65 20 22 73 68 20 |les,.# t|ype "sh |
|000002d0| 66 69 6c 65 20 2d 63 22 | 2e 0a 23 20 43 6f 6e 74 |file -c"|..# Cont|
|000002e0| 65 6e 74 73 3a 20 20 55 | 53 41 47 45 20 6a 63 68 |ents: U|SAGE jch|
|000002f0| 75 66 66 2e 63 20 6a 72 | 65 76 64 63 74 2e 63 20 |uff.c jr|evdct.c |
|00000300| 6d 61 6b 65 66 69 6c 65 | 2e 6d 61 6e 78 0a 23 20 |makefile|.manx.# |
|00000310| 57 72 61 70 70 65 64 20 | 62 79 20 6b 65 6e 74 40 |Wrapped |by kent@|
|00000320| 73 70 61 72 6b 79 20 6f | 6e 20 57 65 64 20 44 65 |sparky o|n Wed De|
|00000330| 63 20 31 36 20 32 30 3a | 35 32 3a 32 39 20 31 39 |c 16 20:|52:29 19|
|00000340| 39 32 0a 50 41 54 48 3d | 2f 62 69 6e 3a 2f 75 73 |92.PATH=|/bin:/us|
|00000350| 72 2f 62 69 6e 3a 2f 75 | 73 72 2f 75 63 62 3a 2f |r/bin:/u|sr/ucb:/|
|00000360| 75 73 72 2f 6c 6f 63 61 | 6c 2f 62 69 6e 3a 2f 75 |usr/loca|l/bin:/u|
|00000370| 73 72 2f 6c 62 69 6e 20 | 3b 20 65 78 70 6f 72 74 |sr/lbin |; export|
|00000380| 20 50 41 54 48 0a 65 63 | 68 6f 20 49 66 20 74 68 | PATH.ec|ho If th|
|00000390| 69 73 20 61 72 63 68 69 | 76 65 20 69 73 20 63 6f |is archi|ve is co|
|000003a0| 6d 70 6c 65 74 65 2c 20 | 79 6f 75 20 77 69 6c 6c |mplete, |you will|
|000003b0| 20 73 65 65 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 | see the| followi|
|000003c0| 6e 67 20 6d 65 73 73 61 | 67 65 3a 0a 65 63 68 6f |ng messa|ge:.echo|
|000003d0| 20 27 20 20 20 20 20 20 | 20 20 20 20 22 73 68 61 | ' | "sha|
|000003e0| 72 3a 20 45 6e 64 20 6f | 66 20 61 72 63 68 69 76 |r: End o|f archiv|
|000003f0| 65 20 31 32 20 28 6f 66 | 20 31 38 29 2e 22 27 0a |e 12 (of| 18)."'.|
|00000400| 69 66 20 74 65 73 74 20 | 2d 66 20 27 55 53 41 47 |if test |-f 'USAG|
|00000410| 45 27 20 2d 61 20 22 24 | 7b 31 7d 22 20 21 3d 20 |E' -a "$|{1}" != |
|00000420| 22 2d 63 22 20 3b 20 74 | 68 65 6e 20 0a 20 20 65 |"-c" ; t|hen . e|
|00000430| 63 68 6f 20 73 68 61 72 | 3a 20 57 69 6c 6c 20 6e |cho shar|: Will n|
|00000440| 6f 74 20 63 6c 6f 62 62 | 65 72 20 65 78 69 73 74 |ot clobb|er exist|
|00000450| 69 6e 67 20 66 69 6c 65 | 20 5c 22 27 55 53 41 47 |ing file| \"'USAG|
|00000460| 45 27 5c 22 0a 65 6c 73 | 65 0a 20 20 65 63 68 6f |E'\".els|e. echo|
|00000470| 20 73 68 61 72 3a 20 45 | 78 74 72 61 63 74 69 6e | shar: E|xtractin|
|00000480| 67 20 5c 22 27 55 53 41 | 47 45 27 5c 22 20 5c 28 |g \"'USA|GE'\" \(|
|00000490| 31 34 36 38 37 20 63 68 | 61 72 61 63 74 65 72 73 |14687 ch|aracters|
|000004a0| 5c 29 0a 20 20 73 65 64 | 20 22 73 2f 5e 58 2f 2f |\). sed| "s/^X//|
|000004b0| 22 20 3e 27 55 53 41 47 | 45 27 20 3c 3c 27 45 4e |" >'USAG|E' <<'EN|
|000004c0| 44 5f 4f 46 5f 46 49 4c | 45 27 0a 58 55 53 41 47 |D_OF_FIL|E'.XUSAG|
|000004d0| 45 20 69 6e 73 74 72 75 | 63 74 69 6f 6e 73 20 66 |E instru|ctions f|
|000004e0| 6f 72 20 74 68 65 20 49 | 6e 64 65 70 65 6e 64 65 |or the I|ndepende|
|000004f0| 6e 74 20 4a 50 45 47 20 | 47 72 6f 75 70 27 73 20 |nt JPEG |Group's |
|00000500| 4a 50 45 47 20 73 6f 66 | 74 77 61 72 65 0a 58 3d |JPEG sof|tware.X=|
|00000510| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000520| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000530| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000540| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000550| 0a 58 0a 58 49 4e 54 52 | 4f 44 55 43 54 49 4f 4e |.X.XINTR|ODUCTION|
|00000560| 0a 58 0a 58 54 68 69 73 | 20 64 69 73 74 72 69 62 |.X.XThis| distrib|
|00000570| 75 74 69 6f 6e 20 63 6f | 6e 74 61 69 6e 73 20 73 |ution co|ntains s|
|00000580| 6f 66 74 77 61 72 65 20 | 74 6f 20 69 6d 70 6c 65 |oftware |to imple|
|00000590| 6d 65 6e 74 20 4a 50 45 | 47 20 69 6d 61 67 65 20 |ment JPE|G image |
|000005a0| 63 6f 6d 70 72 65 73 73 | 69 6f 6e 20 61 6e 64 0a |compress|ion and.|
|000005b0| 58 64 65 63 6f 6d 70 72 | 65 73 73 69 6f 6e 2e 20 |Xdecompr|ession. |
|000005c0| 20 4a 50 45 47 20 28 70 | 72 6f 6e 6f 75 6e 63 65 | JPEG (p|ronounce|
|000005d0| 64 20 22 6a 61 79 2d 70 | 65 67 22 29 20 69 73 20 |d "jay-p|eg") is |
|000005e0| 61 20 73 74 61 6e 64 61 | 72 64 69 7a 65 64 20 63 |a standa|rdized c|
|000005f0| 6f 6d 70 72 65 73 73 69 | 6f 6e 0a 58 6d 65 74 68 |ompressi|on.Xmeth|
|00000600| 6f 64 20 66 6f 72 20 66 | 75 6c 6c 2d 63 6f 6c 6f |od for f|ull-colo|
|00000610| 72 20 61 6e 64 20 67 72 | 61 79 2d 73 63 61 6c 65 |r and gr|ay-scale|
|00000620| 20 69 6d 61 67 65 73 2e | 20 20 4a 50 45 47 20 69 | images.| JPEG i|
|00000630| 73 20 64 65 73 69 67 6e | 65 64 20 74 6f 20 68 61 |s design|ed to ha|
|00000640| 6e 64 6c 65 0a 58 22 72 | 65 61 6c 2d 77 6f 72 6c |ndle.X"r|eal-worl|
|00000650| 64 22 20 73 63 65 6e 65 | 73 2c 20 66 6f 72 20 65 |d" scene|s, for e|
|00000660| 78 61 6d 70 6c 65 20 73 | 63 61 6e 6e 65 64 20 70 |xample s|canned p|
|00000670| 68 6f 74 6f 67 72 61 70 | 68 73 2e 20 20 43 61 72 |hotograp|hs. Car|
|00000680| 74 6f 6f 6e 73 2c 20 6c | 69 6e 65 0a 58 64 72 61 |toons, l|ine.Xdra|
|00000690| 77 69 6e 67 73 2c 20 61 | 6e 64 20 6f 74 68 65 72 |wings, a|nd other|
|000006a0| 20 6e 6f 6e 2d 72 65 61 | 6c 69 73 74 69 63 20 69 | non-rea|listic i|
|000006b0| 6d 61 67 65 73 20 61 72 | 65 20 6e 6f 74 20 4a 50 |mages ar|e not JP|
|000006c0| 45 47 27 73 20 73 74 72 | 6f 6e 67 20 73 75 69 74 |EG's str|ong suit|
|000006d0| 3b 20 6f 6e 20 74 68 69 | 73 0a 58 73 6f 72 74 20 |; on thi|s.Xsort |
|000006e0| 6f 66 20 6d 61 74 65 72 | 69 61 6c 20 79 6f 75 20 |of mater|ial you |
|000006f0| 6d 61 79 20 67 65 74 20 | 70 6f 6f 72 20 69 6d 61 |may get |poor ima|
|00000700| 67 65 20 71 75 61 6c 69 | 74 79 20 61 6e 64 2f 6f |ge quali|ty and/o|
|00000710| 72 20 6c 69 74 74 6c 65 | 20 63 6f 6d 70 72 65 73 |r little| compres|
|00000720| 73 69 6f 6e 2e 0a 58 0a | 58 4a 50 45 47 20 69 73 |sion..X.|XJPEG is|
|00000730| 20 6c 6f 73 73 79 2c 20 | 6d 65 61 6e 69 6e 67 20 | lossy, |meaning |
|00000740| 74 68 61 74 20 74 68 65 | 20 6f 75 74 70 75 74 20 |that the| output |
|00000750| 69 6d 61 67 65 20 69 73 | 20 6e 6f 74 20 6e 65 63 |image is| not nec|
|00000760| 65 73 73 61 72 69 6c 79 | 20 69 64 65 6e 74 69 63 |essarily| identic|
|00000770| 61 6c 20 74 6f 0a 58 74 | 68 65 20 69 6e 70 75 74 |al to.Xt|he input|
|00000780| 20 69 6d 61 67 65 2e 20 | 20 48 65 6e 63 65 20 79 | image. | Hence y|
|00000790| 6f 75 20 73 68 6f 75 6c | 64 20 6e 6f 74 20 75 73 |ou shoul|d not us|
|000007a0| 65 20 4a 50 45 47 20 69 | 66 20 79 6f 75 20 68 61 |e JPEG i|f you ha|
|000007b0| 76 65 20 74 6f 20 68 61 | 76 65 20 69 64 65 6e 74 |ve to ha|ve ident|
|000007c0| 69 63 61 6c 0a 58 6f 75 | 74 70 75 74 20 62 69 74 |ical.Xou|tput bit|
|000007d0| 73 2e 20 20 48 6f 77 65 | 76 65 72 2c 20 6f 6e 20 |s. Howe|ver, on |
|000007e0| 74 79 70 69 63 61 6c 20 | 72 65 61 6c 2d 77 6f 72 |typical |real-wor|
|000007f0| 6c 64 20 69 6d 61 67 65 | 73 2c 20 76 65 72 79 20 |ld image|s, very |
|00000800| 67 6f 6f 64 20 63 6f 6d | 70 72 65 73 73 69 6f 6e |good com|pression|
|00000810| 0a 58 6c 65 76 65 6c 73 | 20 63 61 6e 20 62 65 20 |.Xlevels| can be |
|00000820| 6f 62 74 61 69 6e 65 64 | 20 77 69 74 68 20 6e 6f |obtained| with no|
|00000830| 20 76 69 73 69 62 6c 65 | 20 63 68 61 6e 67 65 2c | visible| change,|
|00000840| 20 61 6e 64 20 61 6d 61 | 7a 69 6e 67 6c 79 20 68 | and ama|zingly h|
|00000850| 69 67 68 20 63 6f 6d 70 | 72 65 73 73 69 6f 6e 0a |igh comp|ression.|
|00000860| 58 69 73 20 70 6f 73 73 | 69 62 6c 65 20 69 66 20 |Xis poss|ible if |
|00000870| 79 6f 75 20 63 61 6e 20 | 74 6f 6c 65 72 61 74 65 |you can |tolerate|
|00000880| 20 61 20 6c 6f 77 2d 71 | 75 61 6c 69 74 79 20 69 | a low-q|uality i|
|00000890| 6d 61 67 65 2e 20 20 59 | 6f 75 20 63 61 6e 20 74 |mage. Y|ou can t|
|000008a0| 72 61 64 65 20 6f 66 66 | 20 69 6d 61 67 65 0a 58 |rade off| image.X|
|000008b0| 71 75 61 6c 69 74 79 20 | 61 67 61 69 6e 73 74 20 |quality |against |
|000008c0| 66 69 6c 65 20 73 69 7a | 65 20 62 79 20 61 64 6a |file siz|e by adj|
|000008d0| 75 73 74 69 6e 67 20 74 | 68 65 20 63 6f 6d 70 72 |usting t|he compr|
|000008e0| 65 73 73 6f 72 27 73 20 | 22 71 75 61 6c 69 74 79 |essor's |"quality|
|000008f0| 22 20 73 65 74 74 69 6e | 67 2e 0a 58 0a 58 54 68 |" settin|g..X.XTh|
|00000900| 69 73 20 66 69 6c 65 20 | 64 65 73 63 72 69 62 65 |is file |describe|
|00000910| 73 20 75 73 61 67 65 20 | 6f 66 20 74 68 65 20 73 |s usage |of the s|
|00000920| 74 61 6e 64 61 72 64 20 | 70 72 6f 67 72 61 6d 73 |tandard |programs|
|00000930| 20 22 63 6a 70 65 67 22 | 20 61 6e 64 20 22 64 6a | "cjpeg"| and "dj|
|00000940| 70 65 67 22 20 74 68 61 | 74 0a 58 63 61 6e 20 62 |peg" tha|t.Xcan b|
|00000950| 65 20 62 75 69 6c 74 20 | 64 69 72 65 63 74 6c 79 |e built |directly|
|00000960| 20 66 72 6f 6d 20 74 68 | 65 20 64 69 73 74 72 69 | from th|e distri|
|00000970| 62 75 74 65 64 20 43 20 | 63 6f 64 65 2e 20 20 53 |buted C |code. S|
|00000980| 65 65 20 74 68 65 20 52 | 45 41 44 4d 45 20 66 69 |ee the R|EADME fi|
|00000990| 6c 65 20 66 6f 72 0a 58 | 68 69 6e 74 73 20 6f 6e |le for.X|hints on|
|000009a0| 20 69 6e 63 6f 72 70 6f | 72 61 74 69 6e 67 20 74 | incorpo|rating t|
|000009b0| 68 65 20 4a 50 45 47 20 | 73 6f 66 74 77 61 72 65 |he JPEG |software|
|000009c0| 20 69 6e 74 6f 20 6f 74 | 68 65 72 20 70 72 6f 67 | into ot|her prog|
|000009d0| 72 61 6d 73 2e 0a 58 0a | 58 49 66 20 79 6f 75 20 |rams..X.|XIf you |
|000009e0| 61 72 65 20 6f 6e 20 61 | 20 55 6e 69 78 20 6d 61 |are on a| Unix ma|
|000009f0| 63 68 69 6e 65 20 79 6f | 75 20 6d 61 79 20 70 72 |chine yo|u may pr|
|00000a00| 65 66 65 72 20 74 6f 20 | 72 65 61 64 20 74 68 65 |efer to |read the|
|00000a10| 20 55 6e 69 78 2d 73 74 | 79 6c 65 20 6d 61 6e 75 | Unix-st|yle manu|
|00000a20| 61 6c 0a 58 70 61 67 65 | 73 20 69 6e 20 66 69 6c |al.Xpage|s in fil|
|00000a30| 65 73 20 63 6a 70 65 67 | 2e 31 20 61 6e 64 20 64 |es cjpeg|.1 and d|
|00000a40| 6a 70 65 67 2e 31 2e 20 | 20 42 75 74 20 61 6c 73 |jpeg.1. | But als|
|00000a50| 6f 20 73 65 65 20 74 68 | 65 20 48 49 4e 54 53 20 |o see th|e HINTS |
|00000a60| 73 65 63 74 69 6f 6e 20 | 62 65 6c 6f 77 2c 0a 58 |section |below,.X|
|00000a70| 77 68 69 63 68 20 69 73 | 20 6e 6f 74 20 70 72 65 |which is| not pre|
|00000a80| 73 65 6e 74 20 69 6e 20 | 65 69 74 68 65 72 20 6d |sent in |either m|
|00000a90| 61 6e 75 61 6c 20 70 61 | 67 65 2e 0a 58 0a 58 4e |anual pa|ge..X.XN|
|00000aa0| 4f 54 45 3a 20 74 68 65 | 20 73 77 69 74 63 68 20 |OTE: the| switch |
|00000ab0| 73 79 6e 74 61 78 20 68 | 61 73 20 62 65 65 6e 20 |syntax h|as been |
|00000ac0| 72 65 64 65 73 69 67 6e | 65 64 20 73 69 6e 63 65 |redesign|ed since|
|00000ad0| 20 74 68 65 20 76 33 20 | 72 65 6c 65 61 73 65 20 | the v3 |release |
|00000ae0| 6f 66 0a 58 63 6a 70 65 | 67 2f 64 6a 70 65 67 2e |of.Xcjpe|g/djpeg.|
|00000af0| 20 20 53 77 69 74 63 68 | 20 6e 61 6d 65 73 20 61 | Switch| names a|
|00000b00| 72 65 20 6e 6f 77 20 77 | 6f 72 64 73 20 69 6e 73 |re now w|ords ins|
|00000b10| 74 65 61 64 20 6f 66 20 | 73 69 6e 67 6c 65 20 6c |tead of |single l|
|00000b20| 65 74 74 65 72 73 2e 0a | 58 0a 58 0a 58 47 45 4e |etters..|X.X.XGEN|
|00000b30| 45 52 41 4c 20 55 53 41 | 47 45 0a 58 0a 58 57 65 |ERAL USA|GE.X.XWe|
|00000b40| 20 70 72 6f 76 69 64 65 | 20 74 77 6f 20 70 72 6f | provide| two pro|
|00000b50| 67 72 61 6d 73 2c 20 63 | 6a 70 65 67 20 74 6f 20 |grams, c|jpeg to |
|00000b60| 63 6f 6d 70 72 65 73 73 | 20 61 6e 20 69 6d 61 67 |compress| an imag|
|00000b70| 65 20 66 69 6c 65 20 69 | 6e 74 6f 20 4a 50 45 47 |e file i|nto JPEG|
|00000b80| 20 66 6f 72 6d 61 74 2c | 0a 58 61 6e 64 20 64 6a | format,|.Xand dj|
|00000b90| 70 65 67 20 74 6f 20 64 | 65 63 6f 6d 70 72 65 73 |peg to d|ecompres|
|00000ba0| 73 20 61 20 4a 50 45 47 | 20 66 69 6c 65 20 62 61 |s a JPEG| file ba|
|00000bb0| 63 6b 20 69 6e 74 6f 20 | 61 20 63 6f 6e 76 65 6e |ck into |a conven|
|00000bc0| 74 69 6f 6e 61 6c 20 69 | 6d 61 67 65 20 66 6f 72 |tional i|mage for|
|00000bd0| 6d 61 74 2e 0a 58 0a 58 | 4f 6e 20 55 6e 69 78 2d |mat..X.X|On Unix-|
|00000be0| 6c 69 6b 65 20 73 79 73 | 74 65 6d 73 2c 20 79 6f |like sys|tems, yo|
|00000bf0| 75 20 73 61 79 3a 0a 58 | 09 63 6a 70 65 67 20 5b |u say:.X|.cjpeg [|
|00000c00| 73 77 69 74 63 68 65 73 | 5d 20 5b 69 6d 61 67 65 |switches|] [image|
|00000c10| 66 69 6c 65 5d 20 3e 6a | 70 65 67 66 69 6c 65 0a |file] >j|pegfile.|
|00000c20| 58 6f 72 0a 58 09 64 6a | 70 65 67 20 5b 73 77 69 |Xor.X.dj|peg [swi|
|00000c30| 74 63 68 65 73 5d 20 5b | 6a 70 65 67 66 69 6c 65 |tches] [|jpegfile|
|00000c40| 5d 20 20 3e 69 6d 61 67 | 65 66 69 6c 65 0a 58 54 |] >imag|efile.XT|
|00000c50| 68 65 20 70 72 6f 67 72 | 61 6d 73 20 72 65 61 64 |he progr|ams read|
|00000c60| 20 74 68 65 20 73 70 65 | 63 69 66 69 65 64 20 69 | the spe|cified i|
|00000c70| 6e 70 75 74 20 66 69 6c | 65 2c 20 6f 72 20 73 74 |nput fil|e, or st|
|00000c80| 61 6e 64 61 72 64 20 69 | 6e 70 75 74 20 69 66 20 |andard i|nput if |
|00000c90| 6e 6f 6e 65 20 69 73 0a | 58 6e 61 6d 65 64 2e 20 |none is.|Xnamed. |
|00000ca0| 20 54 68 65 79 20 61 6c | 77 61 79 73 20 77 72 69 | They al|ways wri|
|00000cb0| 74 65 20 74 6f 20 73 74 | 61 6e 64 61 72 64 20 6f |te to st|andard o|
|00000cc0| 75 74 70 75 74 20 28 77 | 69 74 68 20 74 72 61 63 |utput (w|ith trac|
|00000cd0| 65 2f 65 72 72 6f 72 20 | 6d 65 73 73 61 67 65 73 |e/error |messages|
|00000ce0| 20 74 6f 0a 58 73 74 61 | 6e 64 61 72 64 20 65 72 | to.Xsta|ndard er|
|00000cf0| 72 6f 72 29 2e 20 20 54 | 68 65 73 65 20 63 6f 6e |ror). T|hese con|
|00000d00| 76 65 6e 74 69 6f 6e 73 | 20 61 72 65 20 68 61 6e |ventions| are han|
|00000d10| 64 79 20 66 6f 72 20 70 | 69 70 69 6e 67 20 69 6d |dy for p|iping im|
|00000d20| 61 67 65 73 20 62 65 74 | 77 65 65 6e 0a 58 70 72 |ages bet|ween.Xpr|
|00000d30| 6f 67 72 61 6d 73 2e 0a | 58 0a 58 4f 6e 20 6d 6f |ograms..|X.XOn mo|
|00000d40| 73 74 20 6e 6f 6e 2d 55 | 6e 69 78 20 73 79 73 74 |st non-U|nix syst|
|00000d50| 65 6d 73 2c 20 79 6f 75 | 20 73 61 79 3a 0a 58 09 |ems, you| say:.X.|
|00000d60| 63 6a 70 65 67 20 5b 73 | 77 69 74 63 68 65 73 5d |cjpeg [s|witches]|
|00000d70| 20 69 6d 61 67 65 66 69 | 6c 65 20 6a 70 65 67 66 | imagefi|le jpegf|
|00000d80| 69 6c 65 0a 58 6f 72 0a | 58 09 64 6a 70 65 67 20 |ile.Xor.|X.djpeg |
|00000d90| 5b 73 77 69 74 63 68 65 | 73 5d 20 6a 70 65 67 66 |[switche|s] jpegf|
|00000da0| 69 6c 65 20 20 69 6d 61 | 67 65 66 69 6c 65 0a 58 |ile ima|gefile.X|
|00000db0| 69 2e 65 2e 2c 20 62 6f | 74 68 20 74 68 65 20 69 |i.e., bo|th the i|
|00000dc0| 6e 70 75 74 20 61 6e 64 | 20 6f 75 74 70 75 74 20 |nput and| output |
|00000dd0| 66 69 6c 65 73 20 61 72 | 65 20 6e 61 6d 65 64 20 |files ar|e named |
|00000de0| 6f 6e 20 74 68 65 20 63 | 6f 6d 6d 61 6e 64 20 6c |on the c|ommand l|
|00000df0| 69 6e 65 2e 20 20 54 68 | 69 73 0a 58 73 74 79 6c |ine. Th|is.Xstyl|
|00000e00| 65 20 69 73 20 61 20 6c | 69 74 74 6c 65 20 6d 6f |e is a l|ittle mo|
|00000e10| 72 65 20 66 6f 6f 6c 70 | 72 6f 6f 66 2c 20 61 6e |re foolp|roof, an|
|00000e20| 64 20 69 74 20 6c 6f 73 | 65 73 20 6e 6f 20 66 75 |d it los|es no fu|
|00000e30| 6e 63 74 69 6f 6e 61 6c | 69 74 79 20 69 66 20 79 |nctional|ity if y|
|00000e40| 6f 75 20 64 6f 6e 27 74 | 0a 58 68 61 76 65 20 70 |ou don't|.Xhave p|
|00000e50| 69 70 65 73 2e 20 20 28 | 59 6f 75 20 63 61 6e 20 |ipes. (|You can |
|00000e60| 67 65 74 20 74 68 69 73 | 20 73 74 79 6c 65 20 6f |get this| style o|
|00000e70| 6e 20 55 6e 69 78 20 74 | 6f 6f 2c 20 69 66 20 79 |n Unix t|oo, if y|
|00000e80| 6f 75 20 70 72 65 66 65 | 72 2c 20 62 79 20 64 65 |ou prefe|r, by de|
|00000e90| 66 69 6e 69 6e 67 0a 58 | 54 57 4f 5f 46 49 4c 45 |fining.X|TWO_FILE|
|00000ea0| 5f 43 4f 4d 4d 41 4e 44 | 4c 49 4e 45 20 77 68 65 |_COMMAND|LINE whe|
|00000eb0| 6e 20 79 6f 75 20 63 6f | 6d 70 69 6c 65 20 74 68 |n you co|mpile th|
|00000ec0| 65 20 70 72 6f 67 72 61 | 6d 73 3b 20 73 65 65 20 |e progra|ms; see |
|00000ed0| 53 45 54 55 50 2e 29 0a | 58 0a 58 54 68 65 20 63 |SETUP.).|X.XThe c|
|00000ee0| 75 72 72 65 6e 74 6c 79 | 20 73 75 70 70 6f 72 74 |urrently| support|
|00000ef0| 65 64 20 69 6d 61 67 65 | 20 66 69 6c 65 20 66 6f |ed image| file fo|
|00000f00| 72 6d 61 74 73 20 61 72 | 65 3a 20 50 50 4d 20 28 |rmats ar|e: PPM (|
|00000f10| 50 42 4d 50 4c 55 53 20 | 63 6f 6c 6f 72 20 66 6f |PBMPLUS |color fo|
|00000f20| 72 6d 61 74 29 2c 0a 58 | 50 47 4d 20 28 50 42 4d |rmat),.X|PGM (PBM|
|00000f30| 50 4c 55 53 20 67 72 61 | 79 2d 73 63 61 6c 65 20 |PLUS gra|y-scale |
|00000f40| 66 6f 72 6d 61 74 29 2c | 20 47 49 46 2c 20 54 61 |format),| GIF, Ta|
|00000f50| 72 67 61 2c 20 61 6e 64 | 20 52 4c 45 20 28 55 74 |rga, and| RLE (Ut|
|00000f60| 61 68 20 52 61 73 74 65 | 72 20 54 6f 6f 6c 6b 69 |ah Raste|r Toolki|
|00000f70| 74 0a 58 66 6f 72 6d 61 | 74 29 2e 20 20 28 52 4c |t.Xforma|t). (RL|
|00000f80| 45 20 69 73 20 73 75 70 | 70 6f 72 74 65 64 20 6f |E is sup|ported o|
|00000f90| 6e 6c 79 20 69 66 20 74 | 68 65 20 55 52 54 20 6c |nly if t|he URT l|
|00000fa0| 69 62 72 61 72 79 20 69 | 73 20 61 76 61 69 6c 61 |ibrary i|s availa|
|00000fb0| 62 6c 65 2e 29 0a 58 63 | 6a 70 65 67 20 72 65 63 |ble.).Xc|jpeg rec|
|00000fc0| 6f 67 6e 69 7a 65 73 20 | 74 68 65 20 69 6e 70 75 |ognizes |the inpu|
|00000fd0| 74 20 69 6d 61 67 65 20 | 66 6f 72 6d 61 74 20 61 |t image |format a|
|00000fe0| 75 74 6f 6d 61 74 69 63 | 61 6c 6c 79 2c 20 77 69 |utomatic|ally, wi|
|00000ff0| 74 68 20 74 68 65 20 65 | 78 63 65 70 74 69 6f 6e |th the e|xception|
|00001000| 0a 58 6f 66 20 73 6f 6d | 65 20 54 61 72 67 61 2d |.Xof som|e Targa-|
|00001010| 66 6f 72 6d 61 74 20 66 | 69 6c 65 73 2e 20 20 59 |format f|iles. Y|
|00001020| 6f 75 20 68 61 76 65 20 | 74 6f 20 74 65 6c 6c 20 |ou have |to tell |
|00001030| 64 6a 70 65 67 20 77 68 | 69 63 68 20 66 6f 72 6d |djpeg wh|ich form|
|00001040| 61 74 20 74 6f 20 67 65 | 6e 65 72 61 74 65 2e 0a |at to ge|nerate..|
|00001050| 58 0a 58 54 68 65 20 6f | 6e 6c 79 20 4a 50 45 47 |X.XThe o|nly JPEG|
|00001060| 20 66 69 6c 65 20 66 6f | 72 6d 61 74 20 63 75 72 | file fo|rmat cur|
|00001070| 72 65 6e 74 6c 79 20 73 | 75 70 70 6f 72 74 65 64 |rently s|upported|
|00001080| 20 69 73 20 74 68 65 20 | 4a 46 49 46 20 66 6f 72 | is the |JFIF for|
|00001090| 6d 61 74 2e 20 20 53 75 | 70 70 6f 72 74 20 66 6f |mat. Su|pport fo|
|000010a0| 72 0a 58 74 68 65 20 54 | 49 46 46 20 36 2e 30 20 |r.Xthe T|IFF 6.0 |
|000010b0| 4a 50 45 47 20 66 6f 72 | 6d 61 74 20 77 69 6c 6c |JPEG for|mat will|
|000010c0| 20 70 72 6f 62 61 62 6c | 79 20 62 65 20 61 64 64 | probabl|y be add|
|000010d0| 65 64 20 61 74 20 73 6f | 6d 65 20 66 75 74 75 72 |ed at so|me futur|
|000010e0| 65 20 64 61 74 65 2e 0a | 58 0a 58 41 6c 6c 20 73 |e date..|X.XAll s|
|000010f0| 77 69 74 63 68 20 6e 61 | 6d 65 73 20 6d 61 79 20 |witch na|mes may |
|00001100| 62 65 20 61 62 62 72 65 | 76 69 61 74 65 64 3b 20 |be abbre|viated; |
|00001110| 66 6f 72 20 65 78 61 6d | 70 6c 65 2c 20 2d 67 72 |for exam|ple, -gr|
|00001120| 61 79 73 63 61 6c 65 20 | 6d 61 79 20 62 65 20 77 |ayscale |may be w|
|00001130| 72 69 74 74 65 6e 0a 58 | 2d 67 72 61 79 20 6f 72 |ritten.X|-gray or|
|00001140| 20 2d 67 72 2e 20 20 4d | 6f 73 74 20 6f 66 20 74 | -gr. M|ost of t|
|00001150| 68 65 20 22 62 61 73 69 | 63 22 20 73 77 69 74 63 |he "basi|c" switc|
|00001160| 68 65 73 20 63 61 6e 20 | 62 65 20 61 62 62 72 65 |hes can |be abbre|
|00001170| 76 69 61 74 65 64 20 74 | 6f 20 61 73 20 6c 69 74 |viated t|o as lit|
|00001180| 74 6c 65 20 61 73 0a 58 | 6f 6e 65 20 6c 65 74 74 |tle as.X|one lett|
|00001190| 65 72 2e 20 20 55 70 70 | 65 72 20 61 6e 64 20 6c |er. Upp|er and l|
|000011a0| 6f 77 65 72 20 63 61 73 | 65 20 61 72 65 20 65 71 |ower cas|e are eq|
|000011b0| 75 69 76 61 6c 65 6e 74 | 20 28 2d 47 49 46 20 69 |uivalent| (-GIF i|
|000011c0| 73 20 74 68 65 20 73 61 | 6d 65 20 61 73 20 2d 67 |s the sa|me as -g|
|000011d0| 69 66 29 2e 0a 58 42 72 | 69 74 69 73 68 20 73 70 |if)..XBr|itish sp|
|000011e0| 65 6c 6c 69 6e 67 73 20 | 61 72 65 20 61 6c 73 6f |ellings |are also|
|000011f0| 20 61 63 63 65 70 74 65 | 64 20 28 65 2e 67 2e 2c | accepte|d (e.g.,|
|00001200| 20 2d 67 72 65 79 73 63 | 61 6c 65 29 2c 20 74 68 | -greysc|ale), th|
|00001210| 6f 75 67 68 20 66 6f 72 | 20 62 72 65 76 69 74 79 |ough for| brevity|
|00001220| 0a 58 74 68 65 73 65 20 | 61 72 65 20 6e 6f 74 20 |.Xthese |are not |
|00001230| 6d 65 6e 74 69 6f 6e 65 | 64 20 62 65 6c 6f 77 2e |mentione|d below.|
|00001240| 0a 58 0a 58 0a 58 43 4a | 50 45 47 20 44 45 54 41 |.X.X.XCJ|PEG DETA|
|00001250| 49 4c 53 0a 58 0a 58 54 | 68 65 20 62 61 73 69 63 |ILS.X.XT|he basic|
|00001260| 20 63 6f 6d 6d 61 6e 64 | 20 6c 69 6e 65 20 73 77 | command| line sw|
|00001270| 69 74 63 68 65 73 20 66 | 6f 72 20 63 6a 70 65 67 |itches f|or cjpeg|
|00001280| 20 61 72 65 3a 0a 58 0a | 58 09 2d 71 75 61 6c 69 | are:.X.|X.-quali|
|00001290| 74 79 20 4e 09 53 63 61 | 6c 65 20 71 75 61 6e 74 |ty N.Sca|le quant|
|000012a0| 69 7a 61 74 69 6f 6e 20 | 74 61 62 6c 65 73 20 74 |ization |tables t|
|000012b0| 6f 20 61 64 6a 75 73 74 | 20 69 6d 61 67 65 20 71 |o adjust| image q|
|000012c0| 75 61 6c 69 74 79 2e 0a | 58 09 09 09 51 75 61 6c |uality..|X...Qual|
|000012d0| 69 74 79 20 69 73 20 30 | 20 28 77 6f 72 73 74 29 |ity is 0| (worst)|
|000012e0| 20 74 6f 20 31 30 30 20 | 28 62 65 73 74 29 3b 20 | to 100 |(best); |
|000012f0| 64 65 66 61 75 6c 74 20 | 69 73 20 37 35 2e 0a 58 |default |is 75..X|
|00001300| 09 09 09 28 53 65 65 20 | 62 65 6c 6f 77 20 66 6f |...(See |below fo|
|00001310| 72 20 6d 6f 72 65 20 69 | 6e 66 6f 2e 29 0a 58 0a |r more i|nfo.).X.|
|00001320| 58 09 2d 67 72 61 79 73 | 63 61 6c 65 09 43 72 65 |X.-grays|cale.Cre|
|00001330| 61 74 65 20 6d 6f 6e 6f | 63 68 72 6f 6d 65 20 4a |ate mono|chrome J|
|00001340| 50 45 47 20 66 69 6c 65 | 20 66 72 6f 6d 20 63 6f |PEG file| from co|
|00001350| 6c 6f 72 20 69 6e 70 75 | 74 2e 0a 58 09 09 09 42 |lor inpu|t..X...B|
|00001360| 65 20 73 75 72 65 20 74 | 6f 20 75 73 65 20 74 68 |e sure t|o use th|
|00001370| 69 73 20 73 77 69 74 63 | 68 20 77 68 65 6e 20 63 |is switc|h when c|
|00001380| 6f 6d 70 72 65 73 73 69 | 6e 67 20 61 20 67 72 61 |ompressi|ng a gra|
|00001390| 79 73 63 61 6c 65 0a 58 | 09 09 09 47 49 46 20 66 |yscale.X|...GIF f|
|000013a0| 69 6c 65 2c 20 62 65 63 | 61 75 73 65 20 63 6a 70 |ile, bec|ause cjp|
|000013b0| 65 67 20 69 73 6e 27 74 | 20 62 72 69 67 68 74 20 |eg isn't| bright |
|000013c0| 65 6e 6f 75 67 68 20 74 | 6f 20 6e 6f 74 69 63 65 |enough t|o notice|
|000013d0| 0a 58 09 09 09 77 68 65 | 74 68 65 72 20 61 20 47 |.X...whe|ther a G|
|000013e0| 49 46 20 66 69 6c 65 20 | 75 73 65 73 20 6f 6e 6c |IF file |uses onl|
|000013f0| 79 20 73 68 61 64 65 73 | 20 6f 66 20 67 72 61 79 |y shades| of gray|
|00001400| 2e 20 20 42 79 0a 58 09 | 09 09 73 61 79 69 6e 67 |. By.X.|..saying|
|00001410| 20 2d 67 72 61 79 73 63 | 61 6c 65 2c 20 79 6f 75 | -graysc|ale, you|
|00001420| 27 6c 6c 20 67 65 74 20 | 61 20 73 6d 61 6c 6c 65 |'ll get |a smalle|
|00001430| 72 20 4a 50 45 47 20 66 | 69 6c 65 20 74 68 61 74 |r JPEG f|ile that|
|00001440| 0a 58 09 09 09 74 61 6b | 65 73 20 6c 65 73 73 20 |.X...tak|es less |
|00001450| 74 69 6d 65 20 74 6f 20 | 70 72 6f 63 65 73 73 2e |time to |process.|
|00001460| 0a 58 0a 58 09 2d 6f 70 | 74 69 6d 69 7a 65 09 50 |.X.X.-op|timize.P|
|00001470| 65 72 66 6f 72 6d 20 6f | 70 74 69 6d 69 7a 61 74 |erform o|ptimizat|
|00001480| 69 6f 6e 20 6f 66 20 65 | 6e 74 72 6f 70 79 20 65 |ion of e|ntropy e|
|00001490| 6e 63 6f 64 69 6e 67 20 | 70 61 72 61 6d 65 74 65 |ncoding |paramete|
|000014a0| 72 73 2e 0a 58 09 09 09 | 57 69 74 68 6f 75 74 20 |rs..X...|Without |
|000014b0| 74 68 69 73 2c 20 64 65 | 66 61 75 6c 74 20 65 6e |this, de|fault en|
|000014c0| 63 6f 64 69 6e 67 20 70 | 61 72 61 6d 65 74 65 72 |coding p|arameter|
|000014d0| 73 20 61 72 65 20 75 73 | 65 64 2e 0a 58 09 09 09 |s are us|ed..X...|
|000014e0| 2d 6f 70 74 69 6d 69 7a | 65 20 75 73 75 61 6c 6c |-optimiz|e usuall|
|000014f0| 79 20 6d 61 6b 65 73 20 | 74 68 65 20 4a 50 45 47 |y makes |the JPEG|
|00001500| 20 66 69 6c 65 20 61 20 | 6c 69 74 74 6c 65 20 73 | file a |little s|
|00001510| 6d 61 6c 6c 65 72 2c 0a | 58 09 09 09 62 75 74 20 |maller,.|X...but |
|00001520| 63 6a 70 65 67 20 72 75 | 6e 73 20 73 6f 6d 65 77 |cjpeg ru|ns somew|
|00001530| 68 61 74 20 73 6c 6f 77 | 65 72 20 61 6e 64 20 6e |hat slow|er and n|
|00001540| 65 65 64 73 20 6d 75 63 | 68 20 6d 6f 72 65 0a 58 |eeds muc|h more.X|
|00001550| 09 09 09 6d 65 6d 6f 72 | 79 2e 20 20 49 6d 61 67 |...memor|y. Imag|
|00001560| 65 20 71 75 61 6c 69 74 | 79 20 61 6e 64 20 73 70 |e qualit|y and sp|
|00001570| 65 65 64 20 6f 66 20 64 | 65 63 6f 6d 70 72 65 73 |eed of d|ecompres|
|00001580| 73 69 6f 6e 20 61 72 65 | 0a 58 09 09 09 75 6e 61 |sion are|.X...una|
|00001590| 66 66 65 63 74 65 64 20 | 62 79 20 2d 6f 70 74 69 |ffected |by -opti|
|000015a0| 6d 69 7a 65 2e 0a 58 0a | 58 09 2d 74 61 72 67 61 |mize..X.|X.-targa|
|000015b0| 09 09 49 6e 70 75 74 20 | 66 69 6c 65 20 69 73 20 |..Input |file is |
|000015c0| 54 61 72 67 61 20 66 6f | 72 6d 61 74 2e 20 20 54 |Targa fo|rmat. T|
|000015d0| 61 72 67 61 20 66 69 6c | 65 73 20 74 68 61 74 20 |arga fil|es that |
|000015e0| 63 6f 6e 74 61 69 6e 0a | 58 09 09 09 61 6e 20 22 |contain.|X...an "|
|000015f0| 69 64 65 6e 74 69 66 69 | 63 61 74 69 6f 6e 22 20 |identifi|cation" |
|00001600| 66 69 65 6c 64 20 77 69 | 6c 6c 20 6e 6f 74 20 62 |field wi|ll not b|
|00001610| 65 20 61 75 74 6f 6d 61 | 74 69 63 61 6c 6c 79 0a |e automa|tically.|
|00001620| 58 09 09 09 72 65 63 6f | 67 6e 69 7a 65 64 20 62 |X...reco|gnized b|
|00001630| 79 20 63 6a 70 65 67 3b | 20 66 6f 72 20 73 75 63 |y cjpeg;| for suc|
|00001640| 68 20 66 69 6c 65 73 20 | 79 6f 75 20 6d 75 73 74 |h files |you must|
|00001650| 20 73 70 65 63 69 66 79 | 0a 58 09 09 09 2d 74 61 | specify|.X...-ta|
|00001660| 72 67 61 20 74 6f 20 6d | 61 6b 65 20 63 6a 70 65 |rga to m|ake cjpe|
|00001670| 67 20 74 72 65 61 74 20 | 74 68 65 20 69 6e 70 75 |g treat |the inpu|
|00001680| 74 20 61 73 20 54 61 72 | 67 61 20 66 6f 72 6d 61 |t as Tar|ga forma|
|00001690| 74 2e 0a 58 0a 58 54 68 | 65 20 2d 71 75 61 6c 69 |t..X.XTh|e -quali|
|000016a0| 74 79 20 73 77 69 74 63 | 68 20 6c 65 74 73 20 79 |ty switc|h lets y|
|000016b0| 6f 75 20 74 72 61 64 65 | 20 6f 66 66 20 63 6f 6d |ou trade| off com|
|000016c0| 70 72 65 73 73 65 64 20 | 66 69 6c 65 20 73 69 7a |pressed |file siz|
|000016d0| 65 20 61 67 61 69 6e 73 | 74 20 71 75 61 6c 69 74 |e agains|t qualit|
|000016e0| 79 20 6f 66 0a 58 74 68 | 65 20 72 65 63 6f 6e 73 |y of.Xth|e recons|
|000016f0| 74 72 75 63 74 65 64 20 | 69 6d 61 67 65 3a 20 74 |tructed |image: t|
|00001700| 68 65 20 68 69 67 68 65 | 72 20 74 68 65 20 71 75 |he highe|r the qu|
|00001710| 61 6c 69 74 79 20 73 65 | 74 74 69 6e 67 2c 20 74 |ality se|tting, t|
|00001720| 68 65 20 6c 61 72 67 65 | 72 20 74 68 65 20 4a 50 |he large|r the JP|
|00001730| 45 47 0a 58 66 69 6c 65 | 2c 20 61 6e 64 20 74 68 |EG.Xfile|, and th|
|00001740| 65 20 63 6c 6f 73 65 72 | 20 74 68 65 20 6f 75 74 |e closer| the out|
|00001750| 70 75 74 20 69 6d 61 67 | 65 20 77 69 6c 6c 20 62 |put imag|e will b|
|00001760| 65 20 74 6f 20 74 68 65 | 20 6f 72 69 67 69 6e 61 |e to the| origina|
|00001770| 6c 20 69 6e 70 75 74 2e | 20 20 4e 6f 72 6d 61 6c |l input.| Normal|
|00001780| 6c 79 0a 58 79 6f 75 20 | 77 61 6e 74 20 74 6f 20 |ly.Xyou |want to |
|00001790| 75 73 65 20 74 68 65 20 | 6c 6f 77 65 73 74 20 71 |use the |lowest q|
|000017a0| 75 61 6c 69 74 79 20 73 | 65 74 74 69 6e 67 20 28 |uality s|etting (|
|000017b0| 73 6d 61 6c 6c 65 73 74 | 20 66 69 6c 65 29 20 74 |smallest| file) t|
|000017c0| 68 61 74 20 64 65 63 6f | 6d 70 72 65 73 73 65 73 |hat deco|mpresses|
|000017d0| 0a 58 69 6e 74 6f 20 73 | 6f 6d 65 74 68 69 6e 67 |.Xinto s|omething|
|000017e0| 20 76 69 73 75 61 6c 6c | 79 20 69 6e 64 69 73 74 | visuall|y indist|
|000017f0| 69 6e 67 75 69 73 68 61 | 62 6c 65 20 66 72 6f 6d |inguisha|ble from|
|00001800| 20 74 68 65 20 6f 72 69 | 67 69 6e 61 6c 20 69 6d | the ori|ginal im|
|00001810| 61 67 65 2e 20 20 46 6f | 72 20 74 68 69 73 0a 58 |age. Fo|r this.X|
|00001820| 70 75 72 70 6f 73 65 20 | 74 68 65 20 71 75 61 6c |purpose |the qual|
|00001830| 69 74 79 20 73 65 74 74 | 69 6e 67 20 73 68 6f 75 |ity sett|ing shou|
|00001840| 6c 64 20 62 65 20 62 65 | 74 77 65 65 6e 20 35 30 |ld be be|tween 50|
|00001850| 20 61 6e 64 20 39 35 3b | 20 74 68 65 20 64 65 66 | and 95;| the def|
|00001860| 61 75 6c 74 20 6f 66 20 | 37 35 20 69 73 0a 58 6f |ault of |75 is.Xo|
|00001870| 66 74 65 6e 20 61 62 6f | 75 74 20 72 69 67 68 74 |ften abo|ut right|
|00001880| 2e 20 20 49 66 20 79 6f | 75 20 73 65 65 20 64 65 |. If yo|u see de|
|00001890| 66 65 63 74 73 20 61 74 | 20 2d 71 75 61 6c 69 74 |fects at| -qualit|
|000018a0| 79 20 37 35 2c 20 74 68 | 65 6e 20 67 6f 20 75 70 |y 75, th|en go up|
|000018b0| 20 35 20 6f 72 20 31 30 | 0a 58 63 6f 75 6e 74 73 | 5 or 10|.Xcounts|
|000018c0| 20 61 74 20 61 20 74 69 | 6d 65 20 75 6e 74 69 6c | at a ti|me until|
|000018d0| 20 79 6f 75 20 61 72 65 | 20 68 61 70 70 79 20 77 | you are| happy w|
|000018e0| 69 74 68 20 74 68 65 20 | 6f 75 74 70 75 74 20 69 |ith the |output i|
|000018f0| 6d 61 67 65 2e 20 20 28 | 54 68 65 20 6f 70 74 69 |mage. (|The opti|
|00001900| 6d 61 6c 0a 58 73 65 74 | 74 69 6e 67 20 77 69 6c |mal.Xset|ting wil|
|00001910| 6c 20 76 61 72 79 20 66 | 72 6f 6d 20 6f 6e 65 20 |l vary f|rom one |
|00001920| 69 6d 61 67 65 20 74 6f | 20 61 6e 6f 74 68 65 72 |image to| another|
|00001930| 2e 29 0a 58 0a 58 2d 71 | 75 61 6c 69 74 79 20 31 |.).X.X-q|uality 1|
|00001940| 30 30 20 77 69 6c 6c 20 | 67 65 6e 65 72 61 74 65 |00 will |generate|
|00001950| 20 61 20 71 75 61 6e 74 | 69 7a 61 74 69 6f 6e 20 | a quant|ization |
|00001960| 74 61 62 6c 65 20 6f 66 | 20 61 6c 6c 20 31 27 73 |table of| all 1's|
|00001970| 2c 20 65 6c 69 6d 69 6e | 61 74 69 6e 67 20 6c 6f |, elimin|ating lo|
|00001980| 73 73 0a 58 69 6e 20 74 | 68 65 20 71 75 61 6e 74 |ss.Xin t|he quant|
|00001990| 69 7a 61 74 69 6f 6e 20 | 73 74 65 70 20 28 62 75 |ization |step (bu|
|000019a0| 74 20 74 68 65 72 65 20 | 69 73 20 73 74 69 6c 6c |t there |is still|
|000019b0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 6c 6f 73 | informa|tion los|
|000019c0| 73 20 69 6e 20 73 75 62 | 73 61 6d 70 6c 69 6e 67 |s in sub|sampling|
|000019d0| 2c 0a 58 61 73 20 77 65 | 6c 6c 20 61 73 20 72 6f |,.Xas we|ll as ro|
|000019e0| 75 6e 64 6f 66 66 20 65 | 72 72 6f 72 29 2e 20 20 |undoff e|rror). |
|000019f0| 54 68 69 73 20 73 65 74 | 74 69 6e 67 20 69 73 20 |This set|ting is |
|00001a00| 6d 61 69 6e 6c 79 20 6f | 66 20 69 6e 74 65 72 65 |mainly o|f intere|
|00001a10| 73 74 20 66 6f 72 0a 58 | 65 78 70 65 72 69 6d 65 |st for.X|experime|
|00001a20| 6e 74 61 6c 20 70 75 72 | 70 6f 73 65 73 2e 20 20 |ntal pur|poses. |
|00001a30| 51 75 61 6c 69 74 79 20 | 76 61 6c 75 65 73 20 61 |Quality |values a|
|00001a40| 62 6f 76 65 20 61 62 6f | 75 74 20 39 35 20 61 72 |bove abo|ut 95 ar|
|00001a50| 65 20 4e 4f 54 20 72 65 | 63 6f 6d 6d 65 6e 64 65 |e NOT re|commende|
|00001a60| 64 20 66 6f 72 0a 58 6e | 6f 72 6d 61 6c 20 75 73 |d for.Xn|ormal us|
|00001a70| 65 3b 20 74 68 65 20 63 | 6f 6d 70 72 65 73 73 65 |e; the c|ompresse|
|00001a80| 64 20 66 69 6c 65 20 73 | 69 7a 65 20 67 6f 65 73 |d file s|ize goes|
|00001a90| 20 75 70 20 64 72 61 6d | 61 74 69 63 61 6c 6c 79 | up dram|atically|
|00001aa0| 20 66 6f 72 20 68 61 72 | 64 6c 79 20 61 6e 79 20 | for har|dly any |
|00001ab0| 67 61 69 6e 0a 58 69 6e | 20 6f 75 74 70 75 74 20 |gain.Xin| output |
|00001ac0| 69 6d 61 67 65 20 71 75 | 61 6c 69 74 79 2e 0a 58 |image qu|ality..X|
|00001ad0| 0a 58 49 6e 20 74 68 65 | 20 6f 74 68 65 72 20 64 |.XIn the| other d|
|00001ae0| 69 72 65 63 74 69 6f 6e | 2c 20 71 75 61 6c 69 74 |irection|, qualit|
|00001af0| 79 20 76 61 6c 75 65 73 | 20 62 65 6c 6f 77 20 35 |y values| below 5|
|00001b00| 30 20 77 69 6c 6c 20 70 | 72 6f 64 75 63 65 20 76 |0 will p|roduce v|
|00001b10| 65 72 79 20 73 6d 61 6c | 6c 20 66 69 6c 65 73 0a |ery smal|l files.|
|00001b20| 58 6f 66 20 6c 6f 77 20 | 69 6d 61 67 65 20 71 75 |Xof low |image qu|
|00001b30| 61 6c 69 74 79 2e 20 20 | 53 65 74 74 69 6e 67 73 |ality. |Settings|
|00001b40| 20 61 72 6f 75 6e 64 20 | 35 20 74 6f 20 31 30 20 | around |5 to 10 |
|00001b50| 6d 69 67 68 74 20 62 65 | 20 75 73 65 66 75 6c 20 |might be| useful |
|00001b60| 69 6e 20 70 72 65 70 61 | 72 69 6e 67 20 61 6e 0a |in prepa|ring an.|
|00001b70| 58 69 6e 64 65 78 20 6f | 66 20 61 20 6c 61 72 67 |Xindex o|f a larg|
|00001b80| 65 20 69 6d 61 67 65 20 | 6c 69 62 72 61 72 79 2c |e image |library,|
|00001b90| 20 66 6f 72 20 65 78 61 | 6d 70 6c 65 2e 20 20 54 | for exa|mple. T|
|00001ba0| 72 79 20 2d 71 75 61 6c | 69 74 79 20 32 20 28 6f |ry -qual|ity 2 (o|
|00001bb0| 72 20 73 6f 29 20 66 6f | 72 20 73 6f 6d 65 0a 58 |r so) fo|r some.X|
|00001bc0| 61 6d 75 73 69 6e 67 20 | 43 75 62 69 73 74 20 65 |amusing |Cubist e|
|00001bd0| 66 66 65 63 74 73 2e 20 | 20 28 4e 6f 74 65 3a 20 |ffects. | (Note: |
|00001be0| 71 75 61 6c 69 74 79 20 | 76 61 6c 75 65 73 20 62 |quality |values b|
|00001bf0| 65 6c 6f 77 20 61 62 6f | 75 74 20 32 35 20 67 65 |elow abo|ut 25 ge|
|00001c00| 6e 65 72 61 74 65 20 32 | 2d 62 79 74 65 0a 58 71 |nerate 2|-byte.Xq|
|00001c10| 75 61 6e 74 69 7a 61 74 | 69 6f 6e 20 74 61 62 6c |uantizat|ion tabl|
|00001c20| 65 73 2c 20 77 68 69 63 | 68 20 61 72 65 20 63 6f |es, whic|h are co|
|00001c30| 6e 73 69 64 65 72 65 64 | 20 6f 70 74 69 6f 6e 61 |nsidered| optiona|
|00001c40| 6c 20 69 6e 20 74 68 65 | 20 4a 50 45 47 20 73 74 |l in the| JPEG st|
|00001c50| 61 6e 64 61 72 64 2e 0a | 58 63 6a 70 65 67 20 65 |andard..|Xcjpeg e|
|00001c60| 6d 69 74 73 20 61 20 77 | 61 72 6e 69 6e 67 20 6d |mits a w|arning m|
|00001c70| 65 73 73 61 67 65 20 77 | 68 65 6e 20 79 6f 75 20 |essage w|hen you |
|00001c80| 67 69 76 65 20 73 75 63 | 68 20 61 20 71 75 61 6c |give suc|h a qual|
|00001c90| 69 74 79 20 76 61 6c 75 | 65 2c 20 62 65 63 61 75 |ity valu|e, becau|
|00001ca0| 73 65 0a 58 73 6f 6d 65 | 20 63 6f 6d 6d 65 72 63 |se.Xsome| commerc|
|00001cb0| 69 61 6c 20 4a 50 45 47 | 20 70 72 6f 67 72 61 6d |ial JPEG| program|
|00001cc0| 73 20 6d 61 79 20 62 65 | 20 75 6e 61 62 6c 65 20 |s may be| unable |
|00001cd0| 74 6f 20 64 65 63 6f 64 | 65 20 74 68 65 20 72 65 |to decod|e the re|
|00001ce0| 73 75 6c 74 69 6e 67 20 | 66 69 6c 65 2e 29 0a 58 |sulting |file.).X|
|00001cf0| 0a 58 53 77 69 74 63 68 | 65 73 20 66 6f 72 20 61 |.XSwitch|es for a|
|00001d00| 64 76 61 6e 63 65 64 20 | 75 73 65 72 73 3a 0a 58 |dvanced |users:.X|
|00001d10| 0a 58 09 2d 6d 61 78 6d | 65 6d 6f 72 79 20 4e 09 |.X.-maxm|emory N.|
|00001d20| 53 65 74 20 6c 69 6d 69 | 74 20 66 6f 72 20 61 6d |Set limi|t for am|
|00001d30| 6f 75 6e 74 20 6f 66 20 | 6d 65 6d 6f 72 79 20 74 |ount of |memory t|
|00001d40| 6f 20 75 73 65 20 69 6e | 20 70 72 6f 63 65 73 73 |o use in| process|
|00001d50| 69 6e 67 0a 58 09 09 09 | 6c 61 72 67 65 20 69 6d |ing.X...|large im|
|00001d60| 61 67 65 73 2e 20 20 56 | 61 6c 75 65 20 69 73 20 |ages. V|alue is |
|00001d70| 69 6e 20 74 68 6f 75 73 | 61 6e 64 73 20 6f 66 20 |in thous|ands of |
|00001d80| 62 79 74 65 73 2c 20 6f | 72 0a 58 09 09 09 6d 69 |bytes, o|r.X...mi|
|00001d90| 6c 6c 69 6f 6e 73 20 6f | 66 20 62 79 74 65 73 20 |llions o|f bytes |
|00001da0| 69 66 20 22 4d 22 20 69 | 73 20 61 74 74 61 63 68 |if "M" i|s attach|
|00001db0| 65 64 20 74 6f 20 74 68 | 65 20 6e 75 6d 62 65 72 |ed to th|e number|
|00001dc0| 2e 0a 58 09 09 09 46 6f | 72 20 65 78 61 6d 70 6c |..X...Fo|r exampl|
|00001dd0| 65 2c 20 2d 6d 61 78 20 | 34 6d 20 73 65 6c 65 63 |e, -max |4m selec|
|00001de0| 74 73 20 34 30 30 30 30 | 30 30 20 62 79 74 65 73 |ts 40000|00 bytes|
|00001df0| 2e 20 20 49 66 20 6d 6f | 72 65 0a 58 09 09 09 73 |. If mo|re.X...s|
|00001e00| 70 61 63 65 20 69 73 20 | 6e 65 65 64 65 64 2c 20 |pace is |needed, |
|00001e10| 74 65 6d 70 6f 72 61 72 | 79 20 66 69 6c 65 73 20 |temporar|y files |
|00001e20| 77 69 6c 6c 20 62 65 20 | 75 73 65 64 2e 0a 58 0a |will be |used..X.|
|00001e30| 58 09 2d 72 65 73 74 61 | 72 74 20 4e 09 45 6d 69 |X.-resta|rt N.Emi|
|00001e40| 74 20 61 20 4a 50 45 47 | 20 72 65 73 74 61 72 74 |t a JPEG| restart|
|00001e50| 20 6d 61 72 6b 65 72 20 | 65 76 65 72 79 20 4e 20 | marker |every N |
|00001e60| 4d 43 55 20 72 6f 77 73 | 2c 20 6f 72 20 65 76 65 |MCU rows|, or eve|
|00001e70| 72 79 0a 58 09 09 09 4e | 20 4d 43 55 20 62 6c 6f |ry.X...N| MCU blo|
|00001e80| 63 6b 73 20 69 66 20 22 | 42 22 20 69 73 20 61 74 |cks if "|B" is at|
|00001e90| 74 61 63 68 65 64 20 74 | 6f 20 74 68 65 20 6e 75 |tached t|o the nu|
|00001ea0| 6d 62 65 72 2e 0a 58 09 | 09 09 2d 72 65 73 74 61 |mber..X.|..-resta|
|00001eb0| 72 74 20 30 20 28 74 68 | 65 20 64 65 66 61 75 6c |rt 0 (th|e defaul|
|00001ec0| 74 29 20 6d 65 61 6e 73 | 20 6e 6f 20 72 65 73 74 |t) means| no rest|
|00001ed0| 61 72 74 20 6d 61 72 6b | 65 72 73 2e 0a 58 0a 58 |art mark|ers..X.X|
|00001ee0| 09 2d 73 6d 6f 6f 74 68 | 20 4e 09 53 6d 6f 6f 74 |.-smooth| N.Smoot|
|00001ef0| 68 20 74 68 65 20 69 6e | 70 75 74 20 69 6d 61 67 |h the in|put imag|
|00001f00| 65 20 74 6f 20 65 6c 69 | 6d 69 6e 61 74 65 20 64 |e to eli|minate d|
|00001f10| 69 74 68 65 72 69 6e 67 | 20 6e 6f 69 73 65 2e 0a |ithering| noise..|
|00001f20| 58 09 09 09 4e 2c 20 72 | 61 6e 67 69 6e 67 20 66 |X...N, r|anging f|
|00001f30| 72 6f 6d 20 31 20 74 6f | 20 31 30 30 2c 20 69 6e |rom 1 to| 100, in|
|00001f40| 64 69 63 61 74 65 73 20 | 74 68 65 20 73 74 72 65 |dicates |the stre|
|00001f50| 6e 67 74 68 20 6f 66 0a | 58 09 09 09 73 6d 6f 6f |ngth of.|X...smoo|
|00001f60| 74 68 69 6e 67 2e 20 20 | 30 20 28 74 68 65 20 64 |thing. |0 (the d|
|00001f70| 65 66 61 75 6c 74 29 20 | 6d 65 61 6e 73 20 6e 6f |efault) |means no|
|00001f80| 20 73 6d 6f 6f 74 68 69 | 6e 67 2e 0a 58 0a 58 09 | smoothi|ng..X.X.|
|00001f90| 2d 76 65 72 62 6f 73 65 | 09 45 6e 61 62 6c 65 20 |-verbose|.Enable |
|00001fa0| 64 65 62 75 67 20 70 72 | 69 6e 74 6f 75 74 2e 20 |debug pr|intout. |
|00001fb0| 20 4d 6f 72 65 20 2d 76 | 27 73 20 67 69 76 65 20 | More -v|'s give |
|00001fc0| 6d 6f 72 65 20 70 72 69 | 6e 74 6f 75 74 2e 0a 58 |more pri|ntout..X|
|00001fd0| 09 6f 72 20 20 2d 64 65 | 62 75 67 09 41 6c 73 6f |.or -de|bug.Also|
|00001fe0| 2c 20 76 65 72 73 69 6f | 6e 20 69 6e 66 6f 72 6d |, versio|n inform|
|00001ff0| 61 74 69 6f 6e 20 69 73 | 20 70 72 69 6e 74 65 64 |ation is| printed|
|00002000| 20 61 74 20 73 74 61 72 | 74 75 70 2e 0a 58 0a 58 | at star|tup..X.X|
|00002010| 54 68 65 20 2d 72 65 73 | 74 61 72 74 20 6f 70 74 |The -res|tart opt|
|00002020| 69 6f 6e 20 69 6e 73 65 | 72 74 73 20 65 78 74 72 |ion inse|rts extr|
|00002030| 61 20 6d 61 72 6b 65 72 | 73 20 74 68 61 74 20 61 |a marker|s that a|
|00002040| 6c 6c 6f 77 20 61 20 4a | 50 45 47 20 64 65 63 6f |llow a J|PEG deco|
|00002050| 64 65 72 20 74 6f 0a 58 | 72 65 73 79 6e 63 68 72 |der to.X|resynchr|
|00002060| 6f 6e 69 7a 65 20 61 66 | 74 65 72 20 61 20 74 72 |onize af|ter a tr|
|00002070| 61 6e 73 6d 69 73 73 69 | 6f 6e 20 65 72 72 6f 72 |ansmissi|on error|
|00002080| 2e 20 20 57 69 74 68 6f | 75 74 20 72 65 73 74 61 |. Witho|ut resta|
|00002090| 72 74 20 6d 61 72 6b 65 | 72 73 2c 20 61 6e 79 20 |rt marke|rs, any |
|000020a0| 64 61 6d 61 67 65 0a 58 | 74 6f 20 61 20 63 6f 6d |damage.X|to a com|
|000020b0| 70 72 65 73 73 65 64 20 | 66 69 6c 65 20 77 69 6c |pressed |file wil|
|000020c0| 6c 20 75 73 75 61 6c 6c | 79 20 72 75 69 6e 20 74 |l usuall|y ruin t|
|000020d0| 68 65 20 69 6d 61 67 65 | 20 66 72 6f 6d 20 74 68 |he image| from th|
|000020e0| 65 20 70 6f 69 6e 74 20 | 6f 66 20 74 68 65 20 65 |e point |of the e|
|000020f0| 72 72 6f 72 0a 58 74 6f | 20 74 68 65 20 65 6e 64 |rror.Xto| the end|
|00002100| 20 6f 66 20 74 68 65 20 | 69 6d 61 67 65 3b 20 77 | of the |image; w|
|00002110| 69 74 68 20 72 65 73 74 | 61 72 74 20 6d 61 72 6b |ith rest|art mark|
|00002120| 65 72 73 2c 20 74 68 65 | 20 64 61 6d 61 67 65 20 |ers, the| damage |
|00002130| 69 73 20 75 73 75 61 6c | 6c 79 20 63 6f 6e 66 69 |is usual|ly confi|
|00002140| 6e 65 64 0a 58 74 6f 20 | 74 68 65 20 70 6f 72 74 |ned.Xto |the port|
|00002150| 69 6f 6e 20 6f 66 20 74 | 68 65 20 69 6d 61 67 65 |ion of t|he image|
|00002160| 20 75 70 20 74 6f 20 74 | 68 65 20 6e 65 78 74 20 | up to t|he next |
|00002170| 72 65 73 74 61 72 74 20 | 6d 61 72 6b 65 72 2e 20 |restart |marker. |
|00002180| 20 4f 66 20 63 6f 75 72 | 73 65 2c 20 74 68 65 0a | Of cour|se, the.|
|00002190| 58 72 65 73 74 61 72 74 | 20 6d 61 72 6b 65 72 73 |Xrestart| markers|
|000021a0| 20 6f 63 63 75 70 79 20 | 65 78 74 72 61 20 73 70 | occupy |extra sp|
|000021b0| 61 63 65 2e 20 20 57 65 | 20 72 65 63 6f 6d 6d 65 |ace. We| recomme|
|000021c0| 6e 64 20 2d 72 65 73 74 | 61 72 74 20 31 20 66 6f |nd -rest|art 1 fo|
|000021d0| 72 20 69 6d 61 67 65 73 | 20 74 68 61 74 0a 58 77 |r images| that.Xw|
|000021e0| 69 6c 6c 20 62 65 20 74 | 72 61 6e 73 6d 69 74 74 |ill be t|ransmitt|
|000021f0| 65 64 20 61 63 72 6f 73 | 73 20 75 6e 72 65 6c 69 |ed acros|s unreli|
|00002200| 61 62 6c 65 20 6e 65 74 | 77 6f 72 6b 73 20 73 75 |able net|works su|
|00002210| 63 68 20 61 73 20 55 73 | 65 6e 65 74 2e 0a 58 0a |ch as Us|enet..X.|
|00002220| 58 54 68 65 20 2d 73 6d | 6f 6f 74 68 20 6f 70 74 |XThe -sm|ooth opt|
|00002230| 69 6f 6e 20 66 69 6c 74 | 65 72 73 20 74 68 65 20 |ion filt|ers the |
|00002240| 69 6e 70 75 74 20 74 6f | 20 65 6c 69 6d 69 6e 61 |input to| elimina|
|00002250| 74 65 20 66 69 6e 65 2d | 73 63 61 6c 65 20 6e 6f |te fine-|scale no|
|00002260| 69 73 65 2e 20 20 54 68 | 69 73 20 69 73 0a 58 6f |ise. Th|is is.Xo|
|00002270| 66 74 65 6e 20 75 73 65 | 66 75 6c 20 77 68 65 6e |ften use|ful when|
|00002280| 20 63 6f 6e 76 65 72 74 | 69 6e 67 20 47 49 46 20 | convert|ing GIF |
|00002290| 66 69 6c 65 73 20 74 6f | 20 4a 50 45 47 3a 20 61 |files to| JPEG: a|
|000022a0| 20 6d 6f 64 65 72 61 74 | 65 20 73 6d 6f 6f 74 68 | moderat|e smooth|
|000022b0| 69 6e 67 20 66 61 63 74 | 6f 72 20 6f 66 0a 58 31 |ing fact|or of.X1|
|000022c0| 30 20 74 6f 20 35 30 20 | 67 65 74 73 20 72 69 64 |0 to 50 |gets rid|
|000022d0| 20 6f 66 20 64 69 74 68 | 65 72 69 6e 67 20 70 61 | of dith|ering pa|
|000022e0| 74 74 65 72 6e 73 20 69 | 6e 20 74 68 65 20 69 6e |tterns i|n the in|
|000022f0| 70 75 74 20 66 69 6c 65 | 2c 20 72 65 73 75 6c 74 |put file|, result|
|00002300| 69 6e 67 20 69 6e 20 61 | 0a 58 73 6d 61 6c 6c 65 |ing in a|.Xsmalle|
|00002310| 72 20 4a 50 45 47 20 66 | 69 6c 65 20 61 6e 64 20 |r JPEG f|ile and |
|00002320| 61 20 62 65 74 74 65 72 | 2d 6c 6f 6f 6b 69 6e 67 |a better|-looking|
|00002330| 20 69 6d 61 67 65 2e 20 | 20 54 6f 6f 20 6c 61 72 | image. | Too lar|
|00002340| 67 65 20 61 20 73 6d 6f | 6f 74 68 69 6e 67 20 66 |ge a smo|othing f|
|00002350| 61 63 74 6f 72 0a 58 77 | 69 6c 6c 20 76 69 73 69 |actor.Xw|ill visi|
|00002360| 62 6c 79 20 62 6c 75 72 | 20 74 68 65 20 69 6d 61 |bly blur| the ima|
|00002370| 67 65 2c 20 68 6f 77 65 | 76 65 72 2e 0a 58 0a 58 |ge, howe|ver..X.X|
|00002380| 53 77 69 74 63 68 65 73 | 20 66 6f 72 20 77 69 7a |Switches| for wiz|
|00002390| 61 72 64 73 3a 0a 58 0a | 58 09 2d 61 72 69 74 68 |ards:.X.|X.-arith|
|000023a0| 6d 65 74 69 63 09 55 73 | 65 20 61 72 69 74 68 6d |metic.Us|e arithm|
|000023b0| 65 74 69 63 20 63 6f 64 | 69 6e 67 20 72 61 74 68 |etic cod|ing rath|
|000023c0| 65 72 20 74 68 61 6e 20 | 48 75 66 66 6d 61 6e 20 |er than |Huffman |
|000023d0| 63 6f 64 69 6e 67 2e 0a | 58 09 09 09 28 4e 6f 74 |coding..|X...(Not|
|000023e0| 20 63 75 72 72 65 6e 74 | 6c 79 20 73 75 70 70 6f | current|ly suppo|
|000023f0| 72 74 65 64 20 66 6f 72 | 20 6c 65 67 61 6c 20 72 |rted for| legal r|
|00002400| 65 61 73 6f 6e 73 2e 29 | 0a 58 0a 58 09 2d 6e 6f |easons.)|.X.X.-no|
|00002410| 69 6e 74 65 72 6c 65 61 | 76 65 09 47 65 6e 65 72 |interlea|ve.Gener|
|00002420| 61 74 65 20 6e 6f 6e 69 | 6e 74 65 72 6c 65 61 76 |ate noni|nterleav|
|00002430| 65 64 20 4a 50 45 47 20 | 66 69 6c 65 20 28 6e 6f |ed JPEG |file (no|
|00002440| 74 20 79 65 74 20 73 75 | 70 70 6f 72 74 65 64 29 |t yet su|pported)|
|00002450| 2e 0a 58 0a 58 09 2d 71 | 74 61 62 6c 65 73 20 66 |..X.X.-q|tables f|
|00002460| 69 6c 65 09 55 73 65 20 | 74 68 65 20 71 75 61 6e |ile.Use |the quan|
|00002470| 74 69 7a 61 74 69 6f 6e | 20 74 61 62 6c 65 73 20 |tization| tables |
|00002480| 67 69 76 65 6e 20 69 6e | 20 74 68 65 20 73 70 65 |given in| the spe|
|00002490| 63 69 66 69 65 64 0a 58 | 09 09 09 66 69 6c 65 2e |cified.X|...file.|
|000024a0| 20 20 54 68 65 20 66 69 | 6c 65 20 73 68 6f 75 6c | The fi|le shoul|
|000024b0| 64 20 63 6f 6e 74 61 69 | 6e 20 6f 6e 65 20 74 6f |d contai|n one to|
|000024c0| 20 66 6f 75 72 20 74 61 | 62 6c 65 73 0a 58 09 09 | four ta|bles.X..|
|000024d0| 09 28 36 34 20 76 61 6c | 75 65 73 20 65 61 63 68 |.(64 val|ues each|
|000024e0| 29 20 61 73 20 70 6c 61 | 69 6e 20 74 65 78 74 2e |) as pla|in text.|
|000024f0| 20 20 43 6f 6d 6d 65 6e | 74 73 20 70 72 65 63 65 | Commen|ts prece|
|00002500| 64 65 64 20 62 79 0a 58 | 09 09 09 27 23 27 20 6d |ded by.X|...'#' m|
|00002510| 61 79 20 62 65 20 69 6e | 63 6c 75 64 65 64 20 69 |ay be in|cluded i|
|00002520| 6e 20 74 68 65 20 66 69 | 6c 65 2e 20 20 54 68 65 |n the fi|le. The|
|00002530| 20 74 61 62 6c 65 73 20 | 61 72 65 0a 58 09 09 09 | tables |are.X...|
|00002540| 69 6d 70 6c 69 63 69 74 | 6c 79 20 6e 75 6d 62 65 |implicit|ly numbe|
|00002550| 72 65 64 20 30 2c 31 2c | 65 74 63 2e 20 20 49 66 |red 0,1,|etc. If|
|00002560| 20 2d 71 75 61 6c 69 74 | 79 20 4e 20 69 73 20 61 | -qualit|y N is a|
|00002570| 6c 73 6f 0a 58 09 09 09 | 73 70 65 63 69 66 69 65 |lso.X...|specifie|
|00002580| 64 2c 20 74 68 65 20 76 | 61 6c 75 65 73 20 69 6e |d, the v|alues in|
|00002590| 20 74 68 65 20 66 69 6c | 65 20 61 72 65 20 73 63 | the fil|e are sc|
|000025a0| 61 6c 65 64 20 61 63 63 | 6f 72 64 69 6e 67 0a 58 |aled acc|ording.X|
|000025b0| 09 09 09 74 6f 20 63 6a | 70 65 67 27 73 20 71 75 |...to cj|peg's qu|
|000025c0| 61 6c 69 74 79 20 73 63 | 61 6c 69 6e 67 20 63 75 |ality sc|aling cu|
|000025d0| 72 76 65 2e 0a 58 0a 58 | 09 2d 73 61 6d 70 6c 65 |rve..X.X|.-sample|
|000025e0| 20 48 78 56 5b 2c 2e 2e | 2e 5d 09 53 65 74 20 4a | HxV[,..|.].Set J|
|000025f0| 50 45 47 20 73 61 6d 70 | 6c 69 6e 67 20 66 61 63 |PEG samp|ling fac|
|00002600| 74 6f 72 73 2e 20 20 49 | 66 20 79 6f 75 20 73 70 |tors. I|f you sp|
|00002610| 65 63 69 66 79 0a 58 09 | 09 09 66 65 77 65 72 20 |ecify.X.|..fewer |
|00002620| 48 2f 56 20 70 61 69 72 | 73 20 74 68 61 6e 20 74 |H/V pair|s than t|
|00002630| 68 65 72 65 20 61 72 65 | 20 63 6f 6d 70 6f 6e 65 |here are| compone|
|00002640| 6e 74 73 2c 20 74 68 65 | 0a 58 09 09 09 72 65 6d |nts, the|.X...rem|
|00002650| 61 69 6e 69 6e 67 20 63 | 6f 6d 70 6f 6e 65 6e 74 |aining c|omponent|
|00002660| 73 20 61 72 65 20 73 65 | 74 20 74 6f 20 31 78 31 |s are se|t to 1x1|
|00002670| 20 73 61 6d 70 6c 69 6e | 67 2e 20 20 54 68 65 0a | samplin|g. The.|
|00002680| 58 09 09 09 64 65 66 61 | 75 6c 74 20 73 65 74 74 |X...defa|ult sett|
|00002690| 69 6e 67 20 69 73 20 65 | 71 75 69 76 61 6c 65 6e |ing is e|quivalen|
|000026a0| 74 20 74 6f 20 22 2d 73 | 61 6d 70 6c 65 20 32 78 |t to "-s|ample 2x|
|000026b0| 32 22 2e 0a 58 0a 58 54 | 68 65 20 22 77 69 7a 61 |2"..X.XT|he "wiza|
|000026c0| 72 64 22 20 73 77 69 74 | 63 68 65 73 20 61 72 65 |rd" swit|ches are|
|000026d0| 20 69 6e 74 65 6e 64 65 | 64 20 66 6f 72 20 65 78 | intende|d for ex|
|000026e0| 70 65 72 69 6d 65 6e 74 | 61 74 69 6f 6e 20 77 69 |periment|ation wi|
|000026f0| 74 68 20 4a 50 45 47 2e | 20 20 49 66 20 79 6f 75 |th JPEG.| If you|
|00002700| 0a 58 64 6f 6e 27 74 20 | 6b 6e 6f 77 20 77 68 61 |.Xdon't |know wha|
|00002710| 74 20 79 6f 75 20 61 72 | 65 20 64 6f 69 6e 67 2c |t you ar|e doing,|
|00002720| 20 44 4f 4e 27 54 20 55 | 53 45 20 54 48 45 4d 2e | DON'T U|SE THEM.|
|00002730| 20 20 59 6f 75 20 63 61 | 6e 20 65 61 73 69 6c 79 | You ca|n easily|
|00002740| 20 70 72 6f 64 75 63 65 | 20 66 69 6c 65 73 0a 58 | produce| files.X|
|00002750| 77 69 74 68 20 77 6f 72 | 73 65 20 69 6d 61 67 65 |with wor|se image|
|00002760| 20 71 75 61 6c 69 74 79 | 20 61 6e 64 2f 6f 72 20 | quality| and/or |
|00002770| 70 6f 6f 72 65 72 20 63 | 6f 6d 70 72 65 73 73 69 |poorer c|ompressi|
|00002780| 6f 6e 20 74 68 61 6e 20 | 79 6f 75 27 6c 6c 20 67 |on than |you'll g|
|00002790| 65 74 20 66 72 6f 6d 20 | 74 68 65 0a 58 64 65 66 |et from |the.Xdef|
|000027a0| 61 75 6c 74 20 73 65 74 | 74 69 6e 67 73 2e 20 20 |ault set|tings. |
|000027b0| 46 75 72 74 68 65 72 6d | 6f 72 65 2c 20 74 68 65 |Furtherm|ore, the|
|000027c0| 73 65 20 73 77 69 74 63 | 68 65 73 20 73 68 6f 75 |se switc|hes shou|
|000027d0| 6c 64 20 6e 6f 74 20 62 | 65 20 75 73 65 64 20 77 |ld not b|e used w|
|000027e0| 68 65 6e 20 6d 61 6b 69 | 6e 67 0a 58 66 69 6c 65 |hen maki|ng.Xfile|
|000027f0| 73 20 69 6e 74 65 6e 64 | 65 64 20 66 6f 72 20 67 |s intend|ed for g|
|00002800| 65 6e 65 72 61 6c 20 75 | 73 65 2c 20 62 65 63 61 |eneral u|se, beca|
|00002810| 75 73 65 20 6e 6f 74 20 | 61 6c 6c 20 4a 50 45 47 |use not |all JPEG|
|00002820| 20 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 73 | impleme|ntations|
|00002830| 20 77 69 6c 6c 0a 58 73 | 75 70 70 6f 72 74 20 75 | will.Xs|upport u|
|00002840| 6e 75 73 75 61 6c 20 4a | 50 45 47 20 70 61 72 61 |nusual J|PEG para|
|00002850| 6d 65 74 65 72 20 73 65 | 74 74 69 6e 67 73 2e 0a |meter se|ttings..|
|00002860| 58 0a 58 0a 58 44 4a 50 | 45 47 20 44 45 54 41 49 |X.X.XDJP|EG DETAI|
|00002870| 4c 53 0a 58 0a 58 54 68 | 65 20 62 61 73 69 63 20 |LS.X.XTh|e basic |
|00002880| 63 6f 6d 6d 61 6e 64 20 | 6c 69 6e 65 20 73 77 69 |command |line swi|
|00002890| 74 63 68 65 73 20 66 6f | 72 20 64 6a 70 65 67 20 |tches fo|r djpeg |
|000028a0| 61 72 65 3a 0a 58 0a 58 | 09 2d 63 6f 6c 6f 72 73 |are:.X.X|.-colors|
|000028b0| 20 4e 09 52 65 64 75 63 | 65 20 69 6d 61 67 65 20 | N.Reduc|e image |
|000028c0| 74 6f 20 61 74 20 6d 6f | 73 74 20 4e 20 63 6f 6c |to at mo|st N col|
|000028d0| 6f 72 73 2e 20 20 54 68 | 69 73 20 72 65 64 75 63 |ors. Th|is reduc|
|000028e0| 65 73 20 74 68 65 0a 58 | 09 6f 72 20 2d 71 75 61 |es the.X|.or -qua|
|000028f0| 6e 74 69 7a 65 20 4e 09 | 6e 75 6d 62 65 72 20 6f |ntize N.|number o|
|00002900| 66 20 63 6f 6c 6f 72 73 | 20 75 73 65 64 20 69 6e |f colors| used in|
|00002910| 20 74 68 65 20 6f 75 74 | 70 75 74 20 69 6d 61 67 | the out|put imag|
|00002920| 65 2c 20 73 6f 20 74 68 | 61 74 20 69 74 0a 58 09 |e, so th|at it.X.|
|00002930| 09 09 63 61 6e 20 62 65 | 20 64 69 73 70 6c 61 79 |..can be| display|
|00002940| 65 64 20 6f 6e 20 61 20 | 63 6f 6c 6f 72 6d 61 70 |ed on a |colormap|
|00002950| 70 65 64 20 64 69 73 70 | 6c 61 79 20 6f 72 20 73 |ped disp|lay or s|
|00002960| 74 6f 72 65 64 20 69 6e | 0a 58 09 09 09 61 20 63 |tored in|.X...a c|
|00002970| 6f 6c 6f 72 6d 61 70 70 | 65 64 20 66 69 6c 65 20 |olormapp|ed file |
|00002980| 66 6f 72 6d 61 74 2e 20 | 20 46 6f 72 20 65 78 61 |format. | For exa|
|00002990| 6d 70 6c 65 2c 20 69 66 | 20 79 6f 75 20 68 61 76 |mple, if| you hav|
|000029a0| 65 0a 58 09 09 09 61 6e | 20 38 2d 62 69 74 20 64 |e.X...an| 8-bit d|
|000029b0| 69 73 70 6c 61 79 2c 20 | 79 6f 75 27 64 20 6e 65 |isplay, |you'd ne|
|000029c0| 65 64 20 74 6f 20 72 65 | 64 75 63 65 20 74 6f 20 |ed to re|duce to |
|000029d0| 32 35 36 20 6f 72 20 66 | 65 77 65 72 0a 58 09 09 |256 or f|ewer.X..|
|000029e0| 09 63 6f 6c 6f 72 73 2e | 20 20 28 2d 63 6f 6c 6f |.colors.| (-colo|
|000029f0| 72 73 20 69 73 20 74 68 | 65 20 72 65 63 6f 6d 6d |rs is th|e recomm|
|00002a00| 65 6e 64 65 64 20 6e 61 | 6d 65 2c 20 2d 71 75 61 |ended na|me, -qua|
|00002a10| 6e 74 69 7a 65 0a 58 09 | 09 09 69 73 20 70 72 6f |ntize.X.|..is pro|
|00002a20| 76 69 64 65 64 20 6f 6e | 6c 79 20 66 6f 72 20 62 |vided on|ly for b|
|00002a30| 61 63 6b 77 61 72 64 73 | 20 63 6f 6d 70 61 74 69 |ackwards| compati|
|00002a40| 62 69 6c 69 74 79 2e 29 | 0a 58 0a 58 09 2d 67 69 |bility.)|.X.X.-gi|
|00002a50| 66 09 09 53 65 6c 65 63 | 74 20 47 49 46 20 6f 75 |f..Selec|t GIF ou|
|00002a60| 74 70 75 74 20 66 6f 72 | 6d 61 74 2e 20 20 53 69 |tput for|mat. Si|
|00002a70| 6e 63 65 20 47 49 46 20 | 64 6f 65 73 20 6e 6f 74 |nce GIF |does not|
|00002a80| 20 73 75 70 70 6f 72 74 | 0a 58 09 09 09 6d 6f 72 | support|.X...mor|
|00002a90| 65 20 74 68 61 6e 20 32 | 35 36 20 63 6f 6c 6f 72 |e than 2|56 color|
|00002aa0| 73 2c 20 2d 63 6f 6c 6f | 72 73 20 32 35 36 20 69 |s, -colo|rs 256 i|
|00002ab0| 73 20 61 73 73 75 6d 65 | 64 20 28 75 6e 6c 65 73 |s assume|d (unles|
|00002ac0| 73 0a 58 09 09 09 79 6f | 75 20 73 70 65 63 69 66 |s.X...yo|u specif|
|00002ad0| 79 20 61 20 73 6d 61 6c | 6c 65 72 20 6e 75 6d 62 |y a smal|ler numb|
|00002ae0| 65 72 20 6f 66 20 63 6f | 6c 6f 72 73 29 2e 0a 58 |er of co|lors)..X|
|00002af0| 0a 58 09 2d 70 6e 6d 09 | 09 53 65 6c 65 63 74 20 |.X.-pnm.|.Select |
|00002b00| 50 42 4d 50 4c 55 53 20 | 28 50 50 4d 2f 50 47 4d |PBMPLUS |(PPM/PGM|
|00002b10| 29 20 6f 75 74 70 75 74 | 20 66 6f 72 6d 61 74 20 |) output| format |
|00002b20| 28 74 68 69 73 20 69 73 | 20 74 68 65 0a 58 09 09 |(this is| the.X..|
|00002b30| 09 64 65 66 61 75 6c 74 | 20 66 6f 72 6d 61 74 29 |.default| format)|
|00002b40| 2e 20 20 50 47 4d 20 69 | 73 20 65 6d 69 74 74 65 |. PGM i|s emitte|
|00002b50| 64 20 69 66 20 74 68 65 | 20 4a 50 45 47 20 66 69 |d if the| JPEG fi|
|00002b60| 6c 65 20 69 73 0a 58 09 | 09 09 67 72 61 79 2d 73 |le is.X.|..gray-s|
|00002b70| 63 61 6c 65 20 6f 72 20 | 69 66 20 2d 67 72 61 79 |cale or |if -gray|
|00002b80| 73 63 61 6c 65 20 69 73 | 20 73 70 65 63 69 66 69 |scale is| specifi|
|00002b90| 65 64 3b 20 6f 74 68 65 | 72 77 69 73 65 0a 58 09 |ed; othe|rwise.X.|
|00002ba0| 09 09 50 50 4d 20 69 73 | 20 65 6d 69 74 74 65 64 |..PPM is| emitted|
|00002bb0| 2e 0a 58 0a 58 09 2d 72 | 6c 65 09 09 53 65 6c 65 |..X.X.-r|le..Sele|
|00002bc0| 63 74 20 52 4c 45 20 6f | 75 74 70 75 74 20 66 6f |ct RLE o|utput fo|
|00002bd0| 72 6d 61 74 2e 20 20 28 | 52 65 71 75 69 72 65 73 |rmat. (|Requires|
|00002be0| 20 55 52 54 20 6c 69 62 | 72 61 72 79 2e 29 0a 58 | URT lib|rary.).X|
|00002bf0| 0a 58 09 2d 74 61 72 67 | 61 09 09 53 65 6c 65 63 |.X.-targ|a..Selec|
|00002c00| 74 20 54 61 72 67 61 20 | 6f 75 74 70 75 74 20 66 |t Targa |output f|
|00002c10| 6f 72 6d 61 74 2e 20 20 | 47 72 61 79 2d 73 63 61 |ormat. |Gray-sca|
|00002c20| 6c 65 20 66 6f 72 6d 61 | 74 20 69 73 0a 58 09 09 |le forma|t is.X..|
|00002c30| 09 65 6d 69 74 74 65 64 | 20 69 66 20 74 68 65 20 |.emitted| if the |
|00002c40| 4a 50 45 47 20 66 69 6c | 65 20 69 73 20 67 72 61 |JPEG fil|e is gra|
|00002c50| 79 2d 73 63 61 6c 65 20 | 6f 72 20 69 66 0a 58 09 |y-scale |or if.X.|
|00002c60| 09 09 2d 67 72 61 79 73 | 63 61 6c 65 20 69 73 20 |..-grays|cale is |
|00002c70| 73 70 65 63 69 66 69 65 | 64 3b 20 6f 74 68 65 72 |specifie|d; other|
|00002c80| 77 69 73 65 2c 20 63 6f | 6c 6f 72 6d 61 70 70 65 |wise, co|lormappe|
|00002c90| 64 20 66 6f 72 6d 61 74 | 0a 58 09 09 09 69 73 20 |d format|.X...is |
|00002ca0| 65 6d 69 74 74 65 64 20 | 69 66 20 2d 63 6f 6c 6f |emitted |if -colo|
|00002cb0| 72 73 20 69 73 20 73 70 | 65 63 69 66 69 65 64 3b |rs is sp|ecified;|
|00002cc0| 20 6f 74 68 65 72 77 69 | 73 65 2c 20 32 34 2d 62 | otherwi|se, 24-b|
|00002cd0| 69 74 0a 58 09 09 09 66 | 75 6c 6c 2d 63 6f 6c 6f |it.X...f|ull-colo|
|00002ce0| 72 20 66 6f 72 6d 61 74 | 20 69 73 20 65 6d 69 74 |r format| is emit|
|00002cf0| 74 65 64 2e 0a 58 0a 58 | 53 77 69 74 63 68 65 73 |ted..X.X|Switches|
|00002d00| 20 66 6f 72 20 61 64 76 | 61 6e 63 65 64 20 75 73 | for adv|anced us|
|00002d10| 65 72 73 3a 0a 58 0a 58 | 09 2d 62 6c 6f 63 6b 73 |ers:.X.X|.-blocks|
|00002d20| 6d 6f 6f 74 68 09 50 65 | 72 66 6f 72 6d 20 63 72 |mooth.Pe|rform cr|
|00002d30| 6f 73 73 2d 62 6c 6f 63 | 6b 20 73 6d 6f 6f 74 68 |oss-bloc|k smooth|
|00002d40| 69 6e 67 2e 20 20 54 68 | 69 73 20 69 73 20 71 75 |ing. Th|is is qu|
|00002d50| 69 74 65 0a 58 09 09 09 | 6d 65 6d 6f 72 79 2d 69 |ite.X...|memory-i|
|00002d60| 6e 74 65 6e 73 69 76 65 | 20 61 6e 64 20 6f 6e 6c |ntensive| and onl|
|00002d70| 79 20 73 65 65 6d 73 20 | 74 6f 20 69 6d 70 72 6f |y seems |to impro|
|00002d80| 76 65 20 74 68 65 20 69 | 6d 61 67 65 0a 58 09 09 |ve the i|mage.X..|
|00002d90| 09 61 74 20 76 65 72 79 | 20 6c 6f 77 20 71 75 61 |.at very| low qua|
|00002da0| 6c 69 74 79 20 73 65 74 | 74 69 6e 67 73 20 28 2d |lity set|tings (-|
|00002db0| 71 75 61 6c 69 74 79 20 | 31 30 20 74 6f 20 32 30 |quality |10 to 20|
|00002dc0| 20 6f 72 20 73 6f 29 2e | 0a 58 09 09 09 41 74 20 | or so).|.X...At |
|00002dd0| 6e 6f 72 6d 61 6c 20 71 | 75 61 6c 69 74 79 20 73 |normal q|uality s|
|00002de0| 65 74 74 69 6e 67 73 20 | 69 74 20 6d 61 79 20 6d |ettings |it may m|
|00002df0| 61 6b 65 20 74 68 69 6e | 67 73 20 77 6f 72 73 65 |ake thin|gs worse|
|00002e00| 2e 0a 58 0a 58 09 2d 67 | 72 61 79 73 63 61 6c 65 |..X.X.-g|rayscale|
|00002e10| 09 46 6f 72 63 65 20 67 | 72 61 79 2d 73 63 61 6c |.Force g|ray-scal|
|00002e20| 65 20 6f 75 74 70 75 74 | 20 65 76 65 6e 20 69 66 |e output| even if|
|00002e30| 20 4a 50 45 47 20 66 69 | 6c 65 20 69 73 20 63 6f | JPEG fi|le is co|
|00002e40| 6c 6f 72 2e 0a 58 09 09 | 09 55 73 65 66 75 6c 20 |lor..X..|.Useful |
|00002e50| 66 6f 72 20 76 69 65 77 | 69 6e 67 20 6f 6e 20 6d |for view|ing on m|
|00002e60| 6f 6e 6f 63 68 72 6f 6d | 65 20 64 69 73 70 6c 61 |onochrom|e displa|
|00002e70| 79 73 2e 0a 58 0a 58 09 | 2d 6d 61 78 6d 65 6d 6f |ys..X.X.|-maxmemo|
|00002e80| 72 79 20 4e 09 53 65 74 | 20 6c 69 6d 69 74 20 66 |ry N.Set| limit f|
|00002e90| 6f 72 20 61 6d 6f 75 6e | 74 20 6f 66 20 6d 65 6d |or amoun|t of mem|
|00002ea0| 6f 72 79 20 74 6f 20 75 | 73 65 20 69 6e 20 70 72 |ory to u|se in pr|
|00002eb0| 6f 63 65 73 73 69 6e 67 | 0a 58 09 09 09 6c 61 72 |ocessing|.X...lar|
|00002ec0| 67 65 20 69 6d 61 67 65 | 73 2e 20 20 56 61 6c 75 |ge image|s. Valu|
|00002ed0| 65 20 69 73 20 69 6e 20 | 74 68 6f 75 73 61 6e 64 |e is in |thousand|
|00002ee0| 73 20 6f 66 20 62 79 74 | 65 73 2c 20 6f 72 0a 58 |s of byt|es, or.X|
|00002ef0| 09 09 09 6d 69 6c 6c 69 | 6f 6e 73 20 6f 66 20 62 |...milli|ons of b|
|00002f00| 79 74 65 73 20 69 66 20 | 22 4d 22 20 69 73 20 61 |ytes if |"M" is a|
|00002f10| 74 74 61 63 68 65 64 20 | 74 6f 20 74 68 65 20 6e |ttached |to the n|
|00002f20| 75 6d 62 65 72 2e 0a 58 | 09 09 09 46 6f 72 20 65 |umber..X|...For e|
|00002f30| 78 61 6d 70 6c 65 2c 20 | 2d 6d 61 78 20 34 6d 20 |xample, |-max 4m |
|00002f40| 73 65 6c 65 63 74 73 20 | 34 30 30 30 30 30 30 20 |selects |4000000 |
|00002f50| 62 79 74 65 73 2e 20 20 | 49 66 20 6d 6f 72 65 0a |bytes. |If more.|
|00002f60| 58 09 09 09 73 70 61 63 | 65 20 69 73 20 6e 65 65 |X...spac|e is nee|
|00002f70| 64 65 64 2c 20 74 65 6d | 70 6f 72 61 72 79 20 66 |ded, tem|porary f|
|00002f80| 69 6c 65 73 20 77 69 6c | 6c 20 62 65 20 75 73 65 |iles wil|l be use|
|00002f90| 64 2e 0a 58 0a 58 09 2d | 6e 6f 64 69 74 68 65 72 |d..X.X.-|nodither|
|00002fa0| 09 44 6f 20 6e 6f 74 20 | 75 73 65 20 64 69 74 68 |.Do not |use dith|
|00002fb0| 65 72 69 6e 67 20 69 6e | 20 63 6f 6c 6f 72 20 71 |ering in| color q|
|00002fc0| 75 61 6e 74 69 7a 61 74 | 69 6f 6e 2e 0a 58 09 09 |uantizat|ion..X..|
|00002fd0| 09 42 79 20 64 65 66 61 | 75 6c 74 2c 20 46 6c 6f |.By defa|ult, Flo|
|00002fe0| 79 64 2d 53 74 65 69 6e | 62 65 72 67 20 64 69 74 |yd-Stein|berg dit|
|00002ff0| 68 65 72 69 6e 67 20 69 | 73 20 61 70 70 6c 69 65 |hering i|s applie|
|00003000| 64 20 77 68 65 6e 0a 58 | 09 09 09 71 75 61 6e 74 |d when.X|...quant|
|00003010| 69 7a 69 6e 67 20 63 6f | 6c 6f 72 73 2c 20 62 75 |izing co|lors, bu|
|00003020| 74 20 6f 6e 20 73 6f 6d | 65 20 69 6d 61 67 65 73 |t on som|e images|
|00003030| 20 64 69 74 68 65 72 69 | 6e 67 20 6d 61 79 0a 58 | ditheri|ng may.X|
|00003040| 09 09 09 72 65 73 75 6c | 74 20 69 6e 20 6f 62 6a |...resul|t in obj|
|00003050| 65 63 74 69 6f 6e 61 62 | 6c 65 20 22 67 72 61 69 |ectionab|le "grai|
|00003060| 6e 69 6e 65 73 73 22 2e | 20 20 49 66 20 74 68 61 |niness".| If tha|
|00003070| 74 0a 58 09 09 09 68 61 | 70 70 65 6e 73 2c 20 79 |t.X...ha|ppens, y|
|00003080| 6f 75 20 63 61 6e 20 74 | 75 72 6e 20 6f 66 66 20 |ou can t|urn off |
|00003090| 64 69 74 68 65 72 69 6e | 67 20 77 69 74 68 20 2d |ditherin|g with -|
|000030a0| 6e 6f 64 69 74 68 65 72 | 2e 0a 58 09 09 09 2d 6e |nodither|..X...-n|
|000030b0| 6f 64 69 74 68 65 72 20 | 69 73 20 69 67 6e 6f 72 |odither |is ignor|
|000030c0| 65 64 20 75 6e 6c 65 73 | 73 20 79 6f 75 20 61 6c |ed unles|s you al|
|000030d0| 73 6f 20 73 61 79 20 2d | 63 6f 6c 6f 72 73 20 4e |so say -|colors N|
|000030e0| 2e 0a 58 0a 58 09 2d 6f | 6e 65 70 61 73 73 09 55 |..X.X.-o|nepass.U|
|000030f0| 73 65 20 6f 6e 65 2d 70 | 61 73 73 20 69 6e 73 74 |se one-p|ass inst|
|00003100| 65 61 64 20 6f 66 20 74 | 77 6f 2d 70 61 73 73 20 |ead of t|wo-pass |
|00003110| 63 6f 6c 6f 72 20 71 75 | 61 6e 74 69 7a 61 74 69 |color qu|antizati|
|00003120| 6f 6e 2e 0a 58 09 09 09 | 54 68 65 20 6f 6e 65 2d |on..X...|The one-|
|00003130| 70 61 73 73 20 6d 65 74 | 68 6f 64 20 69 73 20 66 |pass met|hod is f|
|00003140| 61 73 74 65 72 20 61 6e | 64 20 6e 65 65 64 73 20 |aster an|d needs |
|00003150| 6c 65 73 73 20 6d 65 6d | 6f 72 79 2c 0a 58 09 09 |less mem|ory,.X..|
|00003160| 09 62 75 74 20 69 74 20 | 70 72 6f 64 75 63 65 73 |.but it |produces|
|00003170| 20 61 20 6c 6f 77 65 72 | 2d 71 75 61 6c 69 74 79 | a lower|-quality|
|00003180| 20 69 6d 61 67 65 2e 20 | 20 2d 6f 6e 65 70 61 73 | image. | -onepas|
|00003190| 73 20 69 73 0a 58 09 09 | 09 69 67 6e 6f 72 65 64 |s is.X..|.ignored|
|000031a0| 20 75 6e 6c 65 73 73 20 | 79 6f 75 20 61 6c 73 6f | unless |you also|
|000031b0| 20 73 61 79 20 2d 63 6f | 6c 6f 72 73 20 4e 2e 20 | say -co|lors N. |
|000031c0| 20 41 6c 73 6f 2c 0a 58 | 09 09 09 74 68 65 20 6f | Also,.X|...the o|
|000031d0| 6e 65 2d 70 61 73 73 20 | 6d 65 74 68 6f 64 20 69 |ne-pass |method i|
|000031e0| 73 20 61 6c 77 61 79 73 | 20 75 73 65 64 20 66 6f |s always| used fo|
|000031f0| 72 20 67 72 61 79 2d 73 | 63 61 6c 65 0a 58 09 09 |r gray-s|cale.X..|
|00003200| 09 6f 75 74 70 75 74 20 | 28 74 68 65 20 74 77 6f |.output |(the two|
|00003210| 2d 70 61 73 73 20 6d 65 | 74 68 6f 64 20 69 73 20 |-pass me|thod is |
|00003220| 6e 6f 20 69 6d 70 72 6f | 76 65 6d 65 6e 74 20 74 |no impro|vement t|
|00003230| 68 65 6e 29 2e 0a 58 0a | 58 09 2d 76 65 72 62 6f |hen)..X.|X.-verbo|
|00003240| 73 65 09 45 6e 61 62 6c | 65 20 64 65 62 75 67 20 |se.Enabl|e debug |
|00003250| 70 72 69 6e 74 6f 75 74 | 2e 20 20 4d 6f 72 65 20 |printout|. More |
|00003260| 2d 76 27 73 20 67 69 76 | 65 20 6d 6f 72 65 20 70 |-v's giv|e more p|
|00003270| 72 69 6e 74 6f 75 74 2e | 0a 58 09 6f 72 20 20 2d |rintout.|.X.or -|
|00003280| 64 65 62 75 67 09 41 6c | 73 6f 2c 20 76 65 72 73 |debug.Al|so, vers|
|00003290| 69 6f 6e 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |ion info|rmation |
|000032a0| 69 73 20 70 72 69 6e 74 | 65 64 20 61 74 20 73 74 |is print|ed at st|
|000032b0| 61 72 74 75 70 2e 0a 58 | 0a 58 0a 58 48 49 4e 54 |artup..X|.X.XHINT|
|000032c0| 53 0a 58 0a 58 43 6f 6c | 6f 72 20 47 49 46 20 66 |S.X.XCol|or GIF f|
|000032d0| 69 6c 65 73 20 61 72 65 | 20 6e 6f 74 20 74 68 65 |iles are| not the|
|000032e0| 20 69 64 65 61 6c 20 69 | 6e 70 75 74 20 66 6f 72 | ideal i|nput for|
|000032f0| 20 4a 50 45 47 3b 20 4a | 50 45 47 20 69 73 20 72 | JPEG; J|PEG is r|
|00003300| 65 61 6c 6c 79 20 69 6e | 74 65 6e 64 65 64 20 66 |eally in|tended f|
|00003310| 6f 72 0a 58 63 6f 6d 70 | 72 65 73 73 69 6e 67 20 |or.Xcomp|ressing |
|00003320| 66 75 6c 6c 2d 63 6f 6c | 6f 72 20 28 32 34 2d 62 |full-col|or (24-b|
|00003330| 69 74 29 20 69 6d 61 67 | 65 73 2e 20 20 49 6e 20 |it) imag|es. In |
|00003340| 70 61 72 74 69 63 75 6c | 61 72 2c 20 64 6f 6e 27 |particul|ar, don'|
|00003350| 74 20 74 72 79 20 74 6f | 20 63 6f 6e 76 65 72 74 |t try to| convert|
|00003360| 0a 58 63 61 72 74 6f 6f | 6e 73 2c 20 6c 69 6e 65 |.Xcartoo|ns, line|
|00003370| 20 64 72 61 77 69 6e 67 | 73 2c 20 61 6e 64 20 6f | drawing|s, and o|
|00003380| 74 68 65 72 20 69 6d 61 | 67 65 73 20 74 68 61 74 |ther ima|ges that|
|00003390| 20 68 61 76 65 20 6f 6e | 6c 79 20 61 20 66 65 77 | have on|ly a few|
|000033a0| 20 64 69 73 74 69 6e 63 | 74 0a 58 63 6f 6c 6f 72 | distinc|t.Xcolor|
|000033b0| 73 2e 20 20 47 49 46 20 | 77 6f 72 6b 73 20 67 72 |s. GIF |works gr|
|000033c0| 65 61 74 20 6f 6e 20 74 | 68 65 73 65 2c 20 4a 50 |eat on t|hese, JP|
|000033d0| 45 47 20 64 6f 65 73 20 | 6e 6f 74 2e 20 20 49 66 |EG does |not. If|
|000033e0| 20 79 6f 75 20 77 61 6e | 74 20 74 6f 20 63 6f 6e | you wan|t to con|
|000033f0| 76 65 72 74 20 61 0a 58 | 47 49 46 20 74 6f 20 4a |vert a.X|GIF to J|
|00003400| 50 45 47 2c 20 79 6f 75 | 20 73 68 6f 75 6c 64 20 |PEG, you| should |
|00003410| 65 78 70 65 72 69 6d 65 | 6e 74 20 77 69 74 68 20 |experime|nt with |
|00003420| 63 6a 70 65 67 27 73 20 | 2d 71 75 61 6c 69 74 79 |cjpeg's |-quality|
|00003430| 20 61 6e 64 20 2d 73 6d | 6f 6f 74 68 20 6f 70 74 | and -sm|ooth opt|
|00003440| 69 6f 6e 73 0a 58 74 6f | 20 67 65 74 20 61 20 73 |ions.Xto| get a s|
|00003450| 61 74 69 73 66 61 63 74 | 6f 72 79 20 63 6f 6e 76 |atisfact|ory conv|
|00003460| 65 72 73 69 6f 6e 2e 20 | 20 2d 73 6d 6f 6f 74 68 |ersion. | -smooth|
|00003470| 20 31 30 20 6f 72 20 73 | 6f 20 69 73 20 6f 66 74 | 10 or s|o is oft|
|00003480| 65 6e 20 68 65 6c 70 66 | 75 6c 2e 0a 58 0a 58 41 |en helpf|ul..X.XA|
|00003490| 76 6f 69 64 20 72 75 6e | 6e 69 6e 67 20 61 6e 20 |void run|ning an |
|000034a0| 69 6d 61 67 65 20 74 68 | 72 6f 75 67 68 20 61 20 |image th|rough a |
|000034b0| 73 65 72 69 65 73 20 6f | 66 20 4a 50 45 47 20 63 |series o|f JPEG c|
|000034c0| 6f 6d 70 72 65 73 73 69 | 6f 6e 2f 64 65 63 6f 6d |ompressi|on/decom|
|000034d0| 70 72 65 73 73 69 6f 6e | 0a 58 63 79 63 6c 65 73 |pression|.Xcycles|
|000034e0| 2e 20 20 49 6d 61 67 65 | 20 71 75 61 6c 69 74 79 |. Image| quality|
|000034f0| 20 6c 6f 73 73 20 77 69 | 6c 6c 20 61 63 63 75 6d | loss wi|ll accum|
|00003500| 75 6c 61 74 65 3b 20 61 | 66 74 65 72 20 74 65 6e |ulate; a|fter ten|
|00003510| 20 6f 72 20 73 6f 20 63 | 79 63 6c 65 73 20 74 68 | or so c|ycles th|
|00003520| 65 20 69 6d 61 67 65 0a | 58 6d 61 79 20 62 65 20 |e image.|Xmay be |
|00003530| 6e 6f 74 69 63 65 61 62 | 6c 79 20 77 6f 72 73 65 |noticeab|ly worse|
|00003540| 20 74 68 61 6e 20 69 74 | 20 77 61 73 20 61 66 74 | than it| was aft|
|00003550| 65 72 20 6f 6e 65 20 63 | 79 63 6c 65 2e 20 20 49 |er one c|ycle. I|
|00003560| 74 27 73 20 62 65 73 74 | 20 74 6f 20 75 73 65 20 |t's best| to use |
|00003570| 61 0a 58 6c 6f 73 73 6c | 65 73 73 20 66 6f 72 6d |a.Xlossl|ess form|
|00003580| 61 74 20 77 68 69 6c 65 | 20 6d 61 6e 69 70 75 6c |at while| manipul|
|00003590| 61 74 69 6e 67 20 61 6e | 20 69 6d 61 67 65 2c 20 |ating an| image, |
|000035a0| 74 68 65 6e 20 63 6f 6e | 76 65 72 74 20 74 6f 20 |then con|vert to |
|000035b0| 4a 50 45 47 20 66 6f 72 | 6d 61 74 20 77 68 65 6e |JPEG for|mat when|
|000035c0| 0a 58 79 6f 75 20 61 72 | 65 20 72 65 61 64 79 20 |.Xyou ar|e ready |
|000035d0| 74 6f 20 66 69 6c 65 20 | 74 68 65 20 69 6d 61 67 |to file |the imag|
|000035e0| 65 20 61 77 61 79 2e 0a | 58 0a 58 54 68 65 20 2d |e away..|X.XThe -|
|000035f0| 6f 70 74 69 6d 69 7a 65 | 20 6f 70 74 69 6f 6e 20 |optimize| option |
|00003600| 74 6f 20 63 6a 70 65 67 | 20 69 73 20 77 6f 72 74 |to cjpeg| is wort|
|00003610| 68 20 75 73 69 6e 67 20 | 77 68 65 6e 20 79 6f 75 |h using |when you|
|00003620| 20 61 72 65 20 6d 61 6b | 69 6e 67 20 61 20 22 66 | are mak|ing a "f|
|00003630| 69 6e 61 6c 22 0a 58 76 | 65 72 73 69 6f 6e 20 66 |inal".Xv|ersion f|
|00003640| 6f 72 20 70 6f 73 74 69 | 6e 67 20 6f 72 20 61 72 |or posti|ng or ar|
|00003650| 63 68 69 76 69 6e 67 2e | 20 20 49 74 27 73 20 61 |chiving.| It's a|
|00003660| 6c 73 6f 20 61 20 77 69 | 6e 20 77 68 65 6e 20 79 |lso a wi|n when y|
|00003670| 6f 75 20 61 72 65 20 75 | 73 69 6e 67 20 6c 6f 77 |ou are u|sing low|
|00003680| 0a 58 71 75 61 6c 69 74 | 79 20 73 65 74 74 69 6e |.Xqualit|y settin|
|00003690| 67 73 20 74 6f 20 6d 61 | 6b 65 20 76 65 72 79 20 |gs to ma|ke very |
|000036a0| 73 6d 61 6c 6c 20 4a 50 | 45 47 20 66 69 6c 65 73 |small JP|EG files|
|000036b0| 3b 20 74 68 65 20 70 65 | 72 63 65 6e 74 61 67 65 |; the pe|rcentage|
|000036c0| 20 69 6d 70 72 6f 76 65 | 6d 65 6e 74 0a 58 69 73 | improve|ment.Xis|
|000036d0| 20 6f 66 74 65 6e 20 61 | 20 6c 6f 74 20 6d 6f 72 | often a| lot mor|
|000036e0| 65 20 74 68 61 6e 20 69 | 74 20 69 73 20 6f 6e 20 |e than i|t is on |
|000036f0| 6c 61 72 67 65 72 20 66 | 69 6c 65 73 2e 0a 58 0a |larger f|iles..X.|
|00003700| 58 57 68 65 6e 20 6d 61 | 6b 69 6e 67 20 69 6d 61 |XWhen ma|king ima|
|00003710| 67 65 73 20 74 6f 20 62 | 65 20 70 6f 73 74 65 64 |ges to b|e posted|
|00003720| 20 6f 6e 20 55 73 65 6e | 65 74 2c 20 77 65 20 72 | on Usen|et, we r|
|00003730| 65 63 6f 6d 6d 65 6e 64 | 20 75 73 69 6e 67 20 63 |ecommend| using c|
|00003740| 6a 70 65 67 27 73 20 6f | 70 74 69 6f 6e 0a 58 2d |jpeg's o|ption.X-|
|00003750| 72 65 73 74 61 72 74 20 | 31 2e 20 20 54 68 69 73 |restart |1. This|
|00003760| 20 6f 70 74 69 6f 6e 20 | 6c 69 6d 69 74 73 20 74 | option |limits t|
|00003770| 68 65 20 64 61 6d 61 67 | 65 20 64 6f 6e 65 20 74 |he damag|e done t|
|00003780| 6f 20 61 20 63 6f 6d 70 | 72 65 73 73 65 64 20 69 |o a comp|ressed i|
|00003790| 6d 61 67 65 20 62 79 0a | 58 6e 65 74 6e 65 77 73 |mage by.|Xnetnews|
|000037a0| 20 74 72 61 6e 73 6d 69 | 73 73 69 6f 6e 20 65 72 | transmi|ssion er|
|000037b0| 72 6f 72 73 2e 0a 58 0a | 58 54 68 65 20 64 65 66 |rors..X.|XThe def|
|000037c0| 61 75 6c 74 20 6d 65 6d | 6f 72 79 20 75 73 61 67 |ault mem|ory usag|
|000037d0| 65 20 6c 69 6d 69 74 20 | 28 2d 6d 61 78 6d 65 6d |e limit |(-maxmem|
|000037e0| 6f 72 79 29 20 69 73 20 | 73 65 74 20 77 68 65 6e |ory) is |set when|
|000037f0| 20 74 68 65 20 73 6f 66 | 74 77 61 72 65 20 69 73 | the sof|tware is|
|00003800| 0a 58 63 6f 6d 70 69 6c | 65 64 2e 20 20 49 66 20 |.Xcompil|ed. If |
|00003810| 79 6f 75 20 67 65 74 20 | 61 6e 20 22 69 6e 73 75 |you get |an "insu|
|00003820| 66 66 69 63 69 65 6e 74 | 20 6d 65 6d 6f 72 79 22 |fficient| memory"|
|00003830| 20 65 72 72 6f 72 2c 20 | 74 72 79 20 73 70 65 63 | error, |try spec|
|00003840| 69 66 79 69 6e 67 20 61 | 20 73 6d 61 6c 6c 65 72 |ifying a| smaller|
|00003850| 0a 58 2d 6d 61 78 6d 65 | 6d 6f 72 79 20 76 61 6c |.X-maxme|mory val|
|00003860| 75 65 2c 20 65 76 65 6e | 20 2d 6d 61 78 6d 65 6d |ue, even| -maxmem|
|00003870| 6f 72 79 20 30 20 74 6f | 20 75 73 65 20 74 68 65 |ory 0 to| use the|
|00003880| 20 61 62 73 6f 6c 75 74 | 65 20 6d 69 6e 69 6d 75 | absolut|e minimu|
|00003890| 6d 20 73 70 61 63 65 2e | 20 20 59 6f 75 0a 58 6d |m space.| You.Xm|
|000038a0| 61 79 20 77 61 6e 74 20 | 74 6f 20 72 65 63 6f 6d |ay want |to recom|
|000038b0| 70 69 6c 65 20 77 69 74 | 68 20 61 20 73 6d 61 6c |pile wit|h a smal|
|000038c0| 6c 65 72 20 64 65 66 61 | 75 6c 74 20 76 61 6c 75 |ler defa|ult valu|
|000038d0| 65 20 69 66 20 74 68 69 | 73 20 68 61 70 70 65 6e |e if thi|s happen|
|000038e0| 73 20 6f 66 74 65 6e 2e | 0a 58 0a 58 4f 6e 20 6d |s often.|.X.XOn m|
|000038f0| 61 63 68 69 6e 65 73 20 | 74 68 61 74 20 68 61 76 |achines |that hav|
|00003900| 65 20 22 65 6e 76 69 72 | 6f 6e 6d 65 6e 74 22 20 |e "envir|onment" |
|00003910| 76 61 72 69 61 62 6c 65 | 73 2c 20 79 6f 75 20 63 |variable|s, you c|
|00003920| 61 6e 20 64 65 66 69 6e | 65 20 74 68 65 20 65 6e |an defin|e the en|
|00003930| 76 69 72 6f 6e 6d 65 6e | 74 0a 58 76 61 72 69 61 |vironmen|t.Xvaria|
|00003940| 62 6c 65 20 4a 50 45 47 | 4d 45 4d 20 74 6f 20 73 |ble JPEG|MEM to s|
|00003950| 65 74 20 74 68 65 20 64 | 65 66 61 75 6c 74 20 6d |et the d|efault m|
|00003960| 65 6d 6f 72 79 20 6c 69 | 6d 69 74 2e 20 20 54 68 |emory li|mit. Th|
|00003970| 65 20 76 61 6c 75 65 20 | 69 73 20 73 70 65 63 69 |e value |is speci|
|00003980| 66 69 65 64 20 61 73 0a | 58 64 65 73 63 72 69 62 |fied as.|Xdescrib|
|00003990| 65 64 20 66 6f 72 20 74 | 68 65 20 2d 6d 61 78 6d |ed for t|he -maxm|
|000039a0| 65 6d 6f 72 79 20 73 77 | 69 74 63 68 2e 20 20 4a |emory sw|itch. J|
|000039b0| 50 45 47 4d 45 4d 20 6f | 76 65 72 72 69 64 65 73 |PEGMEM o|verrides|
|000039c0| 20 74 68 65 20 64 65 66 | 61 75 6c 74 20 76 61 6c | the def|ault val|
|000039d0| 75 65 0a 58 73 70 65 63 | 69 66 69 65 64 20 77 68 |ue.Xspec|ified wh|
|000039e0| 65 6e 20 74 68 65 20 70 | 72 6f 67 72 61 6d 20 77 |en the p|rogram w|
|000039f0| 61 73 20 63 6f 6d 70 69 | 6c 65 64 2c 20 61 6e 64 |as compi|led, and|
|00003a00| 20 69 74 73 65 6c 66 20 | 69 73 20 6f 76 65 72 72 | itself |is overr|
|00003a10| 69 64 64 65 6e 20 62 79 | 20 61 6e 0a 58 65 78 70 |idden by| an.Xexp|
|00003a20| 6c 69 63 69 74 20 2d 6d | 61 78 6d 65 6d 6f 72 79 |licit -m|axmemory|
|00003a30| 20 73 77 69 74 63 68 2e | 0a 58 0a 58 4f 6e 20 4d | switch.|.X.XOn M|
|00003a40| 53 2d 44 4f 53 20 6d 61 | 63 68 69 6e 65 73 2c 20 |S-DOS ma|chines, |
|00003a50| 2d 6d 61 78 6d 65 6d 6f | 72 79 20 69 73 20 74 68 |-maxmemo|ry is th|
|00003a60| 65 20 61 6d 6f 75 6e 74 | 20 6f 66 20 6d 61 69 6e |e amount| of main|
|00003a70| 20 28 63 6f 6e 76 65 6e | 74 69 6f 6e 61 6c 29 20 | (conven|tional) |
|00003a80| 6d 65 6d 6f 72 79 20 74 | 6f 0a 58 75 73 65 2e 20 |memory t|o.Xuse. |
|00003a90| 20 28 45 78 74 65 6e 64 | 65 64 20 6f 72 20 65 78 | (Extend|ed or ex|
|00003aa0| 70 61 6e 64 65 64 20 6d | 65 6d 6f 72 79 20 69 73 |panded m|emory is|
|00003ab0| 20 61 6c 73 6f 20 75 73 | 65 64 20 69 66 20 61 76 | also us|ed if av|
|00003ac0| 61 69 6c 61 62 6c 65 2e | 29 20 20 4d 6f 73 74 0a |ailable.|) Most.|
|00003ad0| 58 44 4f 53 2d 73 70 65 | 63 69 66 69 63 20 76 65 |XDOS-spe|cific ve|
|00003ae0| 72 73 69 6f 6e 73 20 6f | 66 20 74 68 69 73 20 73 |rsions o|f this s|
|00003af0| 6f 66 74 77 61 72 65 20 | 64 6f 20 74 68 65 69 72 |oftware |do their|
|00003b00| 20 6f 77 6e 20 6d 65 6d | 6f 72 79 20 73 70 61 63 | own mem|ory spac|
|00003b10| 65 20 65 73 74 69 6d 61 | 74 69 6f 6e 0a 58 61 6e |e estima|tion.Xan|
|00003b20| 64 20 64 6f 20 6e 6f 74 | 20 6e 65 65 64 20 2d 6d |d do not| need -m|
|00003b30| 61 78 6d 65 6d 6f 72 79 | 2e 0a 58 0a 58 64 6a 70 |axmemory|..X.Xdjp|
|00003b40| 65 67 20 77 69 74 68 20 | 74 77 6f 2d 70 61 73 73 |eg with |two-pass|
|00003b50| 20 63 6f 6c 6f 72 20 71 | 75 61 6e 74 69 7a 61 74 | color q|uantizat|
|00003b60| 69 6f 6e 20 72 65 71 75 | 69 72 65 73 20 61 20 67 |ion requ|ires a g|
|00003b70| 6f 6f 64 20 64 65 61 6c | 20 6f 66 20 6d 65 6d 6f |ood deal| of memo|
|00003b80| 72 79 3b 20 6f 6e 0a 58 | 4d 53 2d 44 4f 53 20 6d |ry; on.X|MS-DOS m|
|00003b90| 61 63 68 69 6e 65 73 20 | 69 74 20 6d 61 79 20 72 |achines |it may r|
|00003ba0| 75 6e 20 6f 75 74 20 6f | 66 20 6d 65 6d 6f 72 79 |un out o|f memory|
|00003bb0| 20 65 76 65 6e 20 77 69 | 74 68 20 2d 6d 61 78 6d | even wi|th -maxm|
|00003bc0| 65 6d 6f 72 79 20 30 2e | 20 20 49 6e 20 74 68 61 |emory 0.| In tha|
|00003bd0| 74 20 63 61 73 65 0a 58 | 79 6f 75 20 63 61 6e 20 |t case.X|you can |
|00003be0| 73 74 69 6c 6c 20 64 65 | 63 6f 6d 70 72 65 73 73 |still de|compress|
|00003bf0| 2c 20 77 69 74 68 20 73 | 6f 6d 65 20 6c 6f 73 73 |, with s|ome loss|
|00003c00| 20 6f 66 20 69 6d 61 67 | 65 20 71 75 61 6c 69 74 | of imag|e qualit|
|00003c10| 79 2c 20 62 79 20 73 70 | 65 63 69 66 79 69 6e 67 |y, by sp|ecifying|
|00003c20| 0a 58 2d 6f 6e 65 70 61 | 73 73 20 66 6f 72 20 6f |.X-onepa|ss for o|
|00003c30| 6e 65 2d 70 61 73 73 20 | 71 75 61 6e 74 69 7a 61 |ne-pass |quantiza|
|00003c40| 74 69 6f 6e 2e 0a 58 0a | 58 49 66 20 6d 6f 72 65 |tion..X.|XIf more|
|00003c50| 20 73 70 61 63 65 20 69 | 73 20 6e 65 65 64 65 64 | space i|s needed|
|00003c60| 20 74 68 61 6e 20 77 69 | 6c 6c 20 66 69 74 20 69 | than wi|ll fit i|
|00003c70| 6e 20 74 68 65 20 61 76 | 61 69 6c 61 62 6c 65 20 |n the av|ailable |
|00003c80| 6d 61 69 6e 20 6d 65 6d | 6f 72 79 20 28 61 73 0a |main mem|ory (as.|
|00003c90| 58 64 65 74 65 72 6d 69 | 6e 65 64 20 62 79 20 2d |Xdetermi|ned by -|
|00003ca0| 6d 61 78 6d 65 6d 6f 72 | 79 29 2c 20 74 65 6d 70 |maxmemor|y), temp|
|00003cb0| 6f 72 61 72 79 20 66 69 | 6c 65 73 20 77 69 6c 6c |orary fi|les will|
|00003cc0| 20 62 65 20 75 73 65 64 | 2e 20 20 28 4d 53 2d 44 | be used|. (MS-D|
|00003cd0| 4f 53 20 76 65 72 73 69 | 6f 6e 73 0a 58 77 69 6c |OS versi|ons.Xwil|
|00003ce0| 6c 20 74 72 79 20 74 6f | 20 67 65 74 20 65 78 74 |l try to| get ext|
|00003cf0| 65 6e 64 65 64 20 6f 72 | 20 65 78 70 61 6e 64 65 |ended or| expande|
|00003d00| 64 20 6d 65 6d 6f 72 79 | 20 66 69 72 73 74 2e 29 |d memory| first.)|
|00003d10| 20 20 54 68 65 20 74 65 | 6d 70 6f 72 61 72 79 20 | The te|mporary |
|00003d20| 66 69 6c 65 73 20 61 72 | 65 0a 58 6f 66 74 65 6e |files ar|e.Xoften|
|00003d30| 20 72 61 74 68 65 72 20 | 6c 61 72 67 65 3a 20 69 | rather |large: i|
|00003d40| 6e 20 74 79 70 69 63 61 | 6c 20 63 61 73 65 73 20 |n typica|l cases |
|00003d50| 74 68 65 79 20 6f 63 63 | 75 70 79 20 74 68 72 65 |they occ|upy thre|
|00003d60| 65 20 62 79 74 65 73 20 | 70 65 72 20 70 69 78 65 |e bytes |per pixe|
|00003d70| 6c 2c 20 66 6f 72 0a 58 | 65 78 61 6d 70 6c 65 20 |l, for.X|example |
|00003d80| 33 2a 38 30 30 2a 36 30 | 30 20 3d 20 31 2e 34 34 |3*800*60|0 = 1.44|
|00003d90| 4d 62 20 66 6f 72 20 61 | 6e 20 38 30 30 78 36 30 |Mb for a|n 800x60|
|00003da0| 30 20 69 6d 61 67 65 2e | 20 20 49 66 20 79 6f 75 |0 image.| If you|
|00003db0| 20 64 6f 6e 27 74 20 68 | 61 76 65 20 65 6e 6f 75 | don't h|ave enou|
|00003dc0| 67 68 0a 58 66 72 65 65 | 20 64 69 73 6b 20 73 70 |gh.Xfree| disk sp|
|00003dd0| 61 63 65 2c 20 6c 65 61 | 76 65 20 6f 75 74 20 2d |ace, lea|ve out -|
|00003de0| 6f 70 74 69 6d 69 7a 65 | 20 28 66 6f 72 20 63 6a |optimize| (for cj|
|00003df0| 70 65 67 29 20 6f 72 20 | 73 70 65 63 69 66 79 20 |peg) or |specify |
|00003e00| 2d 6f 6e 65 70 61 73 73 | 20 28 66 6f 72 0a 58 64 |-onepass| (for.Xd|
|00003e10| 6a 70 65 67 29 2e 20 20 | 4f 6e 20 4d 53 2d 44 4f |jpeg). |On MS-DO|
|00003e20| 53 2c 20 74 68 65 20 74 | 65 6d 70 6f 72 61 72 79 |S, the t|emporary|
|00003e30| 20 66 69 6c 65 73 20 61 | 72 65 20 63 72 65 61 74 | files a|re creat|
|00003e40| 65 64 20 69 6e 20 74 68 | 65 20 64 69 72 65 63 74 |ed in th|e direct|
|00003e50| 6f 72 79 20 6e 61 6d 65 | 64 20 62 79 0a 58 74 68 |ory name|d by.Xth|
|00003e60| 65 20 54 4d 50 20 6f 72 | 20 54 45 4d 50 20 65 6e |e TMP or| TEMP en|
|00003e70| 76 69 72 6f 6e 6d 65 6e | 74 20 76 61 72 69 61 62 |vironmen|t variab|
|00003e80| 6c 65 2c 20 6f 72 20 69 | 6e 20 74 68 65 20 63 75 |le, or i|n the cu|
|00003e90| 72 72 65 6e 74 20 64 69 | 72 65 63 74 6f 72 79 20 |rrent di|rectory |
|00003ea0| 69 66 20 6e 65 69 74 68 | 65 72 0a 58 6f 66 20 74 |if neith|er.Xof t|
|00003eb0| 68 6f 73 65 20 65 78 69 | 73 74 2e 20 20 41 6d 69 |hose exi|st. Ami|
|00003ec0| 67 61 20 69 6d 70 6c 65 | 6d 65 6e 74 61 74 69 6f |ga imple|mentatio|
|00003ed0| 6e 73 20 70 75 74 20 74 | 68 65 20 74 65 6d 70 20 |ns put t|he temp |
|00003ee0| 66 69 6c 65 73 20 69 6e | 20 74 68 65 20 64 69 72 |files in| the dir|
|00003ef0| 65 63 74 6f 72 79 0a 58 | 6e 61 6d 65 64 20 62 79 |ectory.X|named by|
|00003f00| 20 4a 50 45 47 54 4d 50 | 3a 2c 20 73 6f 20 62 65 | JPEGTMP|:, so be|
|00003f10| 20 73 75 72 65 20 74 6f | 20 61 73 73 69 67 6e 20 | sure to| assign |
|00003f20| 4a 50 45 47 54 4d 50 3a | 20 74 6f 20 61 20 64 69 |JPEGTMP:| to a di|
|00003f30| 73 6b 20 70 61 72 74 69 | 74 69 6f 6e 20 77 69 74 |sk parti|tion wit|
|00003f40| 68 0a 58 61 64 65 71 75 | 61 74 65 20 66 72 65 65 |h.Xadequ|ate free|
|00003f50| 20 73 70 61 63 65 2e 0a | 45 4e 44 5f 4f 46 5f 46 | space..|END_OF_F|
|00003f60| 49 4c 45 0a 20 20 69 66 | 20 74 65 73 74 20 31 34 |ILE. if| test 14|
|00003f70| 36 38 37 20 2d 6e 65 20 | 60 77 63 20 2d 63 20 3c |687 -ne |`wc -c <|
|00003f80| 27 55 53 41 47 45 27 60 | 3b 20 74 68 65 6e 0a 20 |'USAGE'`|; then. |
|00003f90| 20 20 20 65 63 68 6f 20 | 73 68 61 72 3a 20 5c 22 | echo |shar: \"|
|00003fa0| 27 55 53 41 47 45 27 5c | 22 20 75 6e 70 61 63 6b |'USAGE'\|" unpack|
|00003fb0| 65 64 20 77 69 74 68 20 | 77 72 6f 6e 67 20 73 69 |ed with |wrong si|
|00003fc0| 7a 65 21 0a 20 20 66 69 | 0a 20 20 23 20 65 6e 64 |ze!. fi|. # end|
|00003fd0| 20 6f 66 20 27 55 53 41 | 47 45 27 0a 66 69 0a 69 | of 'USA|GE'.fi.i|
|00003fe0| 66 20 74 65 73 74 20 2d | 66 20 27 6a 63 68 75 66 |f test -|f 'jchuf|
|00003ff0| 66 2e 63 27 20 2d 61 20 | 22 24 7b 31 7d 22 20 21 |f.c' -a |"${1}" !|
|00004000| 3d 20 22 2d 63 22 20 3b | 20 74 68 65 6e 20 0a 20 |= "-c" ;| then . |
|00004010| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 57 69 6c 6c | echo sh|ar: Will|
|00004020| 20 6e 6f 74 20 63 6c 6f | 62 62 65 72 20 65 78 69 | not clo|bber exi|
|00004030| 73 74 69 6e 67 20 66 69 | 6c 65 20 5c 22 27 6a 63 |sting fi|le \"'jc|
|00004040| 68 75 66 66 2e 63 27 5c | 22 0a 65 6c 73 65 0a 20 |huff.c'\|".else. |
|00004050| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 45 78 74 72 | echo sh|ar: Extr|
|00004060| 61 63 74 69 6e 67 20 5c | 22 27 6a 63 68 75 66 66 |acting \|"'jchuff|
|00004070| 2e 63 27 5c 22 20 5c 28 | 32 30 30 31 33 20 63 68 |.c'\" \(|20013 ch|
|00004080| 61 72 61 63 74 65 72 73 | 5c 29 0a 20 20 73 65 64 |aracters|\). sed|
|00004090| 20 22 73 2f 5e 58 2f 2f | 22 20 3e 27 6a 63 68 75 | "s/^X//|" >'jchu|
|000040a0| 66 66 2e 63 27 20 3c 3c | 27 45 4e 44 5f 4f 46 5f |ff.c' <<|'END_OF_|
|000040b0| 46 49 4c 45 27 0a 58 2f | 2a 0a 58 20 2a 20 6a 63 |FILE'.X/|*.X * jc|
|000040c0| 68 75 66 66 2e 63 0a 58 | 20 2a 0a 58 20 2a 20 43 |huff.c.X| *.X * C|
|000040d0| 6f 70 79 72 69 67 68 74 | 20 28 43 29 20 31 39 39 |opyright| (C) 199|
|000040e0| 31 2c 20 31 39 39 32 2c | 20 54 68 6f 6d 61 73 20 |1, 1992,| Thomas |
|000040f0| 47 2e 20 4c 61 6e 65 2e | 0a 58 20 2a 20 54 68 69 |G. Lane.|.X * Thi|
|00004100| 73 20 66 69 6c 65 20 69 | 73 20 70 61 72 74 20 6f |s file i|s part o|
|00004110| 66 20 74 68 65 20 49 6e | 64 65 70 65 6e 64 65 6e |f the In|dependen|
|00004120| 74 20 4a 50 45 47 20 47 | 72 6f 75 70 27 73 20 73 |t JPEG G|roup's s|
|00004130| 6f 66 74 77 61 72 65 2e | 0a 58 20 2a 20 46 6f 72 |oftware.|.X * For|
|00004140| 20 63 6f 6e 64 69 74 69 | 6f 6e 73 20 6f 66 20 64 | conditi|ons of d|
|00004150| 69 73 74 72 69 62 75 74 | 69 6f 6e 20 61 6e 64 20 |istribut|ion and |
|00004160| 75 73 65 2c 20 73 65 65 | 20 74 68 65 20 61 63 63 |use, see| the acc|
|00004170| 6f 6d 70 61 6e 79 69 6e | 67 20 52 45 41 44 4d 45 |ompanyin|g README|
|00004180| 20 66 69 6c 65 2e 0a 58 | 20 2a 0a 58 20 2a 20 54 | file..X| *.X * T|
|00004190| 68 69 73 20 66 69 6c 65 | 20 63 6f 6e 74 61 69 6e |his file| contain|
|000041a0| 73 20 48 75 66 66 6d 61 | 6e 20 65 6e 74 72 6f 70 |s Huffma|n entrop|
|000041b0| 79 20 65 6e 63 6f 64 69 | 6e 67 20 72 6f 75 74 69 |y encodi|ng routi|
|000041c0| 6e 65 73 2e 0a 58 20 2a | 20 54 68 65 73 65 20 72 |nes..X *| These r|
|000041d0| 6f 75 74 69 6e 65 73 20 | 61 72 65 20 69 6e 76 6f |outines |are invo|
|000041e0| 6b 65 64 20 76 69 61 20 | 74 68 65 20 6d 65 74 68 |ked via |the meth|
|000041f0| 6f 64 73 20 65 6e 74 72 | 6f 70 79 5f 65 6e 63 6f |ods entr|opy_enco|
|00004200| 64 65 2c 0a 58 20 2a 20 | 65 6e 74 72 6f 70 79 5f |de,.X * |entropy_|
|00004210| 65 6e 63 6f 64 65 5f 69 | 6e 69 74 2f 74 65 72 6d |encode_i|nit/term|
|00004220| 2c 20 61 6e 64 20 65 6e | 74 72 6f 70 79 5f 6f 70 |, and en|tropy_op|
|00004230| 74 69 6d 69 7a 65 2e 0a | 58 20 2a 2f 0a 58 0a 58 |timize..|X */.X.X|
|00004240| 23 69 6e 63 6c 75 64 65 | 20 22 6a 69 6e 63 6c 75 |#include| "jinclu|
|00004250| 64 65 2e 68 22 0a 58 0a | 58 0a 58 2f 2a 20 53 74 |de.h".X.|X.X/* St|
|00004260| 61 74 69 63 20 76 61 72 | 69 61 62 6c 65 73 20 74 |atic var|iables t|
|00004270| 6f 20 61 76 6f 69 64 20 | 70 61 73 73 69 6e 67 20 |o avoid |passing |
|00004280| 27 72 6f 75 6e 64 20 65 | 78 74 72 61 20 70 61 72 |'round e|xtra par|
|00004290| 61 6d 65 74 65 72 73 20 | 2a 2f 0a 58 0a 58 73 74 |ameters |*/.X.Xst|
|000042a0| 61 74 69 63 20 63 6f 6d | 70 72 65 73 73 5f 69 6e |atic com|press_in|
|000042b0| 66 6f 5f 70 74 72 20 63 | 69 6e 66 6f 3b 0a 58 0a |fo_ptr c|info;.X.|
|000042c0| 58 73 74 61 74 69 63 20 | 49 4e 54 33 32 20 68 75 |Xstatic |INT32 hu|
|000042d0| 66 66 5f 70 75 74 5f 62 | 75 66 66 65 72 3b 09 2f |ff_put_b|uffer;./|
|000042e0| 2a 20 63 75 72 72 65 6e | 74 20 62 69 74 2d 61 63 |* curren|t bit-ac|
|000042f0| 63 75 6d 75 6c 61 74 69 | 6f 6e 20 62 75 66 66 65 |cumulati|on buffe|
|00004300| 72 20 2a 2f 0a 58 73 74 | 61 74 69 63 20 69 6e 74 |r */.Xst|atic int|
|00004310| 20 68 75 66 66 5f 70 75 | 74 5f 62 69 74 73 3b 09 | huff_pu|t_bits;.|
|00004320| 2f 2a 20 23 20 6f 66 20 | 62 69 74 73 20 6e 6f 77 |/* # of |bits now|
|00004330| 20 69 6e 20 69 74 20 2a | 2f 0a 58 0a 58 73 74 61 | in it *|/.X.Xsta|
|00004340| 74 69 63 20 63 68 61 72 | 20 2a 20 6f 75 74 70 75 |tic char| * outpu|
|00004350| 74 5f 62 75 66 66 65 72 | 3b 09 2f 2a 20 6f 75 74 |t_buffer|;./* out|
|00004360| 70 75 74 20 62 75 66 66 | 65 72 20 2a 2f 0a 58 73 |put buff|er */.Xs|
|00004370| 74 61 74 69 63 20 69 6e | 74 20 62 79 74 65 73 5f |tatic in|t bytes_|
|00004380| 69 6e 5f 62 75 66 66 65 | 72 3b 0a 58 0a 58 0a 58 |in_buffe|r;.X.X.X|
|00004390| 0a 58 4c 4f 43 41 4c 20 | 76 6f 69 64 0a 58 66 69 |.XLOCAL |void.Xfi|
|000043a0| 78 5f 68 75 66 66 5f 74 | 62 6c 20 28 48 55 46 46 |x_huff_t|bl (HUFF|
|000043b0| 5f 54 42 4c 20 2a 20 68 | 74 62 6c 29 0a 58 2f 2a |_TBL * h|tbl).X/*|
|000043c0| 20 43 6f 6d 70 75 74 65 | 20 64 65 72 69 76 65 64 | Compute| derived|
|000043d0| 20 76 61 6c 75 65 73 20 | 66 6f 72 20 61 20 48 75 | values |for a Hu|
|000043e0| 66 66 6d 61 6e 20 74 61 | 62 6c 65 20 2a 2f 0a 58 |ffman ta|ble */.X|
|000043f0| 7b 0a 58 20 20 69 6e 74 | 20 70 2c 20 69 2c 20 6c |{.X int| p, i, l|
|00004400| 2c 20 6c 61 73 74 70 2c | 20 73 69 3b 0a 58 20 20 |, lastp,| si;.X |
|00004410| 63 68 61 72 20 68 75 66 | 66 73 69 7a 65 5b 32 35 |char huf|fsize[25|
|00004420| 37 5d 3b 0a 58 20 20 55 | 49 4e 54 31 36 20 68 75 |7];.X U|INT16 hu|
|00004430| 66 66 63 6f 64 65 5b 32 | 35 37 5d 3b 0a 58 20 20 |ffcode[2|57];.X |
|00004440| 55 49 4e 54 31 36 20 63 | 6f 64 65 3b 0a 58 20 20 |UINT16 c|ode;.X |
|00004450| 0a 58 20 20 2f 2a 20 46 | 69 67 75 72 65 20 43 2e |.X /* F|igure C.|
|00004460| 31 3a 20 6d 61 6b 65 20 | 74 61 62 6c 65 20 6f 66 |1: make |table of|
|00004470| 20 48 75 66 66 6d 61 6e | 20 63 6f 64 65 20 6c 65 | Huffman| code le|
|00004480| 6e 67 74 68 20 66 6f 72 | 20 65 61 63 68 20 73 79 |ngth for| each sy|
|00004490| 6d 62 6f 6c 20 2a 2f 0a | 58 20 20 2f 2a 20 4e 6f |mbol */.|X /* No|
|000044a0| 74 65 20 74 68 61 74 20 | 74 68 69 73 20 69 73 20 |te that |this is |
|000044b0| 69 6e 20 63 6f 64 65 2d | 6c 65 6e 67 74 68 20 6f |in code-|length o|
|000044c0| 72 64 65 72 2e 20 2a 2f | 0a 58 0a 58 20 20 70 20 |rder. */|.X.X p |
|000044d0| 3d 20 30 3b 0a 58 20 20 | 66 6f 72 20 28 6c 20 3d |= 0;.X |for (l =|
|000044e0| 20 31 3b 20 6c 20 3c 3d | 20 31 36 3b 20 6c 2b 2b | 1; l <=| 16; l++|
|000044f0| 29 20 7b 0a 58 20 20 20 | 20 66 6f 72 20 28 69 20 |) {.X | for (i |
|00004500| 3d 20 31 3b 20 69 20 3c | 3d 20 28 69 6e 74 29 20 |= 1; i <|= (int) |
|00004510| 68 74 62 6c 2d 3e 62 69 | 74 73 5b 6c 5d 3b 20 69 |htbl->bi|ts[l]; i|
|00004520| 2b 2b 29 0a 58 20 20 20 | 20 20 20 68 75 66 66 73 |++).X | huffs|
|00004530| 69 7a 65 5b 70 2b 2b 5d | 20 3d 20 28 63 68 61 72 |ize[p++]| = (char|
|00004540| 29 20 6c 3b 0a 58 20 20 | 7d 0a 58 20 20 68 75 66 |) l;.X |}.X huf|
|00004550| 66 73 69 7a 65 5b 70 5d | 20 3d 20 30 3b 0a 58 20 |fsize[p]| = 0;.X |
|00004560| 20 6c 61 73 74 70 20 3d | 20 70 3b 0a 58 20 20 0a | lastp =| p;.X .|
|00004570| 58 20 20 2f 2a 20 46 69 | 67 75 72 65 20 43 2e 32 |X /* Fi|gure C.2|
|00004580| 3a 20 67 65 6e 65 72 61 | 74 65 20 74 68 65 20 63 |: genera|te the c|
|00004590| 6f 64 65 73 20 74 68 65 | 6d 73 65 6c 76 65 73 20 |odes the|mselves |
|000045a0| 2a 2f 0a 58 20 20 2f 2a | 20 4e 6f 74 65 20 74 68 |*/.X /*| Note th|
|000045b0| 61 74 20 74 68 69 73 20 | 69 73 20 69 6e 20 63 6f |at this |is in co|
|000045c0| 64 65 2d 6c 65 6e 67 74 | 68 20 6f 72 64 65 72 2e |de-lengt|h order.|
|000045d0| 20 2a 2f 0a 58 20 20 0a | 58 20 20 63 6f 64 65 20 | */.X .|X code |
|000045e0| 3d 20 30 3b 0a 58 20 20 | 73 69 20 3d 20 68 75 66 |= 0;.X |si = huf|
|000045f0| 66 73 69 7a 65 5b 30 5d | 3b 0a 58 20 20 70 20 3d |fsize[0]|;.X p =|
|00004600| 20 30 3b 0a 58 20 20 77 | 68 69 6c 65 20 28 68 75 | 0;.X w|hile (hu|
|00004610| 66 66 73 69 7a 65 5b 70 | 5d 29 20 7b 0a 58 20 20 |ffsize[p|]) {.X |
|00004620| 20 20 77 68 69 6c 65 20 | 28 28 28 69 6e 74 29 20 | while |(((int) |
|00004630| 68 75 66 66 73 69 7a 65 | 5b 70 5d 29 20 3d 3d 20 |huffsize|[p]) == |
|00004640| 73 69 29 20 7b 0a 58 20 | 20 20 20 20 20 68 75 66 |si) {.X | huf|
|00004650| 66 63 6f 64 65 5b 70 2b | 2b 5d 20 3d 20 63 6f 64 |fcode[p+|+] = cod|
|00004660| 65 3b 0a 58 20 20 20 20 | 20 20 63 6f 64 65 2b 2b |e;.X | code++|
|00004670| 3b 0a 58 20 20 20 20 7d | 0a 58 20 20 20 20 63 6f |;.X }|.X co|
|00004680| 64 65 20 3c 3c 3d 20 31 | 3b 0a 58 20 20 20 20 73 |de <<= 1|;.X s|
|00004690| 69 2b 2b 3b 0a 58 20 20 | 7d 0a 58 20 20 0a 58 20 |i++;.X |}.X .X |
|000046a0| 20 2f 2a 20 46 69 67 75 | 72 65 20 43 2e 33 3a 20 | /* Figu|re C.3: |
|000046b0| 67 65 6e 65 72 61 74 65 | 20 65 6e 63 6f 64 69 6e |generate| encodin|
|000046c0| 67 20 74 61 62 6c 65 73 | 20 2a 2f 0a 58 20 20 2f |g tables| */.X /|
|000046d0| 2a 20 54 68 65 73 65 20 | 61 72 65 20 63 6f 64 65 |* These |are code|
|000046e0| 20 61 6e 64 20 73 69 7a | 65 20 69 6e 64 65 78 65 | and siz|e indexe|
|000046f0| 64 20 62 79 20 73 79 6d | 62 6f 6c 20 76 61 6c 75 |d by sym|bol valu|
|00004700| 65 20 2a 2f 0a 58 0a 58 | 20 20 2f 2a 20 53 65 74 |e */.X.X| /* Set|
|00004710| 20 61 6e 79 20 63 6f 64 | 65 6c 65 73 73 20 73 79 | any cod|eless sy|
|00004720| 6d 62 6f 6c 73 20 74 6f | 20 68 61 76 65 20 63 6f |mbols to| have co|
|00004730| 64 65 20 6c 65 6e 67 74 | 68 20 30 3b 0a 58 20 20 |de lengt|h 0;.X |
|00004740| 20 2a 20 74 68 69 73 20 | 61 6c 6c 6f 77 73 20 65 | * this |allows e|
|00004750| 6d 69 74 5f 62 69 74 73 | 20 74 6f 20 64 65 74 65 |mit_bits| to dete|
|00004760| 63 74 20 61 6e 79 20 61 | 74 74 65 6d 70 74 20 74 |ct any a|ttempt t|
|00004770| 6f 20 65 6d 69 74 20 73 | 75 63 68 20 73 79 6d 62 |o emit s|uch symb|
|00004780| 6f 6c 73 2e 0a 58 20 20 | 20 2a 2f 0a 58 20 20 4d |ols..X | */.X M|
|00004790| 45 4d 5a 45 52 4f 28 68 | 74 62 6c 2d 3e 65 68 75 |EMZERO(h|tbl->ehu|
|000047a0| 66 73 69 2c 20 53 49 5a | 45 4f 46 28 68 74 62 6c |fsi, SIZ|EOF(htbl|
|000047b0| 2d 3e 65 68 75 66 73 69 | 29 29 3b 0a 58 0a 58 20 |->ehufsi|));.X.X |
|000047c0| 20 66 6f 72 20 28 70 20 | 3d 20 30 3b 20 70 20 3c | for (p |= 0; p <|
|000047d0| 20 6c 61 73 74 70 3b 20 | 70 2b 2b 29 20 7b 0a 58 | lastp; |p++) {.X|
|000047e0| 20 20 20 20 68 74 62 6c | 2d 3e 65 68 75 66 63 6f | htbl|->ehufco|
|000047f0| 5b 68 74 62 6c 2d 3e 68 | 75 66 66 76 61 6c 5b 70 |[htbl->h|uffval[p|
|00004800| 5d 5d 20 3d 20 68 75 66 | 66 63 6f 64 65 5b 70 5d |]] = huf|fcode[p]|
|00004810| 3b 0a 58 20 20 20 20 68 | 74 62 6c 2d 3e 65 68 75 |;.X h|tbl->ehu|
|00004820| 66 73 69 5b 68 74 62 6c | 2d 3e 68 75 66 66 76 61 |fsi[htbl|->huffva|
|00004830| 6c 5b 70 5d 5d 20 3d 20 | 68 75 66 66 73 69 7a 65 |l[p]] = |huffsize|
|00004840| 5b 70 5d 3b 0a 58 20 20 | 7d 0a 58 20 20 0a 58 20 |[p];.X |}.X .X |
|00004850| 20 2f 2a 20 57 65 20 64 | 6f 6e 27 74 20 62 6f 74 | /* We d|on't bot|
|00004860| 68 65 72 20 74 6f 20 66 | 69 6c 6c 20 69 6e 20 74 |her to f|ill in t|
|00004870| 68 65 20 64 65 63 6f 64 | 69 6e 67 20 74 61 62 6c |he decod|ing tabl|
|00004880| 65 73 20 6d 69 6e 63 6f | 64 65 5b 5d 2c 20 6d 61 |es minco|de[], ma|
|00004890| 78 63 6f 64 65 5b 5d 2c | 20 2a 2f 0a 58 20 20 2f |xcode[],| */.X /|
|000048a0| 2a 20 61 6e 64 20 76 61 | 6c 70 74 72 5b 5d 2c 20 |* and va|lptr[], |
|000048b0| 73 69 6e 63 65 20 74 68 | 65 79 20 61 72 65 20 6e |since th|ey are n|
|000048c0| 6f 74 20 75 73 65 64 20 | 66 6f 72 20 65 6e 63 6f |ot used |for enco|
|000048d0| 64 69 6e 67 2e 20 2a 2f | 0a 58 7d 0a 58 0a 58 0a |ding. */|.X}.X.X.|
|000048e0| 58 2f 2a 20 4f 75 74 70 | 75 74 74 69 6e 67 20 62 |X/* Outp|utting b|
|000048f0| 79 74 65 73 20 74 6f 20 | 74 68 65 20 66 69 6c 65 |ytes to |the file|
|00004900| 20 2a 2f 0a 58 0a 58 4c | 4f 43 41 4c 20 76 6f 69 | */.X.XL|OCAL voi|
|00004910| 64 0a 58 66 6c 75 73 68 | 5f 62 79 74 65 73 20 28 |d.Xflush|_bytes (|
|00004920| 76 6f 69 64 29 0a 58 7b | 0a 58 20 20 69 66 20 28 |void).X{|.X if (|
|00004930| 62 79 74 65 73 5f 69 6e | 5f 62 75 66 66 65 72 29 |bytes_in|_buffer)|
|00004940| 0a 58 20 20 20 20 28 2a | 63 69 6e 66 6f 2d 3e 6d |.X (*|cinfo->m|
|00004950| 65 74 68 6f 64 73 2d 3e | 65 6e 74 72 6f 70 79 5f |ethods->|entropy_|
|00004960| 6f 75 74 70 75 74 29 20 | 28 63 69 6e 66 6f 2c 20 |output) |(cinfo, |
|00004970| 6f 75 74 70 75 74 5f 62 | 75 66 66 65 72 2c 20 62 |output_b|uffer, b|
|00004980| 79 74 65 73 5f 69 6e 5f | 62 75 66 66 65 72 29 3b |ytes_in_|buffer);|
|00004990| 0a 58 20 20 62 79 74 65 | 73 5f 69 6e 5f 62 75 66 |.X byte|s_in_buf|
|000049a0| 66 65 72 20 3d 20 30 3b | 0a 58 7d 0a 58 0a 58 0a |fer = 0;|.X}.X.X.|
|000049b0| 58 23 64 65 66 69 6e 65 | 20 65 6d 69 74 5f 62 79 |X#define| emit_by|
|000049c0| 74 65 28 76 61 6c 29 20 | 20 5c 0a 58 20 20 4d 41 |te(val) | \.X MA|
|000049d0| 4b 45 53 54 4d 54 28 20 | 69 66 20 28 62 79 74 65 |KESTMT( |if (byte|
|000049e0| 73 5f 69 6e 5f 62 75 66 | 66 65 72 20 3e 3d 20 4a |s_in_buf|fer >= J|
|000049f0| 50 45 47 5f 42 55 46 5f | 53 49 5a 45 29 20 5c 0a |PEG_BUF_|SIZE) \.|
|00004a00| 58 09 20 20 20 20 20 20 | 66 6c 75 73 68 5f 62 79 |X. |flush_by|
|00004a10| 74 65 73 28 29 3b 20 5c | 0a 58 09 20 20 20 20 6f |tes(); \|.X. o|
|00004a20| 75 74 70 75 74 5f 62 75 | 66 66 65 72 5b 62 79 74 |utput_bu|ffer[byt|
|00004a30| 65 73 5f 69 6e 5f 62 75 | 66 66 65 72 2b 2b 5d 20 |es_in_bu|ffer++] |
|00004a40| 3d 20 28 63 68 61 72 29 | 20 28 76 61 6c 29 3b 20 |= (char)| (val); |
|00004a50| 29 0a 58 0a 58 0a 58 0a | 58 2f 2a 20 4f 75 74 70 |).X.X.X.|X/* Outp|
|00004a60| 75 74 74 69 6e 67 20 62 | 69 74 73 20 74 6f 20 74 |utting b|its to t|
|00004a70| 68 65 20 66 69 6c 65 20 | 2a 2f 0a 58 0a 58 2f 2a |he file |*/.X.X/*|
|00004a80| 20 4f 6e 6c 79 20 74 68 | 65 20 72 69 67 68 74 20 | Only th|e right |
|00004a90| 32 34 20 62 69 74 73 20 | 6f 66 20 68 75 66 66 5f |24 bits |of huff_|
|00004aa0| 70 75 74 5f 62 75 66 66 | 65 72 20 61 72 65 20 75 |put_buff|er are u|
|00004ab0| 73 65 64 3b 20 74 68 65 | 20 76 61 6c 69 64 20 62 |sed; the| valid b|
|00004ac0| 69 74 73 20 61 72 65 0a | 58 20 2a 20 6c 65 66 74 |its are.|X * left|
|00004ad0| 2d 6a 75 73 74 69 66 69 | 65 64 20 69 6e 20 74 68 |-justifi|ed in th|
|00004ae0| 69 73 20 70 61 72 74 2e | 20 20 41 74 20 6d 6f 73 |is part.| At mos|
|00004af0| 74 20 31 36 20 62 69 74 | 73 20 63 61 6e 20 62 65 |t 16 bit|s can be|
|00004b00| 20 70 61 73 73 65 64 20 | 74 6f 20 65 6d 69 74 5f | passed |to emit_|
|00004b10| 62 69 74 73 0a 58 20 2a | 20 69 6e 20 6f 6e 65 20 |bits.X *| in one |
|00004b20| 63 61 6c 6c 2c 20 61 6e | 64 20 77 65 20 6e 65 76 |call, an|d we nev|
|00004b30| 65 72 20 72 65 74 61 69 | 6e 20 6d 6f 72 65 20 74 |er retai|n more t|
|00004b40| 68 61 6e 20 37 20 62 69 | 74 73 20 69 6e 20 68 75 |han 7 bi|ts in hu|
|00004b50| 66 66 5f 70 75 74 5f 62 | 75 66 66 65 72 0a 58 20 |ff_put_b|uffer.X |
|00004b60| 2a 20 62 65 74 77 65 65 | 6e 20 63 61 6c 6c 73 2c |* betwee|n calls,|
|00004b70| 20 73 6f 20 32 34 20 62 | 69 74 73 20 61 72 65 20 | so 24 b|its are |
|00004b80| 73 75 66 66 69 63 69 65 | 6e 74 2e 0a 58 20 2a 2f |sufficie|nt..X */|
|00004b90| 0a 58 0a 58 49 4e 4c 49 | 4e 45 0a 58 4c 4f 43 41 |.X.XINLI|NE.XLOCA|
|00004ba0| 4c 20 76 6f 69 64 0a 58 | 65 6d 69 74 5f 62 69 74 |L void.X|emit_bit|
|00004bb0| 73 20 28 55 49 4e 54 31 | 36 20 63 6f 64 65 2c 20 |s (UINT1|6 code, |
|00004bc0| 69 6e 74 20 73 69 7a 65 | 29 0a 58 7b 0a 58 20 20 |int size|).X{.X |
|00004bd0| 2f 2a 20 54 68 69 73 20 | 72 6f 75 74 69 6e 65 20 |/* This |routine |
|00004be0| 69 73 20 68 65 61 76 69 | 6c 79 20 75 73 65 64 2c |is heavi|ly used,|
|00004bf0| 20 73 6f 20 69 74 27 73 | 20 77 6f 72 74 68 20 63 | so it's| worth c|
|00004c00| 6f 64 69 6e 67 20 74 69 | 67 68 74 6c 79 2e 20 2a |oding ti|ghtly. *|
|00004c10| 2f 0a 58 20 20 72 65 67 | 69 73 74 65 72 20 49 4e |/.X reg|ister IN|
|00004c20| 54 33 32 20 70 75 74 5f | 62 75 66 66 65 72 20 3d |T32 put_|buffer =|
|00004c30| 20 63 6f 64 65 3b 0a 58 | 20 20 72 65 67 69 73 74 | code;.X| regist|
|00004c40| 65 72 20 69 6e 74 20 70 | 75 74 5f 62 69 74 73 20 |er int p|ut_bits |
|00004c50| 3d 20 68 75 66 66 5f 70 | 75 74 5f 62 69 74 73 3b |= huff_p|ut_bits;|
|00004c60| 0a 58 0a 58 20 20 2f 2a | 20 69 66 20 73 69 7a 65 |.X.X /*| if size|
|00004c70| 20 69 73 20 30 2c 20 63 | 61 6c 6c 65 72 20 75 73 | is 0, c|aller us|
|00004c80| 65 64 20 61 6e 20 69 6e | 76 61 6c 69 64 20 48 75 |ed an in|valid Hu|
|00004c90| 66 66 6d 61 6e 20 74 61 | 62 6c 65 20 65 6e 74 72 |ffman ta|ble entr|
|00004ca0| 79 20 2a 2f 0a 58 20 20 | 69 66 20 28 73 69 7a 65 |y */.X |if (size|
|00004cb0| 20 3d 3d 20 30 29 0a 58 | 20 20 20 20 45 52 52 45 | == 0).X| ERRE|
|00004cc0| 58 49 54 28 63 69 6e 66 | 6f 2d 3e 65 6d 65 74 68 |XIT(cinf|o->emeth|
|00004cd0| 6f 64 73 2c 20 22 4d 69 | 73 73 69 6e 67 20 48 75 |ods, "Mi|ssing Hu|
|00004ce0| 66 66 6d 61 6e 20 63 6f | 64 65 20 74 61 62 6c 65 |ffman co|de table|
|00004cf0| 20 65 6e 74 72 79 22 29 | 3b 0a 58 0a 58 20 20 70 | entry")|;.X.X p|
|00004d00| 75 74 5f 62 75 66 66 65 | 72 20 26 3d 20 28 28 28 |ut_buffe|r &= (((|
|00004d10| 49 4e 54 33 32 29 20 31 | 29 20 3c 3c 20 73 69 7a |INT32) 1|) << siz|
|00004d20| 65 29 20 2d 20 31 3b 20 | 2f 2a 20 4d 61 73 6b 20 |e) - 1; |/* Mask |
|00004d30| 6f 66 66 20 61 6e 79 20 | 65 78 63 65 73 73 20 62 |off any |excess b|
|00004d40| 69 74 73 20 69 6e 20 63 | 6f 64 65 20 2a 2f 0a 58 |its in c|ode */.X|
|00004d50| 20 20 0a 58 20 20 70 75 | 74 5f 62 69 74 73 20 2b | .X pu|t_bits +|
|00004d60| 3d 20 73 69 7a 65 3b 09 | 09 2f 2a 20 6e 65 77 20 |= size;.|./* new |
|00004d70| 6e 75 6d 62 65 72 20 6f | 66 20 62 69 74 73 20 69 |number o|f bits i|
|00004d80| 6e 20 62 75 66 66 65 72 | 20 2a 2f 0a 58 20 20 0a |n buffer| */.X .|
|00004d90| 58 20 20 70 75 74 5f 62 | 75 66 66 65 72 20 3c 3c |X put_b|uffer <<|
|00004da0| 3d 20 32 34 20 2d 20 70 | 75 74 5f 62 69 74 73 3b |= 24 - p|ut_bits;|
|00004db0| 20 2f 2a 20 61 6c 69 67 | 6e 20 69 6e 63 6f 6d 69 | /* alig|n incomi|
|00004dc0| 6e 67 20 62 69 74 73 20 | 2a 2f 0a 58 0a 58 20 20 |ng bits |*/.X.X |
|00004dd0| 70 75 74 5f 62 75 66 66 | 65 72 20 7c 3d 20 68 75 |put_buff|er |= hu|
|00004de0| 66 66 5f 70 75 74 5f 62 | 75 66 66 65 72 3b 20 2f |ff_put_b|uffer; /|
|00004df0| 2a 20 61 6e 64 20 6d 65 | 72 67 65 20 77 69 74 68 |* and me|rge with|
|00004e00| 20 6f 6c 64 20 62 75 66 | 66 65 72 20 63 6f 6e 74 | old buf|fer cont|
|00004e10| 65 6e 74 73 20 2a 2f 0a | 58 20 20 0a 58 20 20 77 |ents */.|X .X w|
|00004e20| 68 69 6c 65 20 28 70 75 | 74 5f 62 69 74 73 20 3e |hile (pu|t_bits >|
|00004e30| 3d 20 38 29 20 7b 0a 58 | 20 20 20 20 69 6e 74 20 |= 8) {.X| int |
|00004e40| 63 20 3d 20 28 69 6e 74 | 29 20 28 28 70 75 74 5f |c = (int|) ((put_|
|00004e50| 62 75 66 66 65 72 20 3e | 3e 20 31 36 29 20 26 20 |buffer >|> 16) & |
|00004e60| 30 78 46 46 29 3b 0a 58 | 20 20 20 20 0a 58 20 20 |0xFF);.X| .X |
|00004e70| 20 20 65 6d 69 74 5f 62 | 79 74 65 28 63 29 3b 0a | emit_b|yte(c);.|
|00004e80| 58 20 20 20 20 69 66 20 | 28 63 20 3d 3d 20 30 78 |X if |(c == 0x|
|00004e90| 46 46 29 20 7b 09 09 2f | 2a 20 6e 65 65 64 20 74 |FF) {../|* need t|
|00004ea0| 6f 20 73 74 75 66 66 20 | 61 20 7a 65 72 6f 20 62 |o stuff |a zero b|
|00004eb0| 79 74 65 3f 20 2a 2f 0a | 58 20 20 20 20 20 20 65 |yte? */.|X e|
|00004ec0| 6d 69 74 5f 62 79 74 65 | 28 30 29 3b 0a 58 20 20 |mit_byte|(0);.X |
|00004ed0| 20 20 7d 0a 58 20 20 20 | 20 70 75 74 5f 62 75 66 | }.X | put_buf|
|00004ee0| 66 65 72 20 3c 3c 3d 20 | 38 3b 0a 58 20 20 20 20 |fer <<= |8;.X |
|00004ef0| 70 75 74 5f 62 69 74 73 | 20 2d 3d 20 38 3b 0a 58 |put_bits| -= 8;.X|
|00004f00| 20 20 7d 0a 58 0a 58 20 | 20 68 75 66 66 5f 70 75 | }.X.X | huff_pu|
|00004f10| 74 5f 62 75 66 66 65 72 | 20 3d 20 70 75 74 5f 62 |t_buffer| = put_b|
|00004f20| 75 66 66 65 72 3b 09 2f | 2a 20 55 70 64 61 74 65 |uffer;./|* Update|
|00004f30| 20 67 6c 6f 62 61 6c 20 | 76 61 72 69 61 62 6c 65 | global |variable|
|00004f40| 73 20 2a 2f 0a 58 20 20 | 68 75 66 66 5f 70 75 74 |s */.X |huff_put|
|00004f50| 5f 62 69 74 73 20 3d 20 | 70 75 74 5f 62 69 74 73 |_bits = |put_bits|
|00004f60| 3b 0a 58 7d 0a 58 0a 58 | 0a 58 4c 4f 43 41 4c 20 |;.X}.X.X|.XLOCAL |
|00004f70| 76 6f 69 64 0a 58 66 6c | 75 73 68 5f 62 69 74 73 |void.Xfl|ush_bits|
|00004f80| 20 28 76 6f 69 64 29 0a | 58 7b 0a 58 20 20 65 6d | (void).|X{.X em|
|00004f90| 69 74 5f 62 69 74 73 28 | 28 55 49 4e 54 31 36 29 |it_bits(|(UINT16)|
|00004fa0| 20 30 78 37 46 2c 20 37 | 29 3b 09 2f 2a 20 66 69 | 0x7F, 7|);./* fi|
|00004fb0| 6c 6c 20 61 6e 79 20 70 | 61 72 74 69 61 6c 20 62 |ll any p|artial b|
|00004fc0| 79 74 65 20 77 69 74 68 | 20 6f 6e 65 73 20 2a 2f |yte with| ones */|
|00004fd0| 0a 58 20 20 68 75 66 66 | 5f 70 75 74 5f 62 75 66 |.X huff|_put_buf|
|00004fe0| 66 65 72 20 3d 20 30 3b | 09 09 2f 2a 20 61 6e 64 |fer = 0;|../* and|
|00004ff0| 20 72 65 73 65 74 20 62 | 69 74 2d 62 75 66 66 65 | reset b|it-buffe|
|00005000| 72 20 74 6f 20 65 6d 70 | 74 79 20 2a 2f 0a 58 20 |r to emp|ty */.X |
|00005010| 20 68 75 66 66 5f 70 75 | 74 5f 62 69 74 73 20 3d | huff_pu|t_bits =|
|00005020| 20 30 3b 0a 58 7d 0a 58 | 0a 58 0a 58 0a 58 2f 2a | 0;.X}.X|.X.X.X/*|
|00005030| 20 45 6e 63 6f 64 65 20 | 61 20 73 69 6e 67 6c 65 | Encode |a single|
|00005040| 20 62 6c 6f 63 6b 27 73 | 20 77 6f 72 74 68 20 6f | block's| worth o|
|00005050| 66 20 63 6f 65 66 66 69 | 63 69 65 6e 74 73 20 2a |f coeffi|cients *|
|00005060| 2f 0a 58 2f 2a 20 4e 6f | 74 65 20 74 68 61 74 20 |/.X/* No|te that |
|00005070| 74 68 65 20 44 43 20 63 | 6f 65 66 66 69 63 69 65 |the DC c|oefficie|
|00005080| 6e 74 20 68 61 73 20 61 | 6c 72 65 61 64 79 20 62 |nt has a|lready b|
|00005090| 65 65 6e 20 63 6f 6e 76 | 65 72 74 65 64 20 74 6f |een conv|erted to|
|000050a0| 20 61 20 64 69 66 66 65 | 72 65 6e 63 65 20 2a 2f | a diffe|rence */|
|000050b0| 0a 58 0a 58 4c 4f 43 41 | 4c 20 76 6f 69 64 0a 58 |.X.XLOCA|L void.X|
|000050c0| 65 6e 63 6f 64 65 5f 6f | 6e 65 5f 62 6c 6f 63 6b |encode_o|ne_block|
|000050d0| 20 28 4a 42 4c 4f 43 4b | 20 62 6c 6f 63 6b 2c 20 | (JBLOCK| block, |
|000050e0| 48 55 46 46 5f 54 42 4c | 20 2a 64 63 74 62 6c 2c |HUFF_TBL| *dctbl,|
|000050f0| 20 48 55 46 46 5f 54 42 | 4c 20 2a 61 63 74 62 6c | HUFF_TB|L *actbl|
|00005100| 29 0a 58 7b 0a 58 20 20 | 72 65 67 69 73 74 65 72 |).X{.X |register|
|00005110| 20 69 6e 74 20 74 65 6d | 70 2c 20 74 65 6d 70 32 | int tem|p, temp2|
|00005120| 3b 0a 58 20 20 72 65 67 | 69 73 74 65 72 20 69 6e |;.X reg|ister in|
|00005130| 74 20 6e 62 69 74 73 3b | 0a 58 20 20 72 65 67 69 |t nbits;|.X regi|
|00005140| 73 74 65 72 20 69 6e 74 | 20 6b 2c 20 72 2c 20 69 |ster int| k, r, i|
|00005150| 3b 0a 58 20 20 0a 58 20 | 20 2f 2a 20 45 6e 63 6f |;.X .X | /* Enco|
|00005160| 64 65 20 74 68 65 20 44 | 43 20 63 6f 65 66 66 69 |de the D|C coeffi|
|00005170| 63 69 65 6e 74 20 64 69 | 66 66 65 72 65 6e 63 65 |cient di|fference|
|00005180| 20 70 65 72 20 73 65 63 | 74 69 6f 6e 20 46 2e 31 | per sec|tion F.1|
|00005190| 2e 32 2e 31 20 2a 2f 0a | 58 20 20 0a 58 20 20 74 |.2.1 */.|X .X t|
|000051a0| 65 6d 70 20 3d 20 74 65 | 6d 70 32 20 3d 20 62 6c |emp = te|mp2 = bl|
|000051b0| 6f 63 6b 5b 30 5d 3b 0a | 58 0a 58 20 20 69 66 20 |ock[0];.|X.X if |
|000051c0| 28 74 65 6d 70 20 3c 20 | 30 29 20 7b 0a 58 20 20 |(temp < |0) {.X |
|000051d0| 20 20 74 65 6d 70 20 3d | 20 2d 74 65 6d 70 3b 09 | temp =| -temp;.|
|000051e0| 09 2f 2a 20 74 65 6d 70 | 20 69 73 20 61 62 73 20 |./* temp| is abs |
|000051f0| 76 61 6c 75 65 20 6f 66 | 20 69 6e 70 75 74 20 2a |value of| input *|
|00005200| 2f 0a 58 20 20 20 20 2f | 2a 20 46 6f 72 20 61 20 |/.X /|* For a |
|00005210| 6e 65 67 61 74 69 76 65 | 20 69 6e 70 75 74 2c 20 |negative| input, |
|00005220| 77 61 6e 74 20 74 65 6d | 70 32 20 3d 20 62 69 74 |want tem|p2 = bit|
|00005230| 77 69 73 65 20 63 6f 6d | 70 6c 65 6d 65 6e 74 20 |wise com|plement |
|00005240| 6f 66 20 61 62 73 28 69 | 6e 70 75 74 29 20 2a 2f |of abs(i|nput) */|
|00005250| 0a 58 20 20 20 20 2f 2a | 20 54 68 69 73 20 63 6f |.X /*| This co|
|00005260| 64 65 20 61 73 73 75 6d | 65 73 20 77 65 20 61 72 |de assum|es we ar|
|00005270| 65 20 6f 6e 20 61 20 74 | 77 6f 27 73 20 63 6f 6d |e on a t|wo's com|
|00005280| 70 6c 65 6d 65 6e 74 20 | 6d 61 63 68 69 6e 65 20 |plement |machine |
|00005290| 2a 2f 0a 58 20 20 20 20 | 74 65 6d 70 32 2d 2d 3b |*/.X |temp2--;|
|000052a0| 0a 58 20 20 7d 0a 58 20 | 20 0a 58 20 20 2f 2a 20 |.X }.X | .X /* |
|000052b0| 46 69 6e 64 20 74 68 65 | 20 6e 75 6d 62 65 72 20 |Find the| number |
|000052c0| 6f 66 20 62 69 74 73 20 | 6e 65 65 64 65 64 20 66 |of bits |needed f|
|000052d0| 6f 72 20 74 68 65 20 6d | 61 67 6e 69 74 75 64 65 |or the m|agnitude|
|000052e0| 20 6f 66 20 74 68 65 20 | 63 6f 65 66 66 69 63 69 | of the |coeffici|
|000052f0| 65 6e 74 20 2a 2f 0a 58 | 20 20 6e 62 69 74 73 20 |ent */.X| nbits |
|00005300| 3d 20 30 3b 0a 58 20 20 | 77 68 69 6c 65 20 28 74 |= 0;.X |while (t|
|00005310| 65 6d 70 29 20 7b 0a 58 | 20 20 20 20 6e 62 69 74 |emp) {.X| nbit|
|00005320| 73 2b 2b 3b 0a 58 20 20 | 20 20 74 65 6d 70 20 3e |s++;.X | temp >|
|00005330| 3e 3d 20 31 3b 0a 58 20 | 20 7d 0a 58 20 20 0a 58 |>= 1;.X | }.X .X|
|00005340| 20 20 2f 2a 20 45 6d 69 | 74 20 74 68 65 20 48 75 | /* Emi|t the Hu|
|00005350| 66 66 6d 61 6e 2d 63 6f | 64 65 64 20 73 79 6d 62 |ffman-co|ded symb|
|00005360| 6f 6c 20 66 6f 72 20 74 | 68 65 20 6e 75 6d 62 65 |ol for t|he numbe|
|00005370| 72 20 6f 66 20 62 69 74 | 73 20 2a 2f 0a 58 20 20 |r of bit|s */.X |
|00005380| 65 6d 69 74 5f 62 69 74 | 73 28 64 63 74 62 6c 2d |emit_bit|s(dctbl-|
|00005390| 3e 65 68 75 66 63 6f 5b | 6e 62 69 74 73 5d 2c 20 |>ehufco[|nbits], |
|000053a0| 64 63 74 62 6c 2d 3e 65 | 68 75 66 73 69 5b 6e 62 |dctbl->e|hufsi[nb|
|000053b0| 69 74 73 5d 29 3b 0a 58 | 0a 58 20 20 2f 2a 20 45 |its]);.X|.X /* E|
|000053c0| 6d 69 74 20 74 68 61 74 | 20 6e 75 6d 62 65 72 20 |mit that| number |
|000053d0| 6f 66 20 62 69 74 73 20 | 6f 66 20 74 68 65 20 76 |of bits |of the v|
|000053e0| 61 6c 75 65 2c 20 69 66 | 20 70 6f 73 69 74 69 76 |alue, if| positiv|
|000053f0| 65 2c 20 2a 2f 0a 58 20 | 20 2f 2a 20 6f 72 20 74 |e, */.X | /* or t|
|00005400| 68 65 20 63 6f 6d 70 6c | 65 6d 65 6e 74 20 6f 66 |he compl|ement of|
|00005410| 20 69 74 73 20 6d 61 67 | 6e 69 74 75 64 65 2c 20 | its mag|nitude, |
|00005420| 69 66 20 6e 65 67 61 74 | 69 76 65 2e 20 2a 2f 0a |if negat|ive. */.|
|00005430| 58 20 20 69 66 20 28 6e | 62 69 74 73 29 09 09 09 |X if (n|bits)...|
|00005440| 2f 2a 20 65 6d 69 74 5f | 62 69 74 73 20 72 65 6a |/* emit_|bits rej|
|00005450| 65 63 74 73 20 63 61 6c | 6c 73 20 77 69 74 68 20 |ects cal|ls with |
|00005460| 73 69 7a 65 20 30 20 2a | 2f 0a 58 20 20 20 20 65 |size 0 *|/.X e|
|00005470| 6d 69 74 5f 62 69 74 73 | 28 28 55 49 4e 54 31 36 |mit_bits|((UINT16|
|00005480| 29 20 74 65 6d 70 32 2c | 20 6e 62 69 74 73 29 3b |) temp2,| nbits);|
|00005490| 0a 58 20 20 0a 58 20 20 | 2f 2a 20 45 6e 63 6f 64 |.X .X |/* Encod|
|000054a0| 65 20 74 68 65 20 41 43 | 20 63 6f 65 66 66 69 63 |e the AC| coeffic|
|000054b0| 69 65 6e 74 73 20 70 65 | 72 20 73 65 63 74 69 6f |ients pe|r sectio|
|000054c0| 6e 20 46 2e 31 2e 32 2e | 32 20 2a 2f 0a 58 20 20 |n F.1.2.|2 */.X |
|000054d0| 0a 58 20 20 72 20 3d 20 | 30 3b 09 09 09 2f 2a 20 |.X r = |0;.../* |
|000054e0| 72 20 3d 20 72 75 6e 20 | 6c 65 6e 67 74 68 20 6f |r = run |length o|
|000054f0| 66 20 7a 65 72 6f 73 20 | 2a 2f 0a 58 20 20 0a 58 |f zeros |*/.X .X|
|00005500| 20 20 66 6f 72 20 28 6b | 20 3d 20 31 3b 20 6b 20 | for (k| = 1; k |
|00005510| 3c 20 44 43 54 53 49 5a | 45 32 3b 20 6b 2b 2b 29 |< DCTSIZ|E2; k++)|
|00005520| 20 7b 0a 58 20 20 20 20 | 69 66 20 28 28 74 65 6d | {.X |if ((tem|
|00005530| 70 20 3d 20 62 6c 6f 63 | 6b 5b 6b 5d 29 20 3d 3d |p = bloc|k[k]) ==|
|00005540| 20 30 29 20 7b 0a 58 20 | 20 20 20 20 20 72 2b 2b | 0) {.X | r++|
|00005550| 3b 0a 58 20 20 20 20 7d | 20 65 6c 73 65 20 7b 0a |;.X }| else {.|
|00005560| 58 20 20 20 20 20 20 2f | 2a 20 69 66 20 72 75 6e |X /|* if run|
|00005570| 20 6c 65 6e 67 74 68 20 | 3e 20 31 35 2c 20 6d 75 | length |> 15, mu|
|00005580| 73 74 20 65 6d 69 74 20 | 73 70 65 63 69 61 6c 20 |st emit |special |
|00005590| 72 75 6e 2d 6c 65 6e 67 | 74 68 2d 31 36 20 63 6f |run-leng|th-16 co|
|000055a0| 64 65 73 20 28 30 78 46 | 30 29 20 2a 2f 0a 58 20 |des (0xF|0) */.X |
|000055b0| 20 20 20 20 20 77 68 69 | 6c 65 20 28 72 20 3e 20 | whi|le (r > |
|000055c0| 31 35 29 20 7b 0a 58 09 | 65 6d 69 74 5f 62 69 74 |15) {.X.|emit_bit|
|000055d0| 73 28 61 63 74 62 6c 2d | 3e 65 68 75 66 63 6f 5b |s(actbl-|>ehufco[|
|000055e0| 30 78 46 30 5d 2c 20 61 | 63 74 62 6c 2d 3e 65 68 |0xF0], a|ctbl->eh|
|000055f0| 75 66 73 69 5b 30 78 46 | 30 5d 29 3b 0a 58 09 72 |ufsi[0xF|0]);.X.r|
|00005600| 20 2d 3d 20 31 36 3b 0a | 58 20 20 20 20 20 20 7d | -= 16;.|X }|
|00005610| 0a 58 0a 58 20 20 20 20 | 20 20 74 65 6d 70 32 20 |.X.X | temp2 |
|00005620| 3d 20 74 65 6d 70 3b 0a | 58 20 20 20 20 20 20 69 |= temp;.|X i|
|00005630| 66 20 28 74 65 6d 70 20 | 3c 20 30 29 20 7b 0a 58 |f (temp |< 0) {.X|
|00005640| 09 74 65 6d 70 20 3d 20 | 2d 74 65 6d 70 3b 09 09 |.temp = |-temp;..|
|00005650| 2f 2a 20 74 65 6d 70 20 | 69 73 20 61 62 73 20 76 |/* temp |is abs v|
|00005660| 61 6c 75 65 20 6f 66 20 | 69 6e 70 75 74 20 2a 2f |alue of |input */|
|00005670| 0a 58 09 2f 2a 20 54 68 | 69 73 20 63 6f 64 65 20 |.X./* Th|is code |
|00005680| 61 73 73 75 6d 65 73 20 | 77 65 20 61 72 65 20 6f |assumes |we are o|
|00005690| 6e 20 61 20 74 77 6f 27 | 73 20 63 6f 6d 70 6c 65 |n a two'|s comple|
|000056a0| 6d 65 6e 74 20 6d 61 63 | 68 69 6e 65 20 2a 2f 0a |ment mac|hine */.|
|000056b0| 58 09 74 65 6d 70 32 2d | 2d 3b 0a 58 20 20 20 20 |X.temp2-|-;.X |
|000056c0| 20 20 7d 0a 58 20 20 20 | 20 20 20 0a 58 20 20 20 | }.X | .X |
|000056d0| 20 20 20 2f 2a 20 46 69 | 6e 64 20 74 68 65 20 6e | /* Fi|nd the n|
|000056e0| 75 6d 62 65 72 20 6f 66 | 20 62 69 74 73 20 6e 65 |umber of| bits ne|
|000056f0| 65 64 65 64 20 66 6f 72 | 20 74 68 65 20 6d 61 67 |eded for| the mag|
|00005700| 6e 69 74 75 64 65 20 6f | 66 20 74 68 65 20 63 6f |nitude o|f the co|
|00005710| 65 66 66 69 63 69 65 6e | 74 20 2a 2f 0a 58 20 20 |efficien|t */.X |
|00005720| 20 20 20 20 6e 62 69 74 | 73 20 3d 20 31 3b 09 09 | nbit|s = 1;..|
|00005730| 2f 2a 20 74 68 65 72 65 | 20 6d 75 73 74 20 62 65 |/* there| must be|
|00005740| 20 61 74 20 6c 65 61 73 | 74 20 6f 6e 65 20 31 20 | at leas|t one 1 |
|00005750| 62 69 74 20 2a 2f 0a 58 | 20 20 20 20 20 20 77 68 |bit */.X| wh|
|00005760| 69 6c 65 20 28 74 65 6d | 70 20 3e 3e 3d 20 31 29 |ile (tem|p >>= 1)|
|00005770| 0a 58 09 6e 62 69 74 73 | 2b 2b 3b 0a 58 20 20 20 |.X.nbits|++;.X |
|00005780| 20 20 20 0a 58 20 20 20 | 20 20 20 2f 2a 20 45 6d | .X | /* Em|
|00005790| 69 74 20 48 75 66 66 6d | 61 6e 20 73 79 6d 62 6f |it Huffm|an symbo|
|000057a0| 6c 20 66 6f 72 20 72 75 | 6e 20 6c 65 6e 67 74 68 |l for ru|n length|
|000057b0| 20 2f 20 6e 75 6d 62 65 | 72 20 6f 66 20 62 69 74 | / numbe|r of bit|
|000057c0| 73 20 2a 2f 0a 58 20 20 | 20 20 20 20 69 20 3d 20 |s */.X | i = |
|000057d0| 28 72 20 3c 3c 20 34 29 | 20 2b 20 6e 62 69 74 73 |(r << 4)| + nbits|
|000057e0| 3b 0a 58 20 20 20 20 20 | 20 65 6d 69 74 5f 62 69 |;.X | emit_bi|
|000057f0| 74 73 28 61 63 74 62 6c | 2d 3e 65 68 75 66 63 6f |ts(actbl|->ehufco|
|00005800| 5b 69 5d 2c 20 61 63 74 | 62 6c 2d 3e 65 68 75 66 |[i], act|bl->ehuf|
|00005810| 73 69 5b 69 5d 29 3b 0a | 58 20 20 20 20 20 20 0a |si[i]);.|X .|
|00005820| 58 20 20 20 20 20 20 2f | 2a 20 45 6d 69 74 20 74 |X /|* Emit t|
|00005830| 68 61 74 20 6e 75 6d 62 | 65 72 20 6f 66 20 62 69 |hat numb|er of bi|
|00005840| 74 73 20 6f 66 20 74 68 | 65 20 76 61 6c 75 65 2c |ts of th|e value,|
|00005850| 20 69 66 20 70 6f 73 69 | 74 69 76 65 2c 20 2a 2f | if posi|tive, */|
|00005860| 0a 58 20 20 20 20 20 20 | 2f 2a 20 6f 72 20 74 68 |.X |/* or th|
|00005870| 65 20 63 6f 6d 70 6c 65 | 6d 65 6e 74 20 6f 66 20 |e comple|ment of |
|00005880| 69 74 73 20 6d 61 67 6e | 69 74 75 64 65 2c 20 69 |its magn|itude, i|
|00005890| 66 20 6e 65 67 61 74 69 | 76 65 2e 20 2a 2f 0a 58 |f negati|ve. */.X|
|000058a0| 20 20 20 20 20 20 65 6d | 69 74 5f 62 69 74 73 28 | em|it_bits(|
|000058b0| 28 55 49 4e 54 31 36 29 | 20 74 65 6d 70 32 2c 20 |(UINT16)| temp2, |
|000058c0| 6e 62 69 74 73 29 3b 0a | 58 20 20 20 20 20 20 0a |nbits);.|X .|
|000058d0| 58 20 20 20 20 20 20 72 | 20 3d 20 30 3b 0a 58 20 |X r| = 0;.X |
|000058e0| 20 20 20 7d 0a 58 20 20 | 7d 0a 58 0a 58 20 20 2f | }.X |}.X.X /|
|000058f0| 2a 20 49 66 20 74 68 65 | 20 6c 61 73 74 20 63 6f |* If the| last co|
|00005900| 65 66 28 73 29 20 77 65 | 72 65 20 7a 65 72 6f 2c |ef(s) we|re zero,|
|00005910| 20 65 6d 69 74 20 61 6e | 20 65 6e 64 2d 6f 66 2d | emit an| end-of-|
|00005920| 62 6c 6f 63 6b 20 63 6f | 64 65 20 2a 2f 0a 58 20 |block co|de */.X |
|00005930| 20 69 66 20 28 72 20 3e | 20 30 29 0a 58 20 20 20 | if (r >| 0).X |
|00005940| 20 65 6d 69 74 5f 62 69 | 74 73 28 61 63 74 62 6c | emit_bi|ts(actbl|
|00005950| 2d 3e 65 68 75 66 63 6f | 5b 30 5d 2c 20 61 63 74 |->ehufco|[0], act|
|00005960| 62 6c 2d 3e 65 68 75 66 | 73 69 5b 30 5d 29 3b 0a |bl->ehuf|si[0]);.|
|00005970| 58 7d 0a 58 0a 58 0a 58 | 0a 58 2f 2a 0a 58 20 2a |X}.X.X.X|.X/*.X *|
|00005980| 20 49 6e 69 74 69 61 6c | 69 7a 65 20 66 6f 72 20 | Initial|ize for |
|00005990| 61 20 48 75 66 66 6d 61 | 6e 2d 63 6f 6d 70 72 65 |a Huffma|n-compre|
|000059a0| 73 73 65 64 20 73 63 61 | 6e 2e 0a 58 20 2a 20 54 |ssed sca|n..X * T|
|000059b0| 68 69 73 20 69 73 20 69 | 6e 76 6f 6b 65 64 20 61 |his is i|nvoked a|
|000059c0| 66 74 65 72 20 77 72 69 | 74 69 6e 67 20 74 68 65 |fter wri|ting the|
|000059d0| 20 53 4f 53 20 6d 61 72 | 6b 65 72 2e 0a 58 20 2a | SOS mar|ker..X *|
|000059e0| 20 54 68 65 20 70 69 70 | 65 6c 69 6e 65 20 63 6f | The pip|eline co|
|000059f0| 6e 74 72 6f 6c 6c 65 72 | 20 6d 75 73 74 20 65 73 |ntroller| must es|
|00005a00| 74 61 62 6c 69 73 68 20 | 74 68 65 20 65 6e 74 72 |tablish |the entr|
|00005a10| 6f 70 79 5f 6f 75 74 70 | 75 74 20 6d 65 74 68 6f |opy_outp|ut metho|
|00005a20| 64 20 70 6f 69 6e 74 65 | 72 0a 58 20 2a 20 62 65 |d pointe|r.X * be|
|00005a30| 66 6f 72 65 20 63 61 6c | 6c 69 6e 67 20 74 68 69 |fore cal|ling thi|
|00005a40| 73 20 72 6f 75 74 69 6e | 65 2e 0a 58 20 2a 2f 0a |s routin|e..X */.|
|00005a50| 58 0a 58 4d 45 54 48 4f | 44 44 45 46 20 76 6f 69 |X.XMETHO|DDEF voi|
|00005a60| 64 0a 58 68 75 66 66 5f | 69 6e 69 74 20 28 63 6f |d.Xhuff_|init (co|
|00005a70| 6d 70 72 65 73 73 5f 69 | 6e 66 6f 5f 70 74 72 20 |mpress_i|nfo_ptr |
|00005a80| 78 69 6e 66 6f 29 0a 58 | 7b 0a 58 20 20 73 68 6f |xinfo).X|{.X sho|
|00005a90| 72 74 20 63 69 3b 0a 58 | 20 20 6a 70 65 67 5f 63 |rt ci;.X| jpeg_c|
|00005aa0| 6f 6d 70 6f 6e 65 6e 74 | 5f 69 6e 66 6f 20 2a 20 |omponent|_info * |
|00005ab0| 63 6f 6d 70 70 74 72 3b | 0a 58 0a 58 20 20 2f 2a |compptr;|.X.X /*|
|00005ac0| 20 49 6e 69 74 69 61 6c | 69 7a 65 20 73 74 61 74 | Initial|ize stat|
|00005ad0| 69 63 20 76 61 72 69 61 | 62 6c 65 73 20 2a 2f 0a |ic varia|bles */.|
|00005ae0| 58 20 20 63 69 6e 66 6f | 20 3d 20 78 69 6e 66 6f |X cinfo| = xinfo|
|00005af0| 3b 0a 58 20 20 68 75 66 | 66 5f 70 75 74 5f 62 75 |;.X huf|f_put_bu|
|00005b00| 66 66 65 72 20 3d 20 30 | 3b 0a 58 20 20 68 75 66 |ffer = 0|;.X huf|
|00005b10| 66 5f 70 75 74 5f 62 69 | 74 73 20 3d 20 30 3b 0a |f_put_bi|ts = 0;.|
|00005b20| 58 0a 58 20 20 2f 2a 20 | 49 6e 69 74 69 61 6c 69 |X.X /* |Initiali|
|00005b30| 7a 65 20 74 68 65 20 6f | 75 74 70 75 74 20 62 75 |ze the o|utput bu|
|00005b40| 66 66 65 72 20 2a 2f 0a | 58 20 20 6f 75 74 70 75 |ffer */.|X outpu|
|00005b50| 74 5f 62 75 66 66 65 72 | 20 3d 20 28 63 68 61 72 |t_buffer| = (char|
|00005b60| 20 2a 29 20 28 2a 63 69 | 6e 66 6f 2d 3e 65 6d 65 | *) (*ci|nfo->eme|
|00005b70| 74 68 6f 64 73 2d 3e 61 | 6c 6c 6f 63 5f 73 6d 61 |thods->a|lloc_sma|
|00005b80| 6c 6c 29 0a 58 09 09 09 | 09 28 28 73 69 7a 65 5f |ll).X...|.((size_|
|00005b90| 74 29 20 4a 50 45 47 5f | 42 55 46 5f 53 49 5a 45 |t) JPEG_|BUF_SIZE|
|00005ba0| 29 3b 0a 58 20 20 62 79 | 74 65 73 5f 69 6e 5f 62 |);.X by|tes_in_b|
|00005bb0| 75 66 66 65 72 20 3d 20 | 30 3b 0a 58 0a 58 20 20 |uffer = |0;.X.X |
|00005bc0| 66 6f 72 20 28 63 69 20 | 3d 20 30 3b 20 63 69 20 |for (ci |= 0; ci |
|00005bd0| 3c 20 63 69 6e 66 6f 2d | 3e 63 6f 6d 70 73 5f 69 |< cinfo-|>comps_i|
|00005be0| 6e 5f 73 63 61 6e 3b 20 | 63 69 2b 2b 29 20 7b 0a |n_scan; |ci++) {.|
|00005bf0| 58 20 20 20 20 63 6f 6d | 70 70 74 72 20 3d 20 63 |X com|pptr = c|
|00005c00| 69 6e 66 6f 2d 3e 63 75 | 72 5f 63 6f 6d 70 5f 69 |info->cu|r_comp_i|
|00005c10| 6e 66 6f 5b 63 69 5d 3b | 0a 58 20 20 20 20 2f 2a |nfo[ci];|.X /*|
|00005c20| 20 4d 61 6b 65 20 73 75 | 72 65 20 72 65 71 75 65 | Make su|re reque|
|00005c30| 73 74 65 64 20 74 61 62 | 6c 65 73 20 61 72 65 20 |sted tab|les are |
|00005c40| 70 72 65 73 65 6e 74 20 | 2a 2f 0a 58 20 20 20 20 |present |*/.X |
|00005c50| 69 66 20 28 63 69 6e 66 | 6f 2d 3e 64 63 5f 68 75 |if (cinf|o->dc_hu|
|00005c60| 66 66 5f 74 62 6c 5f 70 | 74 72 73 5b 63 6f 6d 70 |ff_tbl_p|trs[comp|
|00005c70| 70 74 72 2d 3e 64 63 5f | 74 62 6c 5f 6e 6f 5d 20 |ptr->dc_|tbl_no] |
|00005c80| 3d 3d 20 4e 55 4c 4c 20 | 7c 7c 0a 58 09 63 69 6e |== NULL |||.X.cin|
|00005c90| 66 6f 2d 3e 61 63 5f 68 | 75 66 66 5f 74 62 6c 5f |fo->ac_h|uff_tbl_|
|00005ca0| 70 74 72 73 5b 63 6f 6d | 70 70 74 72 2d 3e 61 63 |ptrs[com|pptr->ac|
|00005cb0| 5f 74 62 6c 5f 6e 6f 5d | 20 3d 3d 20 4e 55 4c 4c |_tbl_no]| == NULL|
|00005cc0| 29 0a 58 20 20 20 20 20 | 20 45 52 52 45 58 49 54 |).X | ERREXIT|
|00005cd0| 28 63 69 6e 66 6f 2d 3e | 65 6d 65 74 68 6f 64 73 |(cinfo->|emethods|
|00005ce0| 2c 20 22 55 73 65 20 6f | 66 20 75 6e 64 65 66 69 |, "Use o|f undefi|
|00005cf0| 6e 65 64 20 48 75 66 66 | 6d 61 6e 20 74 61 62 6c |ned Huff|man tabl|
|00005d00| 65 22 29 3b 0a 58 20 20 | 20 20 2f 2a 20 43 6f 6d |e");.X | /* Com|
|00005d10| 70 75 74 65 20 64 65 72 | 69 76 65 64 20 76 61 6c |pute der|ived val|
|00005d20| 75 65 73 20 66 6f 72 20 | 48 75 66 66 6d 61 6e 20 |ues for |Huffman |
|00005d30| 74 61 62 6c 65 73 20 2a | 2f 0a 58 20 20 20 20 2f |tables *|/.X /|
|00005d40| 2a 20 57 65 20 6d 61 79 | 20 64 6f 20 74 68 69 73 |* We may| do this|
|00005d50| 20 6d 6f 72 65 20 74 68 | 61 6e 20 6f 6e 63 65 20 | more th|an once |
|00005d60| 66 6f 72 20 73 61 6d 65 | 20 74 61 62 6c 65 2c 20 |for same| table, |
|00005d70| 62 75 74 20 69 74 27 73 | 20 6e 6f 74 20 61 20 62 |but it's| not a b|
|00005d80| 69 67 20 64 65 61 6c 20 | 2a 2f 0a 58 20 20 20 20 |ig deal |*/.X |
|00005d90| 66 69 78 5f 68 75 66 66 | 5f 74 62 6c 28 63 69 6e |fix_huff|_tbl(cin|
|00005da0| 66 6f 2d 3e 64 63 5f 68 | 75 66 66 5f 74 62 6c 5f |fo->dc_h|uff_tbl_|
|00005db0| 70 74 72 73 5b 63 6f 6d | 70 70 74 72 2d 3e 64 63 |ptrs[com|pptr->dc|
|00005dc0| 5f 74 62 6c 5f 6e 6f 5d | 29 3b 0a 58 20 20 20 20 |_tbl_no]|);.X |
|00005dd0| 66 69 78 5f 68 75 66 66 | 5f 74 62 6c 28 63 69 6e |fix_huff|_tbl(cin|
|00005de0| 66 6f 2d 3e 61 63 5f 68 | 75 66 66 5f 74 62 6c 5f |fo->ac_h|uff_tbl_|
|00005df0| 70 74 72 73 5b 63 6f 6d | 70 70 74 72 2d 3e 61 63 |ptrs[com|pptr->ac|
|00005e00| 5f 74 62 6c 5f 6e 6f 5d | 29 3b 0a 58 20 20 20 20 |_tbl_no]|);.X |
|00005e10| 2f 2a 20 49 6e 69 74 69 | 61 6c 69 7a 65 20 44 43 |/* Initi|alize DC|
|00005e20| 20 70 72 65 64 69 63 74 | 69 6f 6e 73 20 74 6f 20 | predict|ions to |
|00005e30| 30 20 2a 2f 0a 58 20 20 | 20 20 63 69 6e 66 6f 2d |0 */.X | cinfo-|
|00005e40| 3e 6c 61 73 74 5f 64 63 | 5f 76 61 6c 5b 63 69 5d |>last_dc|_val[ci]|
|00005e50| 20 3d 20 30 3b 0a 58 20 | 20 7d 0a 58 0a 58 20 20 | = 0;.X | }.X.X |
|00005e60| 2f 2a 20 49 6e 69 74 69 | 61 6c 69 7a 65 20 72 65 |/* Initi|alize re|
|00005e70| 73 74 61 72 74 20 73 74 | 75 66 66 20 2a 2f 0a 58 |start st|uff */.X|
|00005e80| 20 20 63 69 6e 66 6f 2d | 3e 72 65 73 74 61 72 74 | cinfo-|>restart|
|00005e90| 73 5f 74 6f 5f 67 6f 20 | 3d 20 63 69 6e 66 6f 2d |s_to_go |= cinfo-|
|00005ea0| 3e 72 65 73 74 61 72 74 | 5f 69 6e 74 65 72 76 61 |>restart|_interva|
|00005eb0| 6c 3b 0a 58 20 20 63 69 | 6e 66 6f 2d 3e 6e 65 78 |l;.X ci|nfo->nex|
|00005ec0| 74 5f 72 65 73 74 61 72 | 74 5f 6e 75 6d 20 3d 20 |t_restar|t_num = |
|00005ed0| 30 3b 0a 58 7d 0a 58 0a | 58 0a 58 2f 2a 0a 58 20 |0;.X}.X.|X.X/*.X |
|00005ee0| 2a 20 45 6d 69 74 20 61 | 20 72 65 73 74 61 72 74 |* Emit a| restart|
|00005ef0| 20 6d 61 72 6b 65 72 20 | 26 20 72 65 73 79 6e 63 | marker |& resync|
|00005f00| 68 72 6f 6e 69 7a 65 20 | 70 72 65 64 69 63 74 69 |hronize |predicti|
|00005f10| 6f 6e 73 2e 0a 58 20 2a | 2f 0a 58 0a 58 4c 4f 43 |ons..X *|/.X.XLOC|
|00005f20| 41 4c 20 76 6f 69 64 0a | 58 65 6d 69 74 5f 72 65 |AL void.|Xemit_re|
|00005f30| 73 74 61 72 74 20 28 63 | 6f 6d 70 72 65 73 73 5f |start (c|ompress_|
|00005f40| 69 6e 66 6f 5f 70 74 72 | 20 63 69 6e 66 6f 29 0a |info_ptr| cinfo).|
|00005f50| 58 7b 0a 58 20 20 73 68 | 6f 72 74 20 63 69 3b 0a |X{.X sh|ort ci;.|
|00005f60| 58 0a 58 20 20 66 6c 75 | 73 68 5f 62 69 74 73 28 |X.X flu|sh_bits(|
|00005f70| 29 3b 0a 58 0a 58 20 20 | 65 6d 69 74 5f 62 79 74 |);.X.X |emit_byt|
|00005f80| 65 28 30 78 46 46 29 3b | 0a 58 20 20 65 6d 69 74 |e(0xFF);|.X emit|
|00005f90| 5f 62 79 74 65 28 52 53 | 54 30 20 2b 20 63 69 6e |_byte(RS|T0 + cin|
|00005fa0| 66 6f 2d 3e 6e 65 78 74 | 5f 72 65 73 74 61 72 74 |fo->next|_restart|
|00005fb0| 5f 6e 75 6d 29 3b 0a 58 | 0a 58 20 20 2f 2a 20 52 |_num);.X|.X /* R|
|00005fc0| 65 2d 69 6e 69 74 69 61 | 6c 69 7a 65 20 44 43 20 |e-initia|lize DC |
|00005fd0| 70 72 65 64 69 63 74 69 | 6f 6e 73 20 74 6f 20 30 |predicti|ons to 0|
|00005fe0| 20 2a 2f 0a 58 20 20 66 | 6f 72 20 28 63 69 20 3d | */.X f|or (ci =|
|00005ff0| 20 30 3b 20 63 69 20 3c | 20 63 69 6e 66 6f 2d 3e | 0; ci <| cinfo->|
|00006000| 63 6f 6d 70 73 5f 69 6e | 5f 73 63 61 6e 3b 20 63 |comps_in|_scan; c|
|00006010| 69 2b 2b 29 0a 58 20 20 | 20 20 63 69 6e 66 6f 2d |i++).X | cinfo-|
|00006020| 3e 6c 61 73 74 5f 64 63 | 5f 76 61 6c 5b 63 69 5d |>last_dc|_val[ci]|
|00006030| 20 3d 20 30 3b 0a 58 0a | 58 20 20 2f 2a 20 55 70 | = 0;.X.|X /* Up|
|00006040| 64 61 74 65 20 72 65 73 | 74 61 72 74 20 73 74 61 |date res|tart sta|
|00006050| 74 65 20 2a 2f 0a 58 20 | 20 63 69 6e 66 6f 2d 3e |te */.X | cinfo->|
|00006060| 72 65 73 74 61 72 74 73 | 5f 74 6f 5f 67 6f 20 3d |restarts|_to_go =|
|00006070| 20 63 69 6e 66 6f 2d 3e | 72 65 73 74 61 72 74 5f | cinfo->|restart_|
|00006080| 69 6e 74 65 72 76 61 6c | 3b 0a 58 20 20 63 69 6e |interval|;.X cin|
|00006090| 66 6f 2d 3e 6e 65 78 74 | 5f 72 65 73 74 61 72 74 |fo->next|_restart|
|000060a0| 5f 6e 75 6d 2b 2b 3b 0a | 58 20 20 63 69 6e 66 6f |_num++;.|X cinfo|
|000060b0| 2d 3e 6e 65 78 74 5f 72 | 65 73 74 61 72 74 5f 6e |->next_r|estart_n|
|000060c0| 75 6d 20 26 3d 20 37 3b | 0a 58 7d 0a 58 0a 58 0a |um &= 7;|.X}.X.X.|
|000060d0| 58 2f 2a 0a 58 20 2a 20 | 45 6e 63 6f 64 65 20 61 |X/*.X * |Encode a|
|000060e0| 6e 64 20 6f 75 74 70 75 | 74 20 6f 6e 65 20 4d 43 |nd outpu|t one MC|
|000060f0| 55 27 73 20 77 6f 72 74 | 68 20 6f 66 20 48 75 66 |U's wort|h of Huf|
|00006100| 66 6d 61 6e 2d 63 6f 6d | 70 72 65 73 73 65 64 20 |fman-com|pressed |
|00006110| 63 6f 65 66 66 69 63 69 | 65 6e 74 73 2e 0a 58 20 |coeffici|ents..X |
|00006120| 2a 2f 0a 58 0a 58 4d 45 | 54 48 4f 44 44 45 46 20 |*/.X.XME|THODDEF |
|00006130| 76 6f 69 64 0a 58 68 75 | 66 66 5f 65 6e 63 6f 64 |void.Xhu|ff_encod|
|00006140| 65 20 28 63 6f 6d 70 72 | 65 73 73 5f 69 6e 66 6f |e (compr|ess_info|
|00006150| 5f 70 74 72 20 63 69 6e | 66 6f 2c 20 4a 42 4c 4f |_ptr cin|fo, JBLO|
|00006160| 43 4b 20 2a 4d 43 55 5f | 64 61 74 61 29 0a 58 7b |CK *MCU_|data).X{|
|00006170| 0a 58 20 20 73 68 6f 72 | 74 20 62 6c 6b 6e 2c 20 |.X shor|t blkn, |
|00006180| 63 69 3b 0a 58 20 20 6a | 70 65 67 5f 63 6f 6d 70 |ci;.X j|peg_comp|
|00006190| 6f 6e 65 6e 74 5f 69 6e | 66 6f 20 2a 20 63 6f 6d |onent_in|fo * com|
|000061a0| 70 70 74 72 3b 0a 58 20 | 20 4a 43 4f 45 46 20 74 |pptr;.X | JCOEF t|
|000061b0| 65 6d 70 3b 0a 58 0a 58 | 20 20 2f 2a 20 41 63 63 |emp;.X.X| /* Acc|
|000061c0| 6f 75 6e 74 20 66 6f 72 | 20 72 65 73 74 61 72 74 |ount for| restart|
|000061d0| 20 69 6e 74 65 72 76 61 | 6c 2c 20 65 6d 69 74 20 | interva|l, emit |
|000061e0| 72 65 73 74 61 72 74 20 | 6d 61 72 6b 65 72 20 69 |restart |marker i|
|000061f0| 66 20 6e 65 65 64 65 64 | 20 2a 2f 0a 58 20 20 69 |f needed| */.X i|
|00006200| 66 20 28 63 69 6e 66 6f | 2d 3e 72 65 73 74 61 72 |f (cinfo|->restar|
|00006210| 74 5f 69 6e 74 65 72 76 | 61 6c 29 20 7b 0a 58 20 |t_interv|al) {.X |
|00006220| 20 20 20 69 66 20 28 63 | 69 6e 66 6f 2d 3e 72 65 | if (c|info->re|
|00006230| 73 74 61 72 74 73 5f 74 | 6f 5f 67 6f 20 3d 3d 20 |starts_t|o_go == |
|00006240| 30 29 0a 58 20 20 20 20 | 20 20 65 6d 69 74 5f 72 |0).X | emit_r|
|00006250| 65 73 74 61 72 74 28 63 | 69 6e 66 6f 29 3b 0a 58 |estart(c|info);.X|
|00006260| 20 20 20 20 63 69 6e 66 | 6f 2d 3e 72 65 73 74 61 | cinf|o->resta|
|00006270| 72 74 73 5f 74 6f 5f 67 | 6f 2d 2d 3b 0a 58 20 20 |rts_to_g|o--;.X |
|00006280| 7d 0a 58 0a 58 20 20 66 | 6f 72 20 28 62 6c 6b 6e |}.X.X f|or (blkn|
|00006290| 20 3d 20 30 3b 20 62 6c | 6b 6e 20 3c 20 63 69 6e | = 0; bl|kn < cin|
|000062a0| 66 6f 2d 3e 62 6c 6f 63 | 6b 73 5f 69 6e 5f 4d 43 |fo->bloc|ks_in_MC|
|000062b0| 55 3b 20 62 6c 6b 6e 2b | 2b 29 20 7b 0a 58 20 20 |U; blkn+|+) {.X |
|000062c0| 20 20 63 69 20 3d 20 63 | 69 6e 66 6f 2d 3e 4d 43 | ci = c|info->MC|
|000062d0| 55 5f 6d 65 6d 62 65 72 | 73 68 69 70 5b 62 6c 6b |U_member|ship[blk|
|000062e0| 6e 5d 3b 0a 58 20 20 20 | 20 63 6f 6d 70 70 74 72 |n];.X | compptr|
|000062f0| 20 3d 20 63 69 6e 66 6f | 2d 3e 63 75 72 5f 63 6f | = cinfo|->cur_co|
|00006300| 6d 70 5f 69 6e 66 6f 5b | 63 69 5d 3b 0a 58 20 20 |mp_info[|ci];.X |
|00006310| 20 20 2f 2a 20 43 6f 6e | 76 65 72 74 20 44 43 20 | /* Con|vert DC |
|00006320| 76 61 6c 75 65 20 74 6f | 20 64 69 66 66 65 72 65 |value to| differe|
|00006330| 6e 63 65 2c 20 75 70 64 | 61 74 65 20 6c 61 73 74 |nce, upd|ate last|
|00006340| 5f 64 63 5f 76 61 6c 20 | 2a 2f 0a 58 20 20 20 20 |_dc_val |*/.X |
|00006350| 74 65 6d 70 20 3d 20 4d | 43 55 5f 64 61 74 61 5b |temp = M|CU_data[|
|00006360| 62 6c 6b 6e 5d 5b 30 5d | 3b 0a 58 20 20 20 20 4d |blkn][0]|;.X M|
|00006370| 43 55 5f 64 61 74 61 5b | 62 6c 6b 6e 5d 5b 30 5d |CU_data[|blkn][0]|
|00006380| 20 2d 3d 20 63 69 6e 66 | 6f 2d 3e 6c 61 73 74 5f | -= cinf|o->last_|
|00006390| 64 63 5f 76 61 6c 5b 63 | 69 5d 3b 0a 58 20 20 20 |dc_val[c|i];.X |
|000063a0| 20 63 69 6e 66 6f 2d 3e | 6c 61 73 74 5f 64 63 5f | cinfo->|last_dc_|
|000063b0| 76 61 6c 5b 63 69 5d 20 | 3d 20 74 65 6d 70 3b 0a |val[ci] |= temp;.|
|000063c0| 58 20 20 20 20 65 6e 63 | 6f 64 65 5f 6f 6e 65 5f |X enc|ode_one_|
|000063d0| 62 6c 6f 63 6b 28 4d 43 | 55 5f 64 61 74 61 5b 62 |block(MC|U_data[b|
|000063e0| 6c 6b 6e 5d 2c 0a 58 09 | 09 20 20 20 20 20 63 69 |lkn],.X.|. ci|
|000063f0| 6e 66 6f 2d 3e 64 63 5f | 68 75 66 66 5f 74 62 6c |nfo->dc_|huff_tbl|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.