~ubuntu-branches/ubuntu/lucid/mpg123/lucid

« back to all changes in this revision

Viewing changes to src/layer2.c

Tags: upstream-0.66
ImportĀ upstreamĀ versionĀ 0.66

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
        layer2.c: the layer 2 decoder, root of mpg123
3
3
 
4
4
        copyright 1994-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
5
 
        see COPYING and AUTHORS files in distribution or http://mpg123.de
 
5
        see COPYING and AUTHORS files in distribution or http://mpg123.org
6
6
        initially written by Michael Hipp
7
7
 
8
8
        mpg123 started as mp2 decoder a long time ago...
53
53
 
54
54
  for(k=0;k<27;k++)
55
55
  {
56
 
    double m=mulmul[k];
57
 
    table = muls[k];
58
 
#ifdef USE_MMX
59
 
    if(!param.down_sample) 
60
 
        for(j=3,i=0;i<63;i++,j--)
61
 
    *table++ = 16384 * m * pow(2.0,(double) j / 3.0);
62
 
    else
 
56
    table = opt_init_layer2_table(muls[k], mulmul[k]);
 
57
    *table++ = 0.0;
 
58
  }
 
59
}
 
60
 
 
61
real* init_layer2_table(real *table, double m)
 
62
{
 
63
        int i,j;
 
64
        for(j=3,i=0;i<63;i++,j--)
 
65
        *table++ = m * pow(2.0,(double) j / 3.0);
 
66
 
 
67
        return table;
 
68
}
 
69
 
 
70
#ifdef OPT_MMXORSSE
 
71
real* init_layer2_table_mmx(real *table, double m)
 
72
{
 
73
        int i,j;
 
74
        if(!param.down_sample) 
 
75
        for(j=3,i=0;i<63;i++,j--)
 
76
        *table++ = 16384 * m * pow(2.0,(double) j / 3.0);
 
77
        else
 
78
        for(j=3,i=0;i<63;i++,j--)
 
79
        *table++ = m * pow(2.0,(double) j / 3.0);
 
80
 
 
81
        return table;
 
82
}
63
83
#endif
64
 
    for(j=3,i=0;i<63;i++,j--)
65
 
      *table++ = m * pow(2.0,(double) j / 3.0);
66
 
    *table++ = 0.0;
67
 
  }
68
 
}
69
 
 
70
84
 
71
85
void II_step_one(unsigned int *bit_alloc,int *scale,struct frame *fr)
72
86
{