[FFmpeg-devel] [Toy] LucasArts SMUSH demuxer and decoder

Diego Biurrun diego
Sun Jan 23 19:24:06 CET 2011


On Sun, Jan 23, 2011 at 03:50:04PM +0100, Vitor Sessak wrote:
>
> Git-friendly patch attached. Hope that patchwork will catch it up.
>
> --- /dev/null
> +++ b/libavcodec/sanm.c
> @@ -0,0 +1,1381 @@
> +/*
> + * LucasArts Smush v2 decoder
> + * Copyright (c) 2006 Cyril Zorin
> + * <firstname dot lastname at gmail dot com>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + *
> + */

This is not our standard license header.

> +/**
> + * @file sanm.c
> + * LucasArts Smush v2 decoder
> + */

Filenames are unnecessary and evil with @file directives.

> +#include "avcodec.h"
> +#include "bytestream.h"

More than these are necessary I think, at the very least a few
system headers like stdint.h.

> +typedef struct sanm_ctx
> +{
> +    AVCodecContext *avctx;
> +    const uint8_t* psrc;
> +
> +    int version, subversion;
> +    uint32_t pal[256];
> +    int16_t delta_pal[768];
> +
> +    int pitch;
> +    int width, height;
> +    int aligned_width, aligned_height;
> +    int prev_seq;
> +
> +    AVFrame frame, *output;
> +    uint16_t* pdb0, * pdb1, * pdb2;
> +    int rotate_code;
> +
> +    long npixels, buf_size;
> +
> +    uint16_t* pcodebook;
> +    uint16_t* psmall_codebook;
> +} sanm_ctx;

inconsistent * placement

This whole file could use some K&R love.

I'd also skip all those typedefs.

same for the demuxer

> --- /dev/null
> +++ b/libavformat/sanm.c
> @@ -0,0 +1,395 @@
> +/*
> + * LucasArts Smush v2 demuxer
> + * Copyright (c) 2006 Cyril Zorin
> + * <firstname dot lastname at gmail dot com>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public License
> + * as published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> + * 02110-1301 USA
> + *
> + */

see above

> +/**
> + * @file sanm.c
> + * LucasArts Smush v2 demuxer
> + */

ditto




More information about the ffmpeg-devel mailing list