home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume29 / jpeg / part15 < prev    next >
Encoding:
Text File  |  1992-03-27  |  53.9 KB  |  1,557 lines

  1. Newsgroups: comp.sources.misc
  2. From: jpeg-info@uunet.uu.net (Independent JPEG Group)
  3. Subject:  v29i015:  jpeg - JPEG image compression, Part15/18
  4. Message-ID: <1992Mar25.145404.733@sparky.imd.sterling.com>
  5. X-Md4-Signature: eccbed3270240dac781b2a4d7b461de4
  6. Date: Wed, 25 Mar 1992 14:54:04 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: jpeg-info@uunet.uu.net (Independent JPEG Group)
  10. Posting-number: Volume 29, Issue 15
  11. Archive-name: jpeg/part15
  12. Environment: UNIX, VMS, MS-DOS, Mac, Amiga, Cray
  13.  
  14. #! /bin/sh
  15. # into a shell via "sh file" or similar.  To overwrite existing files,
  16. # type "sh file -c".
  17. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  18. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  19. # Contents:  djpeg.1 jccolor.c jdsample.c jwrrle.c makefile.ansi
  20. #   makefile.mms makefile.sas makefile.unix
  21. # Wrapped by kent@sparky on Mon Mar 23 16:02:55 1992
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. echo If this archive is complete, you will see the following message:
  24. echo '          "shar: End of archive 15 (of 18)."'
  25. if test -f 'djpeg.1' -a "${1}" != "-c" ; then 
  26.   echo shar: Will not clobber existing file \"'djpeg.1'\"
  27. else
  28.   echo shar: Extracting \"'djpeg.1'\" \(3099 characters\)
  29.   sed "s/^X//" >'djpeg.1' <<'END_OF_FILE'
  30. X.TH DJPEG 1 "28 February 1992"
  31. X.SH NAME
  32. Xdjpeg \- decompress a JPEG file to an image file
  33. X.SH SYNOPSIS
  34. X.B djpeg
  35. X[
  36. X.B \-GPRTgD1bd
  37. X]
  38. X[
  39. X.BI \-q " colors"
  40. X]
  41. X[
  42. X.BI \-m " memory"
  43. X]
  44. X[
  45. X.I filename
  46. X]
  47. X.LP
  48. X.SH DESCRIPTION
  49. X.LP
  50. X.B djpeg
  51. Xdecompresses the named JPEG file, or the standard input if no file is named,
  52. Xand produces an image file on the standard output.  PPM, GIF, Targa, or RLE
  53. Xoutput format can be selected.  (RLE is supported only if the URT library is
  54. Xavailable.)
  55. X.SH OPTIONS
  56. X.TP
  57. X.B \-G
  58. XSelect GIF output format (implies
  59. X.BR \-q ,
  60. Xwith default of 256 colors).
  61. X.TP
  62. X.B \-P
  63. XSelect PPM or PGM output format (this is the default).  PGM is emitted if the
  64. XJPEG file is gray-scale or if
  65. X.B \-g
  66. Xis specified.
  67. X.TP
  68. X.B \-R
  69. XSelect RLE output format.  Requires URT library.
  70. X.TP
  71. X.B \-T
  72. XSelect Targa output format.  Gray-scale format is emitted if the JPEG file is
  73. Xgray-scale or if
  74. X.B \-g
  75. Xis specified; otherwise, colormapped format is emitted if
  76. X.B \-q
  77. Xis specified; otherwise, 24-bit full-color format is emitted.
  78. X.TP
  79. X.B \-g
  80. XForce gray-scale output even if input is color.
  81. X.TP
  82. X.BI \-q " N"
  83. XQuantize to N colors.  This reduces the number of colors in the output image
  84. Xso that it can be displayed on a colormapped display or stored in a
  85. Xcolormapped file format.  For example, if you have an 8-bit display, you'd
  86. Xneed to quantize to 256 or fewer colors.
  87. X.TP
  88. X.B \-D
  89. XDo not use dithering in color quantization.  By default, Floyd-Steinberg
  90. Xdithering is applied when quantizing colors, but on some images dithering may
  91. Xresult in objectionable "graininess".  If that happens, you can turn off
  92. Xdithering with
  93. X.BR \-D .
  94. X.B \-D
  95. Xis ignored unless you also say
  96. X.B \-q
  97. Xor
  98. X.BR \-G .
  99. X.TP
  100. X.B \-1
  101. XUse one-pass instead of two-pass color quantization.  The one-pass method is
  102. Xfaster and needs less memory, but it produces a lower-quality image.
  103. X.B \-1
  104. Xis ignored unless you also say
  105. X.B \-q
  106. Xor
  107. X.BR \-G .
  108. XAlso, the one-pass method is always used for gray-scale output (the two-pass
  109. Xmethod is no improvement then).
  110. X.TP
  111. X.B \-b
  112. XPerform cross-block smoothing.  This is quite memory-intensive and only seems
  113. Xto improve the image at low quality settings (\fB\-Q\fR 10 to 20 or so).
  114. XAt normal
  115. X.B \-Q
  116. Xsettings it may make the image worse.
  117. X.TP
  118. X.B \-d
  119. XEnable debug printout.  More
  120. X.BR \-d 's
  121. Xgive more output.  Also, version information is printed at startup.
  122. X.TP
  123. X.BI \-m " memory"
  124. XSet limit for amount of memory to use in processing large images.  Value is
  125. Xin thousands of bytes, or millions of bytes if "M" is attached to the
  126. Xnumber.  For example,
  127. X.B \-m 4m
  128. Xselects 4000000 bytes.  If more space is needed, temporary files will be used.
  129. X.SH EXAMPLES
  130. X.LP
  131. XThis example decompresses the JPEG file foo.jpg, quantizes to 256 colors,
  132. Xand saves the output in GIF format in foo.gif:
  133. X.IP
  134. X.B djpeg \-G
  135. X.I foo.jpg
  136. X.B >
  137. X.I foo.gif
  138. X.SH SEE ALSO
  139. X.BR cjpeg (1)
  140. X.br
  141. X.BR ppm (5),
  142. X.BR pgm (5)
  143. X.br
  144. XWallace, Gregory K.  "The JPEG Still Picture Compression Standard",
  145. XCommunications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
  146. X.SH AUTHOR
  147. XIndependent JPEG Group
  148. X.SH BUGS
  149. XArithmetic coding is not supported for legal reasons.
  150. X.PP
  151. XNot as fast as we'd like.
  152. END_OF_FILE
  153.   if test 3099 -ne `wc -c <'djpeg.1'`; then
  154.     echo shar: \"'djpeg.1'\" unpacked with wrong size!
  155.   fi
  156.   # end of 'djpeg.1'
  157. fi
  158. if test -f 'jccolor.c' -a "${1}" != "-c" ; then 
  159.   echo shar: Will not clobber existing file \"'jccolor.c'\"
  160. else
  161.   echo shar: Extracting \"'jccolor.c'\" \(6864 characters\)
  162.   sed "s/^X//" >'jccolor.c' <<'END_OF_FILE'
  163. X/*
  164. X * jccolor.c
  165. X *
  166. X * Copyright (C) 1991, 1992, Thomas G. Lane.
  167. X * This file is part of the Independent JPEG Group's software.
  168. X * For conditions of distribution and use, see the accompanying README file.
  169. X *
  170. X * This file contains input colorspace conversion routines.
  171. X * These routines are invoked via the methods get_sample_rows
  172. X * and colorin_init/term.
  173. X */
  174. X
  175. X#include "jinclude.h"
  176. X
  177. X
  178. Xstatic JSAMPARRAY pixel_row;    /* Workspace for a pixel row in input format */
  179. X
  180. X
  181. X/*
  182. X * Initialize for colorspace conversion.
  183. X */
  184. X
  185. XMETHODDEF void
  186. Xcolorin_init (compress_info_ptr cinfo)
  187. X{
  188. X  /* Allocate a workspace for the result of get_input_row. */
  189. X  pixel_row = (*cinfo->emethods->alloc_small_sarray)
  190. X        (cinfo->image_width, (long) cinfo->input_components);
  191. X}
  192. X
  193. X
  194. X/*
  195. X * Fetch some rows of pixels from get_input_row and convert to the
  196. X * JPEG colorspace.
  197. X */
  198. X
  199. X
  200. X/*
  201. X * This version handles RGB -> YCbCr conversion.
  202. X * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
  203. X * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
  204. X * The conversion equations to be implemented are therefore
  205. X *    Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B
  206. X *    Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B
  207. X *    Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B
  208. X * where Cb and Cr must be incremented by MAXJSAMPLE/2 to create a
  209. X * nonnegative output value.
  210. X * (These numbers are derived from TIFF Appendix O, draft of 4/10/91.)
  211. X *
  212. X * To avoid floating-point arithmetic, we represent the fractional constants
  213. X * as integers scaled up by 2^14 (about 4 digits precision); we have to divide
  214. X * the products by 2^14, with appropriate rounding, to get the correct answer.
  215. X *
  216. X * For even more speed, we could avoid any multiplications in the inner loop
  217. X * by precalculating the constants times R,G,B for all possible values.
  218. X * This is not currently implemented.
  219. X */
  220. X
  221. X#define SCALEBITS    14
  222. X#define ONE_HALF    ((INT32) 1 << (SCALEBITS-1))
  223. X#define FIX(x)        ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
  224. X
  225. X
  226. XMETHODDEF void
  227. Xget_rgb_ycc_rows (compress_info_ptr cinfo,
  228. X          int rows_to_read, JSAMPIMAGE image_data)
  229. X{
  230. X  register INT32 r, g, b;
  231. X  register JSAMPROW inptr0, inptr1, inptr2;
  232. X  register JSAMPROW outptr0, outptr1, outptr2;
  233. X  register long col;
  234. X  long width = cinfo->image_width;
  235. X  int row;
  236. X
  237. X  for (row = 0; row < rows_to_read; row++) {
  238. X    /* Read one row from the source file */
  239. X    (*cinfo->methods->get_input_row) (cinfo, pixel_row);
  240. X    /* Convert colorspace */
  241. X    inptr0 = pixel_row[0];
  242. X    inptr1 = pixel_row[1];
  243. X    inptr2 = pixel_row[2];
  244. X    outptr0 = image_data[0][row];
  245. X    outptr1 = image_data[1][row];
  246. X    outptr2 = image_data[2][row];
  247. X    for (col = width; col > 0; col--) {
  248. X      r = GETJSAMPLE(*inptr0++);
  249. X      g = GETJSAMPLE(*inptr1++);
  250. X      b = GETJSAMPLE(*inptr2++);
  251. X      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
  252. X       * must be too; we do not need an explicit range-limiting operation.
  253. X       * Hence the value being shifted is never negative, and we don't
  254. X       * need the general RIGHT_SHIFT macro.
  255. X       */
  256. X      /* Y */
  257. X      *outptr0++ = (JSAMPLE)
  258. X    ((  FIX(0.29900)*r  + FIX(0.58700)*g + FIX(0.11400)*b
  259. X      + ONE_HALF) >> SCALEBITS);
  260. X      /* Cb */
  261. X      *outptr1++ = (JSAMPLE)
  262. X    (((-FIX(0.16874))*r - FIX(0.33126)*g + FIX(0.50000)*b
  263. X      + ONE_HALF*(MAXJSAMPLE+1)) >> SCALEBITS);
  264. X      /* Cr */
  265. X      *outptr2++ = (JSAMPLE)
  266. X    ((  FIX(0.50000)*r  - FIX(0.41869)*g - FIX(0.08131)*b
  267. X      + ONE_HALF*(MAXJSAMPLE+1)) >> SCALEBITS);
  268. X    }
  269. X  }
  270. X}
  271. X
  272. X
  273. X/*
  274. X * Fetch some rows of pixels from get_input_row and convert to the
  275. X * JPEG colorspace.
  276. X * This version handles grayscale (no conversion).
  277. X */
  278. X
  279. XMETHODDEF void
  280. Xget_grayscale_rows (compress_info_ptr cinfo,
  281. X            int rows_to_read, JSAMPIMAGE image_data)
  282. X{
  283. X  int row;
  284. X
  285. X  for (row = 0; row < rows_to_read; row++) {
  286. X    /* Read one row from the source file */
  287. X    (*cinfo->methods->get_input_row) (cinfo, pixel_row);
  288. X    /* Convert colorspace (gamma mapping needed here) */
  289. X    jcopy_sample_rows(pixel_row, 0, image_data[0], row,
  290. X              1, cinfo->image_width);
  291. X  }
  292. X}
  293. X
  294. X
  295. X/*
  296. X * Fetch some rows of pixels from get_input_row and convert to the
  297. X * JPEG colorspace.
  298. X * This version handles multi-component colorspaces without conversion.
  299. X */
  300. X
  301. XMETHODDEF void
  302. Xget_noconvert_rows (compress_info_ptr cinfo,
  303. X            int rows_to_read, JSAMPIMAGE image_data)
  304. X{
  305. X  int row, ci;
  306. X
  307. X  for (row = 0; row < rows_to_read; row++) {
  308. X    /* Read one row from the source file */
  309. X    (*cinfo->methods->get_input_row) (cinfo, pixel_row);
  310. X    /* Convert colorspace (gamma mapping needed here) */
  311. X    for (ci = 0; ci < cinfo->input_components; ci++) {
  312. X      jcopy_sample_rows(pixel_row, ci, image_data[ci], row,
  313. X            1, cinfo->image_width);
  314. X    }
  315. X  }
  316. X}
  317. X
  318. X
  319. X/*
  320. X * Finish up at the end of the file.
  321. X */
  322. X
  323. XMETHODDEF void
  324. Xcolorin_term (compress_info_ptr cinfo)
  325. X{
  326. X  /* no work (we let free_all release the workspace) */
  327. X}
  328. X
  329. X
  330. X/*
  331. X * The method selection routine for input colorspace conversion.
  332. X */
  333. X
  334. XGLOBAL void
  335. Xjselccolor (compress_info_ptr cinfo)
  336. X{
  337. X  /* Make sure input_components agrees with in_color_space */
  338. X  switch (cinfo->in_color_space) {
  339. X  case CS_GRAYSCALE:
  340. X    if (cinfo->input_components != 1)
  341. X      ERREXIT(cinfo->emethods, "Bogus input colorspace");
  342. X    break;
  343. X
  344. X  case CS_RGB:
  345. X  case CS_YCbCr:
  346. X  case CS_YIQ:
  347. X    if (cinfo->input_components != 3)
  348. X      ERREXIT(cinfo->emethods, "Bogus input colorspace");
  349. X    break;
  350. X
  351. X  case CS_CMYK:
  352. X    if (cinfo->input_components != 4)
  353. X      ERREXIT(cinfo->emethods, "Bogus input colorspace");
  354. X    break;
  355. X
  356. X  default:
  357. X    ERREXIT(cinfo->emethods, "Unsupported input colorspace");
  358. X    break;
  359. X  }
  360. X
  361. X  /* Check num_components, set conversion method based on requested space */
  362. X  switch (cinfo->jpeg_color_space) {
  363. X  case CS_GRAYSCALE:
  364. X    if (cinfo->num_components != 1)
  365. X      ERREXIT(cinfo->emethods, "Bogus JPEG colorspace");
  366. X    if (cinfo->in_color_space == CS_GRAYSCALE)
  367. X      cinfo->methods->get_sample_rows = get_grayscale_rows;
  368. X    else
  369. X      ERREXIT(cinfo->emethods, "Unsupported color conversion request");
  370. X    break;
  371. X
  372. X  case CS_YCbCr:
  373. X    if (cinfo->num_components != 3)
  374. X      ERREXIT(cinfo->emethods, "Bogus JPEG colorspace");
  375. X    if (cinfo->in_color_space == CS_RGB)
  376. X      cinfo->methods->get_sample_rows = get_rgb_ycc_rows;
  377. X    else if (cinfo->in_color_space == CS_YCbCr)
  378. X      cinfo->methods->get_sample_rows = get_noconvert_rows;
  379. X    else
  380. X      ERREXIT(cinfo->emethods, "Unsupported color conversion request");
  381. X    break;
  382. X
  383. X  case CS_CMYK:
  384. X    if (cinfo->num_components != 4)
  385. X      ERREXIT(cinfo->emethods, "Bogus JPEG colorspace");
  386. X    if (cinfo->in_color_space == CS_CMYK)
  387. X      cinfo->methods->get_sample_rows = get_noconvert_rows;
  388. X    else
  389. X      ERREXIT(cinfo->emethods, "Unsupported color conversion request");
  390. X    break;
  391. X
  392. X  default:
  393. X    ERREXIT(cinfo->emethods, "Unsupported JPEG colorspace");
  394. X    break;
  395. X  }
  396. X
  397. X  cinfo->methods->colorin_init = colorin_init;
  398. X  cinfo->methods->colorin_term = colorin_term;
  399. X}
  400. END_OF_FILE
  401.   if test 6864 -ne `wc -c <'jccolor.c'`; then
  402.     echo shar: \"'jccolor.c'\" unpacked with wrong size!
  403.   fi
  404.   # end of 'jccolor.c'
  405. fi
  406. if test -f 'jdsample.c' -a "${1}" != "-c" ; then 
  407.   echo shar: Will not clobber existing file \"'jdsample.c'\"
  408. else
  409.   echo shar: Extracting \"'jdsample.c'\" \(6290 characters\)
  410.   sed "s/^X//" >'jdsample.c' <<'END_OF_FILE'
  411. X/*
  412. X * jdsample.c
  413. X *
  414. X * Copyright (C) 1991, 1992, Thomas G. Lane.
  415. X * This file is part of the Independent JPEG Group's software.
  416. X * For conditions of distribution and use, see the accompanying README file.
  417. X *
  418. X * This file contains un-subsampling routines.
  419. X * These routines are invoked via the unsubsample and
  420. X * unsubsample_init/term methods.
  421. X */
  422. X
  423. X#include "jinclude.h"
  424. X
  425. X
  426. X/*
  427. X * Initialize for un-subsampling a scan.
  428. X */
  429. X
  430. XMETHODDEF void
  431. Xunsubsample_init (decompress_info_ptr cinfo)
  432. X{
  433. X  /* no work for now */
  434. X}
  435. X
  436. X
  437. X/*
  438. X * Un-subsample pixel values of a single component.
  439. X * This version handles any integral sampling ratios.
  440. X * This is not used for typical JPEG files, so it need not be fast.
  441. X */
  442. X
  443. XMETHODDEF void
  444. Xint_unsubsample (decompress_info_ptr cinfo, int which_component,
  445. X         long input_cols, int input_rows,
  446. X         long output_cols, int output_rows,
  447. X         JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below,
  448. X         JSAMPARRAY output_data)
  449. X{
  450. X  jpeg_component_info * compptr = cinfo->cur_comp_info[which_component];
  451. X  register JSAMPROW inptr, outptr;
  452. X  register JSAMPLE invalue;
  453. X  register short h_expand, h;
  454. X  short v_expand, v;
  455. X  int inrow, outrow;
  456. X  register long incol;
  457. X
  458. X#ifdef DEBUG            /* for debugging pipeline controller */
  459. X  if (input_rows != compptr->v_samp_factor ||
  460. X      output_rows != cinfo->max_v_samp_factor ||
  461. X      (input_cols % compptr->h_samp_factor) != 0 ||
  462. X      (output_cols % cinfo->max_h_samp_factor) != 0 ||
  463. X      output_cols*compptr->h_samp_factor != input_cols*cinfo->max_h_samp_factor)
  464. X    ERREXIT(cinfo->emethods, "Bogus unsubsample parameters");
  465. X#endif
  466. X
  467. X  h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor;
  468. X  v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor;
  469. X
  470. X  outrow = 0;
  471. X  for (inrow = 0; inrow < input_rows; inrow++) {
  472. X    for (v = 0; v < v_expand; v++) {
  473. X      inptr = input_data[inrow];
  474. X      outptr = output_data[outrow++];
  475. X      for (incol = 0; incol < input_cols; incol++) {
  476. X    invalue = GETJSAMPLE(*inptr++);
  477. X    for (h = 0; h < h_expand; h++) {
  478. X      *outptr++ = invalue;
  479. X    }
  480. X      }
  481. X    }
  482. X  }
  483. X}
  484. X
  485. X
  486. X/*
  487. X * Un-subsample pixel values of a single component.
  488. X * This version handles the extremely common case of
  489. X * horizontal expansion by 2 and any integral vertical expansion.
  490. X */
  491. X
  492. XMETHODDEF void
  493. Xh2_unsubsample (decompress_info_ptr cinfo, int which_component,
  494. X        long input_cols, int input_rows,
  495. X        long output_cols, int output_rows,
  496. X        JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below,
  497. X        JSAMPARRAY output_data)
  498. X{
  499. X  jpeg_component_info * compptr = cinfo->cur_comp_info[which_component];
  500. X  register JSAMPROW inptr, outptr;
  501. X  register JSAMPLE invalue;
  502. X  short v_expand, v;
  503. X  int inrow, outrow;
  504. X  register long incol;
  505. X
  506. X#ifdef DEBUG            /* for debugging pipeline controller */
  507. X  if (input_rows != compptr->v_samp_factor ||
  508. X      output_rows != cinfo->max_v_samp_factor ||
  509. X      (input_cols % compptr->h_samp_factor) != 0 ||
  510. X      (output_cols % cinfo->max_h_samp_factor) != 0 ||
  511. X      output_cols*compptr->h_samp_factor != input_cols*cinfo->max_h_samp_factor)
  512. X    ERREXIT(cinfo->emethods, "Bogus unsubsample parameters");
  513. X#endif
  514. X
  515. X  v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor;
  516. X
  517. X/* The subsampled image width will always be a multiple of DCTSIZE,
  518. X * so we can unroll the inner loop.
  519. X */
  520. X
  521. X  outrow = 0;
  522. X  for (inrow = 0; inrow < input_rows; inrow++) {
  523. X    for (v = 0; v < v_expand; v++) {
  524. X      inptr = input_data[inrow];
  525. X      outptr = output_data[outrow++];
  526. X#if DCTSIZE == 8
  527. X      for (incol = 0; incol < input_cols; incol += DCTSIZE) {
  528. X    invalue = GETJSAMPLE(*inptr++);
  529. X    *outptr++ = invalue;
  530. X    *outptr++ = invalue;
  531. X    invalue = GETJSAMPLE(*inptr++);
  532. X    *outptr++ = invalue;
  533. X    *outptr++ = invalue;
  534. X    invalue = GETJSAMPLE(*inptr++);
  535. X    *outptr++ = invalue;
  536. X    *outptr++ = invalue;
  537. X    invalue = GETJSAMPLE(*inptr++);
  538. X    *outptr++ = invalue;
  539. X    *outptr++ = invalue;
  540. X    invalue = GETJSAMPLE(*inptr++);
  541. X    *outptr++ = invalue;
  542. X    *outptr++ = invalue;
  543. X    invalue = GETJSAMPLE(*inptr++);
  544. X    *outptr++ = invalue;
  545. X    *outptr++ = invalue;
  546. X    invalue = GETJSAMPLE(*inptr++);
  547. X    *outptr++ = invalue;
  548. X    *outptr++ = invalue;
  549. X    invalue = GETJSAMPLE(*inptr++);
  550. X    *outptr++ = invalue;
  551. X    *outptr++ = invalue;
  552. X      }
  553. X#else /* nonstandard DCTSIZE */
  554. X      for (incol = 0; incol < input_cols; incol++) {
  555. X    invalue = GETJSAMPLE(*inptr++);
  556. X    *outptr++ = invalue;
  557. X    *outptr++ = invalue;
  558. X      }
  559. X#endif
  560. X    }
  561. X  }
  562. X}
  563. X
  564. X
  565. X/*
  566. X * Un-subsample pixel values of a single component.
  567. X * This version handles the special case of a full-size component.
  568. X */
  569. X
  570. XMETHODDEF void
  571. Xfullsize_unsubsample (decompress_info_ptr cinfo, int which_component,
  572. X              long input_cols, int input_rows,
  573. X              long output_cols, int output_rows,
  574. X              JSAMPARRAY above, JSAMPARRAY input_data, JSAMPARRAY below,
  575. X              JSAMPARRAY output_data)
  576. X{
  577. X#ifdef DEBUG            /* for debugging pipeline controller */
  578. X  if (input_cols != output_cols || input_rows != output_rows)
  579. X    ERREXIT(cinfo->emethods, "Pipeline controller messed up");
  580. X#endif
  581. X
  582. X  jcopy_sample_rows(input_data, 0, output_data, 0, output_rows, output_cols);
  583. X}
  584. X
  585. X
  586. X
  587. X/*
  588. X * Clean up after a scan.
  589. X */
  590. X
  591. XMETHODDEF void
  592. Xunsubsample_term (decompress_info_ptr cinfo)
  593. X{
  594. X  /* no work for now */
  595. X}
  596. X
  597. X
  598. X
  599. X/*
  600. X * The method selection routine for unsubsampling.
  601. X * Note that we must select a routine for each component.
  602. X */
  603. X
  604. XGLOBAL void
  605. Xjselunsubsample (decompress_info_ptr cinfo)
  606. X{
  607. X  short ci;
  608. X  jpeg_component_info * compptr;
  609. X
  610. X  if (cinfo->CCIR601_sampling)
  611. X    ERREXIT(cinfo->emethods, "CCIR601 subsampling not implemented yet");
  612. X
  613. X  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  614. X    compptr = cinfo->cur_comp_info[ci];
  615. X    if (compptr->h_samp_factor == cinfo->max_h_samp_factor &&
  616. X    compptr->v_samp_factor == cinfo->max_v_samp_factor)
  617. X      cinfo->methods->unsubsample[ci] = fullsize_unsubsample;
  618. X    else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
  619. X         (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0)
  620. X      cinfo->methods->unsubsample[ci] = h2_unsubsample;
  621. X    else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 &&
  622. X         (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0)
  623. X      cinfo->methods->unsubsample[ci] = int_unsubsample;
  624. X    else
  625. X      ERREXIT(cinfo->emethods, "Fractional subsampling not implemented yet");
  626. X  }
  627. X
  628. X  cinfo->methods->unsubsample_init = unsubsample_init;
  629. X  cinfo->methods->unsubsample_term = unsubsample_term;
  630. X}
  631. END_OF_FILE
  632.   if test 6290 -ne `wc -c <'jdsample.c'`; then
  633.     echo shar: \"'jdsample.c'\" unpacked with wrong size!
  634.   fi
  635.   # end of 'jdsample.c'
  636. fi
  637. if test -f 'jwrrle.c' -a "${1}" != "-c" ; then 
  638.   echo shar: Will not clobber existing file \"'jwrrle.c'\"
  639. else
  640.   echo shar: Extracting \"'jwrrle.c'\" \(6758 characters\)
  641.   sed "s/^X//" >'jwrrle.c' <<'END_OF_FILE'
  642. X/*
  643. X * jwrrle.c
  644. X *
  645. X * Copyright (C) 1991, 1992, Thomas G. Lane.
  646. X * This file is part of the Independent JPEG Group's software.
  647. X * For conditions of distribution and use, see the accompanying README file.
  648. X *
  649. X * This file contains routines to write output images in RLE format.
  650. X * The Utah Raster Toolkit library is required (version 3.0).
  651. X *
  652. X * These routines may need modification for non-Unix environments or
  653. X * specialized applications.  As they stand, they assume output to
  654. X * an ordinary stdio stream.
  655. X *
  656. X * These routines are invoked via the methods put_pixel_rows, put_color_map,
  657. X * and output_init/term.
  658. X *
  659. X * Based on code contributed by Mike Lijewski.
  660. X */
  661. X
  662. X#include "jinclude.h"
  663. X
  664. X#ifdef RLE_SUPPORTED
  665. X
  666. X/* rle.h is provided by the Utah Raster Toolkit. */
  667. X
  668. X#include <rle.h>
  669. X
  670. X
  671. X/*
  672. X * output_term assumes that JSAMPLE has the same representation as rle_pixel,
  673. X * to wit, "unsigned char".  Hence we can't cope with 12- or 16-bit samples.
  674. X */
  675. X
  676. X#ifndef EIGHT_BIT_SAMPLES
  677. X  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */
  678. X#endif
  679. X
  680. X
  681. X/*
  682. X * Since RLE stores scanlines bottom-to-top, we have to invert the image
  683. X * from JPEG's top-to-bottom order.  To do this, we save the outgoing data
  684. X * in virtual array(s) during put_pixel_row calls, then actually emit the
  685. X * RLE file during output_term.  We use one virtual array if the output is
  686. X * grayscale or colormapped, more if it is full color.
  687. X */
  688. X
  689. X#define MAX_CHANS    4    /* allow up to four color components */
  690. Xstatic big_sarray_ptr channels[MAX_CHANS]; /* Virtual arrays for saved data */
  691. X
  692. Xstatic long cur_output_row;    /* next row# to write to virtual array(s) */
  693. X
  694. X
  695. X/*
  696. X * For now, if we emit an RLE color map then it is always 256 entries long,
  697. X * though not all of the entries need be used.
  698. X */
  699. X
  700. X#define CMAPBITS    8
  701. X#define CMAPLENGTH    (1<<(CMAPBITS))
  702. X
  703. Xstatic rle_map *output_colormap; /* RLE-style color map, or NULL if none */
  704. Xstatic int number_colors;    /* Number of colors actually used */
  705. X
  706. X
  707. X/*
  708. X * Write the file header.
  709. X *
  710. X * In this module it's easier to wait till output_term to actually write
  711. X * anything; here we just request the big arrays we'll need.
  712. X */
  713. X
  714. XMETHODDEF void
  715. Xoutput_init (decompress_info_ptr cinfo)
  716. X{
  717. X  short ci;
  718. X  
  719. X  if (cinfo->final_out_comps > MAX_CHANS)
  720. X    ERREXIT1(cinfo->emethods, "Cannot handle %d output channels for RLE",
  721. X         cinfo->final_out_comps);
  722. X  
  723. X  for (ci = 0; ci < cinfo->final_out_comps; ci++) {
  724. X    channels[ci] = (*cinfo->emethods->request_big_sarray)
  725. X            (cinfo->image_width, cinfo->image_height, 1L);
  726. X  }
  727. X  
  728. X  output_colormap = NULL;    /* No output colormap as yet */
  729. X  number_colors = 0;
  730. X  cur_output_row = 0;        /* Start filling virtual arrays at row 0 */
  731. X
  732. X  cinfo->total_passes++;    /* count file writing as separate pass */
  733. X}
  734. X
  735. X
  736. X/*
  737. X * Write some pixel data.
  738. X *
  739. X * This routine just saves the data away in virtual arrays.
  740. X */
  741. X
  742. XMETHODDEF void
  743. Xput_pixel_rows (decompress_info_ptr cinfo, int num_rows,
  744. X        JSAMPIMAGE pixel_data)
  745. X{
  746. X  JSAMPROW outputrow[1];    /* a pseudo JSAMPARRAY structure */
  747. X  int row;
  748. X  short ci;
  749. X  
  750. X  for (row = 0; row < num_rows; row++) {
  751. X    for (ci = 0; ci < cinfo->final_out_comps; ci++) {
  752. X      outputrow[0] = *((*cinfo->emethods->access_big_sarray)
  753. X            (channels[ci], cur_output_row, TRUE));
  754. X      jcopy_sample_rows(pixel_data[ci], row, outputrow, 0,
  755. X            1, cinfo->image_width);
  756. X    }
  757. X    cur_output_row++;
  758. X  }
  759. X}
  760. X
  761. X
  762. X/*
  763. X * Write the color map.
  764. X *
  765. X *  For RLE output we just save the colormap for the output stage.
  766. X */
  767. X
  768. XMETHODDEF void
  769. Xput_color_map (decompress_info_ptr cinfo, int num_colors, JSAMPARRAY colormap)
  770. X{
  771. X  size_t cmapsize;
  772. X  short ci;
  773. X  int i;
  774. X
  775. X  if (num_colors > CMAPLENGTH)
  776. X    ERREXIT1(cinfo->emethods, "Cannot handle %d colormap entries for RLE",
  777. X         num_colors);
  778. X
  779. X  /* Allocate storage for RLE-style cmap, zero any extra entries */
  780. X  cmapsize = cinfo->color_out_comps * CMAPLENGTH * SIZEOF(rle_map);
  781. X  output_colormap = (rle_map *) (*cinfo->emethods->alloc_small) (cmapsize);
  782. X  MEMZERO((void *) output_colormap, cmapsize);
  783. X
  784. X  /* Save away data in RLE format --- note 8-bit left shift! */
  785. X  /* Shifting would need adjustment for JSAMPLEs wider than 8 bits. */
  786. X  for (ci = 0; ci < cinfo->color_out_comps; ci++) {
  787. X    for (i = 0; i < num_colors; i++) {
  788. X      output_colormap[ci * CMAPLENGTH + i] = GETJSAMPLE(colormap[ci][i]) << 8;
  789. X    }
  790. X  }
  791. X  number_colors = num_colors;
  792. X}
  793. X
  794. X
  795. X/*
  796. X * Finish up at the end of the file.
  797. X *
  798. X * Here is where we really output the RLE file.
  799. X */
  800. X
  801. XMETHODDEF void
  802. Xoutput_term (decompress_info_ptr cinfo)
  803. X{
  804. X  rle_hdr header;        /* Output file information */
  805. X  rle_pixel *output_rows[MAX_CHANS];
  806. X  char cmapcomment[80];
  807. X  short ci;
  808. X  long row;
  809. X
  810. X  /* Initialize the header info */
  811. X  MEMZERO((void *) &header, SIZEOF(rle_hdr)); /* make sure all bits are 0 */
  812. X  header.rle_file = cinfo->output_file;
  813. X  header.xmin     = 0;
  814. X  header.xmax     = cinfo->image_width  - 1;
  815. X  header.ymin     = 0;
  816. X  header.ymax     = cinfo->image_height - 1;
  817. X  header.alpha    = 0;
  818. X  header.ncolors  = cinfo->final_out_comps;
  819. X  for (ci = 0; ci < cinfo->final_out_comps; ci++) {
  820. X    RLE_SET_BIT(header, ci);
  821. X  }
  822. X  if (number_colors > 0) {
  823. X    header.ncmap   = cinfo->color_out_comps;
  824. X    header.cmaplen = CMAPBITS;
  825. X    header.cmap    = output_colormap;
  826. X    /* Add a comment to the output image with the true colormap length. */
  827. X    sprintf(cmapcomment, "color_map_length=%d", number_colors);
  828. X    rle_putcom(cmapcomment, &header);
  829. X  }
  830. X  /* Emit the RLE header and color map (if any) */
  831. X  rle_put_setup(&header);
  832. X
  833. X  /* Now output the RLE data from our virtual array(s).
  834. X   * We assume here that (a) rle_pixel is represented the same as JSAMPLE,
  835. X   * and (b) we are not on a machine where FAR pointers differ from regular.
  836. X   */
  837. X  for (row = cinfo->image_height-1; row >= 0; row--) {
  838. X    (*cinfo->methods->progress_monitor) (cinfo, cinfo->image_height-row-1,
  839. X                     cinfo->image_height);
  840. X    for (ci = 0; ci < cinfo->final_out_comps; ci++) {
  841. X      output_rows[ci] = (rle_pixel *) *((*cinfo->emethods->access_big_sarray)
  842. X                    (channels[ci], row, FALSE));
  843. X    }
  844. X    rle_putrow(output_rows, (int) cinfo->image_width, &header);
  845. X  }
  846. X  cinfo->completed_passes++;
  847. X
  848. X  /* Emit file trailer */
  849. X  rle_puteof(&header);
  850. X  fflush(cinfo->output_file);
  851. X  if (ferror(cinfo->output_file))
  852. X    ERREXIT(cinfo->emethods, "Output file write error");
  853. X
  854. X  /* Release memory */
  855. X  /* no work (we let free_all release the workspace) */
  856. X}
  857. X
  858. X
  859. X/*
  860. X * The method selection routine for RLE format output.
  861. X * This should be called from d_ui_method_selection if RLE output is wanted.
  862. X */
  863. X
  864. XGLOBAL void
  865. Xjselwrle (decompress_info_ptr cinfo)
  866. X{
  867. X  cinfo->methods->output_init    = output_init;
  868. X  cinfo->methods->put_color_map  = put_color_map;
  869. X  cinfo->methods->put_pixel_rows = put_pixel_rows;
  870. X  cinfo->methods->output_term    = output_term;
  871. X}
  872. X
  873. X#endif /* RLE_SUPPORTED */
  874. END_OF_FILE
  875.   if test 6758 -ne `wc -c <'jwrrle.c'`; then
  876.     echo shar: \"'jwrrle.c'\" unpacked with wrong size!
  877.   fi
  878.   # end of 'jwrrle.c'
  879. fi
  880. if test -f 'makefile.ansi' -a "${1}" != "-c" ; then 
  881.   echo shar: Will not clobber existing file \"'makefile.ansi'\"
  882. else
  883.   echo shar: Extracting \"'makefile.ansi'\" \(6360 characters\)
  884.   sed "s/^X//" >'makefile.ansi' <<'END_OF_FILE'
  885. X# Makefile for Independent JPEG Group's software
  886. X
  887. X# This makefile is suitable for Unix-like systems with ANSI-capable compilers.
  888. X# If you have a non-ANSI compiler, makefile.unix is a better starting point.
  889. X
  890. X# Read SETUP instructions before saying "make" !!
  891. X
  892. X# The name of your C compiler:
  893. XCC= cc
  894. X
  895. X# You may need to adjust these cc options:
  896. XCFLAGS= -O
  897. X# In particular:
  898. X#   Add -DBSD if on a pure BSD system (see jinclude.h).
  899. X#   Add -DMEM_STATS to enable gathering of memory usage statistics.
  900. X#   You may also want to add -DTWO_FILE_COMMANDLINE or -D switches for other
  901. X#   symbols listed in jconfig.h, if you prefer not to change jconfig.h.
  902. X
  903. X# Link-time cc options:
  904. XLDFLAGS= 
  905. X
  906. X# To link any special libraries, add the necessary -l commands here.
  907. X# In particular, on some versions of HP-UX (and probably other SysV-derived
  908. X# systems) there is a faster alternate malloc(3) library that you can use
  909. X# by adding "-lmalloc" to this line.
  910. XLDLIBS= 
  911. X
  912. X# miscellaneous OS-dependent stuff
  913. X# linker
  914. XLN= $(CC)
  915. X# file deletion command
  916. XRM= rm -f
  917. X# library (.a) file creation command
  918. XAR= ar rc
  919. X# second step in .a creation (use "touch" if not needed)
  920. XAR2= ranlib
  921. X
  922. X
  923. X# source files (independently compilable files)
  924. XSOURCES= jbsmooth.c jcarith.c jccolor.c jcdeflts.c jcexpand.c jchuff.c \
  925. X        jcmain.c jcmaster.c jcmcu.c jcpipe.c jcsample.c jdarith.c jdcolor.c \
  926. X        jddeflts.c jdhuff.c jdmain.c jdmaster.c jdmcu.c jdpipe.c jdsample.c \
  927. X        jerror.c jquant1.c jquant2.c jfwddct.c jrevdct.c jutils.c jmemmgr.c \
  928. X        jrdjfif.c jrdgif.c jrdppm.c jrdrle.c jrdtarga.c jwrjfif.c jwrgif.c \
  929. X        jwrppm.c jwrrle.c jwrtarga.c
  930. X# virtual source files (not present in distribution file)
  931. XVIRTSOURCES= jmemsys.c
  932. X# system-dependent implementations of source files
  933. XSYSDEPFILES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemdos.h \
  934. X        jmemdosa.asm
  935. X# files included by source files
  936. XINCLUDES= jinclude.h jconfig.h jpegdata.h jversion.h jmemsys.h egetopt.c
  937. X# documentation, test, and support files
  938. XDOCS= README SETUP USAGE CHANGELOG cjpeg.1 djpeg.1 architecture codingrules
  939. XMAKEFILES= makefile.ansi makefile.unix makefile.manx makefile.sas \
  940. X        makefile.mc5 makefile.mc6 makcjpeg.lnk makdjpeg.lnk makefile.bcc \
  941. X        makcjpeg.lst makdjpeg.lst makefile.pwc makcjpeg.cf makdjpeg.cf \
  942. X        makljpeg.cf makefile.mms makefile.vms makvms.opt
  943. XOTHERFILES= ansi2knr.c ckconfig.c example.c
  944. XTESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.jpg
  945. XDISTFILES= $(DOCS) $(MAKEFILES) $(SOURCES) $(SYSDEPFILES) $(INCLUDES) \
  946. X        $(OTHERFILES) $(TESTFILES)
  947. X# objectfiles common to cjpeg and djpeg
  948. XCOMOBJECTS= jutils.o jerror.o jmemmgr.o jmemsys.o
  949. X# compression objectfiles
  950. XCLIBOBJECTS= jcmaster.o jcdeflts.o jcarith.o jccolor.o jcexpand.o jchuff.o \
  951. X        jcmcu.o jcpipe.o jcsample.o jfwddct.o jwrjfif.o jrdgif.o jrdppm.o \
  952. X        jrdrle.o jrdtarga.o
  953. XCOBJECTS= jcmain.o $(CLIBOBJECTS) $(COMOBJECTS)
  954. X# decompression objectfiles
  955. XDLIBOBJECTS= jdmaster.o jddeflts.o jbsmooth.o jdarith.o jdcolor.o jdhuff.o \
  956. X        jdmcu.o jdpipe.o jdsample.o jquant1.o jquant2.o jrevdct.o jrdjfif.o \
  957. X        jwrgif.o jwrppm.o jwrrle.o jwrtarga.o
  958. XDOBJECTS= jdmain.o $(DLIBOBJECTS) $(COMOBJECTS)
  959. X# These objectfiles are included in libjpeg.a
  960. XLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
  961. X
  962. X
  963. Xall: cjpeg djpeg
  964. X# By default, libjpeg.a is not built unless you explicitly request it.
  965. X# You can add libjpeg.a to the line above if you want it built by default.
  966. X
  967. X
  968. Xcjpeg: $(COBJECTS)
  969. X    $(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) $(LDLIBS)
  970. X
  971. Xdjpeg: $(DOBJECTS)
  972. X    $(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) $(LDLIBS)
  973. X
  974. X# libjpeg.a is useful if you are including the JPEG software in a larger
  975. X# program; you'd include it in your link, rather than the individual modules.
  976. Xlibjpeg.a: $(LIBOBJECTS)
  977. X    $(RM) libjpeg.a
  978. X    $(AR) libjpeg.a  $(LIBOBJECTS)
  979. X    $(AR2) libjpeg.a
  980. X
  981. Xclean:
  982. X    $(RM) *.o cjpeg djpeg libjpeg.a core testout.*
  983. X
  984. Xdistribute:
  985. X    $(RM) jpegsrc.tar*
  986. X    tar cvf jpegsrc.tar $(DISTFILES)
  987. X    compress -v jpegsrc.tar
  988. X
  989. Xtest: cjpeg djpeg
  990. X    $(RM) testout.ppm testout.gif testout.jpg
  991. X    ./djpeg testorig.jpg >testout.ppm
  992. X    ./djpeg -G testorig.jpg >testout.gif
  993. X    ./cjpeg testimg.ppm >testout.jpg
  994. X    cmp testimg.ppm testout.ppm
  995. X    cmp testimg.gif testout.gif
  996. X    cmp testimg.jpg testout.jpg
  997. X
  998. X
  999. Xjbsmooth.o : jbsmooth.c jinclude.h jconfig.h jpegdata.h 
  1000. Xjcarith.o : jcarith.c jinclude.h jconfig.h jpegdata.h 
  1001. Xjccolor.o : jccolor.c jinclude.h jconfig.h jpegdata.h 
  1002. Xjcdeflts.o : jcdeflts.c jinclude.h jconfig.h jpegdata.h 
  1003. Xjcexpand.o : jcexpand.c jinclude.h jconfig.h jpegdata.h 
  1004. Xjchuff.o : jchuff.c jinclude.h jconfig.h jpegdata.h 
  1005. Xjcmain.o : jcmain.c jinclude.h jconfig.h jpegdata.h jversion.h egetopt.c 
  1006. Xjcmaster.o : jcmaster.c jinclude.h jconfig.h jpegdata.h 
  1007. Xjcmcu.o : jcmcu.c jinclude.h jconfig.h jpegdata.h 
  1008. Xjcpipe.o : jcpipe.c jinclude.h jconfig.h jpegdata.h 
  1009. Xjcsample.o : jcsample.c jinclude.h jconfig.h jpegdata.h 
  1010. Xjdarith.o : jdarith.c jinclude.h jconfig.h jpegdata.h 
  1011. Xjdcolor.o : jdcolor.c jinclude.h jconfig.h jpegdata.h 
  1012. Xjddeflts.o : jddeflts.c jinclude.h jconfig.h jpegdata.h 
  1013. Xjdhuff.o : jdhuff.c jinclude.h jconfig.h jpegdata.h 
  1014. Xjdmain.o : jdmain.c jinclude.h jconfig.h jpegdata.h jversion.h egetopt.c 
  1015. Xjdmaster.o : jdmaster.c jinclude.h jconfig.h jpegdata.h 
  1016. Xjdmcu.o : jdmcu.c jinclude.h jconfig.h jpegdata.h 
  1017. Xjdpipe.o : jdpipe.c jinclude.h jconfig.h jpegdata.h 
  1018. Xjdsample.o : jdsample.c jinclude.h jconfig.h jpegdata.h 
  1019. Xjerror.o : jerror.c jinclude.h jconfig.h jpegdata.h 
  1020. Xjquant1.o : jquant1.c jinclude.h jconfig.h jpegdata.h 
  1021. Xjquant2.o : jquant2.c jinclude.h jconfig.h jpegdata.h 
  1022. Xjfwddct.o : jfwddct.c jinclude.h jconfig.h jpegdata.h 
  1023. Xjrevdct.o : jrevdct.c jinclude.h jconfig.h jpegdata.h 
  1024. Xjutils.o : jutils.c jinclude.h jconfig.h jpegdata.h 
  1025. Xjmemmgr.o : jmemmgr.c jinclude.h jconfig.h jpegdata.h jmemsys.h 
  1026. Xjrdjfif.o : jrdjfif.c jinclude.h jconfig.h jpegdata.h 
  1027. Xjrdgif.o : jrdgif.c jinclude.h jconfig.h jpegdata.h 
  1028. Xjrdppm.o : jrdppm.c jinclude.h jconfig.h jpegdata.h 
  1029. Xjrdrle.o : jrdrle.c jinclude.h jconfig.h jpegdata.h 
  1030. Xjrdtarga.o : jrdtarga.c jinclude.h jconfig.h jpegdata.h 
  1031. Xjwrjfif.o : jwrjfif.c jinclude.h jconfig.h jpegdata.h 
  1032. Xjwrgif.o : jwrgif.c jinclude.h jconfig.h jpegdata.h 
  1033. Xjwrppm.o : jwrppm.c jinclude.h jconfig.h jpegdata.h 
  1034. Xjwrrle.o : jwrrle.c jinclude.h jconfig.h jpegdata.h 
  1035. Xjwrtarga.o : jwrtarga.c jinclude.h jconfig.h jpegdata.h 
  1036. Xjmemsys.o : jmemsys.c jinclude.h jconfig.h jpegdata.h jmemsys.h 
  1037. END_OF_FILE
  1038.   if test 6360 -ne `wc -c <'makefile.ansi'`; then
  1039.     echo shar: \"'makefile.ansi'\" unpacked with wrong size!
  1040.   fi
  1041.   # end of 'makefile.ansi'
  1042. fi
  1043. if test -f 'makefile.mms' -a "${1}" != "-c" ; then 
  1044.   echo shar: Will not clobber existing file \"'makefile.mms'\"
  1045. else
  1046.   echo shar: Extracting \"'makefile.mms'\" \(6695 characters\)
  1047.   sed "s/^X//" >'makefile.mms' <<'END_OF_FILE'
  1048. X# Makefile for Independent JPEG Group's software
  1049. X
  1050. X# This makefile is for use with MMS on VAX/VMS systems.
  1051. X# Thanks to Rick Dyson (dyson@iowasp.physics.uiowa.edu) for his help.
  1052. X
  1053. X# Read SETUP instructions before saying "MMS" !!
  1054. X
  1055. XCFLAGS= $(CFLAGS) /NoDebug /Optimize /Define = (TWO_FILE_COMMANDLINE,HAVE_STDC,INCLUDES_ARE_ANSI)
  1056. XOPT= Sys$Disk:[]MAKVMS.OPT
  1057. X
  1058. X
  1059. X# source files (independently compilable files)
  1060. XSOURCES= jbsmooth.c jcarith.c jccolor.c jcdeflts.c jcexpand.c jchuff.c \
  1061. X        jcmain.c jcmaster.c jcmcu.c jcpipe.c jcsample.c jdarith.c jdcolor.c \
  1062. X        jddeflts.c jdhuff.c jdmain.c jdmaster.c jdmcu.c jdpipe.c jdsample.c \
  1063. X        jerror.c jquant1.c jquant2.c jfwddct.c jrevdct.c jutils.c jmemmgr.c \
  1064. X        jrdjfif.c jrdgif.c jrdppm.c jrdrle.c jrdtarga.c jwrjfif.c jwrgif.c \
  1065. X        jwrppm.c jwrrle.c jwrtarga.c
  1066. X# virtual source files (not present in distribution file)
  1067. XVIRTSOURCES= jmemsys.c
  1068. X# system-dependent implementations of source files
  1069. XSYSDEPFILES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemdos.h \
  1070. X        jmemdosa.asm
  1071. X# files included by source files
  1072. XINCLUDES= jinclude.h jconfig.h jpegdata.h jversion.h jmemsys.h egetopt.c
  1073. X# documentation, test, and support files
  1074. XDOCS= README SETUP USAGE CHANGELOG cjpeg.1 djpeg.1 architecture codingrules
  1075. XMAKEFILES= makefile.ansi makefile.unix makefile.manx makefile.sas \
  1076. X        makefile.mc5 makefile.mc6 makcjpeg.lnk makdjpeg.lnk makefile.bcc \
  1077. X        makcjpeg.lst makdjpeg.lst makefile.pwc makcjpeg.cf makdjpeg.cf \
  1078. X        makljpeg.cf makefile.mms makefile.vms makvms.opt
  1079. XOTHERFILES= ansi2knr.c ckconfig.c example.c
  1080. XTESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.jpg
  1081. XDISTFILES= $(DOCS) $(MAKEFILES) $(SOURCES) $(SYSDEPFILES) $(INCLUDES) \
  1082. X        $(OTHERFILES) $(TESTFILES)
  1083. X# objectfiles common to cjpeg and djpeg
  1084. XCOMOBJECTS= jutils.obj jerror.obj jmemmgr.obj jmemsys.obj
  1085. X# compression objectfiles
  1086. XCLIBOBJECTS= jcmaster.obj jcdeflts.obj jcarith.obj jccolor.obj jcexpand.obj \
  1087. X        jchuff.obj jcmcu.obj jcpipe.obj jcsample.obj jfwddct.obj \
  1088. X        jwrjfif.obj jrdgif.obj jrdppm.obj jrdrle.obj jrdtarga.obj
  1089. XCOBJECTS= jcmain.obj $(CLIBOBJECTS) $(COMOBJECTS)
  1090. X# decompression objectfiles
  1091. XDLIBOBJECTS= jdmaster.obj jddeflts.obj jbsmooth.obj jdarith.obj jdcolor.obj \
  1092. X        jdhuff.obj jdmcu.obj jdpipe.obj jdsample.obj jquant1.obj \
  1093. X        jquant2.obj jrevdct.obj jrdjfif.obj jwrgif.obj jwrppm.obj \
  1094. X        jwrrle.obj jwrtarga.obj
  1095. XDOBJECTS= jdmain.obj $(DLIBOBJECTS) $(COMOBJECTS)
  1096. X# These objectfiles are included in libjpeg.olb
  1097. XLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
  1098. X# objectfile lists with commas --- what a crock
  1099. XCOBJLIST= jcmain.obj,jcmaster.obj,jcdeflts.obj,jcarith.obj,jccolor.obj,\
  1100. X          jcexpand.obj,jchuff.obj,jcmcu.obj,jcpipe.obj,jcsample.obj,\
  1101. X          jfwddct.obj,jwrjfif.obj,jrdgif.obj,jrdppm.obj,jrdrle.obj,\
  1102. X          jrdtarga.obj,jutils.obj,jerror.obj,jmemmgr.obj,jmemsys.obj
  1103. XDOBJLIST= jdmain.obj,jdmaster.obj,jddeflts.obj,jbsmooth.obj,jdarith.obj,\
  1104. X          jdcolor.obj,jdhuff.obj,jdmcu.obj,jdpipe.obj,jdsample.obj,\
  1105. X          jquant1.obj,jquant2.obj,jrevdct.obj,jrdjfif.obj,jwrgif.obj,\
  1106. X          jwrppm.obj,jwrrle.obj,jwrtarga.obj,jutils.obj,jerror.obj,\
  1107. X          jmemmgr.obj,jmemsys.obj
  1108. XLIBOBJLIST= jcmaster.obj,jcdeflts.obj,jcarith.obj,jccolor.obj,jcexpand.obj,\
  1109. X          jchuff.obj,jcmcu.obj,jcpipe.obj,jcsample.obj,jfwddct.obj,\
  1110. X          jwrjfif.obj,jrdgif.obj,jrdppm.obj,jrdrle.obj,jrdtarga.obj,\
  1111. X          jdmaster.obj,jddeflts.obj,jbsmooth.obj,jdarith.obj,jdcolor.obj,\
  1112. X          jdhuff.obj,jdmcu.obj,jdpipe.obj,jdsample.obj,jquant1.obj,\
  1113. X          jquant2.obj,jrevdct.obj,jrdjfif.obj,jwrgif.obj,jwrppm.obj,\
  1114. X          jwrrle.obj,jwrtarga.obj,jutils.obj,jerror.obj,jmemmgr.obj,\
  1115. X          jmemsys.obj
  1116. X
  1117. X
  1118. X.first
  1119. X    @ Define Sys Sys$Library
  1120. X
  1121. X# By default, libjpeg.olb is not built unless you explicitly request it.
  1122. X# You can add libjpeg.olb to the next line if you want it built by default.
  1123. XALL : cjpeg.exe djpeg.exe
  1124. X    @ Continue
  1125. X
  1126. Xcjpeg.exe : $(COBJECTS)
  1127. X    $(LINK) $(LFLAGS) /Executable = cjpeg.exe $(COBJLIST),$(OPT)/Option
  1128. X
  1129. Xdjpeg.exe : $(DOBJECTS)
  1130. X    $(LINK) $(LFLAGS) /Executable = djpeg.exe $(DOBJLIST),$(OPT)/Option
  1131. X
  1132. X# libjpeg.olb is useful if you are including the JPEG software in a larger
  1133. X# program; you'd include it in your link, rather than the individual modules.
  1134. Xlibjpeg.olb : $(LIBOBJECTS)
  1135. X    Library /Create libjpeg.olb $(LIBOBJLIST)
  1136. X
  1137. Xclean :
  1138. X    @- Set Protection = Owner:RWED *.*;-1
  1139. X    @- Set Protection = Owner:RWED *.OBJ
  1140. X    - Purge /NoLog /NoConfirm *.*
  1141. X    - Delete /NoLog /NoConfirm *.OBJ;
  1142. X
  1143. X
  1144. Xjbsmooth.obj : jbsmooth.c jinclude.h jconfig.h jpegdata.h
  1145. Xjcarith.obj : jcarith.c jinclude.h jconfig.h jpegdata.h
  1146. Xjccolor.obj : jccolor.c jinclude.h jconfig.h jpegdata.h
  1147. Xjcdeflts.obj : jcdeflts.c jinclude.h jconfig.h jpegdata.h
  1148. Xjcexpand.obj : jcexpand.c jinclude.h jconfig.h jpegdata.h
  1149. Xjchuff.obj : jchuff.c jinclude.h jconfig.h jpegdata.h
  1150. Xjcmain.obj : jcmain.c jinclude.h jconfig.h jpegdata.h jversion.h egetopt.c
  1151. Xjcmaster.obj : jcmaster.c jinclude.h jconfig.h jpegdata.h
  1152. Xjcmcu.obj : jcmcu.c jinclude.h jconfig.h jpegdata.h
  1153. Xjcpipe.obj : jcpipe.c jinclude.h jconfig.h jpegdata.h
  1154. Xjcsample.obj : jcsample.c jinclude.h jconfig.h jpegdata.h
  1155. Xjdarith.obj : jdarith.c jinclude.h jconfig.h jpegdata.h
  1156. Xjdcolor.obj : jdcolor.c jinclude.h jconfig.h jpegdata.h
  1157. Xjddeflts.obj : jddeflts.c jinclude.h jconfig.h jpegdata.h
  1158. Xjdhuff.obj : jdhuff.c jinclude.h jconfig.h jpegdata.h
  1159. Xjdmain.obj : jdmain.c jinclude.h jconfig.h jpegdata.h jversion.h egetopt.c
  1160. Xjdmaster.obj : jdmaster.c jinclude.h jconfig.h jpegdata.h
  1161. Xjdmcu.obj : jdmcu.c jinclude.h jconfig.h jpegdata.h
  1162. Xjdpipe.obj : jdpipe.c jinclude.h jconfig.h jpegdata.h
  1163. Xjdsample.obj : jdsample.c jinclude.h jconfig.h jpegdata.h
  1164. Xjerror.obj : jerror.c jinclude.h jconfig.h jpegdata.h
  1165. Xjquant1.obj : jquant1.c jinclude.h jconfig.h jpegdata.h
  1166. Xjquant2.obj : jquant2.c jinclude.h jconfig.h jpegdata.h
  1167. Xjfwddct.obj : jfwddct.c jinclude.h jconfig.h jpegdata.h
  1168. Xjrevdct.obj : jrevdct.c jinclude.h jconfig.h jpegdata.h
  1169. Xjutils.obj : jutils.c jinclude.h jconfig.h jpegdata.h
  1170. Xjmemmgr.obj : jmemmgr.c jinclude.h jconfig.h jpegdata.h jmemsys.h
  1171. Xjrdjfif.obj : jrdjfif.c jinclude.h jconfig.h jpegdata.h
  1172. Xjrdgif.obj : jrdgif.c jinclude.h jconfig.h jpegdata.h
  1173. Xjrdppm.obj : jrdppm.c jinclude.h jconfig.h jpegdata.h
  1174. Xjrdrle.obj : jrdrle.c jinclude.h jconfig.h jpegdata.h
  1175. Xjrdtarga.obj : jrdtarga.c jinclude.h jconfig.h jpegdata.h
  1176. Xjwrjfif.obj : jwrjfif.c jinclude.h jconfig.h jpegdata.h
  1177. Xjwrgif.obj : jwrgif.c jinclude.h jconfig.h jpegdata.h
  1178. Xjwrppm.obj : jwrppm.c jinclude.h jconfig.h jpegdata.h
  1179. Xjwrrle.obj : jwrrle.c jinclude.h jconfig.h jpegdata.h
  1180. Xjwrtarga.obj : jwrtarga.c jinclude.h jconfig.h jpegdata.h
  1181. Xjmemsys.obj : jmemsys.c jinclude.h jconfig.h jpegdata.h jmemsys.h
  1182. END_OF_FILE
  1183.   if test 6695 -ne `wc -c <'makefile.mms'`; then
  1184.     echo shar: \"'makefile.mms'\" unpacked with wrong size!
  1185.   fi
  1186.   # end of 'makefile.mms'
  1187. fi
  1188. if test -f 'makefile.sas' -a "${1}" != "-c" ; then 
  1189.   echo shar: Will not clobber existing file \"'makefile.sas'\"
  1190. else
  1191.   echo shar: Extracting \"'makefile.sas'\" \(6349 characters\)
  1192.   sed "s/^X//" >'makefile.sas' <<'END_OF_FILE'
  1193. X# Makefile for Independent JPEG Group's software
  1194. X
  1195. X# This makefile is for Amiga systems using SAS C 5.10b.
  1196. X# Use jmemname.c as the system-dependent memory manager.
  1197. X# Contributed by Ed Hanway (sisd!jeh@uunet.uu.net).
  1198. X
  1199. X# Read SETUP instructions before saying "make" !!
  1200. X
  1201. X# The name of your C compiler:
  1202. XCC= lc
  1203. X
  1204. X# Uncomment the following lines for generic 680x0 version
  1205. XARCHFLAGS=
  1206. XSUFFIX=
  1207. X
  1208. X# Uncomment the following lines for 68030-only version
  1209. X#ARCHFLAGS= -m3
  1210. X#SUFFIX=.030
  1211. X
  1212. X# You may need to adjust these cc options:
  1213. XCFLAGS= -v -b -rr -O -j104 $(ARCHFLAGS) -DHAVE_STDC -DINCLUDES_ARE_ANSI \
  1214. X    -DAMIGA -DTWO_FILE_COMMANDLINE -DINCOMPLETE_TYPES_BROKEN \
  1215. X    -DNO_MKTEMP -DNEED_SIGNAL_CATCHER
  1216. X# -j104 disables warnings for mismatched const qualifiers
  1217. X
  1218. X# Link-time cc options:
  1219. XLDFLAGS= SC SD ND BATCH
  1220. X
  1221. X# To link any special libraries, add the necessary commands here.
  1222. XLDLIBS= LIB LIB:lcr.lib
  1223. X
  1224. X# miscellaneous OS-dependent stuff
  1225. X# linker
  1226. XLN= blink
  1227. X# file deletion command
  1228. XRM= delete quiet
  1229. X# library (.lib) file creation command
  1230. XAR= oml
  1231. X
  1232. X
  1233. X# source files (independently compilable files)
  1234. XSOURCES= jbsmooth.c jcarith.c jccolor.c jcdeflts.c jcexpand.c jchuff.c \
  1235. X        jcmain.c jcmaster.c jcmcu.c jcpipe.c jcsample.c jdarith.c jdcolor.c \
  1236. X        jddeflts.c jdhuff.c jdmain.c jdmaster.c jdmcu.c jdpipe.c jdsample.c \
  1237. X        jerror.c jquant1.c jquant2.c jfwddct.c jrevdct.c jutils.c jmemmgr.c \
  1238. X        jrdjfif.c jrdgif.c jrdppm.c jrdrle.c jrdtarga.c jwrjfif.c jwrgif.c \
  1239. X        jwrppm.c jwrrle.c jwrtarga.c
  1240. X# virtual source files (not present in distribution file)
  1241. XVIRTSOURCES= jmemsys.c
  1242. X# system-dependent implementations of source files
  1243. XSYSDEPFILES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemdos.h \
  1244. X        jmemdosa.asm
  1245. X# files included by source files
  1246. XINCLUDES= jinclude.h jconfig.h jpegdata.h jversion.h jmemsys.h egetopt.c
  1247. X# documentation, test, and support files
  1248. XDOCS= README SETUP USAGE CHANGELOG cjpeg.1 djpeg.1 architecture codingrules
  1249. XMAKEFILES= makefile.ansi makefile.unix makefile.manx makefile.sas \
  1250. X        makefile.mc5 makefile.mc6 makcjpeg.lnk makdjpeg.lnk makefile.bcc \
  1251. X        makcjpeg.lst makdjpeg.lst makefile.pwc makcjpeg.cf makdjpeg.cf \
  1252. X        makljpeg.cf makefile.mms makefile.vms makvms.opt
  1253. XOTHERFILES= ansi2knr.c ckconfig.c example.c
  1254. XTESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.jpg
  1255. XDISTFILES= $(DOCS) $(MAKEFILES) $(SOURCES) $(SYSDEPFILES) $(INCLUDES) \
  1256. X        $(OTHERFILES) $(TESTFILES)
  1257. X# objectfiles common to cjpeg and djpeg
  1258. XCOMOBJECTS= jutils.o jerror.o jmemmgr.o jmemsys.o
  1259. X# compression objectfiles
  1260. XCLIBOBJECTS= jcmaster.o jcdeflts.o jcarith.o jccolor.o jcexpand.o jchuff.o \
  1261. X        jcmcu.o jcpipe.o jcsample.o jfwddct.o jwrjfif.o jrdgif.o jrdppm.o \
  1262. X        jrdrle.o jrdtarga.o
  1263. XCOBJECTS= jcmain.o $(CLIBOBJECTS) $(COMOBJECTS)
  1264. X# decompression objectfiles
  1265. XDLIBOBJECTS= jdmaster.o jddeflts.o jbsmooth.o jdarith.o jdcolor.o jdhuff.o \
  1266. X        jdmcu.o jdpipe.o jdsample.o jquant1.o jquant2.o jrevdct.o jrdjfif.o \
  1267. X        jwrgif.o jwrppm.o jwrrle.o jwrtarga.o
  1268. XDOBJECTS= jdmain.o $(DLIBOBJECTS) $(COMOBJECTS)
  1269. X# These objectfiles are included in libjpeg.lib
  1270. XLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
  1271. X
  1272. X
  1273. Xall: cjpeg$(SUFFIX) djpeg$(SUFFIX)
  1274. X# By default, libjpeg.lib is not built unless you explicitly request it.
  1275. X# You can add libjpeg.lib to the line above if you want it built by default.
  1276. X
  1277. X
  1278. Xcjpeg$(SUFFIX): $(COBJECTS)
  1279. X    $(LN) <WITH <
  1280. X$(LDFLAGS)
  1281. XTO cjpeg$(SUFFIX)
  1282. XFROM LIB:c.o $(COBJECTS)
  1283. X$(LDLIBS)
  1284. X<
  1285. X
  1286. Xdjpeg$(SUFFIX): $(DOBJECTS)
  1287. X    $(LN) <WITH <
  1288. X$(LDFLAGS)
  1289. XTO djpeg$(SUFFIX)
  1290. XFROM LIB:c.o $(DOBJECTS)
  1291. X$(LDLIBS)
  1292. X<
  1293. X
  1294. X# libjpeg.lib is useful if you are including the JPEG software in a larger
  1295. X# program; you'd include it in your link, rather than the individual modules.
  1296. Xlibjpeg.lib: $(LIBOBJECTS)
  1297. X    -$(RM) libjpeg.lib
  1298. X    $(AR) libjpeg.lib r $(LIBOBJECTS)
  1299. X
  1300. Xclean:
  1301. X    -$(RM) *.o cjpeg djpeg cjpeg.030 djpeg.030 libjpeg.lib core testout.*
  1302. X
  1303. Xdistribute:
  1304. X    -$(RM) jpegsrc.tar*
  1305. X    tar cvf jpegsrc.tar $(DISTFILES)
  1306. X    compress -v jpegsrc.tar
  1307. X
  1308. Xtest: cjpeg djpeg
  1309. X    -$(RM) testout.ppm testout.gif testout.jpg
  1310. X    djpeg testorig.jpg testout.ppm
  1311. X    djpeg -G testorig.jpg testout.gif
  1312. X    cjpeg testimg.ppm testout.jpg
  1313. X    cmp testimg.ppm testout.ppm
  1314. X    cmp testimg.gif testout.gif
  1315. X    cmp testimg.jpg testout.jpg
  1316. X
  1317. X
  1318. Xjbsmooth.o : jbsmooth.c jinclude.h jconfig.h jpegdata.h 
  1319. Xjcarith.o : jcarith.c jinclude.h jconfig.h jpegdata.h 
  1320. Xjccolor.o : jccolor.c jinclude.h jconfig.h jpegdata.h 
  1321. Xjcdeflts.o : jcdeflts.c jinclude.h jconfig.h jpegdata.h 
  1322. Xjcexpand.o : jcexpand.c jinclude.h jconfig.h jpegdata.h 
  1323. Xjchuff.o : jchuff.c jinclude.h jconfig.h jpegdata.h 
  1324. Xjcmain.o : jcmain.c jinclude.h jconfig.h jpegdata.h jversion.h egetopt.c 
  1325. Xjcmaster.o : jcmaster.c jinclude.h jconfig.h jpegdata.h 
  1326. Xjcmcu.o : jcmcu.c jinclude.h jconfig.h jpegdata.h 
  1327. Xjcpipe.o : jcpipe.c jinclude.h jconfig.h jpegdata.h 
  1328. Xjcsample.o : jcsample.c jinclude.h jconfig.h jpegdata.h 
  1329. Xjdarith.o : jdarith.c jinclude.h jconfig.h jpegdata.h 
  1330. Xjdcolor.o : jdcolor.c jinclude.h jconfig.h jpegdata.h 
  1331. Xjddeflts.o : jddeflts.c jinclude.h jconfig.h jpegdata.h 
  1332. Xjdhuff.o : jdhuff.c jinclude.h jconfig.h jpegdata.h 
  1333. Xjdmain.o : jdmain.c jinclude.h jconfig.h jpegdata.h jversion.h egetopt.c 
  1334. Xjdmaster.o : jdmaster.c jinclude.h jconfig.h jpegdata.h 
  1335. Xjdmcu.o : jdmcu.c jinclude.h jconfig.h jpegdata.h 
  1336. Xjdpipe.o : jdpipe.c jinclude.h jconfig.h jpegdata.h 
  1337. Xjdsample.o : jdsample.c jinclude.h jconfig.h jpegdata.h 
  1338. Xjerror.o : jerror.c jinclude.h jconfig.h jpegdata.h 
  1339. Xjquant1.o : jquant1.c jinclude.h jconfig.h jpegdata.h 
  1340. Xjquant2.o : jquant2.c jinclude.h jconfig.h jpegdata.h 
  1341. Xjfwddct.o : jfwddct.c jinclude.h jconfig.h jpegdata.h 
  1342. Xjrevdct.o : jrevdct.c jinclude.h jconfig.h jpegdata.h 
  1343. Xjutils.o : jutils.c jinclude.h jconfig.h jpegdata.h 
  1344. Xjmemmgr.o : jmemmgr.c jinclude.h jconfig.h jpegdata.h jmemsys.h 
  1345. Xjrdjfif.o : jrdjfif.c jinclude.h jconfig.h jpegdata.h 
  1346. Xjrdgif.o : jrdgif.c jinclude.h jconfig.h jpegdata.h 
  1347. Xjrdppm.o : jrdppm.c jinclude.h jconfig.h jpegdata.h 
  1348. Xjrdrle.o : jrdrle.c jinclude.h jconfig.h jpegdata.h 
  1349. Xjrdtarga.o : jrdtarga.c jinclude.h jconfig.h jpegdata.h 
  1350. Xjwrjfif.o : jwrjfif.c jinclude.h jconfig.h jpegdata.h 
  1351. Xjwrgif.o : jwrgif.c jinclude.h jconfig.h jpegdata.h 
  1352. Xjwrppm.o : jwrppm.c jinclude.h jconfig.h jpegdata.h 
  1353. Xjwrrle.o : jwrrle.c jinclude.h jconfig.h jpegdata.h 
  1354. Xjwrtarga.o : jwrtarga.c jinclude.h jconfig.h jpegdata.h 
  1355. Xjmemsys.o : jmemsys.c jinclude.h jconfig.h jpegdata.h jmemsys.h 
  1356. END_OF_FILE
  1357.   if test 6349 -ne `wc -c <'makefile.sas'`; then
  1358.     echo shar: \"'makefile.sas'\" unpacked with wrong size!
  1359.   fi
  1360.   # end of 'makefile.sas'
  1361. fi
  1362. if test -f 'makefile.unix' -a "${1}" != "-c" ; then 
  1363.   echo shar: Will not clobber existing file \"'makefile.unix'\"
  1364. else
  1365.   echo shar: Extracting \"'makefile.unix'\" \(6796 characters\)
  1366.   sed "s/^X//" >'makefile.unix' <<'END_OF_FILE'
  1367. X# Makefile for Independent JPEG Group's software
  1368. X
  1369. X# This makefile is suitable for Unix-like systems with non-ANSI compilers.
  1370. X# If you have an ANSI compiler, makefile.ansi is a better starting point.
  1371. X
  1372. X# Read SETUP instructions before saying "make" !!
  1373. X
  1374. X# The name of your C compiler:
  1375. XCC= cc
  1376. X
  1377. X# You may need to adjust these cc options:
  1378. XCFLAGS= -O
  1379. X# In particular:
  1380. X#   Add -DBSD if on a pure BSD system (see jinclude.h).
  1381. X#   Add -DVMS if on a VMS system (see ansi2knr.c).
  1382. X#   Add -DMSDOS if on an MSDOS system (see ansi2knr.c).
  1383. X#   Add -DMEM_STATS to enable gathering of memory usage statistics.
  1384. X#   You may also want to add -DTWO_FILE_COMMANDLINE or -D switches for other
  1385. X#   symbols listed in jconfig.h, if you prefer not to change jconfig.h.
  1386. X
  1387. X# Link-time cc options:
  1388. XLDFLAGS= 
  1389. X
  1390. X# To link any special libraries, add the necessary -l commands here.
  1391. X# In particular, on some versions of HP-UX (and probably other SysV-derived
  1392. X# systems) there is a faster alternate malloc(3) library that you can use
  1393. X# by adding "-lmalloc" to this line.
  1394. XLDLIBS= 
  1395. X
  1396. X# miscellaneous OS-dependent stuff
  1397. X# linker
  1398. XLN= $(CC)
  1399. X# file deletion command
  1400. XRM= rm -f
  1401. X# library (.a) file creation command
  1402. XAR= ar rc
  1403. X# second step in .a creation (use "touch" if not needed)
  1404. XAR2= ranlib
  1405. X
  1406. X
  1407. X# source files (independently compilable files)
  1408. XSOURCES= jbsmooth.c jcarith.c jccolor.c jcdeflts.c jcexpand.c jchuff.c \
  1409. X        jcmain.c jcmaster.c jcmcu.c jcpipe.c jcsample.c jdarith.c jdcolor.c \
  1410. X        jddeflts.c jdhuff.c jdmain.c jdmaster.c jdmcu.c jdpipe.c jdsample.c \
  1411. X        jerror.c jquant1.c jquant2.c jfwddct.c jrevdct.c jutils.c jmemmgr.c \
  1412. X        jrdjfif.c jrdgif.c jrdppm.c jrdrle.c jrdtarga.c jwrjfif.c jwrgif.c \
  1413. X        jwrppm.c jwrrle.c jwrtarga.c
  1414. X# virtual source files (not present in distribution file)
  1415. XVIRTSOURCES= jmemsys.c
  1416. X# system-dependent implementations of source files
  1417. XSYSDEPFILES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemdos.h \
  1418. X        jmemdosa.asm
  1419. X# files included by source files
  1420. XINCLUDES= jinclude.h jconfig.h jpegdata.h jversion.h jmemsys.h egetopt.c
  1421. X# documentation, test, and support files
  1422. XDOCS= README SETUP USAGE CHANGELOG cjpeg.1 djpeg.1 architecture codingrules
  1423. XMAKEFILES= makefile.ansi makefile.unix makefile.manx makefile.sas \
  1424. X        makefile.mc5 makefile.mc6 makcjpeg.lnk makdjpeg.lnk makefile.bcc \
  1425. X        makcjpeg.lst makdjpeg.lst makefile.pwc makcjpeg.cf makdjpeg.cf \
  1426. X        makljpeg.cf makefile.mms makefile.vms makvms.opt
  1427. XOTHERFILES= ansi2knr.c ckconfig.c example.c
  1428. XTESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.jpg
  1429. XDISTFILES= $(DOCS) $(MAKEFILES) $(SOURCES) $(SYSDEPFILES) $(INCLUDES) \
  1430. X        $(OTHERFILES) $(TESTFILES)
  1431. X# objectfiles common to cjpeg and djpeg
  1432. XCOMOBJECTS= jutils.o jerror.o jmemmgr.o jmemsys.o
  1433. X# compression objectfiles
  1434. XCLIBOBJECTS= jcmaster.o jcdeflts.o jcarith.o jccolor.o jcexpand.o jchuff.o \
  1435. X        jcmcu.o jcpipe.o jcsample.o jfwddct.o jwrjfif.o jrdgif.o jrdppm.o \
  1436. X        jrdrle.o jrdtarga.o
  1437. XCOBJECTS= jcmain.o $(CLIBOBJECTS) $(COMOBJECTS)
  1438. X# decompression objectfiles
  1439. XDLIBOBJECTS= jdmaster.o jddeflts.o jbsmooth.o jdarith.o jdcolor.o jdhuff.o \
  1440. X        jdmcu.o jdpipe.o jdsample.o jquant1.o jquant2.o jrevdct.o jrdjfif.o \
  1441. X        jwrgif.o jwrppm.o jwrrle.o jwrtarga.o
  1442. XDOBJECTS= jdmain.o $(DLIBOBJECTS) $(COMOBJECTS)
  1443. X# These objectfiles are included in libjpeg.a
  1444. XLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
  1445. X
  1446. X
  1447. Xall: ansi2knr cjpeg djpeg
  1448. X# By default, libjpeg.a is not built unless you explicitly request it.
  1449. X# You can add libjpeg.a to the line above if you want it built by default.
  1450. X
  1451. X
  1452. X# This rule causes ansi2knr to be invoked.  If you use this makefile,
  1453. X# make sure PROTO is not defined by jconfig.h.
  1454. X
  1455. X.c.o:
  1456. X    ./ansi2knr $*.c tmpansi.c
  1457. X    $(CC) $(CFLAGS) -c tmpansi.c
  1458. X    mv tmpansi.o $*.o
  1459. X    $(RM) tmpansi.c
  1460. X
  1461. Xansi2knr: ansi2knr.c
  1462. X    $(CC) $(CFLAGS) -o ansi2knr ansi2knr.c
  1463. X
  1464. X
  1465. Xcjpeg: ansi2knr $(COBJECTS)
  1466. X    $(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) $(LDLIBS)
  1467. X
  1468. Xdjpeg: ansi2knr $(DOBJECTS)
  1469. X    $(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) $(LDLIBS)
  1470. X
  1471. X# libjpeg.a is useful if you are including the JPEG software in a larger
  1472. X# program; you'd include it in your link, rather than the individual modules.
  1473. Xlibjpeg.a: ansi2knr $(LIBOBJECTS)
  1474. X    $(RM) libjpeg.a
  1475. X    $(AR) libjpeg.a  $(LIBOBJECTS)
  1476. X    $(AR2) libjpeg.a
  1477. X
  1478. Xclean:
  1479. X    $(RM) *.o cjpeg djpeg libjpeg.a ansi2knr core tmpansi.* testout.*
  1480. X
  1481. Xdistribute:
  1482. X    $(RM) jpegsrc.tar*
  1483. X    tar cvf jpegsrc.tar $(DISTFILES)
  1484. X    compress -v jpegsrc.tar
  1485. X
  1486. Xtest: cjpeg djpeg
  1487. X    $(RM) testout.ppm testout.gif testout.jpg
  1488. X    ./djpeg testorig.jpg >testout.ppm
  1489. X    ./djpeg -G testorig.jpg >testout.gif
  1490. X    ./cjpeg testimg.ppm >testout.jpg
  1491. X    cmp testimg.ppm testout.ppm
  1492. X    cmp testimg.gif testout.gif
  1493. X    cmp testimg.jpg testout.jpg
  1494. X
  1495. X
  1496. Xjbsmooth.o : jbsmooth.c jinclude.h jconfig.h jpegdata.h 
  1497. Xjcarith.o : jcarith.c jinclude.h jconfig.h jpegdata.h 
  1498. Xjccolor.o : jccolor.c jinclude.h jconfig.h jpegdata.h 
  1499. Xjcdeflts.o : jcdeflts.c jinclude.h jconfig.h jpegdata.h 
  1500. Xjcexpand.o : jcexpand.c jinclude.h jconfig.h jpegdata.h 
  1501. Xjchuff.o : jchuff.c jinclude.h jconfig.h jpegdata.h 
  1502. Xjcmain.o : jcmain.c jinclude.h jconfig.h jpegdata.h jversion.h egetopt.c 
  1503. Xjcmaster.o : jcmaster.c jinclude.h jconfig.h jpegdata.h 
  1504. Xjcmcu.o : jcmcu.c jinclude.h jconfig.h jpegdata.h 
  1505. Xjcpipe.o : jcpipe.c jinclude.h jconfig.h jpegdata.h 
  1506. Xjcsample.o : jcsample.c jinclude.h jconfig.h jpegdata.h 
  1507. Xjdarith.o : jdarith.c jinclude.h jconfig.h jpegdata.h 
  1508. Xjdcolor.o : jdcolor.c jinclude.h jconfig.h jpegdata.h 
  1509. Xjddeflts.o : jddeflts.c jinclude.h jconfig.h jpegdata.h 
  1510. Xjdhuff.o : jdhuff.c jinclude.h jconfig.h jpegdata.h 
  1511. Xjdmain.o : jdmain.c jinclude.h jconfig.h jpegdata.h jversion.h egetopt.c 
  1512. Xjdmaster.o : jdmaster.c jinclude.h jconfig.h jpegdata.h 
  1513. Xjdmcu.o : jdmcu.c jinclude.h jconfig.h jpegdata.h 
  1514. Xjdpipe.o : jdpipe.c jinclude.h jconfig.h jpegdata.h 
  1515. Xjdsample.o : jdsample.c jinclude.h jconfig.h jpegdata.h 
  1516. Xjerror.o : jerror.c jinclude.h jconfig.h jpegdata.h 
  1517. Xjquant1.o : jquant1.c jinclude.h jconfig.h jpegdata.h 
  1518. Xjquant2.o : jquant2.c jinclude.h jconfig.h jpegdata.h 
  1519. Xjfwddct.o : jfwddct.c jinclude.h jconfig.h jpegdata.h 
  1520. Xjrevdct.o : jrevdct.c jinclude.h jconfig.h jpegdata.h 
  1521. Xjutils.o : jutils.c jinclude.h jconfig.h jpegdata.h 
  1522. Xjmemmgr.o : jmemmgr.c jinclude.h jconfig.h jpegdata.h jmemsys.h 
  1523. Xjrdjfif.o : jrdjfif.c jinclude.h jconfig.h jpegdata.h 
  1524. Xjrdgif.o : jrdgif.c jinclude.h jconfig.h jpegdata.h 
  1525. Xjrdppm.o : jrdppm.c jinclude.h jconfig.h jpegdata.h 
  1526. Xjrdrle.o : jrdrle.c jinclude.h jconfig.h jpegdata.h 
  1527. Xjrdtarga.o : jrdtarga.c jinclude.h jconfig.h jpegdata.h 
  1528. Xjwrjfif.o : jwrjfif.c jinclude.h jconfig.h jpegdata.h 
  1529. Xjwrgif.o : jwrgif.c jinclude.h jconfig.h jpegdata.h 
  1530. Xjwrppm.o : jwrppm.c jinclude.h jconfig.h jpegdata.h 
  1531. Xjwrrle.o : jwrrle.c jinclude.h jconfig.h jpegdata.h 
  1532. Xjwrtarga.o : jwrtarga.c jinclude.h jconfig.h jpegdata.h 
  1533. Xjmemsys.o : jmemsys.c jinclude.h jconfig.h jpegdata.h jmemsys.h 
  1534. END_OF_FILE
  1535.   if test 6796 -ne `wc -c <'makefile.unix'`; then
  1536.     echo shar: \"'makefile.unix'\" unpacked with wrong size!
  1537.   fi
  1538.   # end of 'makefile.unix'
  1539. fi
  1540. echo shar: End of archive 15 \(of 18\).
  1541. cp /dev/null ark15isdone
  1542. MISSING=""
  1543. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
  1544.     if test ! -f ark${I}isdone ; then
  1545.     MISSING="${MISSING} ${I}"
  1546.     fi
  1547. done
  1548. if test "${MISSING}" = "" ; then
  1549.     echo You have unpacked all 18 archives.
  1550.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1551. else
  1552.     echo You still must unpack the following archives:
  1553.     echo "        " ${MISSING}
  1554. fi
  1555. exit 0
  1556. exit 0 # Just in case...
  1557.