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