home *** CD-ROM | disk | FTP | other *** search
/ Computer Club Elmshorn Atari PD / CCE_PD.iso / pc / 0600 / CCE_0697.ZIP / CCE_0697.PD / JPEGV218 / JPEGV218.TXT < prev   
Text File  |  1994-01-09  |  17KB  |  404 lines

  1.                            The V11 JFIF viewer
  2.                           for the Atari Falcon
  3.  
  4.                       030-only version 2.18, 9/1/94.
  5.  
  6.           By David R. Oldcorn of Volume 11 Software Development
  7. All Falcon-specific parts copyright 1993-1994 Volume 11 Software/DR Oldcorn
  8.         Based on the JFIF C conversion software originally by the
  9.                         Independent JPEG Group.
  10.  
  11.          DSP56001 code and interface written 23/7/93 - 28/7/93
  12.                             (not included)
  13.  
  14.    GIF and Graphics Interchange Format are trademarks of Compuserve, Inc.
  15.  
  16.  
  17.  
  18.  
  19. Usage:
  20.  
  21. About the easiest setup is to set it on a function key and as a
  22. JPG extension triggered system, so double-clicking a JPG file will
  23. show it onscreen, and an F-key will bring up the viewer.
  24.  
  25. Once it is running in viewer mode the controls are as follows:
  26.  
  27. File selection screen:
  28. A-Z:       select drive to be displayed.
  29. Cursors:   move file cursor
  30. RETURN:    show file / enter subdirectory
  31. BACKSPACE: exit subdirectory
  32. *:         show info on current file
  33. Esc:       exit to desktop
  34. Space:     mark file for slideshow
  35. Tab:       start slideshow (show all if no files selected)
  36. Shift+Tab: continuous slideshow (as above but doesn't pause)
  37. Insert:    switch to preferences screen
  38. Help:      show keylist & program info
  39. Delete:    delete currently selected file... will prompt!
  40.  
  41.  
  42. In display mode:
  43. Cursors:   move screen
  44. Esc:       exit now
  45. Return:    exit / next slideshow file
  46. Space:     halfsize picture
  47. Backspace: switch interlaced frame alternacy (not enormously useful, but
  48.            there to show up an unusual problem with interlace on a friend's
  49.            TV).
  50.  
  51.  
  52. On preferences screen:
  53. Cursors:   move cursor / alter contrast settings
  54. Space:     change status
  55. Shift+Curs: +- 10 to contrast settings
  56. Return/Esc/Insert: exit
  57.  
  58.  
  59. This 030 version is entirely public domain, and you are free to distribute
  60. it as much as you like AS LONG AS it and this file are NOT ALTERED in
  61. ANY way, and that it is always accompanied by this file.
  62.  
  63. The full DSP version of this software is available for £5 from:
  64.              Volume 11 Software Development,
  65.              PO Box 311,
  66.              Broughton
  67.              Preston
  68.              PR3 5DZ
  69.              (England)
  70.  
  71. All monies should be made payable to D. Oldcorn.
  72.  
  73. Note that the DSP version is not at all public domain in any way, shape
  74. or form and may not be copied for distribution.
  75.  
  76. I can be contacted until at least August 1994 on email at:
  77. oldcornd@cs.man.ac.uk
  78.  
  79. If you have an email account, and want the DSP version, then I can send
  80. it to you by email if you want - it's quicker for you, and cheaper for me!
  81.  
  82. All feedback, suggestions and comments welcome.
  83.  
  84.  
  85.  
  86. Disclaimer (just in case anything goes wrong I am not responsible):
  87. This software will not necessarily perform to the specifications
  88. set out below due to unforseen problems, and you take all the
  89. blame for anything that goes wrong when you try to use it. If
  90. this idea disturbs you, please do not attempt to use this software.
  91.  
  92.  
  93.  
  94.  
  95. GENERAL NOTES
  96.  
  97. All pictures are displayed in Falcon 16-bit Truecolour.
  98. Even the ST formats (Degas etc.) are run in TC mode, so all the halfsize
  99. features still work.
  100.  
  101. Working memory is: size of file buffer + about 50K + about 100K(DSP) +
  102. size of selected image buffer
  103. The file buffer is 8K for Targa and JPEG with continuous read on, and
  104. the file size for everything else.
  105. For VERY large pictures operating in hardware scroll mode can require
  106. around 2.5-3 Megs due to the very large final image.
  107.  
  108. Memory available to the program is the size of the biggest UNFRAGMENTED
  109. free block in the TOS memory space. This does NOT include the default
  110. screen (the desktop / select screen) so running the viewer from high
  111. colour or large desktop screens will reduce the amount of memory available.
  112. Best mode for memory is 640x200 2 colour. Running the viewer after
  113. other programs can result in it having surprisingly little memory,
  114. as main memory can become fragmented.
  115.  
  116. If you get an 'out of memory' error, set a lower res video mode,
  117. turn hardware scroll off and probably set halfsize on - this will
  118. limit the screen size by not allocating memory for areas outside
  119. the left and right of the visible screen area (it WILL still allocate
  120. for VERTICAL scroll but if halfsize is on this is unlikely to be
  121. necessary).
  122. It has displayed JPEGs as big as 640x2500  and 1700x1700 (halfsized)
  123. on my 4 Meg machine.
  124.  
  125. In slideshow mode, remember it has to hold TWO pictures in memory at
  126. once... so you won't be able to show very big pictures one after
  127. another without running out of memory. That said, if you're running
  128. it in a clear Falcon with just the Control Panel installed, you
  129. should have about 3.8 megs free, so the pics will have to be big to
  130. cause problems.
  131. Things can get really messy if it runs out of memory in slideshow mode,
  132. as attempts to report this fact will usually go unnoticed. It will
  133. generally sit and ping a lot!
  134.  
  135. Due to a slightly unhinged design flaw in the Falcon video XBIOS
  136. (which was always present on the ST too, but because direct hardware
  137. accesses were OK you could get round it) the screen resolution can't
  138. be changed without clearing the screen (to white, of all things) which
  139. 1) leads to the flicker when an image starts loading and 2) leads to
  140. flickering and unusual output when the slideshow swaps an image,
  141. especially if it has to change resolutions
  142.  
  143. VGA mode is limited to 320x240 because the Falcon doesn't support
  144. 640-wide screen modes in VGA Truecolour. The hardware scroll and
  145. halfsize should still be OK so you WILL be able to see a full picture.
  146. All VGA modes are currently untested, because I don't have a VGA handy.
  147. Some feedback has indicated to me that all the VGA bits are completely
  148. cream crackered so don't bet on it working.
  149.  
  150. Full PAL height uses direct access to the video hardware to remove the
  151. top and bottom borders produced when using overscan on a PAL (50Hz)
  152. TV or monitor, this may not work on later versions of the hardware.
  153. When you select this mode your monitor may do something strange, if
  154. it does don't use it (on 4 different TV's and 2 different monitors
  155. there haven't been any problems so far).
  156. This produces the maximum 600 data lines, although you'll probably need
  157. a vertical resize to see the top 30 and bottom 10 of these.
  158.  
  159. The STe hardware scroll registers are also used for pictures which
  160. are wider than the screen. These should be valid on all Falcons, but
  161. an option is given to disable horizontal scrolling, in which case the
  162. hardware register will not be accessed, and the extra memory required
  163. for the screen will not be allocated.
  164.  
  165. All hardware accesses can be optionally disabled, which will prevent
  166. any possibility of any illegal hardware access.
  167.  
  168. It pings when it's finished loading whatever it's loading
  169.  
  170. It's not MultiTOS compatible but it is quite legal in terms of memory
  171. usage and management. Running this under MultiTOS would be completely
  172. pointless. (As far as I can tell, the incompatibility is caused by
  173. changing screen res + direct screen access: although this program
  174. could manage without res changes, if it used the VDI it'd take weeks...
  175. currently plotting one pixel takes 9 instructions in YCrCb...)
  176.  
  177. Error messages will not be printed unless using 'info' on a file.
  178.  
  179. If a slideshow is begun with no selected files, it will run every file
  180. in the current directory. Holding SHIFT when slideshow is activated will
  181. cause it to run without pauses. If no files are being written it will
  182. run in a continuous loop.
  183.  
  184. It has a buffering system to reduce the amount of memory used on JFIFs and
  185. Targas, by default this will not operate on display from floppy (as it is
  186. VERY slow!) but can be changed from the options menu.
  187.  
  188.  
  189.  
  190. GENERAL NOTES ON JFIF CONVERTER.
  191.  
  192. Current version implements a subset of JFIF.
  193. BUT most standard JFIF's will certainly be supported.
  194.  
  195. It will only handle images in YCrCb and greyscale (the only two
  196. logical colourspaces for general use).
  197. Noninterleaved scans are not supported, if I ever see one it will be.
  198. Non-integral upsampling ratios are not supported.
  199.  
  200. This should cover the vast majority of JFIF files.
  201. (This covers ALL the JPEGs I have encountered, and all
  202. which can be created using the Independent JPEG group's CJPEG software).
  203.  
  204. It is recommended that ALL stored JPEGS should be 2x2 1x1 1x1, the
  205. software is most efficient at these sampling ratios.
  206.  
  207. Error checking is performed, and faulty files will halt
  208. the decompacter and/or produce garbage. Resyncing is NOT guaranteed
  209. even if restart markers are included, but in most cases some kind of
  210. resync should be possible.
  211.  
  212. Halfsize reduction is performed by a supersampled zoom at the
  213. upsampling stage (only approximately if you are using non-1x1/2x2
  214. ratios, but this should be fairly rare).
  215.  
  216. NOTES ON DSP CODE:
  217.  
  218. The DSP version is slightly more limited than the plain vanilla
  219. 030 version, due to the limited memory available to the DSP and the
  220. logistics involved in programming a fast, efficient DSP version. As
  221. a result, some JPEGs will have be processed by the 030 entropy decode
  222. rather than the DSP, which will be slower - anything with restart
  223. markers will have to be done on the 030, and anything with silly
  224. sampling ratios (CrCb ratios must be 1x1 1x1 to be OK, and Y must
  225. be 1x1, 2x2, 2x1 or 1x2).
  226. The DSP version completely ignores any detected errors in the input
  227. file (e.g. corruption leading to invalid Huffman table entries being
  228. referenced). If you suspect this, run the 030 entropy decode, which
  229. will produce an error message if there is a problem.
  230. On average it runs about 4 to 5 times faster than a pure 030 scan.
  231. If a full DSP scan can't be done, and the DSP is available, it will
  232. use DSP iDCT and 030 Huffman, which will run about half of full DSP
  233. speed. 030 mode will also be selected if the DSP has been locked
  234. out for any reason.
  235. Other DSP programs should run OK after the JPEG process has terminated.
  236. The DSP system is specially optimised for 640-wide 2x2 1x1 1x1 images
  237. and makes maximum use of available 030 and DSP power on these images.
  238.  
  239.  
  240. NOTES ON GIF CONVERTER
  241.  
  242. Interleaved scans are not currently supported, because I haven't got
  243. any interlaced GIF's!
  244. If no colour map is present it will do something silly.
  245. Halfsize reduction and cutdown are not supported (i.e. hardware scroll
  246. mode only for images bigger than the screen).
  247. It's bloody slow, but that's LZW for you.
  248.  
  249.  
  250. FILE WRITE MODE
  251.  
  252. The viewer is capable of writing an output file whilst displaying
  253. some of the available formats (JFIF and Targa). The output format
  254. can be either JFIF or Targa (uncompressed 24 bit or 8 bit greyscale).
  255. When it writes, it will write a new file whose name is the same as
  256. the old one except for an appropriate extension change. If this file
  257. already exists it will attempt to find a unique filename by tagging A's
  258. onto the name or by moving the last letter of the filename up one (if
  259. all 36 last letters A-Z and 0-9 are used it will not write). I
  260. particularly do not guarantee that this is 100% working, and any
  261. files deleted by accident are your problem. It hasn't ever happened
  262. to me but I never trust these things.
  263.  
  264. If an error occurs the program may do one of three things:
  265.     1. Ignore it and carry on, probably producing a corrupted image
  266.     2. Halt the write process, closing the file, reporting the error
  267.     3. Go Bye Bye (unlikely)
  268. If (Esc) is pressed during write, the file will be closed and
  269. will be incomplete.
  270.  
  271.  
  272. NOTES ON JFIF COMPRESSOR
  273.  
  274. The compressor implemented is a standard JPEG compression, with
  275. full quality setting (1-100, as CJPEG) and Huffman coefficient
  276. optimisation, which will reduce the size of the compressed file by
  277. about 5-10% (it is especially efficient on small files). Using the
  278. optimiser will only add a few seconds to the compression time, but
  279. more memory will be required. Sample ratios are fixed at 2x2 1x1 1x1
  280. (YCrCb) and 1x1 (greyscale). Nothing else is particularly useful
  281. anyway.
  282.  
  283. Memory usage can be large, at least 100k or so, and it will attempt
  284. to use as much memory as possible, to reduce time in disk access. This
  285. is especially useful during optimisation, where it will attempt to use
  286. memory if possible, but otherwise will use a (VERY large) temporary
  287. file on disk called TMPFILE$.$$$. This will be about 900Kish for
  288. 640x480. If it runs out of space things may be a little confused, but
  289. hopefully it will close everything and delete the temp file. BE WARNED
  290. users of AHDI before 6.06, filling a drive can sometimes result in the
  291. loss of boot sector on the next logical drive, which can be very
  292. difficult to recover.
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299. Known bugs:
  300. If really badly out of memory has been known to crash quite heavily, but
  301. with new slideshow memory checking this is now rare/gone?
  302. VGA is completely duff I think
  303.  
  304.  
  305.  
  306. History:
  307.  
  308. 2.18: Error handling actually reports something a bit more useful.
  309. Optimisation shown in info. JFIF can now write just greyscale. Delete
  310. file option added.
  311.  
  312. 2.17: JFIF write while decomp (oooh, doesn't it sound simple - this
  313. added 50K to the source and 5K to the object). Some small bugs fixed,
  314. vskip locked to valid values, and a rare but extremely dangerous
  315. out-of-memory crash when switching res prevented, I hope! Fixed Targa
  316. cutdown so it actually works!
  317.  
  318. 2.16: Targa write while decomp, if wanted, plus Targa read, greyscale
  319. and 24-bit RGB only, will do more when I can get some more example
  320. Targa files. Targas run through new buffered memory system to massively
  321. and essentially remove memory overhead. JPEGs now do too. This may be
  322. a bit slow on write-and-decomp. Options handler made a bit less
  323. obfuscate, and speeded up quite a bit. Entire output handler moved over
  324. to a more flexible format ready for JPEG compacter to be introduced.
  325. Changed PAL600... it's now a bit of a misnomer cos it's now only about
  326. 590 lines....
  327.  
  328. 2.15: Rebuild to modular version started. Memory overhead dropped by
  329. changes to huff handlers, which also fixed a restart marker problem.
  330. Added quality factor to JPEG info. Changed the restart marker processor
  331. slightly so if it finds errors it at least TRIES to carry on.
  332.  
  333. 2.14: Save preferences, and switch to assemble 030-only version. File
  334. sizes now shown. GIF bugs fixed. PAL600 fixed for TV's that have fiddly
  335. syncpulse requirements. Screen scroll system fixed properly. DSP lock
  336. and error detection now reported to options screen. Upsampler reworked
  337. to allow halfsizing of all JPEG's. Halfsize bug fixed. Enabled a key
  338. to swap frame alternacy to occasionally improve display of some JPEGs
  339. on Ken's TV. Contrast expansion added. Went over to DSP code 2.02 to
  340. fix a bug if the first image loaded was greyscale.
  341.  
  342. 2.13: Added other file format handling: Degas, Spectrum 512 (you
  343. won't BELIEVE how much fiddling this routine's been through, since
  344. I had to manually tune it - and a stupid bug didn't help!). Fixed memory
  345. allocate to only allocate on 4-byte boundaries beacuse otherwise
  346. the video system complains.
  347.  
  348. 2.12: Fixed a series of bugs in MCU transform and upsampler to get more
  349. sampling ratios working properly. Improved GIF converter a bit. Added
  350. SOF1 marker to let low-quality sampled images work properly. Added
  351. 'slideshow all' mode if no files are marked. Switched over to 16-bit
  352. Truecolour, but can't see the difference, so I dunno whether it works!
  353.  
  354. 2.11: Fixed PAL600 bug caused by manky video programming. Introduced
  355. Info. Introduced source history. Which is why it doesn't go too far back!
  356.  
  357. 2.10: Added slideshow mode, including view-and-decompress any pic,
  358. including major rewrites to all the video code. Code rearranged into
  359. logical sections (select/view & scan, JPEG, GIF).
  360. Added no-hardware access mode. Fixed some minor bugs with selector.
  361. Rewrote DSP output transform to fix some more sample ratios for DSP.
  362.  
  363. 2.09: Rewrote upsampler for more than just 2x2/1x1 sample ratios.
  364. Went over to DSP code 2.01, and rewrote IDCT-on-DSP output transform
  365. accordingly. Moved big non-initialised data to BSS segment.
  366.  
  367.  
  368. DSP code history:
  369.  
  370. 2.02: Fixed bug to force greyscale images to work OK
  371. 2.01: All coefficient output converted to be range-limited. Some speed
  372. modifications made.
  373. 2.00: Huffman/IDCT on DSP.
  374. 1.0: IDCT on DSP.
  375.  
  376.  
  377.  
  378.  
  379.  
  380. Rough Execution times for 640x480 colour JPEG:
  381. 030 version: 18 seconds
  382. DSP version: 6 seconds
  383.  
  384. Currently supported file formats:
  385.  
  386. JPG - JPEG File Interchange Format
  387. GIF - CompuServe GIF (TM)
  388. PI? - DEGAS uncompressed
  389. PC? - DEGAS compressed
  390. SPC - Spectrum 512 compressed
  391. TGA - Targa, 24-bit colour and 8-bit greyscale uncompressed only
  392.  
  393.  
  394.  
  395. Regular updates should be available - when I either think of new ideas,
  396. or manage to find a new JPEG it won't handle!
  397.  
  398. Coming soon: Starball, an ST / Falcon Pinball game, which is completely
  399. awesome, in every respect. Falcon features include 50 frames per second
  400. operation and stereo soundtracker sound. Even on the ST it'll blow your
  401. socks off. Believe it!
  402.  
  403.  
  404. ə