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

« back to all changes in this revision

Viewing changes to src/decode_altivec.c

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
        decode.c: decoding samples...
3
3
 
4
4
        copyright 1995-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
        altivec optimization by tmkk
8
8
*/
23
23
  else if( (sum) < REAL_MINUS_32768) { *(samples) = -0x8000; (clip)++; } \
24
24
  else { *(samples) = REAL_TO_SHORT(sum); }
25
25
 
26
 
int synth_1to1_8bit(real *bandPtr,int channel,unsigned char *samples,int *pnt)
 
26
int synth_1to1_8bit_altivec(real *bandPtr,int channel,unsigned char *samples,int *pnt)
27
27
{
28
28
  short samples_tmp[64];
29
29
  short *tmp1 = samples_tmp + channel;
30
30
  int i,ret;
31
31
  int pnt1=0;
32
32
 
33
 
  ret = synth_1to1(bandPtr,channel,(unsigned char *) samples_tmp,&pnt1);
 
33
  ret = synth_1to1_altivec(bandPtr,channel,(unsigned char *) samples_tmp,&pnt1);
34
34
  samples += channel + *pnt;
35
35
 
36
36
  for(i=0;i<32;i++) {
43
43
  return ret;
44
44
}
45
45
 
46
 
int synth_1to1_8bit_mono(real *bandPtr,unsigned char *samples,int *pnt)
 
46
int synth_1to1_8bit_mono_altivec(real *bandPtr,unsigned char *samples,int *pnt)
47
47
{
48
48
  short samples_tmp[64];
49
49
  short *tmp1 = samples_tmp;
50
50
  int i,ret;
51
51
  int pnt1 = 0;
52
52
 
53
 
  ret = synth_1to1(bandPtr,0,(unsigned char *) samples_tmp,&pnt1);
 
53
  ret = synth_1to1_altivec(bandPtr,0,(unsigned char *) samples_tmp,&pnt1);
54
54
  samples += *pnt;
55
55
 
56
56
  for(i=0;i<32;i++) {
62
62
  return ret;
63
63
}
64
64
 
65
 
int synth_1to1_8bit_mono2stereo(real *bandPtr,unsigned char *samples,int *pnt)
 
65
int synth_1to1_8bit_mono2stereo_altivec(real *bandPtr,unsigned char *samples,int *pnt)
66
66
{
67
67
  short samples_tmp[64];
68
68
  short *tmp1 = samples_tmp;
69
69
  int i,ret;
70
70
  int pnt1 = 0;
71
71
 
72
 
  ret = synth_1to1(bandPtr,0,(unsigned char *) samples_tmp,&pnt1);
 
72
  ret = synth_1to1_altivec(bandPtr,0,(unsigned char *) samples_tmp,&pnt1);
73
73
  samples += *pnt;
74
74
 
75
75
  for(i=0;i<32;i++) {
82
82
  return ret;
83
83
}
84
84
 
85
 
int synth_1to1_mono(real *bandPtr,unsigned char *samples,int *pnt)
 
85
int synth_1to1_mono_altivec(real *bandPtr,unsigned char *samples,int *pnt)
86
86
{
87
87
  short samples_tmp[64];
88
88
  short *tmp1 = samples_tmp;
89
89
  int i,ret;
90
90
  int pnt1 = 0;
91
91
 
92
 
  ret = synth_1to1(bandPtr,0,(unsigned char *) samples_tmp,&pnt1);
 
92
  ret = synth_1to1_altivec(bandPtr,0,(unsigned char *) samples_tmp,&pnt1);
93
93
  samples += *pnt;
94
94
 
95
95
  for(i=0;i<32;i++) {
103
103
}
104
104
 
105
105
 
106
 
int synth_1to1_mono2stereo(real *bandPtr,unsigned char *samples,int *pnt)
 
106
int synth_1to1_mono2stereo_altivec(real *bandPtr,unsigned char *samples,int *pnt)
107
107
{
108
108
  int i,ret;
109
109
 
110
 
  ret = synth_1to1(bandPtr,0,samples,pnt);
 
110
  ret = synth_1to1_altivec(bandPtr,0,samples,pnt);
111
111
  samples = samples + *pnt - 128;
112
112
 
113
113
  for(i=0;i<32;i++) {
119
119
}
120
120
 
121
121
 
122
 
int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt)
 
122
int synth_1to1_altivec(real *bandPtr,int channel,unsigned char *out,int *pnt)
123
123
{
124
124
  static real __attribute__ ((aligned (16))) buffs[4][4][0x110];
125
125
  static const int step = 2;
146
146
  if(bo & 0x1) {
147
147
    b0 = buf[0];
148
148
    bo1 = bo;
149
 
    dct64(buf[1]+((bo+1)&0xf),buf[0]+bo,bandPtr);
 
149
    dct64_altivec(buf[1]+((bo+1)&0xf),buf[0]+bo,bandPtr);
150
150
  }
151
151
  else {
152
152
    b0 = buf[1];
153
153
    bo1 = bo+1;
154
 
    dct64(buf[0]+bo,buf[1]+bo+1,bandPtr);
 
154
    dct64_altivec(buf[0]+bo,buf[1]+bo+1,bandPtr);
155
155
  }
156
156
 
157
157