[FFmpeg-devel] [PATCH] fix clicks in ADPCM IMA AMV decoder
Vladimir Voroshilov
voroshil
Wed Oct 3 20:12:12 CEST 2007
2007/10/4, Aurelien Jacobs <aurel at gnuage.org>:
> Vladimir Voroshilov wrote:
>
> > 2007/10/3, Vitor Sessak <vitor1001 at gmail.com>:
> > > Hi
> > >
> > > Vladimir Voroshilov wrote:
> > > > Hi, All
> > > >
> > > > Attached simle patches fixes clicks in audio when playing AMV files.
> > >
> > > Cool. Is it still not loud enough?
> >
> > Hm. It is enough loud for me now.
> >
> >
> > > >
> > > > Index: libavcodec/adpcm.c
> > > > ===================================================================
> > > > --- libavcodec/adpcm.c (revision 10652)
> > > > +++ libavcodec/adpcm.c (working copy)
> > > > @@ -1184,7 +1184,7 @@
> > > > break;
> > > > case CODEC_ID_ADPCM_IMA_AMV:
> > > > case CODEC_ID_ADPCM_IMA_SMJPEG:
> > > > - c->status[0].predictor = *src;
> > > > + c->status[0].predictor = (int16_t)AV_RL16(src);
> > > > src += 2;
> > >
> > > c->status[0].predictor = bytestream_get_le16(&src);
> >
> > I've made simple (imho) solution which also comply with other code style.
>
> This new patch is not good. It could segfault on arch which requires strict
> alignment if src is not properly aligned.
> The solution proposed by Vitor is the right one, and it's simpler (it saves
> you the src += 2).
Thanks. Didn't know that.
> BTW: I wonder if step_index shouldn't be read as an int16_t as well ?
According to multimedia wiki it should.
This also also shows why fourth byte is always zero (index<=88)
Included in patch.
--
Regards,
Vladimir Voroshilov mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719
-------------- next part --------------
A non-text attachment was scrubbed...
Name: adpcm_clicking_fix_both3.diff
Type: text/x-diff
Size: 668 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071004/dc2ed2d1/attachment.diff>
More information about the ffmpeg-devel
mailing list