diff options
author | Ryan Jackson <rdjackso@rockbox.org> | 2005-07-15 17:08:14 +0000 |
---|---|---|
committer | Ryan Jackson <rdjackso@rockbox.org> | 2005-07-15 17:08:14 +0000 |
commit | b5b8f05aed7e23a675d09f0982082911f71fba93 (patch) | |
tree | 38ec65fdcf3dc11bf9994b676abdbe65e1f3cfe0 /apps/codecs | |
parent | 34a25a6a3b117582efd49d893bd90e58be7148ca (diff) | |
download | rockbox-b5b8f05aed7e23a675d09f0982082911f71fba93.tar.gz rockbox-b5b8f05aed7e23a675d09f0982082911f71fba93.zip |
Removed calls to mcf5249_init_mac() from asm_mcf5249.h, added call for it to ov_read().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7158 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-rw-r--r-- | apps/codecs/Tremor/asm_mcf5249.h | 10 | ||||
-rw-r--r-- | apps/codecs/Tremor/vorbisfile.c | 4 |
2 files changed, 4 insertions, 10 deletions
diff --git a/apps/codecs/Tremor/asm_mcf5249.h b/apps/codecs/Tremor/asm_mcf5249.h index c9c2851e5a..3aaa66b4af 100644 --- a/apps/codecs/Tremor/asm_mcf5249.h +++ b/apps/codecs/Tremor/asm_mcf5249.h | |||
@@ -35,7 +35,6 @@ static inline void mcf5249_init_mac(void) { | |||
35 | 35 | ||
36 | static inline ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) { | 36 | static inline ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) { |
37 | 37 | ||
38 | mcf5249_init_mac(); | ||
39 | asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply & shift */ | 38 | asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply & shift */ |
40 | "movclr.l %%acc0, %[x];" /* move & clear acc */ | 39 | "movclr.l %%acc0, %[x];" /* move & clear acc */ |
41 | "asr.l #1, %[x];" /* no overflow test */ | 40 | "asr.l #1, %[x];" /* no overflow test */ |
@@ -47,7 +46,6 @@ static inline ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) { | |||
47 | 46 | ||
48 | static inline ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) { | 47 | static inline ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) { |
49 | 48 | ||
50 | mcf5249_init_mac(); | ||
51 | asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply */ | 49 | asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply */ |
52 | "movclr.l %%acc0, %[x];" /* move and clear */ | 50 | "movclr.l %%acc0, %[x];" /* move and clear */ |
53 | : [x] "+&r" (x) | 51 | : [x] "+&r" (x) |
@@ -60,7 +58,6 @@ static inline ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) { | |||
60 | static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) { | 58 | static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) { |
61 | ogg_int32_t r; | 59 | ogg_int32_t r; |
62 | 60 | ||
63 | mcf5249_init_mac(); | ||
64 | asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply */ | 61 | asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply */ |
65 | "movclr.l %%acc0, %[r];" /* get higher half */ | 62 | "movclr.l %%acc0, %[r];" /* get higher half */ |
66 | "mulu.l %[y], %[x];" /* get lower half */ | 63 | "mulu.l %[y], %[x];" /* get lower half */ |
@@ -81,7 +78,6 @@ void XPROD31(ogg_int32_t a, ogg_int32_t b, | |||
81 | ogg_int32_t t, ogg_int32_t v, | 78 | ogg_int32_t t, ogg_int32_t v, |
82 | ogg_int32_t *x, ogg_int32_t *y) | 79 | ogg_int32_t *x, ogg_int32_t *y) |
83 | { | 80 | { |
84 | mcf5249_init_mac(); | ||
85 | asm volatile ("mac.l %[a], %[t], %%acc0;" | 81 | asm volatile ("mac.l %[a], %[t], %%acc0;" |
86 | "mac.l %[b], %[v], %%acc0;" | 82 | "mac.l %[b], %[v], %%acc0;" |
87 | "mac.l %[b], %[t], %%acc1;" | 83 | "mac.l %[b], %[t], %%acc1;" |
@@ -102,7 +98,6 @@ void XNPROD31(ogg_int32_t a, ogg_int32_t b, | |||
102 | ogg_int32_t t, ogg_int32_t v, | 98 | ogg_int32_t t, ogg_int32_t v, |
103 | ogg_int32_t *x, ogg_int32_t *y) | 99 | ogg_int32_t *x, ogg_int32_t *y) |
104 | { | 100 | { |
105 | mcf5249_init_mac(); | ||
106 | asm volatile ("mac.l %[a], %[t], %%acc0;" | 101 | asm volatile ("mac.l %[a], %[t], %%acc0;" |
107 | "msac.l %[b], %[v], %%acc0;" | 102 | "msac.l %[b], %[v], %%acc0;" |
108 | "mac.l %[b], %[t], %%acc1;" | 103 | "mac.l %[b], %[t], %%acc1;" |
@@ -128,7 +123,6 @@ void XNPROD31(ogg_int32_t a, ogg_int32_t b, | |||
128 | if anyone think they can hear a bug caused by this, please try the above | 123 | if anyone think they can hear a bug caused by this, please try the above |
129 | version. */ | 124 | version. */ |
130 | #define XPROD32(_a, _b, _t, _v, _x, _y) \ | 125 | #define XPROD32(_a, _b, _t, _v, _x, _y) \ |
131 | mcf5249_init_mac(); \ | ||
132 | asm volatile ("mac.l %[a], %[t], %%acc0;" \ | 126 | asm volatile ("mac.l %[a], %[t], %%acc0;" \ |
133 | "mac.l %[b], %[v], %%acc0;" \ | 127 | "mac.l %[b], %[v], %%acc0;" \ |
134 | "mac.l %[b], %[t], %%acc1;" \ | 128 | "mac.l %[b], %[t], %%acc1;" \ |
@@ -147,7 +141,6 @@ void XNPROD31(ogg_int32_t a, ogg_int32_t b, | |||
147 | static inline | 141 | static inline |
148 | void mcf5249_vect_add(ogg_int32_t *x, ogg_int32_t *y, int n) | 142 | void mcf5249_vect_add(ogg_int32_t *x, ogg_int32_t *y, int n) |
149 | { | 143 | { |
150 | mcf5249_init_mac(); | ||
151 | /* align to 16 bytes */ | 144 | /* align to 16 bytes */ |
152 | while(n>0 && (int)x&16) { | 145 | while(n>0 && (int)x&16) { |
153 | *x++ += *y++; | 146 | *x++ += *y++; |
@@ -182,7 +175,6 @@ void mcf5249_vect_add(ogg_int32_t *x, ogg_int32_t *y, int n) | |||
182 | static inline | 175 | static inline |
183 | void mcf5249_vect_copy(ogg_int32_t *x, ogg_int32_t *y, int n) | 176 | void mcf5249_vect_copy(ogg_int32_t *x, ogg_int32_t *y, int n) |
184 | { | 177 | { |
185 | mcf5249_init_mac(); | ||
186 | /* align to 16 bytes */ | 178 | /* align to 16 bytes */ |
187 | while(n>0 && (int)x&16) { | 179 | while(n>0 && (int)x&16) { |
188 | *x++ = *y++; | 180 | *x++ = *y++; |
@@ -210,7 +202,6 @@ void mcf5249_vect_copy(ogg_int32_t *x, ogg_int32_t *y, int n) | |||
210 | static inline | 202 | static inline |
211 | void mcf5249_vect_mult_fw(ogg_int32_t *data, LOOKUP_T *window, int n) | 203 | void mcf5249_vect_mult_fw(ogg_int32_t *data, LOOKUP_T *window, int n) |
212 | { | 204 | { |
213 | mcf5249_init_mac(); | ||
214 | /* ensure data is aligned to 16-bytes */ | 205 | /* ensure data is aligned to 16-bytes */ |
215 | while(n>0 && (int)data%16) { | 206 | while(n>0 && (int)data%16) { |
216 | *data = MULT31(*data, *window); | 207 | *data = MULT31(*data, *window); |
@@ -265,7 +256,6 @@ void mcf5249_vect_mult_fw(ogg_int32_t *data, LOOKUP_T *window, int n) | |||
265 | static inline | 256 | static inline |
266 | void mcf5249_vect_mult_bw(ogg_int32_t *data, LOOKUP_T *window, int n) | 257 | void mcf5249_vect_mult_bw(ogg_int32_t *data, LOOKUP_T *window, int n) |
267 | { | 258 | { |
268 | mcf5249_init_mac(); | ||
269 | /* ensure at least data is aligned to 16-bytes */ | 259 | /* ensure at least data is aligned to 16-bytes */ |
270 | while(n>0 && (int)data%16) { | 260 | while(n>0 && (int)data%16) { |
271 | *data = MULT31(*data, *window); | 261 | *data = MULT31(*data, *window); |
diff --git a/apps/codecs/Tremor/vorbisfile.c b/apps/codecs/Tremor/vorbisfile.c index 9cc60c7978..bb069c8896 100644 --- a/apps/codecs/Tremor/vorbisfile.c +++ b/apps/codecs/Tremor/vorbisfile.c | |||
@@ -1548,6 +1548,10 @@ long ov_read(OggVorbis_File *vf,char *buffer,int bytes_req,int *bitstream){ | |||
1548 | 1548 | ||
1549 | if(vf->ready_state<OPENED)return(OV_EINVAL); | 1549 | if(vf->ready_state<OPENED)return(OV_EINVAL); |
1550 | 1550 | ||
1551 | #if CONFIG_CPU == MCF5249 && !defined(SIMULATOR) | ||
1552 | mcf5249_init_mac(); | ||
1553 | #endif | ||
1554 | |||
1551 | while(1){ | 1555 | while(1){ |
1552 | if(vf->ready_state==INITSET){ | 1556 | if(vf->ready_state==INITSET){ |
1553 | samples=vorbis_synthesis_pcmout(&vf->vd,&pcm); | 1557 | samples=vorbis_synthesis_pcmout(&vf->vd,&pcm); |