[FFmpeg-devel] [PATCH] 8088flex TMV demuxer and decoder
Michael Niedermayer
michaelni
Thu Apr 23 19:37:49 CEST 2009
On Thu, Apr 23, 2009 at 12:19:16PM -0500, Daniel Verkamp wrote:
> On Thu, Apr 23, 2009 at 12:07 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> [...]
> >> +static int tmv_decode_frame(AVCodecContext *avctx, void *data,
> >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ?int *data_size, AVPacket *avpkt)
> >> +{
> >> + ? ?TMVContext *tmv ? ?= avctx->priv_data;
> >> + ? ?const uint8_t *src = avpkt->data;
> >> + ? ?uint8_t *dst, *dst_char;
> >> + ? ?unsigned char_cols = avctx->width >> 3;
> >> + ? ?unsigned char_rows = avctx->height >> 3;
> >> + ? ?unsigned x, y, mask, char_y, fg, bg, c;
> >> +
> >> + ? ?if (tmv->pic.data[0])
> >> + ? ? ? ?avctx->release_buffer(avctx, &tmv->pic);
> >> +
> >> + ? ?if (avctx->get_buffer(avctx, &tmv->pic) < 0) {
> >> + ? ? ? ?av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
> >> + ? ? ? ?return -1;
> >> + ? ?}
> >> +
> >> + ? ?tmv->pic.pict_type = FF_I_TYPE;
> >> + ? ?tmv->pic.key_frame = 1;
> >> + ? ?dst ? ? ? ? ? ? ? ?= tmv->pic.data[0];
> >> +
> >
> >> + ? ?if (!tmv->pal_set) {
> >> + ? ? ? ?tmv->pal_set ? ? ? ? ? ? ? ? = 1;
> >> + ? ? ? ?tmv->pic.palette_has_changed = 1;
> >> + ? ? ? ?memcpy(tmv->pic.data[1], ff_cga_palette, 16 * 4);
> >> + ? ?}
> >
> > i dont think you can skip setting the palette like that
> > Only if the buffer returned by (re)get_buffer() is identical to one where
> > the palette has been set already (see AVFrame->age) could it be skiped
> > and yes this likely is broken in existing codecs too
> >
>
> Is it acceptable to just set it every frame then, as in attached?
> Also, is it acceptable to leave the unused part of the palette
> (entries beyond 16) uninitialized?
yes and the patch looks ok
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090423/def1c8aa/attachment.pgp>
More information about the ffmpeg-devel
mailing list