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