* Problems with mpg123 (or is the multia too slow to decode MP3?)
@ 1999-06-18 11:10 RaymondInFinland
1999-06-18 13:02 ` Phillip Ezolt
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: RaymondInFinland @ 1999-06-18 11:10 UTC (permalink / raw)
To: axp-list
Hi,\x0f
\x0f
I recently installed RH6.0 on my alpha and i've noticed that the
included mpg123 player isn't performing very good. It's not able to
decode the MP3 files realtime, it keeps dropping frames all the time.
'top' says it uses max 60% CPU time on my multia with some 10% kernel
CPUtime. Still it drops frames and has glitches. It seems like the
multia isn't fast enough (which seems strange to me, because it
worked perfect with RH5.2). Could it be that the new 2.2.X kernels
are slower with sound or something??\x0f
\x0f
Config:\x0f
multia 166Mhz.\x0f
40 MB RAM.\x0f
\x0f
______ _ _____
(_____ \ | | (_____)
_____) ) ____ _ _ ____ ___ ____ _ | | _ ____
(_____ ( / _ | | | | \ / _ \| _ \ / || | | | | _ \
| ( ( | | |_| | | | | |_| | | | ( (_| | _| |_| | | |
|_|\_||_|\__ |_|_|_|\___/|_| |_|\____| (_____)_| |_|
(____/
_______ _ _ _
(_______|_) | | | | Raymond Hofman
_____ _ ____ | | ____ ____ _ | | Yliopistokatu 16a 603/1
| ___) | | _ \| |/ _ | _ \ / || | 90570 Oulu
| | | | | | | ( ( | | | | ( (_| | Finland
|_| |_|_| |_|_|\_||_|_| |_|\____| r.m.c.hofman@twi.tudelft.nl
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: Problems with mpg123 (or is the multia too slow to decode MP3?) 1999-06-18 11:10 Problems with mpg123 (or is the multia too slow to decode MP3?) RaymondInFinland @ 1999-06-18 13:02 ` Phillip Ezolt 1999-06-18 14:11 ` warp 1999-06-18 13:42 ` Charles Taylor 1999-06-20 4:51 ` Problems with mpg123 (or is the multia too slow to decode MP3?) Richard Henderson 2 siblings, 1 reply; 14+ messages in thread From: Phillip Ezolt @ 1999-06-18 13:02 UTC (permalink / raw) To: axp-list Well, I'm not sure about Alpha, but, at home, on my putzy intel box (100 mhz pentium), the included RH6.0 mpg123 is MUCH worse than the one I compiled myself. I see all the symptons you describe. Grab a copy of mpg123 source, and try complining it yourself. You might also want to try running it with -b 1024. This will give the player 1 meg of buffer space. --Phil Compaq: High Performance Servers Division/Benchmark Performance Engineering ---------------- Alpha, The Fastest Processor on Earth -------------------- Phillip.Ezolt@compaq.com ezolt@perf.zko.dec.com On Fri, 18 Jun 1999, RaymondInFinland wrote: > Hi,\x0f > \x0f > I recently installed RH6.0 on my alpha and i've noticed that the > included mpg123 player isn't performing very good. It's not able to > decode the MP3 files realtime, it keeps dropping frames all the time. > 'top' says it uses max 60% CPU time on my multia with some 10% kernel > CPUtime. Still it drops frames and has glitches. It seems like the > multia isn't fast enough (which seems strange to me, because it > worked perfect with RH5.2). Could it be that the new 2.2.X kernels > are slower with sound or something??\x0f > \x0f > Config:\x0f > multia 166Mhz.\x0f > 40 MB RAM.\x0f > \x0f > > > > ______ _ _____ > (_____ \ | | (_____) > _____) ) ____ _ _ ____ ___ ____ _ | | _ ____ > (_____ ( / _ | | | | \ / _ \| _ \ / || | | | | _ \ > | ( ( | | |_| | | | | |_| | | | ( (_| | _| |_| | | | > |_|\_||_|\__ |_|_|_|\___/|_| |_|\____| (_____)_| |_| > (____/ > _______ _ _ _ > (_______|_) | | | | Raymond Hofman > _____ _ ____ | | ____ ____ _ | | Yliopistokatu 16a 603/1 > | ___) | | _ \| |/ _ | _ \ / || | 90570 Oulu > | | | | | | | ( ( | | | | ( (_| | Finland > |_| |_|_| |_|_|\_||_|_| |_|\____| r.m.c.hofman@twi.tudelft.nl > > -- > To unsubscribe: send e-mail to axp-list-request@redhat.com with > 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com > > > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Problems with mpg123 (or is the multia too slow to decode MP3?) 1999-06-18 13:02 ` Phillip Ezolt @ 1999-06-18 14:11 ` warp 1999-06-18 14:15 ` warp 0 siblings, 1 reply; 14+ messages in thread From: warp @ 1999-06-18 14:11 UTC (permalink / raw) To: axp-list Phillip Ezolt wrote: > > Well, > I'm not sure about Alpha, but, at home, on my putzy intel box (100 mhz > pentium), the included RH6.0 mpg123 is MUCH worse than the one I compiled > myself. I see all the symptons you describe. > > Grab a copy of mpg123 source, and try complining it yourself. > > You might also want to try running it with -b 1024. This will give the player > 1 meg of buffer space. And while compiling the sources yourself on Alpha, don't forget to add: -O3 --funroll-all Regards, Antoine website....: http://windowmaker.mezaway.org - EW! e-mail.....: warp@warped.xs4all.nl & warp@xs4all.nl powered by.: Linux/Alpha & OPENSTEP for Mach/x86 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Problems with mpg123 (or is the multia too slow to decode MP3?) 1999-06-18 14:11 ` warp @ 1999-06-18 14:15 ` warp 1999-06-18 19:49 ` Adam C. Powell, IV 0 siblings, 1 reply; 14+ messages in thread From: warp @ 1999-06-18 14:15 UTC (permalink / raw) To: axp-list warp@xs4all.nl wrote: > And while compiling the sources yourself on Alpha, > don't forget to add: > > -O3 --funroll-all Oops... pressed 'send button' too soon :/ 2nd try, don't forget to add something like: -fomit-frame-pointer -funroll-all-loops \ -finline-functions -ffast-math \ -Wall -O6 -DUSE_MMAP to your CFLAGS section in the mpg123 Makefile for vastly improved playback performance. Antoine ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Problems with mpg123 (or is the multia too slow to decode MP3?) 1999-06-18 14:15 ` warp @ 1999-06-18 19:49 ` Adam C. Powell, IV 1999-06-18 21:01 ` warp 0 siblings, 1 reply; 14+ messages in thread From: Adam C. Powell, IV @ 1999-06-18 19:49 UTC (permalink / raw) To: Cool Cats "warp@xs4all.nl" wrote: > 2nd try, don't forget to add something like: > > -fomit-frame-pointer -funroll-all-loops \ > -finline-functions -ffast-math \ > -Wall -O6 -DUSE_MMAP Doesn't -O6 -mcpu=ev4 (or whatever cpu) include all of these? Well, except maybe -funroll-all-loops and -ffast-math. Are all of these optimizations helpful for mpg123? Just curious, -Adam `Cold Fusion' Powell, IV http://www.ctcms.nist.gov/~powell/ ____ USDoC, National Institute of Standards & Technology (NIST) |\ ||< | Center for Theoretical and Computational Materials Science | \||_> | ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Problems with mpg123 (or is the multia too slow to decode MP3?) 1999-06-18 19:49 ` Adam C. Powell, IV @ 1999-06-18 21:01 ` warp 1999-06-20 4:54 ` Richard Henderson 0 siblings, 1 reply; 14+ messages in thread From: warp @ 1999-06-18 21:01 UTC (permalink / raw) To: axp-list Adam C. Powell, IV wrote: > > "warp@xs4all.nl" wrote: > > > 2nd try, don't forget to add something like: > > > > -fomit-frame-pointer -funroll-all-loops \ > > -finline-functions -ffast-math \ > > -Wall -O6 -DUSE_MMAP > > Doesn't -O6 -mcpu=ev4 (or whatever cpu) include all of these? AFAIK, no, but I could be VERY wrong ;-) > Are all of these optimizations helpful for mpg123? Yes, cpu usage went from 15% (with plain -O2) to 8-9% using the above CFLAGS.. when I linked it to libffm it decreased another 1-2% (about 6-7% total cpu usage). A 200% performance increase is not bad /me thinks ;) BTW, this is on my 21164a/366MHz EV5 based box. Regards, Antoine ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Problems with mpg123 (or is the multia too slow to decode MP3?) 1999-06-18 21:01 ` warp @ 1999-06-20 4:54 ` Richard Henderson 1999-06-21 15:46 ` Ivan Kokshaysky 0 siblings, 1 reply; 14+ messages in thread From: Richard Henderson @ 1999-06-20 4:54 UTC (permalink / raw) To: axp-list On Fri, Jun 18, 1999 at 10:20:43PM +0119, warp@xs4all.nl wrote: > ... when I linked it to libffm it decreased another 1-2% ... The mpg123 build process should be adjusted. It only uses the math library to initialize some tables. This could be done at compile time rather than at run time. r~ ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Problems with mpg123 (or is the multia too slow to decode MP3?) 1999-06-20 4:54 ` Richard Henderson @ 1999-06-21 15:46 ` Ivan Kokshaysky 1999-06-21 17:23 ` Charles E Rick Taylor IV 0 siblings, 1 reply; 14+ messages in thread From: Ivan Kokshaysky @ 1999-06-21 15:46 UTC (permalink / raw) To: axp-list On Sat, Jun 19, 1999 at 09:54:24PM -0700, Richard Henderson wrote: > The mpg123 build process should be adjusted. It only uses the > math library to initialize some tables. This could be done at > compile time rather than at run time. > Right, but since mpg123 calculates these tables only once upon startup, the impact on an overall performance is close to zero. I've made some optimizations of mpg123 for Alphas some time ago, the patch is at ftp.park.msu.ru:/distrib/misc/mpg123-alpha.patch.gz (and srpm at ftp.park.msu.ru:/distrib/RH-5.2/alpha/contrib/SRPMS/mpg123-59q-3.src.rpm) With this patch CPU load of mp3 playback dropped from 6-7% to 3.5-4% on SX164/533MHz. You can also get some extra speedup on alphas with BWX specifying the cpu model in CFLAGS (-mcpu=ev56 etc.) Ivan. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Problems with mpg123 (or is the multia too slow to decode MP3?) 1999-06-21 15:46 ` Ivan Kokshaysky @ 1999-06-21 17:23 ` Charles E Rick Taylor IV 0 siblings, 0 replies; 14+ messages in thread From: Charles E Rick Taylor IV @ 1999-06-21 17:23 UTC (permalink / raw) To: axp-list > I've made some optimizations of mpg123 for Alphas some time ago, > the patch is at ftp.park.msu.ru:/distrib/misc/mpg123-alpha.patch.gz > (and srpm at > ftp.park.msu.ru:/distrib/RH-5.2/alpha/contrib/SRPMS/mpg123-59q-3.src.rpm) I've mirrored the RPMs at ftp://orangesherbert.ces.clemson.edu/pub/mpg123/ mpg123-0.59q-3.src.rpm (source) mpg123-0.59q-3.alpha.rpm (RH 5.x RPM) ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Problems with mpg123 (or is the multia too slow to decode MP3?) 1999-06-18 11:10 Problems with mpg123 (or is the multia too slow to decode MP3?) RaymondInFinland 1999-06-18 13:02 ` Phillip Ezolt @ 1999-06-18 13:42 ` Charles Taylor 1999-06-18 14:43 ` RaymondInFinland 1999-06-20 4:51 ` Problems with mpg123 (or is the multia too slow to decode MP3?) Richard Henderson 2 siblings, 1 reply; 14+ messages in thread From: Charles Taylor @ 1999-06-18 13:42 UTC (permalink / raw) To: axp-list > I recently installed RH6.0 on my alpha and i've noticed that the > included mpg123 player isn't performing very good. It's not able to > decode the MP3 files realtime, it keeps dropping frames all the > time. Is this under X or at the command line? I've noticed that playing mp3s and running X together seems to be right at the edge of a Multia's abilities (could be the terribly slow TGA X server causing part of the problem, but I digress ...) I have a Multia running RH5.2 with a 2.2.4 kernel that can play mp3s without any trouble from the command line, and can play mp3s usually without much trouble from gqmpeg running as the only app under X at 640x480 resolution (my Multia is hooked up to a TV). > worked perfect with RH5.2). Could it be that the new 2.2.X kernels > are slower with sound or something??\x0f Maybe it's something else under RH, or maybe it's a problem with a later kernel than 2.2.4. Wonder if libffm or Compaq's math libraries would help here ... -- Charles E. "Rick" Taylor, IV <charlet@clemson.edu> http://orangesherbert.ces.clemson.edu "We got the MRxL, and you got none!" ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Problems with mpg123 (or is the multia too slow to decode MP3?) 1999-06-18 13:42 ` Charles Taylor @ 1999-06-18 14:43 ` RaymondInFinland 1999-06-18 21:37 ` Peter Petrakis 0 siblings, 1 reply; 14+ messages in thread From: RaymondInFinland @ 1999-06-18 14:43 UTC (permalink / raw) To: axp-list > > I recently installed RH6.0 on my alpha and i've noticed that the > > included mpg123 player isn't performing very good. It's not able to > > decode the MP3 files realtime, it keeps dropping frames all the > > time. > > Is this under X or at the command line? it's at the commandline. I just gonna try and compile my own version of mpg123 and see if that helps... Raymond ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Problems with mpg123 (or is the multia too slow to decode MP3?) 1999-06-18 14:43 ` RaymondInFinland @ 1999-06-18 21:37 ` Peter Petrakis 1999-06-18 23:45 ` Problems with mpg123 (or is the multia too slow to decode MP Charles E Taylor IV 0 siblings, 1 reply; 14+ messages in thread From: Peter Petrakis @ 1999-06-18 21:37 UTC (permalink / raw) To: axp-list Related to playing mp3's as you know x11amp does not work at all. The problem is it's compiled with esound support. Uninstall the esound-devel package and rebuild x11amp and it'll work flawlessly. Peter RaymondInFinland wrote: > > > > I recently installed RH6.0 on my alpha and i've noticed that the > > > included mpg123 player isn't performing very good. It's not able to > > > decode the MP3 files realtime, it keeps dropping frames all the > > > time. > > > > Is this under X or at the command line? > it's at the commandline. I just gonna try and compile my own version > of mpg123 and see if that helps... > > Raymond > > -- > To unsubscribe: send e-mail to axp-list-request@redhat.com with > 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com -- www.alphalinux.org Peter Petrakis Warrior/Engineer ppetrakis@alphalinux.org "Oh my God! They killed Xena! You bastards!!" "<BLAM!!> Who the hell are you!? Name's Ash <click clock> Housewares..." ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Problems with mpg123 (or is the multia too slow to decode MP 1999-06-18 21:37 ` Peter Petrakis @ 1999-06-18 23:45 ` Charles E Taylor IV 0 siblings, 0 replies; 14+ messages in thread From: Charles E Taylor IV @ 1999-06-18 23:45 UTC (permalink / raw) To: axp-list On 18-Jun-99 Peter Petrakis wrote: > Related to playing mp3's as you know x11amp does not work at all. The > problem is it's compiled with esound support. Uninstall the > esound-devel package and rebuild x11amp and it'll work flawlessly. x11amp's not the best choice to play MP3s on a Multia. About the only way I can get it to play without skipping is to force it to downsample. A better choice on a Multia is mpg123 + gqmpeg. --- -------------------------------------------------------- E-Mail: Charles E Taylor IV <charlet@hubcap.clemson.edu> <charlet@innova.net> Date: 18-Jun-99 Time: 19:44:07 -------------------------------------------------------- Visit me on the web! http://orangesherbert.ces.clemson.edu -------------------------------------------------------- ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Problems with mpg123 (or is the multia too slow to decode MP3?) 1999-06-18 11:10 Problems with mpg123 (or is the multia too slow to decode MP3?) RaymondInFinland 1999-06-18 13:02 ` Phillip Ezolt 1999-06-18 13:42 ` Charles Taylor @ 1999-06-20 4:51 ` Richard Henderson 2 siblings, 0 replies; 14+ messages in thread From: Richard Henderson @ 1999-06-20 4:51 UTC (permalink / raw) To: axp-list On Fri, Jun 18, 1999 at 02:10:45PM +0300, RaymondInFinland wrote: > I recently installed RH6.0 on my alpha and i've noticed that the > included mpg123 player isn't performing very good. It's not able to > decode the MP3 files realtime, it keeps dropping frames all the time. Huh. I've never seen mpg123 eat more than 7% cpu when playing to an actual audio device. This is on an avanti, which is marginally faster than a multia, but not 60% worth. I did spend an evening once upon a time tweeking it to run a bit better. This is worth about a 20% speedup in test mode; I forget what that comes to when playing -- not much, really. r~ diff -rup mpg123-0.59q/Makefile mpg123-0.59q-/Makefile --- mpg123-0.59q/Makefile Tue Jan 26 06:35:18 1999 +++ mpg123-0.59q-/Makefile Sat Jun 19 21:36:26 1999 @@ -154,10 +154,8 @@ linux-alsa: mpg123-make linux-alpha: - $(MAKE) CC=gcc LDFLAGS= OBJECTS='decode.o dct64.o audio_oss.o' \ - CFLAGS='-DLINUX -DOSS -Wall -O2 \ - -fomit-frame-pointer -funroll-all-loops \ - -finline-functions -ffast-math \ + $(MAKE) CC=gcc LDFLAGS='-relax' OBJECTS='decode.o dct64.o audio_oss.o' \ + CFLAGS='-DLINUX -DOSS -Wall -O3 -funroll-loops -ffast-math -mcpu=ev56 \ -Wall -O6 -DUSE_MMAP \ $(RPM_OPT_FLAGS)' \ mpg123-make diff -rup mpg123-0.59q/common.c mpg123-0.59q-/common.c --- mpg123-0.59q/common.c Mon Jan 11 14:33:00 1999 +++ mpg123-0.59q-/common.c Sat Jun 19 21:03:04 1999 @@ -32,13 +32,8 @@ int tabsel_123[2][3][16] = { long freqs[9] = { 44100, 48000, 32000, 22050, 24000, 16000 , 11025 , 12000 , 8000 }; -#ifdef I386_ASSEM int bitindex; unsigned char *wordpointer; -#else -static int bitindex; -static unsigned char *wordpointer; -#endif static int fsizeold=0,ssize; static unsigned char bsspace[2][MAXFRAMESIZE+512]; /* MAXFRAMESIZE */ Only in mpg123-0.59q-: config.cache Only in mpg123-0.59q-: config.h diff -rup mpg123-0.59q/dct64.c mpg123-0.59q-/dct64.c --- mpg123-0.59q/dct64.c Sat Sep 20 04:16:04 1997 +++ mpg123-0.59q-/dct64.c Sat Jun 19 21:08:05 1999 @@ -18,7 +18,7 @@ void dct64(real *out0,real *out1,real *s real bufs[64]; { - register int i,j; + register long i,j; register real *b1,*b2,*bs,*costab; b1 = samples; @@ -103,7 +103,7 @@ void dct64(real *out0,real *out1,real *s { register real *b1; - register int i; + register long i; for(b1=bufs,i=8;i;i--,b1+=4) b1[2] += b1[3]; diff -rup mpg123-0.59q/decode.c mpg123-0.59q-/decode.c --- mpg123-0.59q/decode.c Tue Jan 26 04:47:05 1999 +++ mpg123-0.59q-/decode.c Sat Jun 19 21:04:12 1999 @@ -12,10 +12,127 @@ #include "mpg123.h" -#define WRITE_SAMPLE(samples,sum,clip) \ - if( (sum) > 32767.0) { *(samples) = 0x7fff; (clip)++; } \ - else if( (sum) < -32768.0) { *(samples) = -0x8000; (clip)++; } \ - else { *(samples) = sum; } +#define WRITE_SAMPLE(samples,sum,clip) \ + do { \ + long _tmp_ = (sum); \ + long _c1_ = (_tmp_ > 32767); \ + long _c2_ = (_tmp_ < -32768); \ + (clip) += _c1_ + _c2_; \ + if (_c1_) _tmp_ = 32767; \ + if (_c2_) _tmp_ = -32768; \ + *(samples) = _tmp_; \ + } while (0) + +int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt) +{ + static real buffs[2][2][0x110]; + const int step = 2; + static int bo = 1; + short *samples = (short *) (out+*pnt); + + real *b0,(*buf)[0x110]; + long int clip = 0; + long int bo1; + + if(!channel) { + bo--; + bo &= 0xf; + buf = buffs[0]; + } + else { + samples++; + buf = buffs[1]; + } + + if(bo & 0x1) { + b0 = buf[0]; + bo1 = bo; + dct64(buf[1]+((bo+1)&0xf),buf[0]+bo,bandPtr); + } + else { + b0 = buf[1]; + bo1 = bo+1; + dct64(buf[0]+bo,buf[1]+bo+1,bandPtr); + } + + + { + register long j; + real *window = decwin + 16 - bo1; + + for (j=16;j;j--,window+=0x10,samples+=step) + { + real sum, t0, t1, t2, t3; + t0 = window[0] * b0[0]; + t1 = window[1] * b0[1]; + t2 = window[2] * b0[2]; + t3 = window[3] * b0[3]; + t0 += window[4] * b0[4]; + t1 += window[5] * b0[5]; + t2 += window[6] * b0[6]; + t3 += window[7] * b0[7]; + t0 += window[8] * b0[8]; + t1 += window[9] * b0[9]; + t2 += window[10] * b0[10]; + t3 += window[11] * b0[11]; + t0 += window[12] * b0[12]; + t1 += window[13] * b0[13]; + t2 += window[14] * b0[14]; + t3 += window[15] * b0[15]; + window += 16, b0 += 16; + + sum = (t0 - t1) + (t2 - t3); + + WRITE_SAMPLE(samples,sum,clip); + } + + { + real sum, t0, t1, t2, t3; + t0 = window[0x0] * b0[0x0]; + t1 = window[0x2] * b0[0x2]; + t2 = window[0x4] * b0[0x4]; + t3 = window[0x6] * b0[0x6]; + t0 += window[0x8] * b0[0x8]; + t1 += window[0xA] * b0[0xA]; + t2 += window[0xC] * b0[0xC]; + t3 += window[0xE] * b0[0xE]; + sum = (t0 + t1) + (t2 + t3); + WRITE_SAMPLE(samples,sum,clip); + b0-=0x10,window-=0x20,samples+=step; + } + window += bo1<<1; + + for (j=15;j;j--,b0-=0x20,window-=0x10,samples+=step) + { + real sum, t0, t1, t2, t3; + t0 = -window[-1] * b0[0]; + t1 = -window[-2] * b0[1]; + t2 = -window[-3] * b0[2]; + t3 = -window[-4] * b0[3]; + t0 -= window[-5] * b0[4]; + t1 -= window[-6] * b0[5]; + t2 -= window[-7] * b0[6]; + t3 -= window[-8] * b0[7]; + t0 -= window[-9] * b0[8]; + t1 -= window[-10] * b0[9]; + t2 -= window[-11] * b0[10]; + t3 -= window[-12] * b0[11]; + t0 -= window[-13] * b0[12]; + t1 -= window[-14] * b0[13]; + t2 -= window[-15] * b0[14]; + t3 -= window[-16] * b0[15]; + window -= 16, b0 += 16; + + sum = (t0 + t1) + (t2 + t3); + + WRITE_SAMPLE(samples,sum,clip); + } + } + + *pnt += 128; + + return clip; +} int synth_1to1_8bit(real *bandPtr,int channel,unsigned char *samples,int *pnt) { @@ -111,113 +228,3 @@ int synth_1to1_mono2stereo(real *bandPtr return ret; } - - -int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt) -{ - static real buffs[2][2][0x110]; - static const int step = 2; - static int bo = 1; - short *samples = (short *) (out+*pnt); - - real *b0,(*buf)[0x110]; - int clip = 0; - int bo1; - - if(equalfile) - do_equalizer(bandPtr,channel); - - if(!channel) { - bo--; - bo &= 0xf; - buf = buffs[0]; - } - else { - samples++; - buf = buffs[1]; - } - - if(bo & 0x1) { - b0 = buf[0]; - bo1 = bo; - dct64(buf[1]+((bo+1)&0xf),buf[0]+bo,bandPtr); - } - else { - b0 = buf[1]; - bo1 = bo+1; - dct64(buf[0]+bo,buf[1]+bo+1,bandPtr); - } - - - { - register int j; - real *window = decwin + 16 - bo1; - - for (j=16;j;j--,window+=0x10,samples+=step) - { - real sum; - sum = *window++ * *b0++; - sum -= *window++ * *b0++; - sum += *window++ * *b0++; - sum -= *window++ * *b0++; - sum += *window++ * *b0++; - sum -= *window++ * *b0++; - sum += *window++ * *b0++; - sum -= *window++ * *b0++; - sum += *window++ * *b0++; - sum -= *window++ * *b0++; - sum += *window++ * *b0++; - sum -= *window++ * *b0++; - sum += *window++ * *b0++; - sum -= *window++ * *b0++; - sum += *window++ * *b0++; - sum -= *window++ * *b0++; - - WRITE_SAMPLE(samples,sum,clip); - } - - { - real sum; - sum = window[0x0] * b0[0x0]; - sum += window[0x2] * b0[0x2]; - sum += window[0x4] * b0[0x4]; - sum += window[0x6] * b0[0x6]; - sum += window[0x8] * b0[0x8]; - sum += window[0xA] * b0[0xA]; - sum += window[0xC] * b0[0xC]; - sum += window[0xE] * b0[0xE]; - WRITE_SAMPLE(samples,sum,clip); - b0-=0x10,window-=0x20,samples+=step; - } - window += bo1<<1; - - for (j=15;j;j--,b0-=0x20,window-=0x10,samples+=step) - { - real sum; - sum = -*(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - - WRITE_SAMPLE(samples,sum,clip); - } - } - - *pnt += 128; - - return clip; -} - - diff -rup mpg123-0.59q/mpg123.h mpg123-0.59q-/mpg123.h --- mpg123-0.59q/mpg123.h Tue Jan 26 04:47:05 1999 +++ mpg123-0.59q-/mpg123.h Sat Jun 19 21:03:04 1999 @@ -198,6 +198,29 @@ extern unsigned int get1bit(void); extern unsigned int getbits(int); extern unsigned int getbits_fast(int); +#ifdef __GNUC__ +extern inline unsigned int get1bit(void) +{ + extern int bitindex; + extern unsigned char *wordpointer; + + int bi = bitindex; + unsigned char * wp = wordpointer; + + unsigned char rval; + rval = *wp << bi; + + bi++; + wp += bi >> 3; + bi &= 7; + + wordpointer = wp; + bitindex = bi; + + return rval>>7; +} +#endif + extern void set_pointer(long); extern unsigned char *pcm_sample; ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~1999-06-21 18:17 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 1999-06-18 11:10 Problems with mpg123 (or is the multia too slow to decode MP3?) RaymondInFinland 1999-06-18 13:02 ` Phillip Ezolt 1999-06-18 14:11 ` warp 1999-06-18 14:15 ` warp 1999-06-18 19:49 ` Adam C. Powell, IV 1999-06-18 21:01 ` warp 1999-06-20 4:54 ` Richard Henderson 1999-06-21 15:46 ` Ivan Kokshaysky 1999-06-21 17:23 ` Charles E Rick Taylor IV 1999-06-18 13:42 ` Charles Taylor 1999-06-18 14:43 ` RaymondInFinland 1999-06-18 21:37 ` Peter Petrakis 1999-06-18 23:45 ` Problems with mpg123 (or is the multia too slow to decode MP Charles E Taylor IV 1999-06-20 4:51 ` Problems with mpg123 (or is the multia too slow to decode MP3?) Richard Henderson
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox