summaryrefslogtreecommitdiffstats
path: root/mp3lib
diff options
context:
space:
mode:
authorarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-08 21:49:00 +0000
committerarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-08 21:49:00 +0000
commita158f5d74742a50399dc7ba75843675127bfb9b6 (patch)
treefd5972032adb2b4f08bc7e2dc73e2c03de54d55a /mp3lib
parent3040f42cd6854b3f918dda2de753585b62dd9171 (diff)
downloadmpv-a158f5d74742a50399dc7ba75843675127bfb9b6.tar.bz2
mpv-a158f5d74742a50399dc7ba75843675127bfb9b6.tar.xz
applied 'fakemono' patch by Bryan Chan scorpio@acm.org
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@733 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mp3lib')
-rw-r--r--mp3lib/decod386.c34
-rw-r--r--mp3lib/mp3.h4
-rw-r--r--mp3lib/sr1.c13
3 files changed, 51 insertions, 0 deletions
diff --git a/mp3lib/decod386.c b/mp3lib/decod386.c
index f1a7e26b76..0dceb11a71 100644
--- a/mp3lib/decod386.c
+++ b/mp3lib/decod386.c
@@ -72,6 +72,40 @@ static int synth_1to1_mono2stereo(real *bandPtr,unsigned char *samples,int *pnt)
}
+#ifdef USE_FAKE_MONO
+static int synth_1to1_l(real *bandPtr,int channel,unsigned char *out,int *pnt)
+{
+ int i,ret;
+
+ ret = synth_1to1(bandPtr,channel,out,pnt);
+ out = out + *pnt - 128;
+
+ for(i=0;i<32;i++) {
+ ((short *)out)[1] = ((short *)out)[0];
+ out+=4;
+ }
+
+ return ret;
+}
+
+
+static int synth_1to1_r(real *bandPtr,int channel,unsigned char *out,int *pnt)
+{
+ int i,ret;
+
+ ret = synth_1to1(bandPtr,channel,out,pnt);
+ out = out + *pnt - 128;
+
+ for(i=0;i<32;i++) {
+ ((short *)out)[0] = ((short *)out)[1];
+ out+=4;
+ }
+
+ return ret;
+}
+#endif
+
+
static int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt)
{
static real buffs[2][2][0x110];
diff --git a/mp3lib/mp3.h b/mp3lib/mp3.h
index c89833fff2..308c8187af 100644
--- a/mp3lib/mp3.h
+++ b/mp3lib/mp3.h
@@ -1,7 +1,11 @@
/* MP3 Player Library 2.0 (C) 1999 A'rpi/Astral&ESP-team */
/* decoder level: */
+#ifdef USE_FAKE_MONO
+extern void MP3_Init(int fakemono);
+#else
extern void MP3_Init();
+#endif
extern int MP3_Open(char *filename,int buffsize);
extern void MP3_SeekFrame(int num,int dir);
extern void MP3_SeekForward(int num);
diff --git a/mp3lib/sr1.c b/mp3lib/sr1.c
index 0829bc0c4a..f983763a04 100644
--- a/mp3lib/sr1.c
+++ b/mp3lib/sr1.c
@@ -348,7 +348,11 @@ retry1:
static int tables_done_flag=0;
// Init decoder tables. Call first, once!
+#ifdef USE_FAKE_MONO
+void MP3_Init(int fakemono){
+#else
void MP3_Init(){
+#endif
_CpuID=CpuDetect();
_i586=ipentium();
#ifdef HAVE_3DNOW
@@ -362,7 +366,16 @@ void MP3_Init(){
#endif
make_decode_tables(outscale);
+#ifdef USE_FAKE_MONO
+ if (fakemono == 1)
+ fr.synth=synth_1to1_l;
+ else if (fakemono == 2)
+ fr.synth=synth_1to1_r;
+ else
+ fr.synth=synth_1to1;
+#else
fr.synth=synth_1to1;
+#endif
fr.synth_mono=synth_1to1_mono2stereo;
fr.down_sample=0;
fr.down_sample_sblimit = SBLIMIT>>(fr.down_sample);