[Ffmpeg-devel] AVPaletteControl removal from libavf (was Re: [MPlayer-dev-eng] [PATCH] (bit hackish) palette support for libav*)
Michael Niedermayer
michaelni
Tue Jan 30 00:13:11 CET 2007
Hi
On Mon, Jan 29, 2007 at 11:03:26PM +0100, Reimar D?ffinger wrote:
> Hello,
> On Mon, Jan 29, 2007 at 09:26:54PM +0100, Reimar D?ffinger wrote:
> > On Mon, Jan 29, 2007 at 07:19:15PM +0100, Michael Niedermayer wrote:
> > > On Mon, Jan 29, 2007 at 06:22:30PM +0100, Reimar D?ffinger wrote:
> > > > On Mon, Jan 29, 2007 at 05:52:54PM +0100, Michael Niedermayer wrote:
> > [...]
> > > > > palette changes should be sent as packets like normal frames
> > > >
> > > > That might make things quite a bit simpler from the MPlayer side.
> > > > Do you have something in mind already?
> > > > Just adding PKT_FLAG_PALETTE and sending the palette through? Might
> > >
> > > yes
> >
> > Hm.. little problem... Either I move the palette handling into the main
> > loop, which will not work for codecs that have a delay, or I need to
> > pass the palette into the codec somehow...
> > Any suggestions?
> > My first idea is keeping AVPaletteControl, but using it only in
> > libavcodec...
>
> Here is what I came up with so far (MPlayer only). I still have to
> investigate where the changes in ffmpeg must go to (second attached
> patch is for changes needed to ffplay).
> Does this look like the right way to proceed?
[...]
> Index: libavformat/ipmovie.c
> ===================================================================
> --- libavformat/ipmovie.c (revision 7760)
> +++ libavformat/ipmovie.c (working copy)
[...]
> @@ -458,10 +458,9 @@
> r = scratch[j++] * 4;
> g = scratch[j++] * 4;
> b = scratch[j++] * 4;
> - s->palette_control.palette[i] = (r << 16) | (g << 8) | (b);
> + s->palette[i] = (r << 16) | (g << 8) | (b);
> }
> - /* indicate a palette change */
> - s->palette_control.palette_changed = 1;
> + palette_changed = 1;
> break;
>
> case OPCODE_SET_PALETTE_COMPRESSED:
> @@ -498,6 +497,13 @@
> /* make a note of where the stream is sitting */
> s->next_chunk_offset = url_ftell(pb);
>
> + if (palette_changed) {
> + if (av_new_packet(pkt, AVPALETTE_SIZE))
> + chunk_type = CHUNK_NOMEM;
> + memcpy(pkt->data, s->palette, AVPALETTE_SIZE);
are you aware that you put endian specific data into the AVPacket? this is
not good at all
i would rather pass the palette as it is stored to the decoder (unless of
course the specific codec can be stored in several containers and expects
some specific format)
also i would pass the palette like a normal video frame into the decoder
instead of using AVCodecContext
comments and alternatives of course welcome
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070130/b4ec01fe/attachment.pgp>
More information about the ffmpeg-devel
mailing list