git-svn-id: svn://kolibrios.org@286 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2007-01-20 08:51:41 +00:00
parent 6ab013ea0b
commit a646a65def
7 changed files with 60 additions and 21 deletions

View File

@ -8,6 +8,9 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pow_test", "pow_test\pow_test.vcproj", "{9FE40739-2ADC-4241-8182-20E1B3C661A7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ac97", "ac97\ac97.vcproj", "{1C94A897-DA4F-45B2-B8A6-B97AD837828E}"
ProjectSection(ProjectDependencies) = postProject
{CF807B93-2860-41DF-A4D2-5B92B52DFD96} = {CF807B93-2860-41DF-A4D2-5B92B52DFD96}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mpg", "mpg\mpg.vcproj", "{CF807B93-2860-41DF-A4D2-5B92B52DFD96}"
EndProject

View File

@ -183,7 +183,7 @@ int main(int argc, char *argv[]) //int argc, char *argv[])
touch(outbuf, outremain);
make_decode_tables(32767);
init_layer2();
init_layer3(SBLIMIT);
init_layer3(32);
fr.single = -1;
};
@ -266,14 +266,21 @@ void play_mp3()
int totalout;
int outcount;
set_reader(&rd, first_sync);
// memset(&fr,0,sizeof(fr));
fr.down_sample_sblimit = 32;
fr.single = -1;
reset_mpg();
outPtr = outbuf;
totalout=0;
done = 0;
outremain=0x40000;
memset(outbuf,0,0x10000);
SetBuffer(hSound,hBuff,outbuf,0,0x10000);
memset(outbuf,0,0x40000);
set_reader(&rd, 0); //;first_sync);
SetBuffer(hSound,hBuff,outbuf,0,0x8000);
SetBuffer(hSound,hBuff,outbuf,0x8000,0x8000);
PlayBuffer(hSound, hBuff);
while(1)
@ -339,6 +346,7 @@ void play_wave()
// read_file (fname,outbuf,offset,32*1024,0);
// offset+=32*1024;
set_reader(&rd,44);
stream_read_raw(&rd,outbuf,32768);
SetBuffer(hSound,hBuff,outbuf,0,0x8000);
stream_read_raw(&rd,outbuf,32768);

View File

@ -4,7 +4,7 @@ typedef unsigned __int8 Byte;
typedef unsigned __int32 size_t;
extern char *__argv;
extern char *__argv[2];
void crtStartUp();
int __cdecl _purecall();

View File

@ -133,12 +133,22 @@ int synth_1to1_mono2stereo(real *bandPtr,unsigned char *samples,int *pnt)
return ret;
}
int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt)
{
#ifndef PENTIUM_OPT
static real buffs[2][2][0x110];
static const int step = 2;
static int bo = 1;
void init_dct()
{
bo = 1;
memset(buffs,0, sizeof(buffs));
};
int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt)
{
#ifndef PENTIUM_OPT
short *samples = (short *) (out + *pnt);
real *b0,(*buf)[0x110];

View File

@ -220,6 +220,20 @@ void layer3_gapless_buffercheck()
* init tables for layer-3
*/
real hybridIn [2][SBLIMIT][SSLIMIT];
real hybridOut[2][SSLIMIT][SBLIMIT];
static real block[2][2][SBLIMIT*SSLIMIT] = { { { 0, } } };
static int blc[2]={0,0};
void reset_mpg()
{
memset(block,0,sizeof(block));
blc[0]=0;
blc[1]=0;
init_dct();
};
#pragma warning(disable:4244)
void init_layer3(int down_sample_sblimit)
{
@ -601,7 +615,7 @@ static int III_get_scale_factors_2(int *scf,struct gr_info_s *gr_info,int i_ster
int i,j,n=0,numbits=0;
unsigned int slen;
static unsigned char stab[3][6][4] = {
static const unsigned char stab[3][6][4] = {
{ { 6, 5, 5,5 } , { 6, 5, 7,3 } , { 11,10,0,0} ,
{ 7, 7, 7,0 } , { 6, 6, 6,3 } , { 8, 8,5,0} } ,
{ { 9, 9, 9,9 } , { 9, 9,12,6 } , { 18,18,0,0} ,
@ -1727,9 +1741,6 @@ static void III_hybrid(real fsIn[SBLIMIT][SSLIMIT],real tsOut[SSLIMIT][SBLIMIT],
int ch,struct gr_info_s *gr_info)
#endif
{
static real block[2][2][SBLIMIT*SSLIMIT] = { { { 0, } } };
static int blc[2]={0,0};
real *tspnt = (real *) tsOut;
real *rawout1,*rawout2;
int bt,sb = 0;
@ -1782,9 +1793,6 @@ static void III_hybrid(real fsIn[SBLIMIT][SSLIMIT],real tsOut[SSLIMIT][SBLIMIT],
}
}
real hybridIn [2][SBLIMIT][SSLIMIT];
real hybridOut[2][SSLIMIT][SBLIMIT];
int do_layer3(struct frame *fr,byte *pcm_sample,int *pcm_point)
{
int gr, ch, ss,clip=0;

View File

@ -352,7 +352,8 @@ int __stdcall decode_header(struct frame *fr,unsigned long newhead);
int __stdcall set_reader(struct reader *rd, unsigned int filepos);
double pow_test(double, double);
void * __cdecl mem_cpy(void * dst,const void * src,size_t count);
void init_dct();
void reset_mpg();
#ifdef __cplusplus
}
#endif

View File

@ -112,6 +112,15 @@ int __stdcall set_reader(struct reader *rd, unsigned int filepos)
rd->strremain=bytes;
rd->filepos=filepos+bytes;
rd->strpos = 0;
fsizeold=0;
firsthead=0;
bsbufold = 0;
bsbuf = bsspace[1];
bsnum = 0;
ssize=0;
oldhead=0;
memset(bsspace,0,sizeof(bsspace));
return 1;
};
@ -715,8 +724,8 @@ init_resync:
}
#if 0
static int stream_back_bytes(struct reader *rds, off_t bytes)
{
if(stream_lseek(rds,-bytes,SEEK_CUR) < 0)