?? audioplayer.jad
字號(hào):
}
}
private void ulaw_output(OutputStream outputstream,int ai[]) throws IOException{
/* byte abyte0[]=new byte[160];
new Frame(String.valueOf(ai.length)).show();
for(int i=0; i<160; i++)abyte0[i]=(byte)s2u[(0xffff&ai[i])>>3];
if(PLAY){
while(!Gsm_Player.ready)
try{
Thread.currentThread();
Thread.sleep(1L);
}catch(InterruptedException _ex) { }
po.write(abyte0,0,160);
return;
}else{
outputstream.write(abyte0);
return;
}
*/
byte abyte0[]=new byte[ai.length];
//System.out.println(ai.length);
for(int i=0;i<ai.length;i++)abyte0[i]=(byte)s2u[(0xffff&ai[i])>>3];
System.arraycopy(abyte0,0,data,32+decodelen,160);
//System.out.println("process data finished!");
this.decodelen+=160;
if(decodelen>=400){
System.arraycopy(data,432,data,32,decodelen-400);
decodelen=decodelen-400;
decoded=true;
}
//outputstream.write(abyte0);
}
private int[] gsm_decode_java(byte abyte0[]){
short aword0[]=new short[8];
short aword1[]=new short[4];
short aword2[]=new short[4];
short aword3[]=new short[4];
short aword4[]=new short[4];
short aword5[]=new short[52];
int i=0;
aword0[0]=(short)((abyte0[i++]&0xf)<<2);
aword0[0] |= abyte0[i]>>6&0x3;
aword0[1]=(short)(abyte0[i++]&0x3f);
aword0[2]=(short)(abyte0[i]>>3&0x1f);
aword0[3]=(short)((abyte0[i++]&0x7)<<2);
aword0[3] |= abyte0[i]>>6&0x3;
aword0[4]=(short)(abyte0[i]>>2&0xf);
aword0[5]=(short)((abyte0[i++]&0x3)<<2);
aword0[5] |= abyte0[i]>>6&0x3;
aword0[6]=(short)(abyte0[i]>>3&0x7);
aword0[7]=(short)(abyte0[i++]&0x7);
aword1[0]=(short)(abyte0[i]>>1&0x7f);
aword3[0]=(short)((abyte0[i++]&0x1)<<1);
aword3[0] |= abyte0[i]>>7&0x1;
aword2[0]=(short)(abyte0[i]>>5&0x3);
aword4[0]=(short)((abyte0[i++]&0x1f)<<1);
aword4[0] |= abyte0[i]>>7&0x1;
aword5[0]=(short)(abyte0[i]>>4&0x7);
aword5[1]=(short)(abyte0[i]>>1&0x7);
aword5[2]=(short)((abyte0[i++]&0x1)<<2);
aword5[2] |= abyte0[i]>>6&0x3;
aword5[3]=(short)(abyte0[i]>>3&0x7);
aword5[4]=(short)(abyte0[i++]&0x7);
aword5[5]=(short)(abyte0[i]>>5&0x7);
aword5[6]=(short)(abyte0[i]>>2&0x7);
aword5[7]=(short)((abyte0[i++]&0x3)<<1);
aword5[7] |= abyte0[i]>>7&0x1;
aword5[8]=(short)(abyte0[i]>>4&0x7);
aword5[9]=(short)(abyte0[i]>>1&0x7);
aword5[10]=(short)((abyte0[i++]&0x1)<<2);
aword5[10] |= abyte0[i]>>6&0x3;
aword5[11]=(short)(abyte0[i]>>3&0x7);
aword5[12]=(short)(abyte0[i++]&0x7);
aword1[1]=(short)(abyte0[i]>>1&0x7f);
aword3[1]=(short)((abyte0[i++]&0x1)<<1);
aword3[1] |= abyte0[i]>>7&0x1;
aword2[1]=(short)(abyte0[i]>>5&0x3);
aword4[1]=(short)((abyte0[i++]&0x1f)<<1);
aword4[1] |= abyte0[i]>>7&0x1;
aword5[13]=(short)(abyte0[i]>>4&0x7);
aword5[14]=(short)(abyte0[i]>>1&0x7);
aword5[15]=(short)((abyte0[i++]&0x1)<<2);
aword5[15] |= abyte0[i]>>6&0x3;
aword5[16]=(short)(abyte0[i]>>3&0x7);
aword5[17]=(short)(abyte0[i++]&0x7);
aword5[18]=(short)(abyte0[i]>>5&0x7);
aword5[19]=(short)(abyte0[i]>>2&0x7);
aword5[20]=(short)((abyte0[i++]&0x3)<<1);
aword5[20] |= abyte0[i]>>7&0x1;
aword5[21]=(short)(abyte0[i]>>4&0x7);
aword5[22]=(short)(abyte0[i]>>1&0x7);
aword5[23]=(short)((abyte0[i++]&0x1)<<2);
aword5[23] |= abyte0[i]>>6&0x3;
aword5[24]=(short)(abyte0[i]>>3&0x7);
aword5[25]=(short)(abyte0[i++]&0x7);
aword1[2]=(short)(abyte0[i]>>1&0x7f);
aword3[2]=(short)((abyte0[i++]&0x1)<<1);
aword3[2] |= abyte0[i]>>7&0x1;
aword2[2]=(short)(abyte0[i]>>5&0x3);
aword4[2]=(short)((abyte0[i++]&0x1f)<<1);
aword4[2] |= abyte0[i]>>7&0x1;
aword5[26]=(short)(abyte0[i]>>4&0x7);
aword5[27]=(short)(abyte0[i]>>1&0x7);
aword5[28]=(short)((abyte0[i++]&0x1)<<2);
aword5[28] |= abyte0[i]>>6&0x3;
aword5[29]=(short)(abyte0[i]>>3&0x7);
aword5[30]=(short)(abyte0[i++]&0x7);
aword5[31]=(short)(abyte0[i]>>5&0x7);
aword5[32]=(short)(abyte0[i]>>2&0x7);
aword5[33]=(short)((abyte0[i++]&0x3)<<1);
aword5[33] |= abyte0[i]>>7&0x1;
aword5[34]=(short)(abyte0[i]>>4&0x7);
aword5[35]=(short)(abyte0[i]>>1&0x7);
aword5[36]=(short)((abyte0[i++]&0x1)<<2);
aword5[36] |= abyte0[i]>>6&0x3;
aword5[37]=(short)(abyte0[i]>>3&0x7);
aword5[38]=(short)(abyte0[i++]&0x7);
aword1[3]=(short)(abyte0[i]>>1&0x7f);
aword3[3]=(short)((abyte0[i++]&0x1)<<1);
aword3[3] |= abyte0[i]>>7&0x1;
aword2[3]=(short)(abyte0[i]>>5&0x3);
aword4[3]=(short)((abyte0[i++]&0x1f)<<1);
aword4[3] |= abyte0[i]>>7&0x1;
aword5[39]=(short)(abyte0[i]>>4&0x7);
aword5[40]=(short)(abyte0[i]>>1&0x7);
aword5[41]=(short)((abyte0[i++]&0x1)<<2);
aword5[41] |= abyte0[i]>>6&0x3;
aword5[42]=(short)(abyte0[i]>>3&0x7);
aword5[43]=(short)(abyte0[i++]&0x7);
aword5[44]=(short)(abyte0[i]>>5&0x7);
aword5[45]=(short)(abyte0[i]>>2&0x7);
aword5[46]=(short)((abyte0[i++]&0x3)<<1);
aword5[46] |= abyte0[i]>>7&0x1;
aword5[47]=(short)(abyte0[i]>>4&0x7);
aword5[48]=(short)(abyte0[i]>>1&0x7);
aword5[49]=(short)((abyte0[i++]&0x1)<<2);
aword5[49] |= abyte0[i]>>6&0x3;
aword5[50]=(short)(abyte0[i]>>3&0x7);
aword5[51]=(short)(abyte0[i]&0x7);
return Gsm_Decoder_java(aword0,aword1,aword2,aword3,aword4,aword5);
}
private int[] Gsm_Decoder_java(short aword0[],short aword1[],short aword2[],short aword3[],short aword4[],short aword5[]){
int i=0;
short aword6[]=new short[160];
short aword7[]=new short[40];
byte byte0=120;
for(int k=0; k <= 3;){
Gsm_RPE_Decoding_java(aword4[k],aword2[k],i,aword5,aword7);
Gsm_Long_Term_Synthesis_Filtering(aword1[k],aword3[k],aword7,byte0);
System.arraycopy(dp0,byte0,aword6,k * 40,39);
k++;
i += 13;
}
int ai[]=Gsm_Short_Term_Synthesis_Filter(aword0,aword6);
Postprocessing(ai);
return ai;
}
private void Gsm_RPE_Decoding_java(short word0,short word1,int i,short aword0[],short aword1[]){
short aword2[]=new short[13];
short aword3[]=APCM_quantization_xmaxc_to_exp_mant(word0);
APCM_inverse_quantization(aword0,aword2,i,aword3[0],aword3[1]);
RPE_grid_positioning(word1,aword2,aword1);
}
private short[] APCM_quantization_xmaxc_to_exp_mant(short word0)
throws IllegalArgumentException{
short word1=0;
short word2=0;
if(word0 > 15)
word1=(short)(SASR(word0,3) - 1);
word2=(short)(word0 - (word1<<3));
if(word2 == 0){
word1=-4;
word2=7;
}else{
while(word2<=7){
word2=(short)(word2<<1|0x1);
word1--;
}
word2 -= 8;
}
if(word1 < -4 || word1 > 6)
throw new IllegalArgumentException("APCM_quantization_xmaxc_to_exp_mant: exp=" + word1 + " is out of range. Should be>=-4 and <= 6");
if(word2 < 0 || word2 > 7){
throw new IllegalArgumentException("APCM_quantization_xmaxc_to_exp_mant: mant=" + word2 + " is out of range. Should be>=0 and <= 7");
}else{
short aword0[]=new short[2];
aword0[0]=word1;
aword0[1]=word2;
return aword0;
}
}
private void APCM_inverse_quantization(short aword0[],short aword1[],int i,short word0,short word1)
throws IllegalArgumentException{
short word3=gsm_FAC[word1];
short word4=GSM_SUB((short)6,word0);
short word5=gsm_asl((short)1,GSM_SUB(word4,(short)1));
int k=0;
for(int l=0; l < 13; l++)
{
short word2=(short)((aword0[i++]<<1) - 7);
if(word2 > 7 || word2 < -7)
throw new IllegalArgumentException("APCM_inverse_quantization: temp=" + word2 + " is out of range. Should be>=-7 and <= 7");
word2 <<= 12;
word2=GSM_MULT_R(word3,word2);
word2=GSM_ADD(word2,word5);
aword1[k++]=gsm_asr(word2,word4);
}
}
private static void RPE_grid_positioning(short word0,short aword0[],short aword1[])
throws IllegalArgumentException
{
int i=13;
int k=0;
int l=0;
if(word0 < 0 || word0 > 3)
throw new IllegalArgumentException("RPE_grid_positioning: Mc=" + word0 + " is out of range. Should be>=0 and <= 3");
switch(word0)
{
case 3: // '\003'
aword1[l++]=0;
// fall through
case 2: // '\002'
aword1[l++]=0;
// fall through
case 1: // '\001'
aword1[l++]=0;
// fall through
case 0: // '\0'
aword1[l++]=aword0[k++];
i--;
break;
}
do
{
aword1[l++]=0;
aword1[l++]=0;
aword1[l++]=aword0[k++];
}
while(--i > 0);
while(++word0 < 4)
aword1[l++]=0;
}
private void Gsm_Long_Term_Synthesis_Filtering(short word0,short word1,short aword0[],int i)
throws IllegalArgumentException
{
short word4=word0>=40 && word0 <= 120?word0:nrp;
nrp=word4;
if(word4 < 40 || word4 > 120)
throw new IllegalArgumentException("Gsm_Long_Term_Synthesis_Filtering Nr=" + word4 + " is out of range. Should be>=40 and <= 120");
short word2=gsm_QLB[word1];
if(word2 == -32768)
throw new IllegalArgumentException("Gsm_Long_Term_Synthesis_Filtering brp=" + word2 + " is out of range. Should be=" + -32768);
for(int k=0; k <= 39; k++)
{
short word3=GSM_MULT_R(word2,dp0[(k - word4) + i]);
dp0[k + i]=GSM_ADD(aword0[k],word3);
}
System.arraycopy(dp0,i - 80,dp0,i - 120,120);
}
private int[] Gsm_Short_Term_Synthesis_Filter(short aword0[],short aword1[])
throws ArrayIndexOutOfBoundsException
{
short aword2[]=new short[8];
int ai[]=new int[160];
short aword3[]=LARpp[j];
short aword4[]=LARpp[j ^= 0x1];
Decoding_of_the_coded_Log_Area_Ratios(aword0,aword3);
Coefficients_0_12(aword4,aword3,aword2);
LARp_to_rp(aword2);
Short_term_synthesis_filtering(aword2,13,aword1,ai,0);
Coefficients_13_26(aword4,aword3,aword2);
LARp_to_rp(aword2);
Short_term_synthesis_filtering(aword2,14,aword1,ai,13);
Coefficients_27_39(aword4,aword3,aword2);
LARp_to_rp(aword2);
Short_term_synthesis_filtering(aword2,13,aword1,ai,27);
Coefficients_40_159(aword3,aword2);
LARp_to_rp(aword2);
Short_term_synthesis_filtering(aword2,120,aword1,ai,40);
return ai;
}
private static void Decoding_of_the_coded_Log_Area_Ratios(short aword0[],short aword1[])
{
short word0=0;
int i=0;
STEP(aword0,aword1,i++,word0,(short)0,(short)-32,(short)13107);
STEP(aword0,aword1,i++,word0,(short)0,(short)-32,(short)13107);
STEP(aword0,aword1,i++,word0,(short)2048,(short)-16,(short)13107);
STEP(aword0,aword1,i++,word0,(short)-2560,(short)-16,(short)13107);
STEP(aword0,aword1,i++,word0,(short)94,(short)-8,(short)19223);
STEP(aword0,aword1,i++,word0,(short)-1792,(short)-8,(short)17476);
STEP(aword0,aword1,i++,word0,(short)-341,(short)-4,(short)31454);
STEP(aword0,aword1,i++,word0,(short)-1144,(short)-4,(short)29708);
}
private static void STEP(short aword0[],short aword1[],int i,short word0,short word1,short word2,short word3)
{
word0=(short)(GSM_ADD(aword0[i],word2)<<10);
word0=GSM_SUB(word0,(short)(word1<<1));
word0=GSM_MULT_R(word3,word0);
aword1[i]=GSM_ADD(word0,word0);
}
private static void Coefficients_0_12(short aword0[],short aword1[],short aword2[])
{
for(int i=0; i < 8; i++)
{
aword2[i]=GSM_ADD(SASR(aword0[i],2),SASR(aword1[i],2));
aword2[i]=GSM_ADD(aword2[i],SASR(aword0[i],1));
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -