From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
Newsgroups: comp.sys.mac.programmer
Subject: Re: QuickTime and Fast Dithering
Date: 6 Nov 92 15:18:54 +1300
Followup-To: comp.sys.mac.programmer
Organization: University of Waikato, Hamilton, New Zealand

In article <40577@sdcc12.ucsd.edu>, sakelley@euclid.ucsd.edu (Scott Kelley) writes:

> I'm doing a project in MacroMind Director that also uses QuickTime.
> Since Director's built in support for QuickTime isn't sufficient for our
> needs, I've beed writing XObjects (Director's version of XCMD's) to play
> back movies and still images. We want to store stills and video clips at
> 24-bit color and then have them "dither down nicely" for display on
> 8-bit systems.
>
> Here's the problem I'm having: by default, QuickTime is displaying
> everything using it's "fast dither" algorithm. This is fine for video
> clips, but for still images (JPEG), we'd like to do a little better.
> According to the QT 1.0 developer's guide, page 3-20:
>
>    "Apple decompressors use fast dithering when copying from image band
>    buffers to 8-bit destinations. If the accuracy for decompression is
>    above normal, then the decompressors use true error diffusion rather
>    than fast dithering."
>
> Does this imply that QT will ALWAYS use fast dithering to an 8-bit
> destination, or is it possible to bump up the "accuracy" setting for
> playback to get better results? If so, how can I set this accuracy
> setting? This setting is NOT the "temporal/spatial quality" setting;
> I've tried setting those high and low and I always get the fast dither.
> I have found a couple of functions in the movie toolbox (like
> SetMediaQuality) and in the image compression manager
> (SetDSequenceAccuracy) that seemed to imply (I hope) that I could
> specify that I wanted high quality just before I started playback, and
> that I would get what I want. But I haven't been able to sort out the
> details well enough to actually try it yet.

Hi, Scott!

Now, you need to keep a number of different concepts straight here:

* The spatial/temporal quality settings govern the amount of *compression*
  you get; as you rightly observed, they don't control whether the decompressors
  use fast dithering on playback or not.
* The media quality setting (as set by SetMediaQuality) is nothing more than
  an informational hint to the Movie Toolbox; it allows you to have alternative
  versions of tracks that contain the same information at different quality
  levels (e g a video track optimized for 4-bit displays versus another one
  optimized for 8-bit displays), and have the Movie Toolbox automatically pick
  the right one based on your system configuration.
* You're getting very warm with your comment about SetDSequenceAccuracy.
  When you decompress an image, you can specify an "accuracy" setting, which
  specifies how much effort the decompressor should put into the job. You
  can specify a range of numeric values, but all that really happens in
  practice is that, if you specify a value of "normal", then you will get
  fast dithering (if appropriate), whereas if you specify a value greater than
  this, the image will be drawn using standard QuickDraw drawing modes,
  including normal QuickDraw dithering if appropriate.

Unfortunately, the playback decompression sequence is buried in the depths of
the workings of the video media handler, and I know of no calls to let you get
access to it.

> I should also probably point out that right now I'm working with JPEG
> images stored as single-frame movies. This is because Director's native
> support for QuickTime only recognizes MooV files, so to get it to load a
> JPEG image, I have to store it as a movie. I could store the JPEG images
> as compressed PICT images and then use Director's "link to file" option
> for PICT's, but that doesn't work for us because it stores absolute
> pathname links. Eventually we will move to using all our own XObjects to
> talk to QuickTime, and, if necessary, I can write a separate XObject
> for stills.

I'd say you're really better off abandoning the single-frame movie approach,
and storing your stills as (JPEG-compressed) PICTs. And if Director is too
inflexible with its links to files, then to hell with it--write that stills
XObject!

One of my current projects is a simple interactive tour, with lots of still
images stored as JPEG-compressed PICT files. I'm doing it in HyperCard, with
a whole lot of custom XCMDs and XFCNs. I'm actually storing aliases to the
individual picture files, which gives you a bit more flexibility in how you
arrange things.

I think Director is a marvellous tool for creating animations, but I personally
prefer to put together final presentations in HyperCard. It's sort of like
plasticine: some may see it as a kids' toy, but I can mould it into any shape
I want!

Lawrence D'Oliveiro                       fone: +64-7-856-2889
Computer Services Dept                     fax: +64-7-838-4066
University of Waikato            electric mail: ldo@waikato.ac.nz
Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
Newsgroups: comp.sys.mac.programmer