home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume34 / jpeg / part18 < prev    next >
Encoding:
Text File  |  1992-12-16  |  43.6 KB  |  1,394 lines

  1. Newsgroups: comp.sources.misc
  2. From: jpeg-info@uunet.uu.net (Independent JPEG Group)
  3. Subject:  v34i072:  jpeg - JPEG image compression, Part18/18
  4. Message-ID: <1992Dec17.165222.7031@sparky.imd.sterling.com>
  5. X-Md4-Signature: 4368b6409751dccf6a35226503cd26b5
  6. Date: Thu, 17 Dec 1992 16:52:22 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: jpeg-info@uunet.uu.net (Independent JPEG Group)
  10. Posting-number: Volume 34, Issue 72
  11. Archive-name: jpeg/part18
  12. Environment: UNIX, VMS, MS-DOS, Mac, Amiga, Atari, Cray
  13. Supersedes: jpeg: Volume 29, Issue 1-18
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then feed it
  17. # into a shell via "sh file" or similar.  To overwrite existing files,
  18. # type "sh file -c".
  19. # Contents:  CHANGELOG djpeg.1 jbsmooth.c jcmaster.c jerror.c
  20. #   jmemansi.c jmemnobs.c jutils.c makcjpeg.st makdjpeg.st
  21. #   makefile.vms makljpeg.st
  22. # Wrapped by kent@sparky on Wed Dec 16 20:52:32 1992
  23. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 18 (of 18)."'
  26. if test -f 'CHANGELOG' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'CHANGELOG'\"
  28. else
  29.   echo shar: Extracting \"'CHANGELOG'\" \(5002 characters\)
  30.   sed "s/^X//" >'CHANGELOG' <<'END_OF_FILE'
  31. XCHANGELOG for Independent JPEG Group's JPEG software
  32. X
  33. XVersion 4  10-Dec-92
  34. X--------------------
  35. X
  36. XRevised user interface: switches now use names instead of single letters.
  37. X(Old switch letters are acceptable abbreviations of new switch names, EXCEPT
  38. Xfor djpeg's old -g, -D, -1 switches.)  cjpeg has several new switches.
  39. X
  40. XProvision for smoothing the input image added to cjpeg.  This helps a lot with
  41. Xconverting dithered GIFs to JPEG.
  42. X
  43. XDecoder upsampling now uses interpolation instead of pixel replication; this
  44. Ximproves rendering of sharp colored edges.
  45. X
  46. XThe decompressor will now try to continue after detecting an error in the
  47. Xcompressed data, instead of just aborting.  If the input file has restart
  48. Xmarkers, full synchronization will usually be regained at the next undamaged
  49. Xrestart marker.  (But you're still out of luck if any of the header markers
  50. Xare corrupt.)
  51. X
  52. XSubstantial improvements in speed; DCT accuracy improved too.
  53. X
  54. XNumerous minor changes to improve portability.  egetopt.c, which was by far
  55. Xthe worst portability problem, is gone altogether.
  56. X
  57. XA few bugfixes, sigh (mostly affecting DOS implementations only).
  58. XBugfix: on DOS machines, cjpeg -o would fail on grayscale input files.
  59. XBugfix: one-pass quantization to more than 64 color levels would fail on
  60. X16-bit-int machines.  This could only happen with quantized grayscale output.
  61. X
  62. XA couple of changes affect code that calls the JPEG subroutine library:
  63. X
  64. X1. The parameter struct tag names are now capitalized (Compress_info_struct,
  65. XCompress_methods_struct, Decompress_info_struct, Decompress_methods_struct,
  66. Xand External_methods_struct).  This makes it easier to live with brain-damaged
  67. Xcompilers with short identifier lengths.  (All identifiers used in the JPEG
  68. Xcode are now unique within the first 16 characters.)
  69. X
  70. X2. If you are not calling jselerror(), you need to initialize three new fields
  71. Xin the emethods structure, typically as follows:
  72. X    e_methods.num_warnings = 0; /* no warnings emitted yet */
  73. X    e_methods.first_warning_level = 0; /* display first corrupt-data warning */
  74. X    e_methods.more_warning_level = 3; /* but suppress additional ones */
  75. XThese fields control handling of corrupt-data warnings.
  76. X
  77. X
  78. XVersion 3  17-Mar-92
  79. X--------------------
  80. X
  81. XMemory manager is finally capable of swapping to temp files.  There are
  82. Xseparate versions of jmemsys.c for no temp files (same behavior as older
  83. Xversions), simple temp files with or without tmpfile(), and a DOS-specific
  84. Xversion (including special code for EMS and XMS).  This is probably much more
  85. Xsystem-dependent than any of the older code; some bugs may surface here.
  86. X
  87. XHooks added for user interface to install progress monitoring routine
  88. X(percent-done bar, etc).  See comments with dummy progress_monitor
  89. Xroutines in jcdeflts.c, jddeflts.c.
  90. X
  91. XTwo-pass color quantization (finally!).  This is now the default method when
  92. Xquantizing; say '-1' to djpeg for quick-and-ugly 1-pass method.  There is
  93. Xa test file for checking 2-pass quantization and GIF output.
  94. X
  95. XFixed bug in jcopy_block_row that broke cjpeg -o option and djpeg -b option
  96. Xon MSDOS machines.
  97. X
  98. XMiscellaneous small speedups; notably, DCT computation rearranged so that
  99. XGCC "inline" feature is no longer needed for good code quality.
  100. X
  101. XFile config.c renamed ckconfig.c to avoid name conflict with /etc/config
  102. Xon Unix systems.
  103. X
  104. XAdded example.c to document usage of JPEG subroutines better.
  105. X
  106. XMemory manager now knows how to release all storage during error exit ---
  107. Xavoids memory leak when using JPEG as subroutines.  This implies a couple
  108. Xsmall changes to the subroutine interface: the old free_defaults subroutines
  109. Xare no longer needed, but if you have a replacement error_exit method then it
  110. Xmust call the new free_all method.  Also, jselvirtmem renamed to jselmemmgr.
  111. X
  112. XCode for reading Targa files with 32-bit pixels was incorrect.
  113. X
  114. XColorspace conversion slightly faster and more accurate; because of
  115. Xthis, old "test" files will no longer match bit-for-bit.
  116. X
  117. X
  118. XVersion 2  13-Dec-91
  119. X--------------------
  120. X
  121. XDocumentation improved a little --- there are man pages now.
  122. XInstallation instructions moved from README to a separate file SETUP.
  123. X
  124. XNew program config.c is provided to help you get the configuration options
  125. Xright.  This should make installation a lot more foolproof.
  126. X
  127. XSense of djpeg -D switch reversed: dithering is now ON by default.
  128. X
  129. XRLE image file support added (thanks to Mike Lijewski).
  130. X
  131. XTarga image file support added (thanks to Lee Crocker).
  132. X
  133. XPPM input now accepts all PPM and PGM files.
  134. X
  135. XBug fix: on machines where 'int' is 16 bits, high-Q-setting JPEG files
  136. Xwere not decoded correctly.
  137. X
  138. XNumerous changes to improve portability.  There should be few or no compiler
  139. Xwarnings now.
  140. X
  141. XMakefiles cleaned up; defaults now appropriate for production use rather than
  142. Xdebugging.
  143. X
  144. XSubroutine interface cleaned up.  If you wrote code based on version 1's
  145. Xjcmain/jdmain, you'll need to change it, but it should get a little shorter
  146. Xand simpler.
  147. X
  148. X
  149. XVersion 1   7-Oct-91
  150. X--------------------
  151. X
  152. XInitial public release.
  153. END_OF_FILE
  154.   if test 5002 -ne `wc -c <'CHANGELOG'`; then
  155.     echo shar: \"'CHANGELOG'\" unpacked with wrong size!
  156.   fi
  157.   # end of 'CHANGELOG'
  158. fi
  159. if test -f 'djpeg.1' -a "${1}" != "-c" ; then 
  160.   echo shar: Will not clobber existing file \"'djpeg.1'\"
  161. else
  162.   echo shar: Extracting \"'djpeg.1'\" \(4520 characters\)
  163.   sed "s/^X//" >'djpeg.1' <<'END_OF_FILE'
  164. X.TH DJPEG 1 "2 August 1992"
  165. X.SH NAME
  166. Xdjpeg \- decompress a JPEG file to an image file
  167. X.SH SYNOPSIS
  168. X.B djpeg
  169. X[
  170. X.BI \-colors " N"
  171. X]
  172. X[
  173. X.B \-gif
  174. X]
  175. X[
  176. X.B \-pnm
  177. X]
  178. X[
  179. X.B \-rle
  180. X]
  181. X[
  182. X.B \-targa
  183. X]
  184. X[
  185. X.B \-blocksmooth
  186. X]
  187. X[
  188. X.B \-grayscale
  189. X]
  190. X[
  191. X.BI \-maxmemory " N"
  192. X]
  193. X[
  194. X.B \-nodither
  195. X]
  196. X[
  197. X.B \-onepass
  198. X]
  199. X[
  200. X.B \-verbose
  201. X]
  202. X[
  203. X.B \-debug
  204. X]
  205. X[
  206. X.I filename
  207. X]
  208. X.LP
  209. X.SH DESCRIPTION
  210. X.LP
  211. X.B djpeg
  212. Xdecompresses the named JPEG file, or the standard input if no file is named,
  213. Xand produces an image file on the standard output.  PBMPLUS (PPM/PGM), GIF,
  214. XTarga, or RLE (Utah Raster Toolkit) output format can be selected.  (RLE is
  215. Xsupported only if the URT library is available.)
  216. X.SH OPTIONS
  217. XAll switch names may be abbreviated; for example,
  218. X.B \-grayscale
  219. Xmay be written
  220. X.B \-gray
  221. Xor
  222. X.BR \-gr .
  223. XMost of the "basic" switches can be abbreviated to as little as one letter.
  224. XUpper and lower case are equivalent (thus
  225. X.B \-GIF
  226. Xis the same as
  227. X.BR \-gif ).
  228. XBritish spellings are also accepted (e.g.,
  229. X.BR \-greyscale ),
  230. Xthough for brevity these are not mentioned below.
  231. X.PP
  232. XThe basic switches are:
  233. X.TP
  234. X.BI \-colors " N"
  235. XReduce image to at most N colors.  This reduces the number of colors used in
  236. Xthe output image, so that it can be displayed on a colormapped display or
  237. Xstored in a colormapped file format.  For example, if you have an 8-bit
  238. Xdisplay, you'd need to reduce to 256 or fewer colors.
  239. X.TP
  240. X.BI \-quantize " N"
  241. XSame as
  242. X.BR \-colors .
  243. X.B \-colors
  244. Xis the recommended name,
  245. X.B \-quantize
  246. Xis provided only for backwards compatibility.
  247. X.TP
  248. X.B \-gif
  249. XSelect GIF output format.  Since GIF does not support more than 256 colors,
  250. X.B \-colors 256
  251. Xis assumed (unless you specify a smaller number of colors).
  252. X.TP
  253. X.B \-pnm
  254. XSelect PBMPLUS (PPM/PGM) output format (this is the default format).
  255. XPGM is emitted if the JPEG file is gray-scale or if
  256. X.B \-grayscale
  257. Xis specified; otherwise PPM is emitted.
  258. X.TP
  259. X.B \-rle
  260. XSelect RLE output format.  (Requires URT library.)
  261. X.TP
  262. X.B \-targa
  263. XSelect Targa output format.  Gray-scale format is emitted if the JPEG file is
  264. Xgray-scale or if
  265. X.B \-grayscale
  266. Xis specified; otherwise, colormapped format is emitted if
  267. X.B \-colors
  268. Xis specified; otherwise, 24-bit full-color format is emitted.
  269. X.PP
  270. XSwitches for advanced users:
  271. X.TP
  272. X.B \-blocksmooth
  273. XPerform cross-block smoothing.  This is quite memory-intensive and only seems
  274. Xto improve the image at very low quality settings (\fB\-quality\fR 10 to 20 or
  275. Xso).  At normal quality settings it may make the image worse.
  276. X.TP
  277. X.B \-grayscale
  278. XForce gray-scale output even if JPEG file is color.
  279. XUseful for viewing on monochrome displays.
  280. X.TP
  281. X.BI \-maxmemory " N"
  282. XSet limit for amount of memory to use in processing large images.  Value is
  283. Xin thousands of bytes, or millions of bytes if "M" is attached to the
  284. Xnumber.  For example,
  285. X.B \-max 4m
  286. Xselects 4000000 bytes.  If more space is needed, temporary files will be used.
  287. X.TP
  288. X.B \-nodither
  289. XDo not use dithering in color quantization.  By default, Floyd-Steinberg
  290. Xdithering is applied when quantizing colors, but on some images dithering may
  291. Xresult in objectionable "graininess".  If that happens, you can turn off
  292. Xdithering with
  293. X.BR \-nodither .
  294. X.B \-nodither
  295. Xis ignored unless you also say
  296. X.B \-colors
  297. X.IR N .
  298. X.TP
  299. X.B \-onepass
  300. XUse one-pass instead of two-pass color quantization.  The one-pass method is
  301. Xfaster and needs less memory, but it produces a lower-quality image.
  302. X.B \-onepass
  303. Xis ignored unless you also say
  304. X.B \-colors
  305. X.IR N .
  306. XAlso, the one-pass method is always used for gray-scale output (the two-pass
  307. Xmethod is no improvement then).
  308. X.TP
  309. X.B \-verbose
  310. XEnable debug printout.  More
  311. X.BR \-v 's
  312. Xgive more output.  Also, version information is printed at startup.
  313. X.TP
  314. X.B \-debug
  315. XSame as
  316. X.BR \-verbose .
  317. X.SH EXAMPLES
  318. X.LP
  319. XThis example decompresses the JPEG file foo.jpg, automatically quantizes to
  320. X256 colors, and saves the output in GIF format in foo.gif:
  321. X.IP
  322. X.B djpeg \-gif
  323. X.I foo.jpg
  324. X.B >
  325. X.I foo.gif
  326. X.SH ENVIRONMENT
  327. X.TP
  328. X.B JPEGMEM
  329. XIf this environment variable is set, its value is the default memory limit.
  330. XThe value is specified as described for the
  331. X.B \-maxmemory
  332. Xswitch.
  333. X.B JPEGMEM
  334. Xoverrides the default value specified when the program was compiled, and
  335. Xitself is overridden by an explicit
  336. X.BR \-maxmemory .
  337. X.SH SEE ALSO
  338. X.BR cjpeg (1)
  339. X.br
  340. X.BR ppm (5),
  341. X.BR pgm (5)
  342. X.br
  343. XWallace, Gregory K.  "The JPEG Still Picture Compression Standard",
  344. XCommunications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
  345. X.SH AUTHOR
  346. XIndependent JPEG Group
  347. X.SH BUGS
  348. XArithmetic coding is not supported for legal reasons.
  349. X.PP
  350. XStill not as fast as we'd like.
  351. END_OF_FILE
  352.   if test 4520 -ne `wc -c <'djpeg.1'`; then
  353.     echo shar: \"'djpeg.1'\" unpacked with wrong size!
  354.   fi
  355.   # end of 'djpeg.1'
  356. fi
  357. if test -f 'jbsmooth.c' -a "${1}" != "-c" ; then 
  358.   echo shar: Will not clobber existing file \"'jbsmooth.c'\"
  359. else
  360.   echo shar: Extracting \"'jbsmooth.c'\" \(3259 characters\)
  361.   sed "s/^X//" >'jbsmooth.c' <<'END_OF_FILE'
  362. X/*
  363. X * jbsmooth.c
  364. X *
  365. X * Copyright (C) 1991, 1992, Thomas G. Lane.
  366. X * This file is part of the Independent JPEG Group's software.
  367. X * For conditions of distribution and use, see the accompanying README file.
  368. X *
  369. X * This file contains cross-block smoothing routines.
  370. X * These routines are invoked via the smooth_coefficients method.
  371. X */
  372. X
  373. X#include "jinclude.h"
  374. X
  375. X#ifdef BLOCK_SMOOTHING_SUPPORTED
  376. X
  377. X
  378. X/*
  379. X * Cross-block coefficient smoothing.
  380. X */
  381. X
  382. XMETHODDEF void
  383. Xsmooth_coefficients (decompress_info_ptr cinfo,
  384. X             jpeg_component_info *compptr,
  385. X             JBLOCKROW above,
  386. X             JBLOCKROW currow,
  387. X             JBLOCKROW below,
  388. X             JBLOCKROW output)
  389. X{
  390. X  QUANT_TBL_PTR Qptr = cinfo->quant_tbl_ptrs[compptr->quant_tbl_no];
  391. X  long blocks_in_row = compptr->downsampled_width / DCTSIZE;
  392. X  long col;
  393. X
  394. X  /* First, copy the block row as-is.
  395. X   * This takes care of the first & last blocks in the row, the top/bottom
  396. X   * special cases, and the higher-order coefficients in each block.
  397. X   */
  398. X  jcopy_block_row(currow, output, blocks_in_row);
  399. X
  400. X  /* Now apply the smoothing calculation, but not to any blocks on the
  401. X   * edges of the image.
  402. X   */
  403. X
  404. X  if (above != NULL && below != NULL) {
  405. X    for (col = 1; col < blocks_in_row-1; col++) {
  406. X
  407. X      /* See section K.8 of the JPEG standard.
  408. X       *
  409. X       * As I understand it, this produces approximations
  410. X       * for the low frequency AC components, based on the
  411. X       * DC values of the block and its eight neighboring blocks.
  412. X       * (Thus it can't be used for blocks on the image edges.)
  413. X       */
  414. X
  415. X      /* The layout of these variables corresponds to text and figure in K.8 */
  416. X      
  417. X      JCOEF DC1, DC2, DC3;
  418. X      JCOEF DC4, DC5, DC6;
  419. X      JCOEF DC7, DC8, DC9;
  420. X      
  421. X      long       AC01, AC02;
  422. X      long AC10, AC11;
  423. X      long AC20;
  424. X      
  425. X      DC1 = above [col-1][0];
  426. X      DC2 = above [col  ][0];
  427. X      DC3 = above [col+1][0];
  428. X      DC4 = currow[col-1][0];
  429. X      DC5 = currow[col  ][0];
  430. X      DC6 = currow[col+1][0];
  431. X      DC7 = below [col-1][0];
  432. X      DC8 = below [col  ][0];
  433. X      DC9 = below [col+1][0];
  434. X      
  435. X#define DIVIDE_256(x)    x = ( (x) < 0 ? -((128-(x))/256) : ((x)+128)/256 )
  436. X      
  437. X      AC01 = (36 * (DC4 - DC6));
  438. X      DIVIDE_256(AC01);
  439. X      AC10 = (36 * (DC2 - DC8));
  440. X      DIVIDE_256(AC10);
  441. X      AC20 = (9 * (DC2 + DC8 - 2*DC5));
  442. X      DIVIDE_256(AC20);
  443. X      AC11 = (5 * ((DC1 - DC3) - (DC7 - DC9)));
  444. X      DIVIDE_256(AC11);
  445. X      AC02 = (9 * (DC4 + DC6 - 2*DC5));
  446. X      DIVIDE_256(AC02);
  447. X      
  448. X      /* I think that this checks to see if the quantisation
  449. X       * on the transmitting side would have produced this
  450. X       * answer. If so, then we use our (hopefully better)
  451. X       * estimate.
  452. X       */
  453. X
  454. X#define ABS(x)    ((x) < 0 ? -(x) : (x))
  455. X
  456. X#define COND_ASSIGN(_ac,_n,_z)   if ((ABS(output[col][_n] - (_ac))<<1) <= Qptr[_z]) output[col][_n] = (JCOEF) (_ac)
  457. X
  458. X      COND_ASSIGN(AC01,  1, 1);
  459. X      COND_ASSIGN(AC02,  2, 5);
  460. X      COND_ASSIGN(AC10,  8, 2);
  461. X      COND_ASSIGN(AC11,  9, 4);
  462. X      COND_ASSIGN(AC20, 16, 3);
  463. X    }
  464. X  }
  465. X}
  466. X
  467. X
  468. X/*
  469. X * The method selection routine for cross-block smoothing.
  470. X */
  471. X
  472. XGLOBAL void
  473. Xjselbsmooth (decompress_info_ptr cinfo)
  474. X{
  475. X  /* just one implementation for now */
  476. X  cinfo->methods->smooth_coefficients = smooth_coefficients;
  477. X}
  478. X
  479. X#endif /* BLOCK_SMOOTHING_SUPPORTED */
  480. END_OF_FILE
  481.   if test 3259 -ne `wc -c <'jbsmooth.c'`; then
  482.     echo shar: \"'jbsmooth.c'\" unpacked with wrong size!
  483.   fi
  484.   # end of 'jbsmooth.c'
  485. fi
  486. if test -f 'jcmaster.c' -a "${1}" != "-c" ; then 
  487.   echo shar: Will not clobber existing file \"'jcmaster.c'\"
  488. else
  489.   echo shar: Extracting \"'jcmaster.c'\" \(4206 characters\)
  490.   sed "s/^X//" >'jcmaster.c' <<'END_OF_FILE'
  491. X/*
  492. X * jcmaster.c
  493. X *
  494. X * Copyright (C) 1991, 1992, Thomas G. Lane.
  495. X * This file is part of the Independent JPEG Group's software.
  496. X * For conditions of distribution and use, see the accompanying README file.
  497. X *
  498. X * This file contains the main control for the JPEG compressor.
  499. X * The system-dependent (user interface) code should call jpeg_compress()
  500. X * after doing appropriate setup of the compress_info_struct parameter.
  501. X */
  502. X
  503. X#include "jinclude.h"
  504. X
  505. X
  506. XMETHODDEF void
  507. Xc_per_scan_method_selection (compress_info_ptr cinfo)
  508. X/* Central point for per-scan method selection */
  509. X{
  510. X  /* Edge expansion */
  511. X  jselexpand(cinfo);
  512. X  /* Downsampling of pixels */
  513. X  jseldownsample(cinfo);
  514. X  /* MCU extraction */
  515. X  jselcmcu(cinfo);
  516. X}
  517. X
  518. X
  519. XLOCAL void
  520. Xc_initial_method_selection (compress_info_ptr cinfo)
  521. X/* Central point for initial method selection */
  522. X{
  523. X  /* Input image reading method selection is already done. */
  524. X  /* So is output file header formatting (both are done by user interface). */
  525. X
  526. X  /* Gamma and color space conversion */
  527. X  jselccolor(cinfo);
  528. X  /* Entropy encoding: either Huffman or arithmetic coding. */
  529. X#ifdef C_ARITH_CODING_SUPPORTED
  530. X  jselcarithmetic(cinfo);
  531. X#else
  532. X  cinfo->arith_code = FALSE;    /* force Huffman mode */
  533. X#endif
  534. X  jselchuffman(cinfo);
  535. X  /* Pipeline control */
  536. X  jselcpipeline(cinfo);
  537. X  /* Overall control (that's me!) */
  538. X  cinfo->methods->c_per_scan_method_selection = c_per_scan_method_selection;
  539. X}
  540. X
  541. X
  542. XLOCAL void
  543. Xinitial_setup (compress_info_ptr cinfo)
  544. X/* Do computations that are needed before initial method selection */
  545. X{
  546. X  short ci;
  547. X  jpeg_component_info *compptr;
  548. X
  549. X  /* Compute maximum sampling factors; check factor validity */
  550. X  cinfo->max_h_samp_factor = 1;
  551. X  cinfo->max_v_samp_factor = 1;
  552. X  for (ci = 0; ci < cinfo->num_components; ci++) {
  553. X    compptr = &cinfo->comp_info[ci];
  554. X    if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
  555. X    compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
  556. X      ERREXIT(cinfo->emethods, "Bogus sampling factors");
  557. X    cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
  558. X                   compptr->h_samp_factor);
  559. X    cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
  560. X                   compptr->v_samp_factor);
  561. X
  562. X  }
  563. X
  564. X  /* Compute logical downsampled dimensions of components */
  565. X  for (ci = 0; ci < cinfo->num_components; ci++) {
  566. X    compptr = &cinfo->comp_info[ci];
  567. X    compptr->true_comp_width = (cinfo->image_width * compptr->h_samp_factor
  568. X                + cinfo->max_h_samp_factor - 1)
  569. X                / cinfo->max_h_samp_factor;
  570. X    compptr->true_comp_height = (cinfo->image_height * compptr->v_samp_factor
  571. X                 + cinfo->max_v_samp_factor - 1)
  572. X                 / cinfo->max_v_samp_factor;
  573. X  }
  574. X}
  575. X
  576. X
  577. X/*
  578. X * This is the main entry point to the JPEG compressor.
  579. X */
  580. X
  581. X
  582. XGLOBAL void
  583. Xjpeg_compress (compress_info_ptr cinfo)
  584. X{
  585. X  /* Init pass counts to 0 --- total_passes is adjusted in method selection */
  586. X  cinfo->total_passes = 0;
  587. X  cinfo->completed_passes = 0;
  588. X
  589. X  /* Read the input file header: determine image size & component count.
  590. X   * NOTE: the user interface must have initialized the input_init method
  591. X   * pointer (eg, by calling jselrppm) before calling me.
  592. X   * The other file reading methods (get_input_row etc.) were probably
  593. X   * set at the same time, but could be set up by input_init itself,
  594. X   * or by c_ui_method_selection.
  595. X   */
  596. X  (*cinfo->methods->input_init) (cinfo);
  597. X
  598. X  /* Give UI a chance to adjust compression parameters and select */
  599. X  /* output file format based on results of input_init. */
  600. X  (*cinfo->methods->c_ui_method_selection) (cinfo);
  601. X
  602. X  /* Now select methods for compression steps. */
  603. X  initial_setup(cinfo);
  604. X  c_initial_method_selection(cinfo);
  605. X
  606. X  /* Initialize the output file & other modules as needed */
  607. X  /* (entropy_encoder is inited by pipeline controller) */
  608. X
  609. X  (*cinfo->methods->colorin_init) (cinfo);
  610. X  (*cinfo->methods->write_file_header) (cinfo);
  611. X
  612. X  /* And let the pipeline controller do the rest. */
  613. X  (*cinfo->methods->c_pipeline_controller) (cinfo);
  614. X
  615. X  /* Finish output file, release working storage, etc */
  616. X  (*cinfo->methods->write_file_trailer) (cinfo);
  617. X  (*cinfo->methods->colorin_term) (cinfo);
  618. X  (*cinfo->methods->input_term) (cinfo);
  619. X
  620. X  (*cinfo->emethods->free_all) ();
  621. X
  622. X  /* My, that was easy, wasn't it? */
  623. X}
  624. END_OF_FILE
  625.   if test 4206 -ne `wc -c <'jcmaster.c'`; then
  626.     echo shar: \"'jcmaster.c'\" unpacked with wrong size!
  627.   fi
  628.   # end of 'jcmaster.c'
  629. fi
  630. if test -f 'jerror.c' -a "${1}" != "-c" ; then 
  631.   echo shar: Will not clobber existing file \"'jerror.c'\"
  632. else
  633.   echo shar: Extracting \"'jerror.c'\" \(2640 characters\)
  634.   sed "s/^X//" >'jerror.c' <<'END_OF_FILE'
  635. X/*
  636. X * jerror.c
  637. X *
  638. X * Copyright (C) 1991, 1992, Thomas G. Lane.
  639. X * This file is part of the Independent JPEG Group's software.
  640. X * For conditions of distribution and use, see the accompanying README file.
  641. X *
  642. X * This file contains simple error-reporting and trace-message routines.
  643. X * These are suitable for Unix-like systems and others where writing to
  644. X * stderr is the right thing to do.  If the JPEG software is integrated
  645. X * into a larger application, you may well need to replace these.
  646. X *
  647. X * The error_exit() routine should not return to its caller.  Within a
  648. X * larger application, you might want to have it do a longjmp() to return
  649. X * control to the outer user interface routine.  This should work since
  650. X * the portable JPEG code doesn't use setjmp/longjmp.  You should make sure
  651. X * that free_all is called either within error_exit or after the return to
  652. X * the outer-level routine.
  653. X *
  654. X * These routines are used by both the compression and decompression code.
  655. X */
  656. X
  657. X#include "jinclude.h"
  658. X#ifdef INCLUDES_ARE_ANSI
  659. X#include <stdlib.h>        /* to declare exit() */
  660. X#endif
  661. X
  662. X#ifndef EXIT_FAILURE        /* define exit() codes if not provided */
  663. X#define EXIT_FAILURE  1
  664. X#endif
  665. X
  666. X
  667. Xstatic external_methods_ptr methods; /* saved for access to message_parm, free_all */
  668. X
  669. X
  670. XMETHODDEF void
  671. Xtrace_message (const char *msgtext)
  672. X{
  673. X  fprintf(stderr, msgtext,
  674. X      methods->message_parm[0], methods->message_parm[1],
  675. X      methods->message_parm[2], methods->message_parm[3],
  676. X      methods->message_parm[4], methods->message_parm[5],
  677. X      methods->message_parm[6], methods->message_parm[7]);
  678. X  fprintf(stderr, "\n");
  679. X}
  680. X
  681. X
  682. XMETHODDEF void
  683. Xerror_exit (const char *msgtext)
  684. X{
  685. X  (*methods->trace_message) (msgtext);
  686. X  (*methods->free_all) ();    /* clean up memory allocation */
  687. X  exit(EXIT_FAILURE);
  688. X}
  689. X
  690. X
  691. X/*
  692. X * The method selection routine for simple error handling.
  693. X * The system-dependent setup routine should call this routine
  694. X * to install the necessary method pointers in the supplied struct.
  695. X */
  696. X
  697. XGLOBAL void
  698. Xjselerror (external_methods_ptr emethods)
  699. X{
  700. X  methods = emethods;        /* save struct addr for later access */
  701. X
  702. X  emethods->error_exit = error_exit;
  703. X  emethods->trace_message = trace_message;
  704. X
  705. X  emethods->trace_level = 0;    /* default = no tracing */
  706. X
  707. X  emethods->num_warnings = 0;    /* no warnings emitted yet */
  708. X  /* By default, the first corrupt-data warning will be displayed,
  709. X   * but additional ones will appear only if trace level is at least 3.
  710. X   * A corrupt data file could generate many warnings, so it's a good idea
  711. X   * to suppress additional messages except at high tracing levels.
  712. X   */
  713. X  emethods->first_warning_level = 0;
  714. X  emethods->more_warning_level = 3;
  715. X}
  716. END_OF_FILE
  717.   if test 2640 -ne `wc -c <'jerror.c'`; then
  718.     echo shar: \"'jerror.c'\" unpacked with wrong size!
  719.   fi
  720.   # end of 'jerror.c'
  721. fi
  722. if test -f 'jmemansi.c' -a "${1}" != "-c" ; then 
  723.   echo shar: Will not clobber existing file \"'jmemansi.c'\"
  724. else
  725.   echo shar: Extracting \"'jmemansi.c'\" \(4303 characters\)
  726.   sed "s/^X//" >'jmemansi.c' <<'END_OF_FILE'
  727. X/*
  728. X * jmemansi.c  (jmemsys.c)
  729. X *
  730. X * Copyright (C) 1992, Thomas G. Lane.
  731. X * This file is part of the Independent JPEG Group's software.
  732. X * For conditions of distribution and use, see the accompanying README file.
  733. X *
  734. X * This file provides a simple generic implementation of the system-
  735. X * dependent portion of the JPEG memory manager.  This implementation
  736. X * assumes that you have the ANSI-standard library routine tmpfile().
  737. X * Also, the problem of determining the amount of memory available
  738. X * is shoved onto the user.
  739. X */
  740. X
  741. X#include "jinclude.h"
  742. X#include "jmemsys.h"
  743. X
  744. X#ifdef INCLUDES_ARE_ANSI
  745. X#include <stdlib.h>        /* to declare malloc(), free() */
  746. X#else
  747. Xextern void * malloc PP((size_t size));
  748. Xextern void free PP((void *ptr));
  749. X#endif
  750. X
  751. X#ifndef SEEK_SET        /* pre-ANSI systems may not define this; */
  752. X#define SEEK_SET  0        /* if not, assume 0 is correct */
  753. X#endif
  754. X
  755. X
  756. Xstatic external_methods_ptr methods; /* saved for access to error_exit */
  757. X
  758. Xstatic long total_used;        /* total memory requested so far */
  759. X
  760. X
  761. X/*
  762. X * Memory allocation and freeing are controlled by the regular library
  763. X * routines malloc() and free().
  764. X */
  765. X
  766. XGLOBAL void *
  767. Xjget_small (size_t sizeofobject)
  768. X{
  769. X  total_used += sizeofobject;
  770. X  return (void *) malloc(sizeofobject);
  771. X}
  772. X
  773. XGLOBAL void
  774. Xjfree_small (void * object)
  775. X{
  776. X  free(object);
  777. X}
  778. X
  779. X/*
  780. X * We assume NEED_FAR_POINTERS is not defined and so the separate entry points
  781. X * jget_large, jfree_large are not needed.
  782. X */
  783. X
  784. X
  785. X/*
  786. X * This routine computes the total memory space available for allocation.
  787. X * It's impossible to do this in a portable way; our current solution is
  788. X * to make the user tell us (with a default value set at compile time).
  789. X * If you can actually get the available space, it's a good idea to subtract
  790. X * a slop factor of 5% or so.
  791. X */
  792. X
  793. X#ifndef DEFAULT_MAX_MEM        /* so can override from makefile */
  794. X#define DEFAULT_MAX_MEM        1000000L /* default: one megabyte */
  795. X#endif
  796. X
  797. XGLOBAL long
  798. Xjmem_available (long min_bytes_needed, long max_bytes_needed)
  799. X{
  800. X  return methods->max_memory_to_use - total_used;
  801. X}
  802. X
  803. X
  804. X/*
  805. X * Backing store (temporary file) management.
  806. X * Backing store objects are only used when the value returned by
  807. X * jmem_available is less than the total space needed.  You can dispense
  808. X * with these routines if you have plenty of virtual memory; see jmemnobs.c.
  809. X */
  810. X
  811. X
  812. XMETHODDEF void
  813. Xread_backing_store (backing_store_ptr info, void FAR * buffer_address,
  814. X            long file_offset, long byte_count)
  815. X{
  816. X  if (fseek(info->temp_file, file_offset, SEEK_SET))
  817. X    ERREXIT(methods, "fseek failed on temporary file");
  818. X  if (JFREAD(info->temp_file, buffer_address, byte_count)
  819. X      != (size_t) byte_count)
  820. X    ERREXIT(methods, "fread failed on temporary file");
  821. X}
  822. X
  823. X
  824. XMETHODDEF void
  825. Xwrite_backing_store (backing_store_ptr info, void FAR * buffer_address,
  826. X             long file_offset, long byte_count)
  827. X{
  828. X  if (fseek(info->temp_file, file_offset, SEEK_SET))
  829. X    ERREXIT(methods, "fseek failed on temporary file");
  830. X  if (JFWRITE(info->temp_file, buffer_address, byte_count)
  831. X      != (size_t) byte_count)
  832. X    ERREXIT(methods, "fwrite failed on temporary file --- out of disk space?");
  833. X}
  834. X
  835. X
  836. XMETHODDEF void
  837. Xclose_backing_store (backing_store_ptr info)
  838. X{
  839. X  fclose(info->temp_file);
  840. X  /* Since this implementation uses tmpfile() to create the file,
  841. X   * no explicit file deletion is needed.
  842. X   */
  843. X}
  844. X
  845. X
  846. X/*
  847. X * Initial opening of a backing-store object.
  848. X *
  849. X * This version uses tmpfile(), which constructs a suitable file name
  850. X * behind the scenes.  We don't have to use temp_name[] at all;
  851. X * indeed, we can't even find out the actual name of the temp file.
  852. X */
  853. X
  854. XGLOBAL void
  855. Xjopen_backing_store (backing_store_ptr info, long total_bytes_needed)
  856. X{
  857. X  if ((info->temp_file = tmpfile()) == NULL)
  858. X    ERREXIT(methods, "Failed to create temporary file");
  859. X  info->read_backing_store = read_backing_store;
  860. X  info->write_backing_store = write_backing_store;
  861. X  info->close_backing_store = close_backing_store;
  862. X}
  863. X
  864. X
  865. X/*
  866. X * These routines take care of any system-dependent initialization and
  867. X * cleanup required.  Keep in mind that jmem_term may be called more than
  868. X * once.
  869. X */
  870. X
  871. XGLOBAL void
  872. Xjmem_init (external_methods_ptr emethods)
  873. X{
  874. X  methods = emethods;        /* save struct addr for error exit access */
  875. X  emethods->max_memory_to_use = DEFAULT_MAX_MEM;
  876. X  total_used = 0;
  877. X}
  878. X
  879. XGLOBAL void
  880. Xjmem_term (void)
  881. X{
  882. X  /* no work */
  883. X}
  884. END_OF_FILE
  885.   if test 4303 -ne `wc -c <'jmemansi.c'`; then
  886.     echo shar: \"'jmemansi.c'\" unpacked with wrong size!
  887.   fi
  888.   # end of 'jmemansi.c'
  889. fi
  890. if test -f 'jmemnobs.c' -a "${1}" != "-c" ; then 
  891.   echo shar: Will not clobber existing file \"'jmemnobs.c'\"
  892. else
  893.   echo shar: Extracting \"'jmemnobs.c'\" \(2263 characters\)
  894.   sed "s/^X//" >'jmemnobs.c' <<'END_OF_FILE'
  895. X/*
  896. X * jmemnobs.c  (jmemsys.c)
  897. X *
  898. X * Copyright (C) 1992, Thomas G. Lane.
  899. X * This file is part of the Independent JPEG Group's software.
  900. X * For conditions of distribution and use, see the accompanying README file.
  901. X *
  902. X * This file provides a really simple implementation of the system-
  903. X * dependent portion of the JPEG memory manager.  This implementation
  904. X * assumes that no backing-store files are needed: all required space
  905. X * can be obtained from malloc().
  906. X * This is very portable in the sense that it'll compile on almost anything,
  907. X * but you'd better have lots of main memory (or virtual memory) if you want
  908. X * to process big images.
  909. X * Note that the max_memory_to_use option is ignored by this implementation.
  910. X */
  911. X
  912. X#include "jinclude.h"
  913. X#include "jmemsys.h"
  914. X
  915. X#ifdef INCLUDES_ARE_ANSI
  916. X#include <stdlib.h>        /* to declare malloc(), free() */
  917. X#else
  918. Xextern void * malloc PP((size_t size));
  919. Xextern void free PP((void *ptr));
  920. X#endif
  921. X
  922. X
  923. Xstatic external_methods_ptr methods; /* saved for access to error_exit */
  924. X
  925. X
  926. X/*
  927. X * Memory allocation and freeing are controlled by the regular library
  928. X * routines malloc() and free().
  929. X */
  930. X
  931. XGLOBAL void *
  932. Xjget_small (size_t sizeofobject)
  933. X{
  934. X  return (void *) malloc(sizeofobject);
  935. X}
  936. X
  937. XGLOBAL void
  938. Xjfree_small (void * object)
  939. X{
  940. X  free(object);
  941. X}
  942. X
  943. X/*
  944. X * We assume NEED_FAR_POINTERS is not defined and so the separate entry points
  945. X * jget_large, jfree_large are not needed.
  946. X */
  947. X
  948. X
  949. X/*
  950. X * This routine computes the total memory space available for allocation.
  951. X * Here we always say, "we got all you want bud!"
  952. X */
  953. X
  954. XGLOBAL long
  955. Xjmem_available (long min_bytes_needed, long max_bytes_needed)
  956. X{
  957. X  return max_bytes_needed;
  958. X}
  959. X
  960. X
  961. X/*
  962. X * Backing store (temporary file) management.
  963. X * This should never be called and we just error out.
  964. X */
  965. X
  966. XGLOBAL void
  967. Xjopen_backing_store (backing_store_ptr info, long total_bytes_needed)
  968. X{
  969. X  ERREXIT(methods, "Backing store not supported");
  970. X}
  971. X
  972. X
  973. X/*
  974. X * These routines take care of any system-dependent initialization and
  975. X * cleanup required.  Keep in mind that jmem_term may be called more than
  976. X * once.
  977. X */
  978. X
  979. XGLOBAL void
  980. Xjmem_init (external_methods_ptr emethods)
  981. X{
  982. X  methods = emethods;        /* save struct addr for error exit access */
  983. X  emethods->max_memory_to_use = 0;
  984. X}
  985. X
  986. XGLOBAL void
  987. Xjmem_term (void)
  988. X{
  989. X  /* no work */
  990. X}
  991. END_OF_FILE
  992.   if test 2263 -ne `wc -c <'jmemnobs.c'`; then
  993.     echo shar: \"'jmemnobs.c'\" unpacked with wrong size!
  994.   fi
  995.   # end of 'jmemnobs.c'
  996. fi
  997. if test -f 'jutils.c' -a "${1}" != "-c" ; then 
  998.   echo shar: Will not clobber existing file \"'jutils.c'\"
  999. else
  1000.   echo shar: Extracting \"'jutils.c'\" \(3355 characters\)
  1001.   sed "s/^X//" >'jutils.c' <<'END_OF_FILE'
  1002. X/*
  1003. X * jutils.c
  1004. X *
  1005. X * Copyright (C) 1991, 1992, Thomas G. Lane.
  1006. X * This file is part of the Independent JPEG Group's software.
  1007. X * For conditions of distribution and use, see the accompanying README file.
  1008. X *
  1009. X * This file contains miscellaneous utility routines needed for both
  1010. X * compression and decompression.
  1011. X * Note we prefix all global names with "j" to minimize conflicts with
  1012. X * a surrounding application.
  1013. X */
  1014. X
  1015. X#include "jinclude.h"
  1016. X
  1017. X
  1018. XGLOBAL long
  1019. Xjround_up (long a, long b)
  1020. X/* Compute a rounded up to next multiple of b; a >= 0, b > 0 */
  1021. X{
  1022. X  a += b-1;
  1023. X  return a - (a % b);
  1024. X}
  1025. X
  1026. X
  1027. X/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays
  1028. X * and coefficient-block arrays.  This won't work on 80x86 because the arrays
  1029. X * are FAR and we're assuming a small-pointer memory model.  However, some
  1030. X * DOS compilers provide far-pointer versions of memcpy() and memset() even
  1031. X * in the small-model libraries.  These will be used if USE_FMEM is defined.
  1032. X * Otherwise, the routines below do it the hard way.  (The performance cost
  1033. X * is not all that great, because these routines aren't very heavily used.)
  1034. X */
  1035. X
  1036. X#ifndef NEED_FAR_POINTERS    /* normal case, same as regular macros */
  1037. X#define FMEMCOPY(dest,src,size)    MEMCOPY(dest,src,size)
  1038. X#define FMEMZERO(target,size)    MEMZERO(target,size)
  1039. X#else                /* 80x86 case, define if we can */
  1040. X#ifdef USE_FMEM
  1041. X#define FMEMCOPY(dest,src,size)    _fmemcpy((void FAR *)(dest), (const void FAR *)(src), (size_t)(size))
  1042. X#define FMEMZERO(target,size)    _fmemset((void FAR *)(target), 0, (size_t)(size))
  1043. X#endif
  1044. X#endif
  1045. X
  1046. X
  1047. XGLOBAL void
  1048. Xjcopy_sample_rows (JSAMPARRAY input_array, int source_row,
  1049. X           JSAMPARRAY output_array, int dest_row,
  1050. X           int num_rows, long num_cols)
  1051. X/* Copy some rows of samples from one place to another.
  1052. X * num_rows rows are copied from input_array[source_row++]
  1053. X * to output_array[dest_row++]; these areas should not overlap.
  1054. X * The source and destination arrays must be at least as wide as num_cols.
  1055. X */
  1056. X{
  1057. X  register JSAMPROW inptr, outptr;
  1058. X#ifdef FMEMCOPY
  1059. X  register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE));
  1060. X#else
  1061. X  register long count;
  1062. X#endif
  1063. X  register int row;
  1064. X
  1065. X  input_array += source_row;
  1066. X  output_array += dest_row;
  1067. X
  1068. X  for (row = num_rows; row > 0; row--) {
  1069. X    inptr = *input_array++;
  1070. X    outptr = *output_array++;
  1071. X#ifdef FMEMCOPY
  1072. X    FMEMCOPY(outptr, inptr, count);
  1073. X#else
  1074. X    for (count = num_cols; count > 0; count--)
  1075. X      *outptr++ = *inptr++;    /* needn't bother with GETJSAMPLE() here */
  1076. X#endif
  1077. X  }
  1078. X}
  1079. X
  1080. X
  1081. XGLOBAL void
  1082. Xjcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, long num_blocks)
  1083. X/* Copy a row of coefficient blocks from one place to another. */
  1084. X{
  1085. X#ifdef FMEMCOPY
  1086. X  FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));
  1087. X#else
  1088. X  register JCOEFPTR inptr, outptr;
  1089. X  register long count;
  1090. X
  1091. X  inptr = (JCOEFPTR) input_row;
  1092. X  outptr = (JCOEFPTR) output_row;
  1093. X  for (count = num_blocks * DCTSIZE2; count > 0; count--) {
  1094. X    *outptr++ = *inptr++;
  1095. X  }
  1096. X#endif
  1097. X}
  1098. X
  1099. X
  1100. XGLOBAL void
  1101. Xjzero_far (void FAR * target, size_t bytestozero)
  1102. X/* Zero out a chunk of FAR memory. */
  1103. X/* This might be sample-array data, block-array data, or alloc_medium data. */
  1104. X{
  1105. X#ifdef FMEMZERO
  1106. X  FMEMZERO(target, bytestozero);
  1107. X#else
  1108. X  register char FAR * ptr = (char FAR *) target;
  1109. X  register size_t count;
  1110. X
  1111. X  for (count = bytestozero; count > 0; count--) {
  1112. X    *ptr++ = 0;
  1113. X  }
  1114. X#endif
  1115. X}
  1116. END_OF_FILE
  1117.   if test 3355 -ne `wc -c <'jutils.c'`; then
  1118.     echo shar: \"'jutils.c'\" unpacked with wrong size!
  1119.   fi
  1120.   # end of 'jutils.c'
  1121. fi
  1122. if test -f 'makcjpeg.st' -a "${1}" != "-c" ; then 
  1123.   echo shar: Will not clobber existing file \"'makcjpeg.st'\"
  1124. else
  1125.   echo shar: Extracting \"'makcjpeg.st'\" \(1453 characters\)
  1126.   sed "s/^X//" >'makcjpeg.st' <<'END_OF_FILE'
  1127. X; Project file for Independent JPEG Group's software
  1128. X;
  1129. X; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C.
  1130. X; Thanks to Frank Moehle (Frank.Moehle@arbi.informatik.uni-oldenburg.de)
  1131. X; and to Dr. B. Setzepfandt (bernd@gina.uni-muenster.de).
  1132. X;
  1133. X; To use this file, rename it to CJPEG.PRJ.
  1134. X; If you are using Turbo C, change filenames beginning with "PC..." to "TC..."
  1135. X; Read SETUP instructions before trying to make the program!
  1136. X;
  1137. X;
  1138. X;      * * * Output file * * *
  1139. Xcjpeg.ttp
  1140. X;
  1141. X;      * * * DEFINES * * * 
  1142. X.C[-DHAVE_STDC]
  1143. X.C[-DINCLUDES_ARE_ANSI]
  1144. X.C[-DNEED_SIGNAL_CATCHER]  ; It's safer to have a signal catcher.
  1145. X.C[-DTWO_FILE_COMMANDLINE] ; If you like the UNIX - style with
  1146. X                           ; I/O redirection, comment this line out.
  1147. X.C[-DPROGRESS_REPORT]      ; This enables the % progress indicator
  1148. X;
  1149. X; * * * COMPILER OPTIONS * * *  
  1150. X.C[-P]        ; absolute calls
  1151. X.C[-M]        ; and no string merging, folks
  1152. X.C[-w-par]    ; no "parameter xxxx unused"
  1153. X.C[-DINCOMPLETE_TYPES_BROKEN] ; suppress warnings about undefined structures
  1154. X.C[-wsig]     ; warn if significant digits may be lost
  1155. X.C[-w-cln]    ; no "constant is long" warnings
  1156. X=
  1157. X; * * * * List of modules * * * * 
  1158. XPCSTART.O
  1159. Xjcmain.c        (jinclude.h,jconfig.h,jpegdata.h,jversion.h)
  1160. XJPEG.LIB           ; built by LIB_JPEG.PRJ
  1161. X;PCFLTLIB.LIB      ; floating point library -- you shouldn't need this
  1162. XPCSTDLIB.LIB       ; standard library
  1163. XPCEXTLIB.LIB       ; extended library
  1164. END_OF_FILE
  1165.   if test 1453 -ne `wc -c <'makcjpeg.st'`; then
  1166.     echo shar: \"'makcjpeg.st'\" unpacked with wrong size!
  1167.   fi
  1168.   # end of 'makcjpeg.st'
  1169. fi
  1170. if test -f 'makdjpeg.st' -a "${1}" != "-c" ; then 
  1171.   echo shar: Will not clobber existing file \"'makdjpeg.st'\"
  1172. else
  1173.   echo shar: Extracting \"'makdjpeg.st'\" \(1453 characters\)
  1174.   sed "s/^X//" >'makdjpeg.st' <<'END_OF_FILE'
  1175. X; Project file for Independent JPEG Group's software
  1176. X;
  1177. X; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C.
  1178. X; Thanks to Frank Moehle (Frank.Moehle@arbi.informatik.uni-oldenburg.de)
  1179. X; and to Dr. B. Setzepfandt (bernd@gina.uni-muenster.de).
  1180. X;
  1181. X; To use this file, rename it to DJPEG.PRJ.
  1182. X; If you are using Turbo C, change filenames beginning with "PC..." to "TC..."
  1183. X; Read SETUP instructions before trying to make the program!
  1184. X;
  1185. X;
  1186. X;      * * * Output file * * *
  1187. Xdjpeg.ttp
  1188. X;
  1189. X;      * * * DEFINES * * * 
  1190. X.C[-DHAVE_STDC]
  1191. X.C[-DINCLUDES_ARE_ANSI]
  1192. X.C[-DNEED_SIGNAL_CATCHER]  ; It's safer to have a signal catcher.
  1193. X.C[-DTWO_FILE_COMMANDLINE] ; If you like the UNIX - style with
  1194. X                           ; I/O redirection, comment this line out.
  1195. X.C[-DPROGRESS_REPORT]      ; This enables the % progress indicator
  1196. X;
  1197. X; * * * COMPILER OPTIONS * * *  
  1198. X.C[-P]        ; absolute calls
  1199. X.C[-M]        ; and no string merging, folks
  1200. X.C[-w-par]    ; no "parameter xxxx unused"
  1201. X.C[-DINCOMPLETE_TYPES_BROKEN] ; suppress warnings about undefined structures
  1202. X.C[-wsig]     ; warn if significant digits may be lost
  1203. X.C[-w-cln]    ; no "constant is long" warnings
  1204. X=
  1205. X; * * * * List of modules * * * * 
  1206. XPCSTART.O
  1207. Xjdmain.c        (jinclude.h,jconfig.h,jpegdata.h,jversion.h)
  1208. XJPEG.LIB           ; built by LIB_JPEG.PRJ
  1209. X;PCFLTLIB.LIB      ; floating point library -- you shouldn't need this
  1210. XPCSTDLIB.LIB       ; standard library
  1211. XPCEXTLIB.LIB       ; extended library
  1212. END_OF_FILE
  1213.   if test 1453 -ne `wc -c <'makdjpeg.st'`; then
  1214.     echo shar: \"'makdjpeg.st'\" unpacked with wrong size!
  1215.   fi
  1216.   # end of 'makdjpeg.st'
  1217. fi
  1218. if test -f 'makefile.vms' -a "${1}" != "-c" ; then 
  1219.   echo shar: Will not clobber existing file \"'makefile.vms'\"
  1220. else
  1221.   echo shar: Extracting \"'makefile.vms'\" \(2439 characters\)
  1222.   sed "s/^X//" >'makefile.vms' <<'END_OF_FILE'
  1223. X$! Makefile for Independent JPEG Group's software
  1224. X$!
  1225. X$! This is a command procedure for use on VAX/VMS systems that do not have MMS.
  1226. X$! It builds the JPEG software by brute force, recompiling everything whether
  1227. X$! or not it is necessary.  It then runs the basic self-test.
  1228. X$! Thanks to Rick Dyson (dyson@iowasp.physics.uiowa.edu)
  1229. X$! and Tim Bell (tbell@netcom.com) for their help.
  1230. X$!
  1231. X$! Read SETUP instructions before running this!!
  1232. X$!
  1233. X$ DoCompile := CC /NoDebug /Optimize /Define = (TWO_FILE_COMMANDLINE,HAVE_STDC,INCLUDES_ARE_ANSI)
  1234. X$!
  1235. X$ DoCompile jcmain.c
  1236. X$ DoCompile jdmain.c
  1237. X$ DoCompile jcmaster.c
  1238. X$ DoCompile jcdeflts.c
  1239. X$ DoCompile jcarith.c
  1240. X$ DoCompile jccolor.c
  1241. X$ DoCompile jcexpand.c
  1242. X$ DoCompile jchuff.c
  1243. X$ DoCompile jcmcu.c
  1244. X$ DoCompile jcpipe.c
  1245. X$ DoCompile jcsample.c
  1246. X$ DoCompile jfwddct.c
  1247. X$ DoCompile jwrjfif.c
  1248. X$ DoCompile jrdgif.c
  1249. X$ DoCompile jrdppm.c
  1250. X$ DoCompile jrdrle.c
  1251. X$ DoCompile jrdtarga.c
  1252. X$ DoCompile jdmaster.c
  1253. X$ DoCompile jddeflts.c
  1254. X$ DoCompile jbsmooth.c
  1255. X$ DoCompile jdarith.c
  1256. X$ DoCompile jdcolor.c
  1257. X$ DoCompile jdhuff.c
  1258. X$ DoCompile jdmcu.c
  1259. X$ DoCompile jdpipe.c
  1260. X$ DoCompile jdsample.c
  1261. X$ DoCompile jquant1.c
  1262. X$ DoCompile jquant2.c
  1263. X$ DoCompile jrevdct.c
  1264. X$ DoCompile jrdjfif.c
  1265. X$ DoCompile jwrgif.c
  1266. X$ DoCompile jwrppm.c
  1267. X$ DoCompile jwrrle.c
  1268. X$ DoCompile jwrtarga.c
  1269. X$ DoCompile jutils.c
  1270. X$ DoCompile jerror.c
  1271. X$ DoCompile jmemmgr.c
  1272. X$ DoCompile jmemsys.c
  1273. X$!
  1274. X$ Library /Create libjpeg.olb  jcmaster.obj,jcdeflts.obj,jcarith.obj, -
  1275. X          jccolor.obj,jcexpand.obj,jchuff.obj,jcmcu.obj,jcpipe.obj, -
  1276. X          jcsample.obj,jfwddct.obj,jwrjfif.obj,jrdgif.obj,jrdppm.obj, -
  1277. X          jrdrle.obj,jrdtarga.obj,jdmaster.obj,jddeflts.obj,jbsmooth.obj, -
  1278. X          jdarith.obj,jdcolor.obj,jdhuff.obj,jdmcu.obj,jdpipe.obj, -
  1279. X          jdsample.obj,jquant1.obj,jquant2.obj,jrevdct.obj,jrdjfif.obj, -
  1280. X          jwrgif.obj,jwrppm.obj,jwrrle.obj,jwrtarga.obj,jutils.obj, -
  1281. X          jerror.obj,jmemmgr.obj,jmemsys.obj
  1282. X$!
  1283. X$ Link /Executable = cjpeg.exe  jcmain.obj,libjpeg.olb/Library,Sys$Disk:[]MAKVMS.OPT/Option
  1284. X$!
  1285. X$ Link /Executable = djpeg.exe  jdmain.obj,libjpeg.olb/Library,Sys$Disk:[]MAKVMS.OPT/Option
  1286. X$!
  1287. X$! Run the self-test
  1288. X$!
  1289. X$ mcr sys$disk:[]djpeg      testorig.jpg testout.ppm
  1290. X$ mcr sys$disk:[]djpeg -gif testorig.jpg testout.gif
  1291. X$ mcr sys$disk:[]cjpeg      testimg.ppm testout.jpg
  1292. X$ Backup /Compare/Log testimg.ppm testout.ppm
  1293. X$ Backup /Compare/Log testimg.gif testout.gif
  1294. X$ Backup /Compare/Log testimg.jpg testout.jpg
  1295. X$!
  1296. X$ Exit
  1297. END_OF_FILE
  1298.   if test 2439 -ne `wc -c <'makefile.vms'`; then
  1299.     echo shar: \"'makefile.vms'\" unpacked with wrong size!
  1300.   fi
  1301.   # end of 'makefile.vms'
  1302. fi
  1303. if test -f 'makljpeg.st' -a "${1}" != "-c" ; then 
  1304.   echo shar: Will not clobber existing file \"'makljpeg.st'\"
  1305. else
  1306.   echo shar: Extracting \"'makljpeg.st'\" \(2548 characters\)
  1307.   sed "s/^X//" >'makljpeg.st' <<'END_OF_FILE'
  1308. X; Project file for Independent JPEG Group's software
  1309. X;
  1310. X; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C.
  1311. X; Thanks to Frank Moehle (Frank.Moehle@arbi.informatik.uni-oldenburg.de)
  1312. X; and to Dr. B. Setzepfandt (bernd@gina.uni-muenster.de).
  1313. X;
  1314. X; To use this file, rename it to LIB_JPEG.PRJ.
  1315. X; Read SETUP instructions before trying to make the library!
  1316. X;
  1317. X;
  1318. X;      * * * Output file * * *
  1319. Xjpeg.lib
  1320. X;
  1321. X;      * * * DEFINES * * * 
  1322. X.C[-DHAVE_STDC]
  1323. X.C[-DINCLUDES_ARE_ANSI]
  1324. X;
  1325. X; * * * COMPILER OPTIONS * * *  
  1326. X.C[-P]        ; absolute calls
  1327. X.C[-M]        ; and no string merging, folks
  1328. X.C[-w-par]    ; no "parameter xxxx unused"
  1329. X.C[-DINCOMPLETE_TYPES_BROKEN] ; suppress warnings about undefined structures
  1330. X.C[-wsig]     ; warn if significant digits may be lost
  1331. X.C[-w-cln]    ; no "constant is long" warnings
  1332. X.L[-J]        ; link new Obj-format (so we get a library)
  1333. X=
  1334. X; * * * * List of modules * * * * 
  1335. Xjbsmooth.c        (jinclude.h,jconfig.h,jpegdata.h)
  1336. Xjcarith.c        (jinclude.h,jconfig.h,jpegdata.h)
  1337. Xjccolor.c        (jinclude.h,jconfig.h,jpegdata.h)
  1338. Xjcdeflts.c        (jinclude.h,jconfig.h,jpegdata.h)
  1339. Xjcexpand.c        (jinclude.h,jconfig.h,jpegdata.h)
  1340. Xjchuff.c        (jinclude.h,jconfig.h,jpegdata.h)
  1341. Xjcmaster.c        (jinclude.h,jconfig.h,jpegdata.h)
  1342. Xjcmcu.c        (jinclude.h,jconfig.h,jpegdata.h)
  1343. Xjcpipe.c        (jinclude.h,jconfig.h,jpegdata.h)
  1344. Xjcsample.c        (jinclude.h,jconfig.h,jpegdata.h)
  1345. Xjdarith.c        (jinclude.h,jconfig.h,jpegdata.h)
  1346. Xjdcolor.c        (jinclude.h,jconfig.h,jpegdata.h)
  1347. Xjddeflts.c        (jinclude.h,jconfig.h,jpegdata.h)
  1348. Xjdhuff.c        (jinclude.h,jconfig.h,jpegdata.h)
  1349. Xjdmaster.c        (jinclude.h,jconfig.h,jpegdata.h)
  1350. Xjdmcu.c        (jinclude.h,jconfig.h,jpegdata.h)
  1351. Xjdpipe.c        (jinclude.h,jconfig.h,jpegdata.h)
  1352. Xjdsample.c        (jinclude.h,jconfig.h,jpegdata.h)
  1353. Xjerror.c        (jinclude.h,jconfig.h,jpegdata.h)
  1354. Xjquant1.c        (jinclude.h,jconfig.h,jpegdata.h)
  1355. Xjquant2.c        (jinclude.h,jconfig.h,jpegdata.h)
  1356. Xjfwddct.c        (jinclude.h,jconfig.h,jpegdata.h)
  1357. Xjrevdct.c        (jinclude.h,jconfig.h,jpegdata.h)
  1358. Xjutils.c        (jinclude.h,jconfig.h,jpegdata.h)
  1359. Xjmemmgr.c        (jinclude.h,jconfig.h,jpegdata.h,jmemsys.h)
  1360. Xjrdjfif.c        (jinclude.h,jconfig.h,jpegdata.h)
  1361. Xjrdgif.c        (jinclude.h,jconfig.h,jpegdata.h)
  1362. Xjrdppm.c        (jinclude.h,jconfig.h,jpegdata.h)
  1363. Xjrdrle.c        (jinclude.h,jconfig.h,jpegdata.h)
  1364. Xjrdtarga.c        (jinclude.h,jconfig.h,jpegdata.h)
  1365. Xjwrjfif.c        (jinclude.h,jconfig.h,jpegdata.h)
  1366. Xjwrgif.c        (jinclude.h,jconfig.h,jpegdata.h)
  1367. Xjwrppm.c        (jinclude.h,jconfig.h,jpegdata.h)
  1368. Xjwrrle.c        (jinclude.h,jconfig.h,jpegdata.h)
  1369. Xjwrtarga.c        (jinclude.h,jconfig.h,jpegdata.h)
  1370. Xjmemsys.c        (jinclude.h,jconfig.h,jpegdata.h,jmemsys.h)
  1371. END_OF_FILE
  1372.   if test 2548 -ne `wc -c <'makljpeg.st'`; then
  1373.     echo shar: \"'makljpeg.st'\" unpacked with wrong size!
  1374.   fi
  1375.   # end of 'makljpeg.st'
  1376. fi
  1377. echo shar: End of archive 18 \(of 18\).
  1378. cp /dev/null ark18isdone
  1379. MISSING=""
  1380. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
  1381.     if test ! -f ark${I}isdone ; then
  1382.     MISSING="${MISSING} ${I}"
  1383.     fi
  1384. done
  1385. if test "${MISSING}" = "" ; then
  1386.     echo You have unpacked all 18 archives.
  1387.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1388. else
  1389.     echo You still must unpack the following archives:
  1390.     echo "        " ${MISSING}
  1391. fi
  1392. exit 0
  1393. exit 0 # Just in case...
  1394.