Re: "1-Hit Wonders"

Mike Melanson <[email protected]>
Newsgroups gmane.comp.video.xine.codec.devel
Message-ID <[email protected]>
On Thu, 25 Mar 2004, Jim Leonard wrote:

> Mike Melanson wrote:
>
> > 	Then there was the MVE format from Wing Commander III...the color
> > system on that one defies explanation.
>
> Checking...  "Each SHOT chunk has a 768-byte RGB palette specified in
> the file header."  Doesn't sound so complicated to me; am I missing
> something?

	Yeah, read towards the end of the document under the section
"Obtaining The Palette" (I guess I should make mention of it earlier in
the description):

----------------
The 768 color components described in each PALT chunk do not represent
red, green, and blue values. In order to obtain the actual RGB
components, each PALT component must be rotated left by 2 (or right by
6, if you prefer). The rotated number is then used as an index into a
table to obtain the actual red, green, or blue component value, which
ranges from 0..255. The 256-element palette conversion table is:

unsigned char wc3_pal_lookup[] = {
...
};

As an example, the number 0x68 is written in binary as 01101000.
Rotating left by 2 yields 10100001 = 0xA1. Index 0xA1 in the above table
is 0xB1 which would be the actual color component used.
----------------

So, I guess the scheme qualifies as a 8-bit range since the values in the
table range range from 0x00..0xFD. I still have no idea what the scheme
achieves, aside from frustrating reverse engineering efforts (which would
be a valid goal).

> > 	Good catch. It's supposed to be the 1 million (6 0s).
>
> As long as I'm catching stuff, you should fix your description of RoQ
> encoding :)

	It's on "the list" (y'know, the kilometer-long one :). There are a
few other mistakes in that document I need to fix but no one has found
them yet.

--
	-Mike Melanson


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.