isbn 2.0.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (288) hide show
  1. data/{README → README.md} +5 -11
  2. data/Rakefile +20 -14
  3. data/isbn.gemspec +23 -0
  4. data/lib/isbn.rb +2 -0
  5. data/test/isbn_spec.rb +1 -1
  6. metadata +29 -316
  7. data/VERSION +0 -1
  8. data/src/gocr-0.48/.cvsignore +0 -6
  9. data/src/gocr-0.48/AUTHORS +0 -7
  10. data/src/gocr-0.48/BUGS +0 -55
  11. data/src/gocr-0.48/CREDITS +0 -17
  12. data/src/gocr-0.48/HISTORY +0 -243
  13. data/src/gocr-0.48/INSTALL +0 -83
  14. data/src/gocr-0.48/Makefile +0 -193
  15. data/src/gocr-0.48/Makefile.in +0 -193
  16. data/src/gocr-0.48/README +0 -165
  17. data/src/gocr-0.48/READMEde.txt +0 -80
  18. data/src/gocr-0.48/REMARK.txt +0 -18
  19. data/src/gocr-0.48/REVIEW +0 -538
  20. data/src/gocr-0.48/TODO +0 -65
  21. data/src/gocr-0.48/bin/.cvsignore +0 -2
  22. data/src/gocr-0.48/bin/create_db +0 -38
  23. data/src/gocr-0.48/bin/gocr.tcl +0 -527
  24. data/src/gocr-0.48/bin/gocr_chk.sh +0 -44
  25. data/src/gocr-0.48/configure +0 -4689
  26. data/src/gocr-0.48/configure.in +0 -71
  27. data/src/gocr-0.48/doc/.#Makefile.1.6 +0 -39
  28. data/src/gocr-0.48/doc/.cvsignore +0 -2
  29. data/src/gocr-0.48/doc/Makefile +0 -39
  30. data/src/gocr-0.48/doc/Makefile.in +0 -39
  31. data/src/gocr-0.48/doc/example.dtd +0 -53
  32. data/src/gocr-0.48/doc/example.xml +0 -21
  33. data/src/gocr-0.48/doc/examples.txt +0 -67
  34. data/src/gocr-0.48/doc/gocr.html +0 -578
  35. data/src/gocr-0.48/doc/unicode.txt +0 -57
  36. data/src/gocr-0.48/examples/.#Makefile.1.22 +0 -166
  37. data/src/gocr-0.48/examples/4x6.png +0 -0
  38. data/src/gocr-0.48/examples/4x6.txt +0 -2
  39. data/src/gocr-0.48/examples/5x7.png +0 -0
  40. data/src/gocr-0.48/examples/5x7.png.txt +0 -2
  41. data/src/gocr-0.48/examples/5x8.png +0 -0
  42. data/src/gocr-0.48/examples/5x8.png.txt +0 -2
  43. data/src/gocr-0.48/examples/Makefile +0 -166
  44. data/src/gocr-0.48/examples/color.fig +0 -20
  45. data/src/gocr-0.48/examples/ex.fig +0 -16
  46. data/src/gocr-0.48/examples/font.tex +0 -22
  47. data/src/gocr-0.48/examples/font1.tex +0 -46
  48. data/src/gocr-0.48/examples/font2.fig +0 -27
  49. data/src/gocr-0.48/examples/font_nw.tex +0 -24
  50. data/src/gocr-0.48/examples/handwrt1.jpg +0 -0
  51. data/src/gocr-0.48/examples/handwrt1.txt +0 -10
  52. data/src/gocr-0.48/examples/inverse.fig +0 -20
  53. data/src/gocr-0.48/examples/matrix.jpg +0 -0
  54. data/src/gocr-0.48/examples/ocr-a-subset.png +0 -0
  55. data/src/gocr-0.48/examples/ocr-a-subset.png.txt +0 -4
  56. data/src/gocr-0.48/examples/ocr-a.png +0 -0
  57. data/src/gocr-0.48/examples/ocr-a.txt +0 -6
  58. data/src/gocr-0.48/examples/ocr-b.png +0 -0
  59. data/src/gocr-0.48/examples/ocr-b.png.txt +0 -4
  60. data/src/gocr-0.48/examples/polish.tex +0 -28
  61. data/src/gocr-0.48/examples/rotate45.fig +0 -14
  62. data/src/gocr-0.48/examples/score +0 -36
  63. data/src/gocr-0.48/examples/text.tex +0 -28
  64. data/src/gocr-0.48/gpl.html +0 -537
  65. data/src/gocr-0.48/include/.cvsignore +0 -2
  66. data/src/gocr-0.48/include/config.h +0 -36
  67. data/src/gocr-0.48/include/config.h.in +0 -36
  68. data/src/gocr-0.48/include/version.h +0 -2
  69. data/src/gocr-0.48/install-sh +0 -3
  70. data/src/gocr-0.48/make.bat +0 -57
  71. data/src/gocr-0.48/man/.cvsignore +0 -2
  72. data/src/gocr-0.48/man/Makefile +0 -29
  73. data/src/gocr-0.48/man/Makefile.in +0 -29
  74. data/src/gocr-0.48/man/man1/gocr.1 +0 -166
  75. data/src/gocr-0.48/src/.cvsignore +0 -4
  76. data/src/gocr-0.48/src/Makefile +0 -132
  77. data/src/gocr-0.48/src/Makefile.in +0 -132
  78. data/src/gocr-0.48/src/amiga.h +0 -31
  79. data/src/gocr-0.48/src/barcode.c +0 -846
  80. data/src/gocr-0.48/src/barcode.c.orig +0 -593
  81. data/src/gocr-0.48/src/barcode.h +0 -11
  82. data/src/gocr-0.48/src/box.c +0 -372
  83. data/src/gocr-0.48/src/database.c +0 -462
  84. data/src/gocr-0.48/src/detect.c +0 -943
  85. data/src/gocr-0.48/src/gocr.c +0 -373
  86. data/src/gocr-0.48/src/gocr.h +0 -288
  87. data/src/gocr-0.48/src/jconv.c +0 -168
  88. data/src/gocr-0.48/src/job.c +0 -84
  89. data/src/gocr-0.48/src/lines.c +0 -350
  90. data/src/gocr-0.48/src/list.c +0 -334
  91. data/src/gocr-0.48/src/list.h +0 -90
  92. data/src/gocr-0.48/src/ocr0.c +0 -6756
  93. data/src/gocr-0.48/src/ocr0.h +0 -63
  94. data/src/gocr-0.48/src/ocr0n.c +0 -1475
  95. data/src/gocr-0.48/src/ocr1.c +0 -85
  96. data/src/gocr-0.48/src/ocr1.h +0 -3
  97. data/src/gocr-0.48/src/otsu.c +0 -289
  98. data/src/gocr-0.48/src/otsu.h +0 -23
  99. data/src/gocr-0.48/src/output.c +0 -289
  100. data/src/gocr-0.48/src/output.h +0 -37
  101. data/src/gocr-0.48/src/pcx.c +0 -153
  102. data/src/gocr-0.48/src/pcx.h +0 -9
  103. data/src/gocr-0.48/src/pgm2asc.c +0 -2893
  104. data/src/gocr-0.48/src/pgm2asc.h +0 -105
  105. data/src/gocr-0.48/src/pixel.c +0 -537
  106. data/src/gocr-0.48/src/pnm.c +0 -533
  107. data/src/gocr-0.48/src/pnm.h +0 -35
  108. data/src/gocr-0.48/src/progress.c +0 -87
  109. data/src/gocr-0.48/src/progress.h +0 -42
  110. data/src/gocr-0.48/src/remove.c +0 -703
  111. data/src/gocr-0.48/src/tga.c +0 -87
  112. data/src/gocr-0.48/src/tga.h +0 -6
  113. data/src/gocr-0.48/src/unicode.c +0 -1314
  114. data/src/gocr-0.48/src/unicode.h +0 -1257
  115. data/src/jpeg-7/Makefile.am +0 -133
  116. data/src/jpeg-7/Makefile.in +0 -1089
  117. data/src/jpeg-7/README +0 -322
  118. data/src/jpeg-7/aclocal.m4 +0 -8990
  119. data/src/jpeg-7/ansi2knr.1 +0 -36
  120. data/src/jpeg-7/ansi2knr.c +0 -739
  121. data/src/jpeg-7/cderror.h +0 -132
  122. data/src/jpeg-7/cdjpeg.c +0 -181
  123. data/src/jpeg-7/cdjpeg.h +0 -187
  124. data/src/jpeg-7/change.log +0 -270
  125. data/src/jpeg-7/cjpeg.1 +0 -325
  126. data/src/jpeg-7/cjpeg.c +0 -616
  127. data/src/jpeg-7/ckconfig.c +0 -402
  128. data/src/jpeg-7/coderules.txt +0 -118
  129. data/src/jpeg-7/config.guess +0 -1561
  130. data/src/jpeg-7/config.sub +0 -1686
  131. data/src/jpeg-7/configure +0 -17139
  132. data/src/jpeg-7/configure.ac +0 -317
  133. data/src/jpeg-7/depcomp +0 -630
  134. data/src/jpeg-7/djpeg.1 +0 -251
  135. data/src/jpeg-7/djpeg.c +0 -617
  136. data/src/jpeg-7/example.c +0 -433
  137. data/src/jpeg-7/filelist.txt +0 -215
  138. data/src/jpeg-7/install-sh +0 -520
  139. data/src/jpeg-7/install.txt +0 -1097
  140. data/src/jpeg-7/jaricom.c +0 -148
  141. data/src/jpeg-7/jcapimin.c +0 -282
  142. data/src/jpeg-7/jcapistd.c +0 -161
  143. data/src/jpeg-7/jcarith.c +0 -921
  144. data/src/jpeg-7/jccoefct.c +0 -453
  145. data/src/jpeg-7/jccolor.c +0 -459
  146. data/src/jpeg-7/jcdctmgr.c +0 -482
  147. data/src/jpeg-7/jchuff.c +0 -1612
  148. data/src/jpeg-7/jcinit.c +0 -65
  149. data/src/jpeg-7/jcmainct.c +0 -293
  150. data/src/jpeg-7/jcmarker.c +0 -667
  151. data/src/jpeg-7/jcmaster.c +0 -770
  152. data/src/jpeg-7/jcomapi.c +0 -106
  153. data/src/jpeg-7/jconfig.bcc +0 -48
  154. data/src/jpeg-7/jconfig.cfg +0 -45
  155. data/src/jpeg-7/jconfig.dj +0 -38
  156. data/src/jpeg-7/jconfig.mac +0 -43
  157. data/src/jpeg-7/jconfig.manx +0 -43
  158. data/src/jpeg-7/jconfig.mc6 +0 -52
  159. data/src/jpeg-7/jconfig.sas +0 -43
  160. data/src/jpeg-7/jconfig.st +0 -42
  161. data/src/jpeg-7/jconfig.txt +0 -155
  162. data/src/jpeg-7/jconfig.vc +0 -45
  163. data/src/jpeg-7/jconfig.vms +0 -37
  164. data/src/jpeg-7/jconfig.wat +0 -38
  165. data/src/jpeg-7/jcparam.c +0 -632
  166. data/src/jpeg-7/jcprepct.c +0 -358
  167. data/src/jpeg-7/jcsample.c +0 -545
  168. data/src/jpeg-7/jctrans.c +0 -381
  169. data/src/jpeg-7/jdapimin.c +0 -396
  170. data/src/jpeg-7/jdapistd.c +0 -275
  171. data/src/jpeg-7/jdarith.c +0 -762
  172. data/src/jpeg-7/jdatadst.c +0 -151
  173. data/src/jpeg-7/jdatasrc.c +0 -212
  174. data/src/jpeg-7/jdcoefct.c +0 -736
  175. data/src/jpeg-7/jdcolor.c +0 -396
  176. data/src/jpeg-7/jdct.h +0 -393
  177. data/src/jpeg-7/jddctmgr.c +0 -382
  178. data/src/jpeg-7/jdhuff.c +0 -1309
  179. data/src/jpeg-7/jdinput.c +0 -384
  180. data/src/jpeg-7/jdmainct.c +0 -512
  181. data/src/jpeg-7/jdmarker.c +0 -1360
  182. data/src/jpeg-7/jdmaster.c +0 -663
  183. data/src/jpeg-7/jdmerge.c +0 -400
  184. data/src/jpeg-7/jdpostct.c +0 -290
  185. data/src/jpeg-7/jdsample.c +0 -361
  186. data/src/jpeg-7/jdtrans.c +0 -136
  187. data/src/jpeg-7/jerror.c +0 -252
  188. data/src/jpeg-7/jerror.h +0 -304
  189. data/src/jpeg-7/jfdctflt.c +0 -174
  190. data/src/jpeg-7/jfdctfst.c +0 -230
  191. data/src/jpeg-7/jfdctint.c +0 -4348
  192. data/src/jpeg-7/jidctflt.c +0 -242
  193. data/src/jpeg-7/jidctfst.c +0 -368
  194. data/src/jpeg-7/jidctint.c +0 -5137
  195. data/src/jpeg-7/jinclude.h +0 -91
  196. data/src/jpeg-7/jmemansi.c +0 -167
  197. data/src/jpeg-7/jmemdos.c +0 -638
  198. data/src/jpeg-7/jmemdosa.asm +0 -379
  199. data/src/jpeg-7/jmemmac.c +0 -289
  200. data/src/jpeg-7/jmemmgr.c +0 -1118
  201. data/src/jpeg-7/jmemname.c +0 -276
  202. data/src/jpeg-7/jmemnobs.c +0 -109
  203. data/src/jpeg-7/jmemsys.h +0 -198
  204. data/src/jpeg-7/jmorecfg.h +0 -369
  205. data/src/jpeg-7/jpegint.h +0 -395
  206. data/src/jpeg-7/jpeglib.h +0 -1135
  207. data/src/jpeg-7/jpegtran.1 +0 -272
  208. data/src/jpeg-7/jpegtran.c +0 -546
  209. data/src/jpeg-7/jquant1.c +0 -856
  210. data/src/jpeg-7/jquant2.c +0 -1310
  211. data/src/jpeg-7/jutils.c +0 -179
  212. data/src/jpeg-7/jversion.h +0 -14
  213. data/src/jpeg-7/libjpeg.map +0 -4
  214. data/src/jpeg-7/libjpeg.txt +0 -3067
  215. data/src/jpeg-7/ltmain.sh +0 -8406
  216. data/src/jpeg-7/makcjpeg.st +0 -36
  217. data/src/jpeg-7/makdjpeg.st +0 -36
  218. data/src/jpeg-7/makeadsw.vc6 +0 -77
  219. data/src/jpeg-7/makeasln.vc9 +0 -33
  220. data/src/jpeg-7/makecdep.vc6 +0 -82
  221. data/src/jpeg-7/makecdsp.vc6 +0 -130
  222. data/src/jpeg-7/makecmak.vc6 +0 -159
  223. data/src/jpeg-7/makecvcp.vc9 +0 -186
  224. data/src/jpeg-7/makeddep.vc6 +0 -82
  225. data/src/jpeg-7/makeddsp.vc6 +0 -130
  226. data/src/jpeg-7/makedmak.vc6 +0 -159
  227. data/src/jpeg-7/makedvcp.vc9 +0 -186
  228. data/src/jpeg-7/makefile.ansi +0 -220
  229. data/src/jpeg-7/makefile.bcc +0 -291
  230. data/src/jpeg-7/makefile.dj +0 -226
  231. data/src/jpeg-7/makefile.manx +0 -220
  232. data/src/jpeg-7/makefile.mc6 +0 -255
  233. data/src/jpeg-7/makefile.mms +0 -224
  234. data/src/jpeg-7/makefile.sas +0 -258
  235. data/src/jpeg-7/makefile.unix +0 -234
  236. data/src/jpeg-7/makefile.vc +0 -217
  237. data/src/jpeg-7/makefile.vms +0 -142
  238. data/src/jpeg-7/makefile.wat +0 -239
  239. data/src/jpeg-7/makejdep.vc6 +0 -423
  240. data/src/jpeg-7/makejdsp.vc6 +0 -285
  241. data/src/jpeg-7/makejdsw.vc6 +0 -29
  242. data/src/jpeg-7/makejmak.vc6 +0 -425
  243. data/src/jpeg-7/makejsln.vc9 +0 -17
  244. data/src/jpeg-7/makejvcp.vc9 +0 -328
  245. data/src/jpeg-7/makeproj.mac +0 -213
  246. data/src/jpeg-7/makerdep.vc6 +0 -6
  247. data/src/jpeg-7/makerdsp.vc6 +0 -78
  248. data/src/jpeg-7/makermak.vc6 +0 -110
  249. data/src/jpeg-7/makervcp.vc9 +0 -133
  250. data/src/jpeg-7/maketdep.vc6 +0 -43
  251. data/src/jpeg-7/maketdsp.vc6 +0 -122
  252. data/src/jpeg-7/maketmak.vc6 +0 -131
  253. data/src/jpeg-7/maketvcp.vc9 +0 -178
  254. data/src/jpeg-7/makewdep.vc6 +0 -6
  255. data/src/jpeg-7/makewdsp.vc6 +0 -78
  256. data/src/jpeg-7/makewmak.vc6 +0 -110
  257. data/src/jpeg-7/makewvcp.vc9 +0 -133
  258. data/src/jpeg-7/makljpeg.st +0 -68
  259. data/src/jpeg-7/maktjpeg.st +0 -30
  260. data/src/jpeg-7/makvms.opt +0 -4
  261. data/src/jpeg-7/missing +0 -376
  262. data/src/jpeg-7/rdbmp.c +0 -439
  263. data/src/jpeg-7/rdcolmap.c +0 -253
  264. data/src/jpeg-7/rdgif.c +0 -38
  265. data/src/jpeg-7/rdjpgcom.1 +0 -63
  266. data/src/jpeg-7/rdjpgcom.c +0 -515
  267. data/src/jpeg-7/rdppm.c +0 -459
  268. data/src/jpeg-7/rdrle.c +0 -387
  269. data/src/jpeg-7/rdswitch.c +0 -365
  270. data/src/jpeg-7/rdtarga.c +0 -500
  271. data/src/jpeg-7/structure.txt +0 -945
  272. data/src/jpeg-7/testimg.bmp +0 -0
  273. data/src/jpeg-7/testimg.jpg +0 -0
  274. data/src/jpeg-7/testimg.ppm +0 -4
  275. data/src/jpeg-7/testimgp.jpg +0 -0
  276. data/src/jpeg-7/testorig.jpg +0 -0
  277. data/src/jpeg-7/testprog.jpg +0 -0
  278. data/src/jpeg-7/transupp.c +0 -1533
  279. data/src/jpeg-7/transupp.h +0 -205
  280. data/src/jpeg-7/usage.txt +0 -605
  281. data/src/jpeg-7/wizard.txt +0 -211
  282. data/src/jpeg-7/wrbmp.c +0 -442
  283. data/src/jpeg-7/wrgif.c +0 -399
  284. data/src/jpeg-7/wrjpgcom.1 +0 -103
  285. data/src/jpeg-7/wrjpgcom.c +0 -583
  286. data/src/jpeg-7/wrppm.c +0 -269
  287. data/src/jpeg-7/wrrle.c +0 -305
  288. data/src/jpeg-7/wrtarga.c +0 -253
data/src/jpeg-7/jdcolor.c DELETED
@@ -1,396 +0,0 @@
1
- /*
2
- * jdcolor.c
3
- *
4
- * Copyright (C) 1991-1997, Thomas G. Lane.
5
- * This file is part of the Independent JPEG Group's software.
6
- * For conditions of distribution and use, see the accompanying README file.
7
- *
8
- * This file contains output colorspace conversion routines.
9
- */
10
-
11
- #define JPEG_INTERNALS
12
- #include "jinclude.h"
13
- #include "jpeglib.h"
14
-
15
-
16
- /* Private subobject */
17
-
18
- typedef struct {
19
- struct jpeg_color_deconverter pub; /* public fields */
20
-
21
- /* Private state for YCC->RGB conversion */
22
- int * Cr_r_tab; /* => table for Cr to R conversion */
23
- int * Cb_b_tab; /* => table for Cb to B conversion */
24
- INT32 * Cr_g_tab; /* => table for Cr to G conversion */
25
- INT32 * Cb_g_tab; /* => table for Cb to G conversion */
26
- } my_color_deconverter;
27
-
28
- typedef my_color_deconverter * my_cconvert_ptr;
29
-
30
-
31
- /**************** YCbCr -> RGB conversion: most common case **************/
32
-
33
- /*
34
- * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
35
- * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
36
- * The conversion equations to be implemented are therefore
37
- * R = Y + 1.40200 * Cr
38
- * G = Y - 0.34414 * Cb - 0.71414 * Cr
39
- * B = Y + 1.77200 * Cb
40
- * where Cb and Cr represent the incoming values less CENTERJSAMPLE.
41
- * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
42
- *
43
- * To avoid floating-point arithmetic, we represent the fractional constants
44
- * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
45
- * the products by 2^16, with appropriate rounding, to get the correct answer.
46
- * Notice that Y, being an integral input, does not contribute any fraction
47
- * so it need not participate in the rounding.
48
- *
49
- * For even more speed, we avoid doing any multiplications in the inner loop
50
- * by precalculating the constants times Cb and Cr for all possible values.
51
- * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
52
- * for 12-bit samples it is still acceptable. It's not very reasonable for
53
- * 16-bit samples, but if you want lossless storage you shouldn't be changing
54
- * colorspace anyway.
55
- * The Cr=>R and Cb=>B values can be rounded to integers in advance; the
56
- * values for the G calculation are left scaled up, since we must add them
57
- * together before rounding.
58
- */
59
-
60
- #define SCALEBITS 16 /* speediest right-shift on some machines */
61
- #define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
62
- #define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
63
-
64
-
65
- /*
66
- * Initialize tables for YCC->RGB colorspace conversion.
67
- */
68
-
69
- LOCAL(void)
70
- build_ycc_rgb_table (j_decompress_ptr cinfo)
71
- {
72
- my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
73
- int i;
74
- INT32 x;
75
- SHIFT_TEMPS
76
-
77
- cconvert->Cr_r_tab = (int *)
78
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
79
- (MAXJSAMPLE+1) * SIZEOF(int));
80
- cconvert->Cb_b_tab = (int *)
81
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
82
- (MAXJSAMPLE+1) * SIZEOF(int));
83
- cconvert->Cr_g_tab = (INT32 *)
84
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
85
- (MAXJSAMPLE+1) * SIZEOF(INT32));
86
- cconvert->Cb_g_tab = (INT32 *)
87
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
88
- (MAXJSAMPLE+1) * SIZEOF(INT32));
89
-
90
- for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
91
- /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
92
- /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
93
- /* Cr=>R value is nearest int to 1.40200 * x */
94
- cconvert->Cr_r_tab[i] = (int)
95
- RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
96
- /* Cb=>B value is nearest int to 1.77200 * x */
97
- cconvert->Cb_b_tab[i] = (int)
98
- RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
99
- /* Cr=>G value is scaled-up -0.71414 * x */
100
- cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x;
101
- /* Cb=>G value is scaled-up -0.34414 * x */
102
- /* We also add in ONE_HALF so that need not do it in inner loop */
103
- cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;
104
- }
105
- }
106
-
107
-
108
- /*
109
- * Convert some rows of samples to the output colorspace.
110
- *
111
- * Note that we change from noninterleaved, one-plane-per-component format
112
- * to interleaved-pixel format. The output buffer is therefore three times
113
- * as wide as the input buffer.
114
- * A starting row offset is provided only for the input buffer. The caller
115
- * can easily adjust the passed output_buf value to accommodate any row
116
- * offset required on that side.
117
- */
118
-
119
- METHODDEF(void)
120
- ycc_rgb_convert (j_decompress_ptr cinfo,
121
- JSAMPIMAGE input_buf, JDIMENSION input_row,
122
- JSAMPARRAY output_buf, int num_rows)
123
- {
124
- my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
125
- register int y, cb, cr;
126
- register JSAMPROW outptr;
127
- register JSAMPROW inptr0, inptr1, inptr2;
128
- register JDIMENSION col;
129
- JDIMENSION num_cols = cinfo->output_width;
130
- /* copy these pointers into registers if possible */
131
- register JSAMPLE * range_limit = cinfo->sample_range_limit;
132
- register int * Crrtab = cconvert->Cr_r_tab;
133
- register int * Cbbtab = cconvert->Cb_b_tab;
134
- register INT32 * Crgtab = cconvert->Cr_g_tab;
135
- register INT32 * Cbgtab = cconvert->Cb_g_tab;
136
- SHIFT_TEMPS
137
-
138
- while (--num_rows >= 0) {
139
- inptr0 = input_buf[0][input_row];
140
- inptr1 = input_buf[1][input_row];
141
- inptr2 = input_buf[2][input_row];
142
- input_row++;
143
- outptr = *output_buf++;
144
- for (col = 0; col < num_cols; col++) {
145
- y = GETJSAMPLE(inptr0[col]);
146
- cb = GETJSAMPLE(inptr1[col]);
147
- cr = GETJSAMPLE(inptr2[col]);
148
- /* Range-limiting is essential due to noise introduced by DCT losses. */
149
- outptr[RGB_RED] = range_limit[y + Crrtab[cr]];
150
- outptr[RGB_GREEN] = range_limit[y +
151
- ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
152
- SCALEBITS))];
153
- outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]];
154
- outptr += RGB_PIXELSIZE;
155
- }
156
- }
157
- }
158
-
159
-
160
- /**************** Cases other than YCbCr -> RGB **************/
161
-
162
-
163
- /*
164
- * Color conversion for no colorspace change: just copy the data,
165
- * converting from separate-planes to interleaved representation.
166
- */
167
-
168
- METHODDEF(void)
169
- null_convert (j_decompress_ptr cinfo,
170
- JSAMPIMAGE input_buf, JDIMENSION input_row,
171
- JSAMPARRAY output_buf, int num_rows)
172
- {
173
- register JSAMPROW inptr, outptr;
174
- register JDIMENSION count;
175
- register int num_components = cinfo->num_components;
176
- JDIMENSION num_cols = cinfo->output_width;
177
- int ci;
178
-
179
- while (--num_rows >= 0) {
180
- for (ci = 0; ci < num_components; ci++) {
181
- inptr = input_buf[ci][input_row];
182
- outptr = output_buf[0] + ci;
183
- for (count = num_cols; count > 0; count--) {
184
- *outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */
185
- outptr += num_components;
186
- }
187
- }
188
- input_row++;
189
- output_buf++;
190
- }
191
- }
192
-
193
-
194
- /*
195
- * Color conversion for grayscale: just copy the data.
196
- * This also works for YCbCr -> grayscale conversion, in which
197
- * we just copy the Y (luminance) component and ignore chrominance.
198
- */
199
-
200
- METHODDEF(void)
201
- grayscale_convert (j_decompress_ptr cinfo,
202
- JSAMPIMAGE input_buf, JDIMENSION input_row,
203
- JSAMPARRAY output_buf, int num_rows)
204
- {
205
- jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0,
206
- num_rows, cinfo->output_width);
207
- }
208
-
209
-
210
- /*
211
- * Convert grayscale to RGB: just duplicate the graylevel three times.
212
- * This is provided to support applications that don't want to cope
213
- * with grayscale as a separate case.
214
- */
215
-
216
- METHODDEF(void)
217
- gray_rgb_convert (j_decompress_ptr cinfo,
218
- JSAMPIMAGE input_buf, JDIMENSION input_row,
219
- JSAMPARRAY output_buf, int num_rows)
220
- {
221
- register JSAMPROW inptr, outptr;
222
- register JDIMENSION col;
223
- JDIMENSION num_cols = cinfo->output_width;
224
-
225
- while (--num_rows >= 0) {
226
- inptr = input_buf[0][input_row++];
227
- outptr = *output_buf++;
228
- for (col = 0; col < num_cols; col++) {
229
- /* We can dispense with GETJSAMPLE() here */
230
- outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
231
- outptr += RGB_PIXELSIZE;
232
- }
233
- }
234
- }
235
-
236
-
237
- /*
238
- * Adobe-style YCCK->CMYK conversion.
239
- * We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same
240
- * conversion as above, while passing K (black) unchanged.
241
- * We assume build_ycc_rgb_table has been called.
242
- */
243
-
244
- METHODDEF(void)
245
- ycck_cmyk_convert (j_decompress_ptr cinfo,
246
- JSAMPIMAGE input_buf, JDIMENSION input_row,
247
- JSAMPARRAY output_buf, int num_rows)
248
- {
249
- my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
250
- register int y, cb, cr;
251
- register JSAMPROW outptr;
252
- register JSAMPROW inptr0, inptr1, inptr2, inptr3;
253
- register JDIMENSION col;
254
- JDIMENSION num_cols = cinfo->output_width;
255
- /* copy these pointers into registers if possible */
256
- register JSAMPLE * range_limit = cinfo->sample_range_limit;
257
- register int * Crrtab = cconvert->Cr_r_tab;
258
- register int * Cbbtab = cconvert->Cb_b_tab;
259
- register INT32 * Crgtab = cconvert->Cr_g_tab;
260
- register INT32 * Cbgtab = cconvert->Cb_g_tab;
261
- SHIFT_TEMPS
262
-
263
- while (--num_rows >= 0) {
264
- inptr0 = input_buf[0][input_row];
265
- inptr1 = input_buf[1][input_row];
266
- inptr2 = input_buf[2][input_row];
267
- inptr3 = input_buf[3][input_row];
268
- input_row++;
269
- outptr = *output_buf++;
270
- for (col = 0; col < num_cols; col++) {
271
- y = GETJSAMPLE(inptr0[col]);
272
- cb = GETJSAMPLE(inptr1[col]);
273
- cr = GETJSAMPLE(inptr2[col]);
274
- /* Range-limiting is essential due to noise introduced by DCT losses. */
275
- outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */
276
- outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */
277
- ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
278
- SCALEBITS)))];
279
- outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; /* blue */
280
- /* K passes through unchanged */
281
- outptr[3] = inptr3[col]; /* don't need GETJSAMPLE here */
282
- outptr += 4;
283
- }
284
- }
285
- }
286
-
287
-
288
- /*
289
- * Empty method for start_pass.
290
- */
291
-
292
- METHODDEF(void)
293
- start_pass_dcolor (j_decompress_ptr cinfo)
294
- {
295
- /* no work needed */
296
- }
297
-
298
-
299
- /*
300
- * Module initialization routine for output colorspace conversion.
301
- */
302
-
303
- GLOBAL(void)
304
- jinit_color_deconverter (j_decompress_ptr cinfo)
305
- {
306
- my_cconvert_ptr cconvert;
307
- int ci;
308
-
309
- cconvert = (my_cconvert_ptr)
310
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
311
- SIZEOF(my_color_deconverter));
312
- cinfo->cconvert = (struct jpeg_color_deconverter *) cconvert;
313
- cconvert->pub.start_pass = start_pass_dcolor;
314
-
315
- /* Make sure num_components agrees with jpeg_color_space */
316
- switch (cinfo->jpeg_color_space) {
317
- case JCS_GRAYSCALE:
318
- if (cinfo->num_components != 1)
319
- ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
320
- break;
321
-
322
- case JCS_RGB:
323
- case JCS_YCbCr:
324
- if (cinfo->num_components != 3)
325
- ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
326
- break;
327
-
328
- case JCS_CMYK:
329
- case JCS_YCCK:
330
- if (cinfo->num_components != 4)
331
- ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
332
- break;
333
-
334
- default: /* JCS_UNKNOWN can be anything */
335
- if (cinfo->num_components < 1)
336
- ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
337
- break;
338
- }
339
-
340
- /* Set out_color_components and conversion method based on requested space.
341
- * Also clear the component_needed flags for any unused components,
342
- * so that earlier pipeline stages can avoid useless computation.
343
- */
344
-
345
- switch (cinfo->out_color_space) {
346
- case JCS_GRAYSCALE:
347
- cinfo->out_color_components = 1;
348
- if (cinfo->jpeg_color_space == JCS_GRAYSCALE ||
349
- cinfo->jpeg_color_space == JCS_YCbCr) {
350
- cconvert->pub.color_convert = grayscale_convert;
351
- /* For color->grayscale conversion, only the Y (0) component is needed */
352
- for (ci = 1; ci < cinfo->num_components; ci++)
353
- cinfo->comp_info[ci].component_needed = FALSE;
354
- } else
355
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
356
- break;
357
-
358
- case JCS_RGB:
359
- cinfo->out_color_components = RGB_PIXELSIZE;
360
- if (cinfo->jpeg_color_space == JCS_YCbCr) {
361
- cconvert->pub.color_convert = ycc_rgb_convert;
362
- build_ycc_rgb_table(cinfo);
363
- } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
364
- cconvert->pub.color_convert = gray_rgb_convert;
365
- } else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) {
366
- cconvert->pub.color_convert = null_convert;
367
- } else
368
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
369
- break;
370
-
371
- case JCS_CMYK:
372
- cinfo->out_color_components = 4;
373
- if (cinfo->jpeg_color_space == JCS_YCCK) {
374
- cconvert->pub.color_convert = ycck_cmyk_convert;
375
- build_ycc_rgb_table(cinfo);
376
- } else if (cinfo->jpeg_color_space == JCS_CMYK) {
377
- cconvert->pub.color_convert = null_convert;
378
- } else
379
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
380
- break;
381
-
382
- default:
383
- /* Permit null conversion to same output space */
384
- if (cinfo->out_color_space == cinfo->jpeg_color_space) {
385
- cinfo->out_color_components = cinfo->num_components;
386
- cconvert->pub.color_convert = null_convert;
387
- } else /* unsupported non-null conversion */
388
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
389
- break;
390
- }
391
-
392
- if (cinfo->quantize_colors)
393
- cinfo->output_components = 1; /* single colormapped output component */
394
- else
395
- cinfo->output_components = cinfo->out_color_components;
396
- }
data/src/jpeg-7/jdct.h DELETED
@@ -1,393 +0,0 @@
1
- /*
2
- * jdct.h
3
- *
4
- * Copyright (C) 1994-1996, Thomas G. Lane.
5
- * This file is part of the Independent JPEG Group's software.
6
- * For conditions of distribution and use, see the accompanying README file.
7
- *
8
- * This include file contains common declarations for the forward and
9
- * inverse DCT modules. These declarations are private to the DCT managers
10
- * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms.
11
- * The individual DCT algorithms are kept in separate files to ease
12
- * machine-dependent tuning (e.g., assembly coding).
13
- */
14
-
15
-
16
- /*
17
- * A forward DCT routine is given a pointer to an input sample array and
18
- * a pointer to a work area of type DCTELEM[]; the DCT is to be performed
19
- * in-place in that buffer. Type DCTELEM is int for 8-bit samples, INT32
20
- * for 12-bit samples. (NOTE: Floating-point DCT implementations use an
21
- * array of type FAST_FLOAT, instead.)
22
- * The input data is to be fetched from the sample array starting at a
23
- * specified column. (Any row offset needed will be applied to the array
24
- * pointer before it is passed to the FDCT code.)
25
- * Note that the number of samples fetched by the FDCT routine is
26
- * DCT_h_scaled_size * DCT_v_scaled_size.
27
- * The DCT outputs are returned scaled up by a factor of 8; they therefore
28
- * have a range of +-8K for 8-bit data, +-128K for 12-bit data. This
29
- * convention improves accuracy in integer implementations and saves some
30
- * work in floating-point ones.
31
- * Quantization of the output coefficients is done by jcdctmgr.c.
32
- */
33
-
34
- #if BITS_IN_JSAMPLE == 8
35
- typedef int DCTELEM; /* 16 or 32 bits is fine */
36
- #else
37
- typedef INT32 DCTELEM; /* must have 32 bits */
38
- #endif
39
-
40
- typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data,
41
- JSAMPARRAY sample_data,
42
- JDIMENSION start_col));
43
- typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data,
44
- JSAMPARRAY sample_data,
45
- JDIMENSION start_col));
46
-
47
-
48
- /*
49
- * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer
50
- * to an output sample array. The routine must dequantize the input data as
51
- * well as perform the IDCT; for dequantization, it uses the multiplier table
52
- * pointed to by compptr->dct_table. The output data is to be placed into the
53
- * sample array starting at a specified column. (Any row offset needed will
54
- * be applied to the array pointer before it is passed to the IDCT code.)
55
- * Note that the number of samples emitted by the IDCT routine is
56
- * DCT_h_scaled_size * DCT_v_scaled_size.
57
- */
58
-
59
- /* typedef inverse_DCT_method_ptr is declared in jpegint.h */
60
-
61
- /*
62
- * Each IDCT routine has its own ideas about the best dct_table element type.
63
- */
64
-
65
- typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */
66
- #if BITS_IN_JSAMPLE == 8
67
- typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */
68
- #define IFAST_SCALE_BITS 2 /* fractional bits in scale factors */
69
- #else
70
- typedef INT32 IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */
71
- #define IFAST_SCALE_BITS 13 /* fractional bits in scale factors */
72
- #endif
73
- typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
74
-
75
-
76
- /*
77
- * Each IDCT routine is responsible for range-limiting its results and
78
- * converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could
79
- * be quite far out of range if the input data is corrupt, so a bulletproof
80
- * range-limiting step is required. We use a mask-and-table-lookup method
81
- * to do the combined operations quickly. See the comments with
82
- * prepare_range_limit_table (in jdmaster.c) for more info.
83
- */
84
-
85
- #define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE)
86
-
87
- #define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
88
-
89
-
90
- /* Short forms of external names for systems with brain-damaged linkers. */
91
-
92
- #ifdef NEED_SHORT_EXTERNAL_NAMES
93
- #define jpeg_fdct_islow jFDislow
94
- #define jpeg_fdct_ifast jFDifast
95
- #define jpeg_fdct_float jFDfloat
96
- #define jpeg_fdct_7x7 jFD7x7
97
- #define jpeg_fdct_6x6 jFD6x6
98
- #define jpeg_fdct_5x5 jFD5x5
99
- #define jpeg_fdct_4x4 jFD4x4
100
- #define jpeg_fdct_3x3 jFD3x3
101
- #define jpeg_fdct_2x2 jFD2x2
102
- #define jpeg_fdct_1x1 jFD1x1
103
- #define jpeg_fdct_9x9 jFD9x9
104
- #define jpeg_fdct_10x10 jFD10x10
105
- #define jpeg_fdct_11x11 jFD11x11
106
- #define jpeg_fdct_12x12 jFD12x12
107
- #define jpeg_fdct_13x13 jFD13x13
108
- #define jpeg_fdct_14x14 jFD14x14
109
- #define jpeg_fdct_15x15 jFD15x15
110
- #define jpeg_fdct_16x16 jFD16x16
111
- #define jpeg_fdct_16x8 jFD16x8
112
- #define jpeg_fdct_14x7 jFD14x7
113
- #define jpeg_fdct_12x6 jFD12x6
114
- #define jpeg_fdct_10x5 jFD10x5
115
- #define jpeg_fdct_8x4 jFD8x4
116
- #define jpeg_fdct_6x3 jFD6x3
117
- #define jpeg_fdct_4x2 jFD4x2
118
- #define jpeg_fdct_2x1 jFD2x1
119
- #define jpeg_fdct_8x16 jFD8x16
120
- #define jpeg_fdct_7x14 jFD7x14
121
- #define jpeg_fdct_6x12 jFD6x12
122
- #define jpeg_fdct_5x10 jFD5x10
123
- #define jpeg_fdct_4x8 jFD4x8
124
- #define jpeg_fdct_3x6 jFD3x6
125
- #define jpeg_fdct_2x4 jFD2x4
126
- #define jpeg_fdct_1x2 jFD1x2
127
- #define jpeg_idct_islow jRDislow
128
- #define jpeg_idct_ifast jRDifast
129
- #define jpeg_idct_float jRDfloat
130
- #define jpeg_idct_7x7 jRD7x7
131
- #define jpeg_idct_6x6 jRD6x6
132
- #define jpeg_idct_5x5 jRD5x5
133
- #define jpeg_idct_4x4 jRD4x4
134
- #define jpeg_idct_3x3 jRD3x3
135
- #define jpeg_idct_2x2 jRD2x2
136
- #define jpeg_idct_1x1 jRD1x1
137
- #define jpeg_idct_9x9 jRD9x9
138
- #define jpeg_idct_10x10 jRD10x10
139
- #define jpeg_idct_11x11 jRD11x11
140
- #define jpeg_idct_12x12 jRD12x12
141
- #define jpeg_idct_13x13 jRD13x13
142
- #define jpeg_idct_14x14 jRD14x14
143
- #define jpeg_idct_15x15 jRD15x15
144
- #define jpeg_idct_16x16 jRD16x16
145
- #define jpeg_idct_16x8 jRD16x8
146
- #define jpeg_idct_14x7 jRD14x7
147
- #define jpeg_idct_12x6 jRD12x6
148
- #define jpeg_idct_10x5 jRD10x5
149
- #define jpeg_idct_8x4 jRD8x4
150
- #define jpeg_idct_6x3 jRD6x3
151
- #define jpeg_idct_4x2 jRD4x2
152
- #define jpeg_idct_2x1 jRD2x1
153
- #define jpeg_idct_8x16 jRD8x16
154
- #define jpeg_idct_7x14 jRD7x14
155
- #define jpeg_idct_6x12 jRD6x12
156
- #define jpeg_idct_5x10 jRD5x10
157
- #define jpeg_idct_4x8 jRD4x8
158
- #define jpeg_idct_3x6 jRD3x8
159
- #define jpeg_idct_2x4 jRD2x4
160
- #define jpeg_idct_1x2 jRD1x2
161
- #endif /* NEED_SHORT_EXTERNAL_NAMES */
162
-
163
- /* Extern declarations for the forward and inverse DCT routines. */
164
-
165
- EXTERN(void) jpeg_fdct_islow
166
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
167
- EXTERN(void) jpeg_fdct_ifast
168
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
169
- EXTERN(void) jpeg_fdct_float
170
- JPP((FAST_FLOAT * data, JSAMPARRAY sample_data, JDIMENSION start_col));
171
- EXTERN(void) jpeg_fdct_7x7
172
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
173
- EXTERN(void) jpeg_fdct_6x6
174
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
175
- EXTERN(void) jpeg_fdct_5x5
176
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
177
- EXTERN(void) jpeg_fdct_4x4
178
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
179
- EXTERN(void) jpeg_fdct_3x3
180
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
181
- EXTERN(void) jpeg_fdct_2x2
182
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
183
- EXTERN(void) jpeg_fdct_1x1
184
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
185
- EXTERN(void) jpeg_fdct_9x9
186
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
187
- EXTERN(void) jpeg_fdct_10x10
188
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
189
- EXTERN(void) jpeg_fdct_11x11
190
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
191
- EXTERN(void) jpeg_fdct_12x12
192
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
193
- EXTERN(void) jpeg_fdct_13x13
194
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
195
- EXTERN(void) jpeg_fdct_14x14
196
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
197
- EXTERN(void) jpeg_fdct_15x15
198
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
199
- EXTERN(void) jpeg_fdct_16x16
200
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
201
- EXTERN(void) jpeg_fdct_16x8
202
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
203
- EXTERN(void) jpeg_fdct_14x7
204
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
205
- EXTERN(void) jpeg_fdct_12x6
206
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
207
- EXTERN(void) jpeg_fdct_10x5
208
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
209
- EXTERN(void) jpeg_fdct_8x4
210
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
211
- EXTERN(void) jpeg_fdct_6x3
212
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
213
- EXTERN(void) jpeg_fdct_4x2
214
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
215
- EXTERN(void) jpeg_fdct_2x1
216
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
217
- EXTERN(void) jpeg_fdct_8x16
218
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
219
- EXTERN(void) jpeg_fdct_7x14
220
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
221
- EXTERN(void) jpeg_fdct_6x12
222
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
223
- EXTERN(void) jpeg_fdct_5x10
224
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
225
- EXTERN(void) jpeg_fdct_4x8
226
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
227
- EXTERN(void) jpeg_fdct_3x6
228
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
229
- EXTERN(void) jpeg_fdct_2x4
230
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
231
- EXTERN(void) jpeg_fdct_1x2
232
- JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
233
-
234
- EXTERN(void) jpeg_idct_islow
235
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
236
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
237
- EXTERN(void) jpeg_idct_ifast
238
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
239
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
240
- EXTERN(void) jpeg_idct_float
241
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
242
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
243
- EXTERN(void) jpeg_idct_7x7
244
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
245
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
246
- EXTERN(void) jpeg_idct_6x6
247
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
248
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
249
- EXTERN(void) jpeg_idct_5x5
250
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
251
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
252
- EXTERN(void) jpeg_idct_4x4
253
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
254
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
255
- EXTERN(void) jpeg_idct_3x3
256
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
257
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
258
- EXTERN(void) jpeg_idct_2x2
259
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
260
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
261
- EXTERN(void) jpeg_idct_1x1
262
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
263
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
264
- EXTERN(void) jpeg_idct_9x9
265
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
266
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
267
- EXTERN(void) jpeg_idct_10x10
268
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
269
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
270
- EXTERN(void) jpeg_idct_11x11
271
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
272
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
273
- EXTERN(void) jpeg_idct_12x12
274
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
275
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
276
- EXTERN(void) jpeg_idct_13x13
277
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
278
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
279
- EXTERN(void) jpeg_idct_14x14
280
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
281
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
282
- EXTERN(void) jpeg_idct_15x15
283
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
284
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
285
- EXTERN(void) jpeg_idct_16x16
286
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
287
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
288
- EXTERN(void) jpeg_idct_16x8
289
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
290
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
291
- EXTERN(void) jpeg_idct_14x7
292
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
293
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
294
- EXTERN(void) jpeg_idct_12x6
295
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
296
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
297
- EXTERN(void) jpeg_idct_10x5
298
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
299
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
300
- EXTERN(void) jpeg_idct_8x4
301
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
302
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
303
- EXTERN(void) jpeg_idct_6x3
304
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
305
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
306
- EXTERN(void) jpeg_idct_4x2
307
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
308
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
309
- EXTERN(void) jpeg_idct_2x1
310
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
311
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
312
- EXTERN(void) jpeg_idct_8x16
313
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
314
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
315
- EXTERN(void) jpeg_idct_7x14
316
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
317
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
318
- EXTERN(void) jpeg_idct_6x12
319
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
320
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
321
- EXTERN(void) jpeg_idct_5x10
322
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
323
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
324
- EXTERN(void) jpeg_idct_4x8
325
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
326
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
327
- EXTERN(void) jpeg_idct_3x6
328
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
329
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
330
- EXTERN(void) jpeg_idct_2x4
331
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
332
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
333
- EXTERN(void) jpeg_idct_1x2
334
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
335
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
336
-
337
-
338
- /*
339
- * Macros for handling fixed-point arithmetic; these are used by many
340
- * but not all of the DCT/IDCT modules.
341
- *
342
- * All values are expected to be of type INT32.
343
- * Fractional constants are scaled left by CONST_BITS bits.
344
- * CONST_BITS is defined within each module using these macros,
345
- * and may differ from one module to the next.
346
- */
347
-
348
- #define ONE ((INT32) 1)
349
- #define CONST_SCALE (ONE << CONST_BITS)
350
-
351
- /* Convert a positive real constant to an integer scaled by CONST_SCALE.
352
- * Caution: some C compilers fail to reduce "FIX(constant)" at compile time,
353
- * thus causing a lot of useless floating-point operations at run time.
354
- */
355
-
356
- #define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
357
-
358
- /* Descale and correctly round an INT32 value that's scaled by N bits.
359
- * We assume RIGHT_SHIFT rounds towards minus infinity, so adding
360
- * the fudge factor is correct for either sign of X.
361
- */
362
-
363
- #define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
364
-
365
- /* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
366
- * This macro is used only when the two inputs will actually be no more than
367
- * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a
368
- * full 32x32 multiply. This provides a useful speedup on many machines.
369
- * Unfortunately there is no way to specify a 16x16->32 multiply portably
370
- * in C, but some C compilers will do the right thing if you provide the
371
- * correct combination of casts.
372
- */
373
-
374
- #ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
375
- #define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT16) (const)))
376
- #endif
377
- #ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */
378
- #define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT32) (const)))
379
- #endif
380
-
381
- #ifndef MULTIPLY16C16 /* default definition */
382
- #define MULTIPLY16C16(var,const) ((var) * (const))
383
- #endif
384
-
385
- /* Same except both inputs are variables. */
386
-
387
- #ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
388
- #define MULTIPLY16V16(var1,var2) (((INT16) (var1)) * ((INT16) (var2)))
389
- #endif
390
-
391
- #ifndef MULTIPLY16V16 /* default definition */
392
- #define MULTIPLY16V16(var1,var2) ((var1) * (var2))
393
- #endif