[FFmpeg-devel] [PATCH] fix clicks in ADPCM IMA AMV decoder

Vitor Sessak vitor1001
Wed Oct 3 20:46:20 CEST 2007


Hi

Vladimir Voroshilov wrote:
>>>>>> Vladimir Voroshilov wrote:
>>>>>>> Hi, All
>>>>>>>
>>> Index: libavcodec/adpcm.c
>>> ===================================================================
>>> --- libavcodec/adpcm.c        (revision 10652)
>>> +++ libavcodec/adpcm.c        (working copy)
>>> @@ -1184,10 +1184,8 @@
>>>          break;
>>>      case CODEC_ID_ADPCM_IMA_AMV:
>>>      case CODEC_ID_ADPCM_IMA_SMJPEG:
>>> -        c->status[0].predictor = *src;
>>> -        src += 2;
>>> -        c->status[0].step_index = *src++;
>>> -        src++;  /* skip another byte before getting to the meat */
>>> +        c->status[0].predictor = (signed short)bytestream_get_le16(&src);
>>> +        c->status[0].step_index = bytestream_get_le16(&src);
>> I suppose the signed short cast is useless. If so, please remove it.
>> If you remove it, you could also align the = sign.
> 
> Signed cast is required (exactly this signed cast removes clicks in sound).

Would just this do it?

c->status[0].predictor = (signed) bytestream_get_le16(&src);

-Vitor




More information about the ffmpeg-devel mailing list