[FFmpeg-devel] [PATCH] G.722 decoder

Martin Storsjö martin
Tue Sep 7 23:13:07 CEST 2010


On Tue, 7 Sep 2010, Michael Niedermayer wrote:

> On Mon, Sep 06, 2010 at 01:07:04AM +0300, Martin Storsj? wrote:
> [...]
> > +/**
> > + * adaptive predictor
> > + *
> > + * @param cur_diff the dequantized and scaled delta calculated from the
> > + *                 current codeword
> > + * @note On x86 using the MULL macro in a loop is slower than not using
> > + *       the macro.
> > + */
> > +static void do_adaptive_prediction(struct G722Band *band, const int cur_diff)
> > +{
> > +    int sg[2], limit, i, cur_qtzd_reconst;
> > +
> > +    const int cur_part_reconst = band->s_zero + cur_diff < 0;
> > +
> > +    sg[0] = sign_lookup[cur_part_reconst != band->part_reconst_mem[0]];
> > +    sg[1] = sign_lookup[cur_part_reconst == band->part_reconst_mem[1]];
> > +    band->part_reconst_mem[1] = band->part_reconst_mem[0];
> > +    band->part_reconst_mem[0] = cur_part_reconst;
> > +
> > +    band->pole_mem[1] = av_clip((sg[0] * av_clip(band->pole_mem[0], -8191, 8191) >> 5) +
> > +                                (sg[1] << 7) + MULL(band->pole_mem[1], 127, 7), -12288, 12288);
> 
> this doesnt need a MULL and i suspect its not the only one

True. Actually all MULL's could be removed just fine.

> [...]
> > +static av_cold int g722_init(AVCodecContext * avctx)
> > +{
> > +    G722Context *c = (G722Context *) avctx->priv_data;
> 
>  unneeded cast

Removed.

Updated patch attached.

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Initial-G.722-decoder-patch.patch
Type: text/x-diff
Size: 15072 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100908/e78f06fb/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-G.722-muxer-demuxer.patch
Type: text/x-diff
Size: 2874 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100908/e78f06fb/attachment-0001.patch>



More information about the ffmpeg-devel mailing list