[FFmpeg-devel] [PATCH 1/3] LucasArts SMUSH VIMA audio decoder

Michael Niedermayer michaelni at gmx.at
Sun Jun 17 15:16:37 CEST 2012


On Thu, Jun 14, 2012 at 12:47:02AM +0000, Paul B Mahol wrote:
> 
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  doc/general.texi       |    2 +
>  libavcodec/Makefile    |    1 +
>  libavcodec/allcodecs.c |    1 +
>  libavcodec/avcodec.h   |    1 +
>  libavcodec/vima.c      |  261 ++++++++++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 266 insertions(+), 0 deletions(-)
>  create mode 100644 libavcodec/vima.c
> 
> diff --git a/doc/general.texi b/doc/general.texi
> index 74092e4..0f73748 100644
> --- a/doc/general.texi
> +++ b/doc/general.texi
> @@ -814,6 +814,8 @@ following image formats are supported:
>  @item TrueHD                 @tab     @tab  X
>      @tab Used in HD-DVD and Blu-Ray discs.
>  @item TwinVQ (VQF flavor)    @tab     @tab  X
> + at item VIMA
> +    @tab Used in SANM variant of LucasArts SMUSH animations.
>  @item Vorbis                 @tab  E  @tab  X
>      @tab A native but very primitive encoder exists.
>  @item WavPack                @tab     @tab  X
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index 9e352a6..360f597 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -610,6 +610,7 @@ OBJS-$(CONFIG_ADPCM_THP_DECODER)          += adpcm.o adpcm_data.o
>  OBJS-$(CONFIG_ADPCM_XA_DECODER)           += adpcm.o adpcm_data.o
>  OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER)       += adpcm.o adpcm_data.o
>  OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER)       += adpcmenc.o adpcm_data.o
> +OBJS-$(CONFIG_VIMA_DECODER)               += vima.o
>  
>  # libavformat dependencies
>  OBJS-$(CONFIG_ADTS_MUXER)              += mpeg4audio.o
> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> index 4067537..ef748ed 100644
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -394,6 +394,7 @@ void avcodec_register_all(void)
>      REGISTER_DECODER (ADPCM_THP, adpcm_thp);
>      REGISTER_DECODER (ADPCM_XA, adpcm_xa);
>      REGISTER_ENCDEC  (ADPCM_YAMAHA, adpcm_yamaha);
> +    REGISTER_DECODER (VIMA, vima);
>  
>      /* subtitles */
>      REGISTER_ENCDEC  (ASS, ass);
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index e2b754f..c0585e4 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -331,6 +331,7 @@ enum CodecID {
>      CODEC_ID_ADPCM_IMA_ISS,
>      CODEC_ID_ADPCM_G722,
>      CODEC_ID_ADPCM_IMA_APC,
> +    CODEC_ID_VIMA       = MKBETAG('V','I','M','A'),
>  
>      /* AMR */
>      CODEC_ID_AMR_NB = 0x12000,
> diff --git a/libavcodec/vima.c b/libavcodec/vima.c
> new file mode 100644
> index 0000000..ef8f50b
> --- /dev/null
> +++ b/libavcodec/vima.c
> @@ -0,0 +1,261 @@
> +/*
> + * LucasArt VIMA decoder
> + * Copyright (c) 2012 Paul B Mahol
> + *
> + * 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
> + */
> +
> +#include "libavutil/audioconvert.h"
> +#include "avcodec.h"
> +#include "bytestream.h"
> +
> +typedef struct {
> +    AVFrame     frame;
> +    uint16_t    predict_table[5786 * 2];
> +} VimaContext;
> +

> +static const int16_t step_table[] =

duplicate of ff_adpcm_step_table


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120617/cbe8902b/attachment.asc>


More information about the ffmpeg-devel mailing list