Mercurial > libavcodec.hg
diff avcodec.h @ 1585:6b224ca24033 libavcodec
revised palette API, courtesy of Roberto Togni (rtogni at freemail.it)
author | melanson |
---|---|
date | Thu, 30 Oct 2003 05:40:58 +0000 |
parents | ece0ad14a35d |
children | 6d37b161cf85 |
line wrap: on
line diff
--- a/avcodec.h Wed Oct 29 17:30:13 2003 +0000 +++ b/avcodec.h Thu Oct 30 05:40:58 2003 +0000 @@ -453,7 +453,13 @@ * - decoding: set by lavc\ */\ AVPanScan *pan_scan;\ - + \ + /**\ + * tell user application that palette has changed from previous frame.\ + * - encoding: ??? (no palette-enabled encoder yet)\ + * - decoding: set by lavc (default 0)\ + */\ + int palette_has_changed;\ #define FF_QSCALE_TYPE_MPEG1 0 #define FF_QSCALE_TYPE_MPEG2 1 @@ -1345,6 +1351,13 @@ * - decoding: unused */ int lmax; + + /** + * Palette control structure + * - encoding: ??? (no palette-enabled encoder yet) + * - decoding: set by user. + */ + struct AVPaletteControl *palctrl; } AVCodecContext; @@ -1426,17 +1439,18 @@ * This structure defines a method for communicating palette changes * between and demuxer and a decoder. */ +#define AVPALETTE_SIZE 256 typedef struct AVPaletteControl { /* demuxer sets this to 1 to indicate the palette has changed; * decoder resets to 0 */ int palette_changed; - /* 256 3-byte RGB palette entries; the components should be - * formatted in the buffer as "RGBRGB..." and should be scaled to - * 8 bits if they originally represented 6-bit VGA palette - * components */ - unsigned char palette[256 * 3]; + /* 4-byte ARGB palette entries, stored in native byte order; note that + * the individual palette components should be on a 8-bit scale; if + * the palette data comes from a IBM VGA native format, the component + * data is probably 6 bits in size and needs to be scaled */ + unsigned int palette[AVPALETTE_SIZE]; } AVPaletteControl;