diff -U 3 -H -d -r -N -- mpg123-0.59r-15/decode_i486.c mpg123-0.59r/decode_i486.c
--- mpg123-0.59r-15/decode_i486.c	1998-11-19 11:42:36.000000000 +0100
+++ mpg123-0.59r/decode_i486.c	2004-09-20 20:57:44.000000000 +0200
@@ -246,3 +246,108 @@
   return clip;
 }
 
+int synth_2to1_486(real *bandPtr,int channel,unsigned char *out, int nb_blocks)
+{
+  static int buffs[2][2][17*FIR_BUFFER_SIZE];
+  static int bo[2] = { FIR_SIZE-1, FIR_SIZE-1 };
+  short *samples = (short *) out;
+  int *b0,(*buf)[17*FIR_BUFFER_SIZE];
+  int clip = 0; 
+  int block,b,bo_start;
+
+  /* samples address */
+  samples+=channel;
+
+  bo_start=bo[channel];
+  buf = buffs[channel];
+
+  b=bo_start;
+  for(block=0;block<nb_blocks;block++) {
+
+    /* FIR offset */
+    b++;
+    if (b >= FIR_BUFFER_SIZE) {
+      int *p,*q;
+      int c,i,j;
+      
+      /* we shift the buffers */
+      for(c=0;c<2;c++) {
+        p=&buf[c][0]+1;
+        q=p+(FIR_BUFFER_SIZE-FIR_SIZE);
+        for(i=0;i<17;i++) {
+          for(j=0;j<FIR_SIZE-1;j++) p[j]=q[j];
+          p+=FIR_BUFFER_SIZE;
+          q+=FIR_BUFFER_SIZE;
+        }
+      }
+      /* we update 'bo' accordingly */
+      b=bo[channel]=FIR_SIZE;
+    }
+    
+    if(b & 1) {
+      dct64_486(buf[1]+b,buf[0]+b,bandPtr);
+    } else {
+      dct64_486(buf[0]+b,buf[1]+b,bandPtr);
+    }
+    bandPtr+=32;
+  }
+  bo[channel]=b;
+
+  /* filter bank: part 1 */
+  b=bo_start;
+  for(block=0;block<nb_blocks;block++) {
+    b++;
+    if (b >= FIR_BUFFER_SIZE) b=FIR_SIZE;
+    if(b & 1) {
+      b0 = buf[0] + b - (FIR_SIZE-1);
+    } else {
+      b0 = buf[1] + b - (FIR_SIZE-1);
+    }
+
+ FIR16_1(0,-7,53,-114,509,-1288,1643,-9372,18759,9372,1643,1288,509,114,53,7,0);
+ b0+=FIR_BUFFER_SIZE;\
+ FIR16_2(1,-6,50,-86,520,-1106,1910,-8447,18714,10294,1322,1469,488,145,55,8,0,
+ 15,0,-8,55,-145,488,-1469,1322,-10294,18714,8447,1910,1106,520,86,50,6);
+ b0+=FIR_BUFFER_SIZE;\
+ FIR16_2(2,-4,47,-61,521,-926,2123,-7528,18578,11205,944,1647,455,177,56,10,0,
+ 14,0,-10,56,-177,455,-1647,944,-11205,18578,7528,2123,926,521,61,47,4);
+ b0+=FIR_BUFFER_SIZE;\
+ FIR16_2(3,-4,44,-38,514,-751,2284,-6620,18353,12097,509,1817,411,212,57,12,0,
+ 13,0,-12,57,-212,411,-1817,509,-12097,18353,6620,2284,751,514,38,44,4);
+ b0+=FIR_BUFFER_SIZE;\
+
+    samples+=32;
+  }
+  samples-=32*nb_blocks;
+
+  /* filter bank: part 2 */
+  
+  b=bo_start;
+  for(block=0;block<nb_blocks;block++) {
+    b++;
+    if (b >= FIR_BUFFER_SIZE) b=FIR_SIZE;
+    if(b & 1) {
+      b0 = buf[0] + b - (FIR_SIZE-1) + 8*FIR_BUFFER_SIZE;
+    } else {
+      b0 = buf[1] + b - (FIR_SIZE-1) + 8*FIR_BUFFER_SIZE;
+    }
+
+ FIR16_2(4,-3,40,-18,500,-582,2398,-5732,18042,12963,17,1977,353,247,56,14,0,
+ 12,0,-14,56,-247,353,-1977,17,-12963,18042,5732,2398,582,500,18,40,3);
+ b0+=FIR_BUFFER_SIZE;\
+ FIR16_2(5,-2,36,0,479,-423,2465,-4869,17647,13794,-530,2122,282,284,53,17,0,
+ 11,0,-17,53,-284,282,-2122,-530,-13794,17647,4869,2465,423,479,0,36,2);
+ b0+=FIR_BUFFER_SIZE;\
+ FIR16_2(6,-2,33,14,454,-273,2491,-4038,17173,14583,-1133,2249,198,320,50,19,0,
+ 10,0,-19,50,-320,198,-2249,-1133,-14583,17173,4038,2491,273,454,-14,33,2);
+ b0+=FIR_BUFFER_SIZE;\
+ FIR16_2(7,-1,29,26,424,-136,2479,-3245,16623,15322,-1788,2354,100,357,44,22,-1,
+ 9,-1,-22,44,-357,100,-2354,-1788,-15322,16623,3245,2479,136,424,-26,29,1);
+ b0+=FIR_BUFFER_SIZE;\
+ FIR16_1(8,-1,0,36,0,-11,0,-2493,0,16004,0,2431,0,391,0,26,0);
+ 
+    samples+=32;
+  }
+  
+  return clip;
+}
diff -U 3 -H -d -r -N -- mpg123-0.59r-15/layer3.c mpg123-0.59r/layer3.c
--- mpg123-0.59r-15/layer3.c	2004-09-20 22:21:18.000000000 +0200
+++ mpg123-0.59r/layer3.c	2004-09-15 00:58:45.000000000 +0200
@@ -1818,7 +1818,7 @@
     }
 
 #ifdef I486_OPT
-    if (fr->synth != synth_1to1 || single >= 0) {
+    if ((fr->synth != synth_1to1 && fr->synth != synth_2to1) || single >= 0) {
 #endif
     for(ss=0;ss<SSLIMIT;ss++) {
       if(single >= 0) {
@@ -1845,16 +1845,27 @@
 #ifdef I486_OPT
     } else {
       /* Only stereo, 16 bits benefit from the 486 optimization. */
+      /* However, a i486dx4@75Mhz still needs *optimized* 2to1 downsampling */
+      int block_size;
+      
+      block_size=2*32;
+      if (fr->synth == synth_1to1) block_size=block_size*2;
+
       ss=0;
       while (ss < SSLIMIT) {
         int n;
-        n=(audiobufsize - pcm_point) / (2*2*32);
+        n=(audiobufsize - pcm_point) / block_size;
         if (n > (SSLIMIT-ss)) n=SSLIMIT-ss;
-        
-        synth_1to1_486(hybridOut[0][ss],0,pcm_sample+pcm_point,n);
-        synth_1to1_486(hybridOut[1][ss],1,pcm_sample+pcm_point,n);
+
+        if (fr->synth == synth_1to1) {
+            synth_1to1_486(hybridOut[0][ss],0,pcm_sample+pcm_point,n);
+            synth_1to1_486(hybridOut[1][ss],1,pcm_sample+pcm_point,n);
+        } else {
+            synth_2to1_486(hybridOut[0][ss],0,pcm_sample+pcm_point,n);
+            synth_2to1_486(hybridOut[1][ss],1,pcm_sample+pcm_point,n);
+        }
         ss+=n;
-        pcm_point+=(2*2*32)*n;
+        pcm_point+=block_size*n;
         
         if(pcm_point >= audiobufsize)
           audio_flush(outmode,ai);
diff -U 3 -H -d -r -N -- mpg123-0.59r-15/mpg123.h mpg123-0.59r/mpg123.h
--- mpg123-0.59r-15/mpg123.h	2004-09-20 22:21:18.000000000 +0200
+++ mpg123-0.59r/mpg123.h	2004-09-22 20:58:34.000000000 +0200
@@ -384,6 +384,6 @@
 #define FIR_BUFFER_SIZE  128
 extern void dct64_486(int *a,int *b,real *c);
 extern int synth_1to1_486(real *bandPtr,int channel,unsigned char *out,int nb_blocks);
-
+extern int synth_2to1_486(real *bandPtr,int channel,unsigned char *out,int nb_blocks);
 
 
diff -U 3 -H -d -r -N -- mpg123-0.59r-15/README mpg123-0.59r/README
--- mpg123-0.59r-15/README	2004-09-20 22:21:18.000000000 +0200
+++ mpg123-0.59r/README	2004-09-20 22:51:16.000000000 +0200
@@ -184,6 +184,7 @@
 Copyrights (c) 1997 of several enhancements by Oliver Fromme.
 See the packages 'maplay 1.2(+)' and 'mpegaudio' for their copy-policies.
 Copyrights (c) 1997 of the OS2 specific parts by Niclas Lindstrom
+Copyrights (c) 1998 of the i486 optimization code by Fabrice Bellard.
 
 known bugs:
 -----------
diff -U 3 -H -d -r -N -- mpg123-0.59r-15/README.i486 mpg123-0.59r/README.i486
--- mpg123-0.59r-15/README.i486	1970-01-01 01:00:00.000000000 +0100
+++ mpg123-0.59r/README.i486	2004-09-20 22:48:31.000000000 +0200
@@ -0,0 +1,42 @@
+
+i486 optimization :
+------------------
+
+You can compile the code by 'make linux-i486' to enable the 486
+specific optimizations. DO NOT USE IT ON A PENTIUM, IT WILL BE
+SLOWER THAN THE NORMAL CODE.
+
+The i486 optimizations are *only* enabled when playing in layer 3 at
+44.1 kHz or 22.1 kHz in 16 bits. The other modes fallback to the
+default pentium optimized routines.
+
+In other words, if you use a 8 bit sound card, the i486 optimizations
+won't be used !
+
+Try to increase the buffer size with the option '-b' if your CPU is
+not fast enough.
+
+'Benchmarks': (+/- 2%) 
+----------------------
+MPEG 1.0 layer III, 112 kbit/s, 44100 Hz joint-stereo
+
+Processor     22kHz/stereo  44kHz/stereo
+
+486DX2/66        OK            - (almost!)
+486DX4/100       OK            OK
+
+Please send me some feedback to tell if it works on your i486 !
+
+Fabrice Bellard.
+--
+bellard@email.enst.fr - http://www-stud.enst.fr/~bellard
+
+-----------------------------------------------------
+merged back i486 optimized 2to1 downsampling
+MPEG 1.0 Layer III, 128 kbit/s, 44100 Hz joint-stereo
+
+486DX4/75        OK           - (90 %)
+
+160 kbit/s and up work as well.
+Christoph Jungegger (disdos%traum404,de)   20.09.2004
+-----------------------------------------------------
