[FFmpeg-devel] [PATCH] LucasArts-SMUSH playback

Paul B Mahol onemda at gmail.com
Mon May 7 11:17:22 CEST 2012


On 5/3/12, compn <tempn at twmi.rr.com> wrote:
> On Thu, 3 May 2012 12:06:01 +0000, Paul B Mahol wrote:
>>--- a/libavcodec/allcodecs.c
>>+++ b/libavcodec/allcodecs.c
>>@@ -392,6 +392,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);
>
>>--- a/libavcodec/avcodec.h
>>+++ b/libavcodec/avcodec.h
>>@@ -330,6 +330,7 @@ enum CodecID {
>>     CODEC_ID_ADPCM_IMA_ISS,
>>     CODEC_ID_ADPCM_G722,
>>     CODEC_ID_ADPCM_IMA_APC,
>>+    CODEC_ID_VIMA,
>
> if its adpcm it should be called adpcm_vima. if its not adpcm it should
> go under audio codecs list. i think.

It is variation of ADPCM IMA, it is not called ADPCM_VIMA because it
so much different from already available adpcm codecs and so written
in separate file.
>
>
>>+ * LucasArt VIMA decoder
>>+ * Copyright (c) 2012 Paul B Mahol
>
> is VIMA just the name or an acronym?

Dunno.
>
>
>>+++ b/libavcodec/avcodec.h
>>@@ -257,6 +257,7 @@ enum CodecID {
>>     CODEC_ID_CDXL,
>>     CODEC_ID_XBM,
>>     CODEC_ID_ZEROCODEC,
>>+    CODEC_ID_SANM,
>>     CODEC_ID_Y41P       = MKBETAG('Y','4','1','P'),
>>     CODEC_ID_ESCAPE130  = MKBETAG('E','1','3','0'),
>>     CODEC_ID_EXR        = MKBETAG('0','E','X','R'),
>
>
> this list is in order to keep backwards compatable with api.
> you have to follow these rules, at the top of the enum in avcodec.h:
>
>  * If you add a codec ID to this list, add it so that
>  * 1. no value of a existing codec ID changes (that would break ABI),
>  * 2. Give it a value which when taken as ASCII is recognized uniquely
> by a human as this specific codec.
>  *    This ensures that 2 forks can independently add CodecIDs without
> producing conflicts.

Not really. Nothing stops libav to add codec with same number as
already one available in ffmpeg.


More information about the ffmpeg-devel mailing list