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

Vladimir Voroshilov voroshil
Wed Oct 3 20:53:45 CEST 2007


2007/10/4, Vitor Sessak <vitor1001 at gmail.com>:
> 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);

No, "(signed)" cast does not work.

-- 
Regards,
Vladimir Voroshilov     mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719




More information about the ffmpeg-devel mailing list