home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / vg-2.03 / jpeg / README < prev    next >
Encoding:
Text File  |  1995-05-03  |  21.1 KB  |  417 lines

  1. The files in this directory are based in part on the work of the
  2. Independent JPEG Group.
  3.  
  4. However, this code does not use the same architecture as the Independent
  5. JPEG Group's free JPEG software and much of the code has undergone
  6. substantial changes. 
  7.  
  8. With the exception of the reverse DCT code in jrevdct.c it is unlikely
  9. that you will recognise any of it ....
  10.  
  11. The Independent JPEG Group's JPEG software comes with the following REAME:
  12.  
  13. --------------------------------------------------------------------------------
  14.  
  15.  
  16. The Independent JPEG Group's JPEG software
  17. ==========================================
  18.  
  19. README for release 4 of 10-Dec-92
  20. =================================
  21.  
  22. This distribution contains the fourth public release of the Independent JPEG
  23. Group's free JPEG software.  You are welcome to redistribute this software and
  24. to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
  25.  
  26. For installation instructions, see file SETUP.
  27.  
  28. For usage instructions, see file USAGE (or the cjpeg.1 and djpeg.1 manual
  29. pages; but USAGE contains a "hints" section not found in the manual pages).
  30. Useful information can also be found in the JPEG FAQ (Frequently Asked
  31. Questions) article; see ARCHIVE LOCATIONS below to obtain the FAQ article.
  32.  
  33. This software is still undergoing revision.  Updated versions may be obtained
  34. by FTP or UUCP to UUNET and other archive sites; see ARCHIVE LOCATIONS below
  35. for details.
  36.  
  37. Serious users of this software (particularly those incorporating it into
  38. larger programs) should contact jpeg-info@uunet.uu.net to be added to our
  39. electronic mailing list.  Mailing list members are notified of updates and
  40. have a chance to participate in technical discussions, etc.
  41.  
  42. This software is the work of Tom Lane, Philip Gladstone, Luis Ortiz,
  43. Lee Crocker, Ge' Weijers, and other members of the Independent JPEG Group.
  44.  
  45.  
  46. DISCLAIMER
  47. ==========
  48.  
  49. THIS SOFTWARE IS NOT COMPLETE NOR FULLY DEBUGGED.  It is not guaranteed to be
  50. useful for anything, nor to be compatible with subsequent releases, nor to be
  51. an accurate implementation of the JPEG standard.  (See LEGAL ISSUES for even
  52. more disclaimers.)
  53.  
  54. Despite that, we believe that this software is pretty good, and if you find
  55. any problems with it, we'd like to know about them.  Please report problems
  56. by e-mail to jpeg-info@uunet.uu.net.
  57.  
  58.  
  59. WHAT'S HERE
  60. ===========
  61.  
  62. This distribution contains C software to implement JPEG image compression and
  63. decompression.  JPEG (pronounced "jay-peg") is a standardized compression
  64. method for full-color and gray-scale images.  JPEG is intended for compressing
  65. "real-world" scenes; cartoons and other non-realistic images are not its
  66. strong suit.  JPEG is lossy, meaning that the output image is not necessarily
  67. identical to the input image.  Hence you must not use JPEG if you have to have
  68. identical output bits.  However, on typical images of real-world scenes, very
  69. good compression levels can be obtained with no visible change, and amazingly
  70. high compression levels are possible if you can tolerate a low-quality image.
  71. For more details, see the references, or just experiment with various
  72. compression settings.
  73.  
  74. The software implements JPEG baseline and extended-sequential compression
  75. processes.  Provision is made for supporting all variants of these processes,
  76. although some uncommon parameter settings aren't implemented yet.  For legal
  77. reasons, we are not distributing code for the arithmetic-coding process; see
  78. LEGAL ISSUES.  At present we have made no provision for supporting the
  79. progressive, hierarchical, or lossless processes defined in the standard.
  80.  
  81. In order to support file conversion and viewing software, we have included
  82. considerable functionality beyond the bare JPEG coding/decoding capability;
  83. for example, the color quantization modules are not strictly part of JPEG
  84. decoding, but they are essential for output to colormapped file formats or
  85. colormapped displays.  These extra functions can be compiled out if not
  86. required for a particular application.
  87.  
  88. The emphasis in designing this software has been on achieving portability and
  89. flexibility, while also making it fast enough to be useful.  In particular,
  90. the software is not intended to be read as a tutorial on JPEG.  (See the
  91. REFERENCES section for introductory material.)  While we hope that the entire
  92. package will someday be industrial-strength code, much remains to be done in
  93. performance tuning and in improving the capabilities of individual modules.
  94.  
  95.  
  96. This software can be used on several levels:
  97.  
  98. * As canned software for JPEG compression and decompression.  Just edit the
  99.   Makefile and configuration files as needed (see file SETUP), compile and go.
  100.   Members of the Independent JPEG Group will improve the out-of-the-box
  101.   functionality and speed as time goes on.
  102.  
  103. * As the basis for other JPEG programs.  For example, you could incorporate
  104.   the decompressor into a general image viewing package by replacing the
  105.   output module with write-to-screen functions.  For an implementation on
  106.   specific hardware, you might want to replace some of the inner loops with
  107.   assembly code.  For a non-command-line-driven system, you might want a
  108.   different user interface.  (Members of the group will be producing Macintosh
  109.   and Amiga versions with more appropriate user interfaces, for example.)
  110.  
  111. * As a toolkit for experimentation with JPEG and JPEG-like algorithms.  Most
  112.   of the individual decisions you might want to mess with are packaged up into
  113.   separate modules.  For example, the details of color-space conversion and
  114.   subsampling techniques are each localized in one compressor and one
  115.   decompressor module.  You'd probably also want to extend the user interface
  116.   to give you more detailed control over the JPEG compression parameters.
  117.  
  118. In particular, we welcome the use of this software as a component of commercial
  119. products; no royalty is required.
  120.  
  121.  
  122. ARCHIVE LOCATIONS
  123. =================
  124.  
  125. The "official" archive site for this software is ftp.uu.net (Internet
  126. address 137.39.1.9 or 192.48.96.9).  The most recent released version can
  127. always be found there in directory graphics/jpeg.  This particular version
  128. will be archived as jpegsrc.v4.tar.Z.  If you are on the Internet, you can
  129. retrieve files from UUNET by anonymous FTP.  If you don't have FTP access,
  130. UUNET's archives are also available via UUCP; contact postmaster@uunet.uu.net
  131. for information on retrieving files that way.
  132.  
  133. Numerous Internet sites maintain copies of the UUNET files; in particular,
  134. you can probably find a copy at any site that archives comp.sources.misc
  135. submissions.  However, only ftp.uu.net is guaranteed to have the latest
  136. official version.
  137.  
  138. You can also obtain this software from CompuServe, in the GRAPHSUPPORT forum
  139. (GO PICS), library 15; this version will be file jpsrc4.zip.  Again,
  140. CompuServe is not guaranteed to have the very latest version.
  141.  
  142. The JPEG FAQ (Frequently Asked Questions) article is a useful source of
  143. general information about JPEG.  It is updated constantly and therefore
  144. is not included in this distribution.  The FAQ is posted every two weeks
  145. to Usenet newsgroups comp.graphics, news.answers, and other groups.  You
  146. can always obtain the latest version from the news.answers archive at
  147. rtfm.mit.edu (18.172.1.27).  By FTP, fetch /pub/usenet/news.answers/jpeg-faq.
  148. If you don't have FTP, send e-mail to mail-server@rtfm.mit.edu with body
  149. "send usenet/news.answers/jpeg-faq".
  150.  
  151.  
  152. SUPPORTING SOFTWARE
  153. ===================
  154.  
  155. You will probably want Jef Poskanzer's PBMPLUS image software, which provides
  156. many useful operations on PPM-format image files.  In particular, it can
  157. convert PPM images to and from a wide range of other formats.  You can FTP
  158. this free software from export.lcs.mit.edu (contrib/pbmplus*.tar.Z) or
  159. ftp.ee.lbl.gov (pbmplus*.tar.Z).  Unfortunately PBMPLUS is not nearly as
  160. portable as the JPEG software is; you are likely to have difficulty making it
  161. work on any non-Unix machine.
  162.  
  163. If you are using X Windows you might want to use the xv or xloadimage viewers
  164. to save yourself the trouble of converting PPM to some other format.  Both of
  165. these can be found in the contrib directory at export.lcs.mit.edu.  Actually,
  166. xv version 2.00 and up incorporates our software and thus can read and write
  167. JPEG files directly.  (NOTE: since xv internally reduces all images to 8
  168. bits/pixel, a JPEG file written by xv will not be very high quality; and xv
  169. cannot fully exploit a 24-bit display.  These problems are expected to go away
  170. in the next xv release, planned for early 1993.  In the meantime, use
  171. xloadimage for 24-bit displays.)
  172.  
  173. For DOS machines, Lee Crocker's free Piclab program is a useful companion to
  174. the JPEG software.  The latest version, currently 1.91, is available by FTP
  175. from SIMTEL20 and its various mirror sites, file <msdos.graphics>piclb191.zip.
  176. CompuServe also has it, in the same library as the JPEG software.
  177.  
  178.  
  179. SOFTWARE THAT'S NO HELP AT ALL
  180. ==============================
  181.  
  182. Handmade Software's shareware PC program GIF2JPG produces files that are
  183. totally incompatible with our programs.  They use a proprietary format that is
  184. an amalgam of GIF and JPEG representations.  However, you can force GIF2JPG
  185. to produce compatible files with its -j switch, and their decompression
  186. program JPG2GIF can read our files (at least ones produced with our default
  187. option settings).
  188.  
  189. Some commercial JPEG implementations are also incompatible as of this writing,
  190. especially programs released before summer 1991.  The root of the problem is
  191. that the ISO JPEG committee failed to specify a concrete file format.  Some
  192. vendors "filled in the blanks" on their own, creating proprietary formats that
  193. no one else could read.  (For example, none of the early commercial JPEG
  194. implementations for the Macintosh were able to exchange compressed files.)
  195.  
  196. The file format we have adopted is called JFIF (see REFERENCES).  This format
  197. has been agreed to by a number of major commercial JPEG vendors, and we expect
  198. that it will become the de facto standard.  JFIF is a minimal representation;
  199. work is also going forward to incorporate JPEG compression into the TIFF 6.0
  200. standard, for use in "high end" applications that need to record a lot of
  201. additional data about an image.  We intend to support TIFF 6.0 in the future.
  202. We hope that these two formats will be sufficient and that other, incompatible
  203. JPEG file formats will not proliferate.
  204.  
  205. Indeed, part of the reason for developing and releasing this free software is
  206. to help force rapid convergence to de facto standards for JPEG file formats.
  207. SUPPORT STANDARD, NON-PROPRIETARY FORMATS: demand JFIF or TIFF 6.0!
  208.  
  209.  
  210. USING JPEG AS A SUBROUTINE IN A LARGER PROGRAM
  211. ==============================================
  212.  
  213. You can readily incorporate the JPEG compression and decompression routines in
  214. a larger program.  The file example.c provides a skeleton of the interface
  215. routines you'll need for this purpose.  Essentially, you replace jcmain.c (for
  216. compression) and/or jdmain.c (for decompression) with your own code.  Note
  217. that the fewer JPEG options you allow the user to twiddle, the less code you
  218. need; all the default options are set up automatically.  (Alternately, if you
  219. know a lot about JPEG or have a special application, you may want to twiddle
  220. the default options even more extensively than jcmain/jdmain do.)
  221.  
  222. Most likely, you will want the uncompressed image to come from memory (for
  223. compression) or go to memory or the screen (for decompression).  For this
  224. purpose you must provide image reading or writing routines that match the
  225. interface used by the image file I/O modules (jrdXXX or jwrXXX); again,
  226. example.c shows a skeleton of what is required.  In this situation, you
  227. won't need any of the non-JPEG image file I/O modules used by cjpeg and djpeg.
  228.  
  229. By default, any error detected inside the JPEG routines will cause a message
  230. to be printed on stderr, followed by exit().  You can override this behavior
  231. by supplying your own message-printing and/or error-exit routines; again,
  232. example.c shows how.
  233.  
  234. We recommend you create libjpeg.a as shown in the Makefile, then link that
  235. with your surrounding program.  (If your linker is at all reasonable, only the
  236. code you actually need will get loaded.)  Include the files jconfig.h and
  237. jpegdata.h in C files that need to call the JPEG routines.
  238.  
  239. CAUTION: some people have tried to compile JPEG and their surrounding code
  240. with different compilers, e.g., cc for JPEG and c++ or gcc for the rest.  This
  241. is a Real Bad Move and you will deserve what happens to you if you try it.
  242. (Hint: the parameter structures can get laid out differently with no warning.)
  243.  
  244. Read our "architecture" file for more info.  If it seems to you that the
  245. software structure doesn't accommodate what you want to do, please contact
  246. the authors.
  247.  
  248. Beginning with version 3, we will endeavor to hold the interface described by
  249. example.c constant, so that you can plug in updated versions of the JPEG code
  250. just by recompiling.  However, we can't guarantee this, especially if you
  251. choose to twiddle any JPEG options not listed in example.c.  Check the
  252. CHANGELOG when installing any new version, and compare example.c against the
  253. prior version.  Recompile your calling software (don't just relink), as we may
  254. add or subtract fields in the parameter structures.
  255.  
  256.  
  257. REFERENCES
  258. ==========
  259.  
  260. We highly recommend reading one or more of these references before trying to
  261. understand the innards of any JPEG software.
  262.  
  263. The best short technical introduction to the JPEG compression algorithm is
  264.     Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
  265.     Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
  266. (Adjacent articles in that issue discuss MPEG motion picture compression,
  267. applications of JPEG, and related topics.)  If you don't have the CACM issue
  268. handy, a PostScript file containing a revised version of the article is
  269. available at ftp.uu.net, graphics/jpeg/wallace.ps.Z.  The file (actually a
  270. preprint for an article to appear in IEEE Trans. Consumer Electronics) omits
  271. the sample images that appeared in CACM, but it includes corrections and some
  272. added material.  Note: the Wallace article is copyright ACM and IEEE, and it
  273. may not be used for commercial purposes.
  274.  
  275. A somewhat less technical, more leisurely introduction to JPEG can be found in
  276. "The Data Compression Book" by Mark Nelson, published by M&T Books (Redwood
  277. City, CA), 1991, ISBN 1-55851-216-0.  This book provides good explanations and
  278. example C code for a multitude of compression methods including JPEG.  It is
  279. an excellent source if you are comfortable reading C code but don't know much
  280. about data compression in general.  The book's JPEG sample code is far from
  281. industrial-strength, but when you are ready to look at a full implementation,
  282. you've got one here...
  283.  
  284. A new textbook about JPEG is "JPEG Still Image Data Compression Standard" by
  285. William B. Pennebaker and Joan L. Mitchell, published by Van Nostrand
  286. Reinhold, 1993, ISBN 0-442-01272-1.  Price US$59.95.  This book includes the
  287. complete text of the ISO JPEG standards (DIS 10918-1 and draft DIS 10918-2).
  288. This is by far the most complete exposition of JPEG in existence, and I highly
  289. recommend it.  If you read the entire book, you will probably know more about
  290. JPEG than I do.
  291.  
  292. The JPEG standard itself is not available electronically; you must order a
  293. paper copy through ISO.  (Unless you are concerned about having a certified
  294. official copy, I recommend buying the Pennebaker and Mitchell book instead;
  295. it's much cheaper and includes a great deal of useful explanatory material.)
  296. In the US, copies of the standard may be ordered from ANSI Sales at (212)
  297. 642-4900.  It's not cheap: as of 1992, Part 1 is $95 and Part 2 is $47, plus
  298. 7% shipping/handling.  The standard is divided into two parts, Part 1 being
  299. the actual specification, while Part 2 covers compliance testing methods.
  300. As of early 1992, Part 1 has Draft International Standard status.  It is
  301. titled "Digital Compression and Coding of Continuous-tone Still Images, Part
  302. 1: Requirements and guidelines" and has document number ISO/IEC DIS 10918-1.
  303. Part 2 is still at Committee Draft status.  It is titled "Digital Compression
  304. and Coding of Continuous-tone Still Images, Part 2: Compliance testing" and
  305. has document number ISO/IEC CD 10918-2.  (NOTE: I'm told that the final
  306. version of Part 2 will differ considerably from the CD draft.)
  307.  
  308. The JPEG standard does not specify all details of an interchangeable file
  309. format.  For the omitted details we follow the "JFIF" conventions, revision
  310. 1.02.  A copy of the JFIF spec is available from:
  311.     Literature Department
  312.     C-Cube Microsystems, Inc.
  313.     399A West Trimble Road
  314.     San Jose, CA  95131
  315.     (408) 944-6300
  316. A PostScript version of this document is available at ftp.uu.net, file
  317. graphics/jpeg/jfif.ps.Z.  It can also be obtained by e-mail from the C-Cube
  318. mail server, netlib@c3.pla.ca.us.  Send the message "send jfif_ps from jpeg"
  319. to the server to obtain the JFIF document; send the message "help" if you have
  320. trouble.
  321.  
  322. The TIFF 6.0 file format specification can be obtained by FTP from sgi.com
  323. (192.48.153.1), file graphics/tiff/TIFF6.ps.Z; or you can order a printed copy
  324. from Aldus Corp. at (206) 628-6593.  It should be noted that the TIFF 6.0 spec
  325. of 3-June-92 has a number of serious problems in its JPEG features.  A
  326. clarification note will probably be needed to ensure that TIFF JPEG files are
  327. compatible across different implementations.  The IJG does not intend to
  328. support TIFF 6.0 until these problems are resolved.
  329.  
  330. If you want to understand this implementation, start by reading the
  331. "architecture" documentation file.  Please read "codingrules" if you want to
  332. contribute any code.
  333.  
  334.  
  335. LEGAL ISSUES
  336. ============
  337.  
  338. The authors make NO WARRANTY or representation, either express or implied,
  339. with respect to this software, its quality, accuracy, merchantability, or
  340. fitness for a particular purpose.  This software is provided "AS IS", and you,
  341. its user, assume the entire risk as to its quality and accuracy.
  342.  
  343. This software is copyright (C) 1991, 1992, Thomas G. Lane.
  344. All Rights Reserved except as specified below.
  345.  
  346. Permission is hereby granted to use, copy, modify, and distribute this
  347. software (or portions thereof) for any purpose, without fee, subject to these
  348. conditions:
  349. (1) If any part of the source code for this software is distributed, then this
  350. README file must be included, with this copyright and no-warranty notice
  351. unaltered; and any additions, deletions, or changes to the original files
  352. must be clearly indicated in accompanying documentation.
  353. (2) If only executable code is distributed, then the accompanying
  354. documentation must state that "this software is based in part on the work of
  355. the Independent JPEG Group".
  356. (3) Permission for use of this software is granted only if the user accepts
  357. full responsibility for any undesirable consequences; the authors accept
  358. NO LIABILITY for damages of any kind.
  359.  
  360. Permission is NOT granted for the use of any IJG author's name or company name
  361. in advertising or publicity relating to this software or products derived from
  362. it.  This software may be referred to only as "the Independent JPEG Group's
  363. software".
  364.  
  365. We specifically permit and encourage the use of this software as the basis of
  366. commercial products, provided that all warranty or liability claims are
  367. assumed by the product vendor.
  368.  
  369.  
  370. ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
  371. sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
  372. ansi2knr.c is NOT covered by the above copyright and conditions, but instead
  373. by the usual distribution terms of the Free Software Foundation; principally,
  374. that you must include source code if you redistribute it.  (See the file
  375. ansi2knr.c for full details.)  However, since ansi2knr.c is not needed as part
  376. of any program generated from the JPEG code, this does not limit you more than
  377. the foregoing paragraphs do.
  378.  
  379.  
  380. It appears that the arithmetic coding option of the JPEG spec is covered by
  381. patents owned by IBM and AT&T, as well as a pending Japanese patent of
  382. Mitsubishi.  Hence arithmetic coding cannot legally be used without obtaining
  383. one or more licenses.  For this reason, support for arithmetic coding has been
  384. removed from the free JPEG software.  (Since arithmetic coding provides only a
  385. marginal gain over the unpatented Huffman mode, it is unlikely that very many
  386. implementors will support it.  If you do obtain the necessary licenses,
  387. contact jpeg-info@uunet.uu.net for a copy of our arithmetic coding modules.)
  388. So far as we are aware, there are no patent restrictions on the remaining
  389. code.
  390.  
  391.  
  392. We are required to state that
  393.     "The Graphics Interchange Format(c) is the Copyright property of
  394.     CompuServe Incorporated.  GIF(sm) is a Service Mark property of
  395.     CompuServe Incorporated."
  396.  
  397.  
  398. TO DO
  399. =====
  400.  
  401. The next major release will probably be a significant rewrite to allow use of
  402. this code in conjunction with Sam Leffler's free TIFF library (assuming the
  403. bugs in the TIFF 6.0 specification get resolved).
  404.  
  405. Many of the modules need fleshing out to provide more complete
  406. implementations, or to provide faster paths for common cases.
  407. Speeding things up is still high on our priority list.
  408.  
  409. We'd appreciate it if people would compile and check out the code on as wide a
  410. variety of systems as possible, and report any portability problems
  411. encountered (with solutions, if possible).  Checks of file compatibility with
  412. other JPEG implementations would also be of interest.  Finally, we would
  413. appreciate code profiles showing where the most time is spent, especially on
  414. unusual systems.
  415.  
  416. Please send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net.
  417.