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

Michael Niedermayer michaelni
Tue Sep 7 19:12:24 CEST 2010


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


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

 unneeded cast
 

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100907/a5f078f6/attachment.pgp>



More information about the ffmpeg-devel mailing list