[FFmpeg-cvslog] r21117 - in trunk: doc/general.texi libavcodec/Makefile libavcodec/allcodecs.c libavcodec/anm.c libavcodec/avcodec.h

Stefano Sabatini stefano.sabatini-lala
Sun Jan 10 12:11:28 CET 2010


On date Sunday 2010-01-10 06:41:37 +0100, pross wrote:
> Author: pross
> Date: Sun Jan 10 06:41:36 2010
> New Revision: 21117
> 
> Log:
> Deluxe Paint Animation decoder
> 
> Added:
>    trunk/libavcodec/anm.c
> Modified:
>    trunk/doc/general.texi
>    trunk/libavcodec/Makefile
>    trunk/libavcodec/allcodecs.c
>    trunk/libavcodec/avcodec.h
> 
> Modified: trunk/doc/general.texi
> ==============================================================================
> --- trunk/doc/general.texi	Sun Jan 10 06:08:42 2010	(r21116)
> +++ trunk/doc/general.texi	Sun Jan 10 06:41:36 2010	(r21117)
> @@ -345,6 +345,7 @@ following image formats are supported:
>  @item Creative YUV (CYUV)    @tab     @tab  X
>  @item Dirac                  @tab  E  @tab  E
>      @tab supported through external libdirac/libschroedinger libraries
> + at item Deluxe Paint Animation @tab     @tab  X
>  @item DNxHD                  @tab   X @tab  X
>      @tab aka SMPTE VC3
>  @item Duck TrueMotion 1.0   @tab     @tab  X
> 
> Modified: trunk/libavcodec/Makefile
> ==============================================================================
> --- trunk/libavcodec/Makefile	Sun Jan 10 06:08:42 2010	(r21116)
> +++ trunk/libavcodec/Makefile	Sun Jan 10 06:41:36 2010	(r21117)
> @@ -50,6 +50,7 @@ OBJS-$(CONFIG_ALAC_DECODER)            +
>  OBJS-$(CONFIG_ALAC_ENCODER)            += alacenc.o
>  OBJS-$(CONFIG_ALS_DECODER)             += alsdec.o
>  OBJS-$(CONFIG_AMV_DECODER)             += sp5xdec.o mjpegdec.o mjpeg.o
> +OBJS-$(CONFIG_ANM_DECODER)             += anm.o
>  OBJS-$(CONFIG_APE_DECODER)             += apedec.o
>  OBJS-$(CONFIG_ASV1_DECODER)            += asv1.o mpeg12data.o
>  OBJS-$(CONFIG_ASV1_ENCODER)            += asv1.o mpeg12data.o
> 
> Modified: trunk/libavcodec/allcodecs.c
> ==============================================================================
> --- trunk/libavcodec/allcodecs.c	Sun Jan 10 06:08:42 2010	(r21116)
> +++ trunk/libavcodec/allcodecs.c	Sun Jan 10 06:41:36 2010	(r21117)
> @@ -64,6 +64,7 @@ void avcodec_register_all(void)
>      /* video codecs */
>      REGISTER_DECODER (AASC, aasc);
>      REGISTER_DECODER (AMV, amv);
> +    REGISTER_DECODER (ANM, anm);
>      REGISTER_ENCDEC  (ASV1, asv1);
>      REGISTER_ENCDEC  (ASV2, asv2);
>      REGISTER_DECODER (AURA, aura);
> 
> Added: trunk/libavcodec/anm.c
> ==============================================================================
> --- /dev/null	00:00:00 1970	(empty, because file is newly added)
> +++ trunk/libavcodec/anm.c	Sun Jan 10 06:41:36 2010	(r21117)
> @@ -0,0 +1,197 @@
> +/*
> + * Deluxe Paint Animation decoder
> + * Copyright (c) 2009 Peter Ross
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg 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.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg 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 FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +/**
> + * @file libavcodec/anm.c
> + * Deluxe Paint Animation decoder
> + */
> +
> +#include "avcodec.h"
> +#include "bytestream.h"
> +
> +typedef struct AnmContext {
> +    AVFrame frame;
> +    int x;  ///< x coordinate position
> +} AnmContext;
> +
> +static av_cold int decode_init(AVCodecContext *avctx)
> +{
> +    AnmContext *s = avctx->priv_data;
> +    const uint8_t *buf;
> +    int i;
> +
> +    avctx->pix_fmt = PIX_FMT_PAL8;
> +
> +    if (avctx->extradata_size != 16*8 + 4*256)
> +        return -1;
> +
> +    s->frame.reference = 1;
> +    if (avctx->get_buffer(avctx, &s->frame) < 0) {
> +        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
> +        return -1;
> +    }
> +
> +    buf = avctx->extradata + 16*8;
> +    for (i = 0; i < 256; i++)
> +        ((uint32_t*)s->frame.data[1])[i] = bytestream_get_le32(&buf);
> +
> +    return 0;
> +}
> +
> +/**
> + * Perform decode operation

Third person and final "." missing. If you prefer you can use first
pejorative person.
Also add a space between the description and the first @param.

> + * @param dst, dst_end Destination image buffer

_d_estination, since the description is not a complete sentence, *or*
an incomplete sentence followed by a complete sentence (yes, these
rules are weird).

> + * @param buf, buf_end Source buffer (optional, see below)
> + * @param pixel Fill color (optional, see below)
> + * @param count Pixel count
> + * @param x Pointer to x-axis counter
> + * @param width Image width
> + * @param linesize Destination image buffer linesize
> + * @return non-zero if destination buffer is exhausted

Same as before.

> + *
> + * a copy operation is achieved when 'buf' is set
> + * a fill operation is acheived when 'buf' is null and pixel is >= 0
> + * a skip operation is acheived when 'buf' is null and pixel is < 0

Please upcase the first word and add the missing dots, also
s/acheived/achieved/.

Regards.



More information about the ffmpeg-cvslog mailing list