diff options
author | Mike Melanson <mike@multimedia.cx> | 2003-10-30 05:40:58 +0000 |
---|---|---|
committer | Mike Melanson <mike@multimedia.cx> | 2003-10-30 05:40:58 +0000 |
commit | 2a2bbcb05fde486eef76d070f26eecddd4de0ace (patch) | |
tree | 781c3c83552a80cb71014d3ff66ff05df14f5f7e /libavcodec/avcodec.h | |
parent | 9df1d2490d61c273a3ac9573c49cf4d20b4d750e (diff) | |
download | ffmpeg-2a2bbcb05fde486eef76d070f26eecddd4de0ace.tar.gz |
revised palette API, courtesy of Roberto Togni (rtogni at freemail.it)
Originally committed as revision 2451 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r-- | libavcodec/avcodec.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index ad3eb546a1..90b20f425d 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -453,7 +453,13 @@ typedef struct AVPanScan{ * - 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 @@ typedef struct AVCodecContext { * - 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 @@ typedef struct AVPicture { * 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; |