Revision 0d849074

View differences:

libavcodec/mpegaudiodec.c
247 247

  
248 248
static int dev_4_3_coefs[DEV_ORDER];
249 249

  
250
#if 0 /* unused */
251
static int pow_mult3[3] = {
252
    POW_FIX(1.0),
253
    POW_FIX(1.25992104989487316476),
254
    POW_FIX(1.58740105196819947474),
255
};
256
#endif
257

  
258 250
static av_cold void int_pow_init(void)
259 251
{
260 252
    int i, a;
......
266 258
    }
267 259
}
268 260

  
269
#if 0 /* unused, remove? */
270
/* return the mantissa and the binary exponent */
271
static int int_pow(int i, int *exp_ptr)
272
{
273
    int e, er, eq, j;
274
    int a, a1;
275

  
276
    /* renormalize */
277
    a = i;
278
    e = POW_FRAC_BITS;
279
    while (a < (1 << (POW_FRAC_BITS - 1))) {
280
        a = a << 1;
281
        e--;
282
    }
283
    a -= (1 << POW_FRAC_BITS);
284
    a1 = 0;
285
    for(j = DEV_ORDER - 1; j >= 0; j--)
286
        a1 = POW_MULL(a, dev_4_3_coefs[j] + a1);
287
    a = (1 << POW_FRAC_BITS) + a1;
288
    /* exponent compute (exact) */
289
    e = e * 4;
290
    er = e % 3;
291
    eq = e / 3;
292
    a = POW_MULL(a, pow_mult3[er]);
293
    while (a >= 2 * POW_FRAC_ONE) {
294
        a = a >> 1;
295
        eq++;
296
    }
297
    /* convert to float */
298
    while (a < POW_FRAC_ONE) {
299
        a = a << 1;
300
        eq--;
301
    }
302
    /* now POW_FRAC_ONE <= a < 2 * POW_FRAC_ONE */
303
#if POW_FRAC_BITS > FRAC_BITS
304
    a = (a + (1 << (POW_FRAC_BITS - FRAC_BITS - 1))) >> (POW_FRAC_BITS - FRAC_BITS);
305
    /* correct overflow */
306
    if (a >= 2 * (1 << FRAC_BITS)) {
307
        a = a >> 1;
308
        eq++;
309
    }
310
#endif
311
    *exp_ptr = eq;
312
    return a;
313
}
314
#endif
315

  
316 261
static av_cold int decode_init(AVCodecContext * avctx)
317 262
{
318 263
    MPADecodeContext *s = avctx->priv_data;

Also available in: Unified diff