[FFmpeg-devel] [PATCH] Video decoder and demuxer for AMV files

Vitor Sessak vitor1001
Tue Sep 25 18:02:58 CEST 2007


Hi and thanks for having a look,

M?ns Rullg?rd wrote:
>>> On Mon, Sep 24, 2007 at 08:44:21PM +0200, Vitor Sessak wrote:
>>>> Interestingly, while you were working with the video patch, I had a
>>>> look at the audio. See attached patch.
>> New patch, this time against the latest svn.
>>
>> -Vitor
>> Index: libavcodec/adpcm.c
>> ===================================================================
>> --- libavcodec/adpcm.c	(revision 10567)
>> +++ libavcodec/adpcm.c	(working copy)
>> @@ -1195,6 +1195,19 @@
>>              src++;
>>          }
>>          break;
>> +    case CODEC_ID_ADPCM_IMA_AMV:
>> +        c->status[0].predictor = *src;
>> +        src += 2;
>> +        c->status[0].step_index = *src++;
>> +        src++;  /* skip another byte before getting to the meat */
>> +        while (src < buf + buf_size) {
>> +            *samples++ = adpcm_ima_expand_nibble(&c->status[0],
>> +                (*src >> 4) & 0x0F, 3);
> 
> Useless & 0xf.

I'll keep it for now to make my changes to the actual code minimal (see 
above).

> 
>> +            *samples++ = adpcm_ima_expand_nibble(&c->status[0],
>> +                *src & 0x0F, 3);
> 
> The indentation here and in the previous statement looks odd to me.
> I prefer indenting lines like these a little more to emphasise that
> they are part of the same statement.
> 

Same thing.

>> +            src++;
>> +        }
>> +        break;
> 

Actually, I wanted to make explicit the similarity to the smjpeg audio 
decoder. But I found a way of doing it without duplicating code. New 
patch attached.

-Vitor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amv_audio3.diff
Type: text/x-patch
Size: 2830 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070925/6b6160b3/attachment.bin>



More information about the ffmpeg-devel mailing list