[FFmpeg-soc] BFI

Mike Melanson mike at multimedia.cx
Sat Mar 22 05:08:32 CET 2008


Sisir Koppaka wrote:
> But the size of the BFI palette is 256*3 right? Did you mean to say that
> there is a 256-color palette for R, G and B individually? In that case,
> wouldn't R,G and B have a depth of 256 instead of 64?  Also, I'm setting the
> palette once in the demuxer? How often do we have to set the palette? like
> for every frame in the decoder?

In C, the palette generally looks like this:

unsigned char palette[256][3];

So that makes 256*3 = 768 bytes.

When you a (commonly) 320x200 video frame of PIX_FMT_PAL8 data, that is
64000 pixels = 64000 bytes. To find the color that a particular pixel
represents, use the byte to index into palette[]. That will give you the
R, G, and B values for that pixel. Each of those R, G, and B values will
max out at 64. Multiply by 4, naively, to scale up to a full 8-bit range.

As for the palette communication, I have to admit that I can't remember
off the top of my head how that's supposed to work right now. If Kostya
is monitoring the conversation, hopefully, he will jump in.

How is the BFI demuxer coming? Are you dispatching video and audio? Can
you hear the audio yet?

-- 
	-Mike Melanson



More information about the FFmpeg-soc mailing list