亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? g711.java

?? 結構非常清晰的SIP協議棧
?? JAVA
字號:
package local.media;



/** G.711 codec.
  * This class provides methods for u-law, A-law and linear PCM conversions.
  */
public class G711
{
   static final int SIGN_BIT=0x80;    // Sign bit for a A-law byte.
   static final int QUANT_MASK=0xf;   // Quantization field mask.
   static final int NSEGS=8;          // Number of A-law segments.
   static final int SEG_SHIFT=4;      // Left shift for segment number.
   static final int SEG_MASK=0x70;    // Segment field mask.
  
   static final int[] seg_end={  0xFF, 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF  };
  
   // copy from CCITT G.711 specifications
   
   /** u- to A-law conversions */
   static final int[] _u2a={
     	1,	1,	2,	2,	3,	3,	4,	4,
     	5,	5,	6,	6,	7,	7,	8,	8,
     	9,	10,	11,	12,	13,	14,	15,	16,
     	17,   18,	19,	20,	21,	22,	23,	24,
     	25,	27,	29,	31,	33,	34,	35,	36,
     	37,	38,	39,	40,	41,	42,	43,	44,
     	46,	48,	49,	50,	51,	52,	53,	54,
     	55,	56,	57,	58,	59,	60,	61,	62,
     	64,	65,	66,	67,	68,	69,	70,	71,
     	72,	73,	74,	75,	76,	77,	78,	79,
     	81,	82,	83,	84,	85,	86,	87,	88,
     	89,	90,	91,	92,	93,	94,	95,	96,
     	97,	98,	99,	100,	101,	102,	103,	104,
     	105,	106,	107,	108,	109,	110,	111,	112,
     	113,	114,	115,	116,	117,	118,	119,	120,
     	121,	122,	123,	124,	125,	126,	127,	128  };
     	
   /** A- to u-law conversions */
   static final int[] _a2u={
     	1,	3,	5,	7,	9,	11,	13,	15,
     	16,	17,	18,	19,	20,	21,	22,	23,
     	24,	25,	26,	27,	28,	29,	30,	31,
     	32,	32,	33,	33,	34,	34,	35,	35,
     	36,	37,	38,	39,	40,	41,	42,	43,
     	44,	45,	46,	47,	48,	48,	49,	49,
     	50,	51,	52,	53,	54,	55,	56,	57,
     	58,	59,	60,	61,	62,	63,	64,	64,
     	65,	66,	67,	68,	69,	70,	71,	72,
     	73,	74,	75,	76,	77,	78,	79,	79,
     	80,	81,	82,	83,	84,	85,	86,	87,
     	88,	89,	90,	91,	92,	93,	94,	95,
     	96,	97,	98,	99,	100,	101,	102,	103,
     	104,	105,	106,	107,	108,	109,	110,	111,
     	112,	113,	114,	115,	116,	117,	118,	119,
     	120,	121,	122,	123,	124,	125,	126,	127  };
  
  
   static int search(int val,	int[] table)
   {  for (int i=0; i<table.length; i++) if (val<=table[i]) return i;
      return table.length;
   }

  
   /** Converts a 16-bit linear PCM value to 8-bit A-law.
     *
     * It accepts an 16-bit integer and encodes it as A-law data.
     *
     *   Linear Input Code    Compressed Code
     *   -----------------    ---------------
     *   0000000wxyza         000wxyz
     *   0000001wxyza         001wxyz
     *   000001wxyzab         010wxyz
     *   00001wxyzabc         011wxyz
     *   0001wxyzabcd         100wxyz
     *   001wxyzabcde         101wxyz
     *   01wxyzabcdef         110wxyz
     *   1wxyzabcdefg         111wxyz
     *
     * For further information see John C. Bellamy's Digital Telephony, 1982,
     * John Wiley & Sons, pps 98-111 and 472-476.
     */
   public static int linear2alaw(int pcm_val) // 2's complement (16-bit range)
   {  int mask;
  	   int seg;
  	   //unsigned char aval;
      int aval;
  
     	if (pcm_val>=0)
     	{   mask=0xD5; // sign (7th) bit = 1
     	}
      else
      {  mask=0x55; // sign bit = 0
         pcm_val=-pcm_val-8;
     	}
     
     	// Convert the scaled magnitude to segment number.
     	seg=search(pcm_val,seg_end);
     
     	// Combine the sign, segment, and quantization bits.
     	if (seg>=8) // out of range, return maximum value.
         return (0x7F^mask);
     	else
     	{  aval=seg<<SEG_SHIFT;
         if (seg<2) aval|=(pcm_val>>4)&QUANT_MASK;
     	   else aval|=(pcm_val>>(seg+3))&QUANT_MASK;
         return (aval^mask);
     	}
   }
  
   /** Converts an A-law value to 16-bit linear PCM
     */
   //public static int alaw2linear(unsigned char a_val)
   public static int alaw2linear(int a_val)
   {  int t;
      int seg;
  	   a_val^=0x55;   
     	t=(a_val&QUANT_MASK)<<4;
     	//seg=((unsigned)a_val&SEG_MASK)>>SEG_SHIFT;
      seg=(a_val&SEG_MASK)>>SEG_SHIFT;
     	switch (seg)
     	{  case 0:
            t+=8;
            break;
     	   case 1:
            t+=0x108;
            break;
         default:
     	      t+=0x108;
     	      t<<=seg-1;
  	   }
  	   return ((a_val&SIGN_BIT)!=0)? t : -t;
   }
  
  
   /** Bias for linear code. */
   public static final int BIAS=0x84;


   /** Converts a linear PCM value to u-law
     *
     * In order to simplify the encoding process, the original linear magnitude
     * is biased by adding 33 which shifts the encoding range from (0 - 8158) to
     * (33 - 8191). The result can be seen in the following encoding table:
     *
     *   Biased Linear Input Code   Compressed Code
     *   ------------------------   ---------------
     *   00000001wxyza              000wxyz
     *   0000001wxyzab              001wxyz
     *   000001wxyzabc              010wxyz
     *   00001wxyzabcd              011wxyz
     *   0001wxyzabcde              100wxyz
     *   001wxyzabcdef              101wxyz
     *   01wxyzabcdefg              110wxyz
     *   1wxyzabcdefgh              111wxyz
     *
     * Each biased linear code has a leading 1 which identifies the segment
     * number. The value of the segment number is equal to 7 minus the number
     * of leading 0's. The quantization interval is directly available as the
     * four bits wxyz.  The trailing bits (a - h) are ignored.
     *
     * Ordinarily the complement of the resulting code word is used for
     * transmission, and so the code word is complemented before it is returned.
     *
     * For further information see John C. Bellamy's Digital Telephony, 1982,
     * John Wiley & Sons, pps 98-111 and 472-476.
     */
   public static int linear2ulaw(int pcm_val)	// 2's complement (16-bit range)
   {  int mask;
      int seg;
      //unsigned char uval;
      int uval;
  
  	   // Get the sign and the magnitude of the value.
  	   if (pcm_val<0)
  	   {  pcm_val=BIAS-pcm_val;
         mask=0x7F;
  	   }
  	   else
  	   {  pcm_val+=BIAS;
  	      mask=0xFF;
  	   }
  	   // Convert the scaled magnitude to segment number.
  	   seg=search(pcm_val,seg_end);
  
  	   // Combine the sign, segment, quantization bits; and complement the code word.

     	if (seg>=8) return (0x7F^mask); // out of range, return maximum value.
     	else
     	{  uval=(seg<<4) | ((pcm_val>>(seg+3)) & 0xF);
         return (uval^mask);
  	   }
   }
  
   /** ConvertS a u-law value to 16-bit linear PCM.
     *
     * First, a biased linear code is derived from the code word. An unbiased
     * output can then be obtained by subtracting 33 from the biased code.
     *
     * Note that this function expects to be passed the complement of the
     * original code word. This is in keeping with ISDN conventions.
     */
   //public static int ulaw2linear(unsigned char u_val)
   public static int ulaw2linear(int u_val)
   {  int t;
     	// Complement to obtain normal u-law value.
     	u_val=~u_val;
  	   // Extract and bias the quantization bits. Then shift up by the segment number and subtract out the bias.
     	t=((u_val&QUANT_MASK)<<3) + BIAS;
     	//t<<=((unsigned)u_val&SEG_MASK)>>SEG_SHIFT;
      t<<=(u_val&SEG_MASK)>>SEG_SHIFT;
     
     	return ((u_val&SIGN_BIT)!=0)? (BIAS-t) : (t-BIAS);
  }

  
   /** A-law to u-law conversion.
     */
   //public static int alaw2ulaw(unsigned char aval)
   public static int alaw2ulaw(int aval)
   {  aval&=0xff;
  	   return ((aval & 0x80)!=0)? (0xFF^_a2u[aval^0xD5]) : (0x7F^_a2u[aval^0x55]);
   }

  
   /** u-law to A-law conversion.
     */
   //public static int ulaw2alaw(unsigned char uval)
   public static int ulaw2alaw(int uval)
   {  uval&=0xff;
  	   return ((uval&0x80)!=0)? (0xD5^(_u2a[0xFF^uval]-1)) : (0x55^(_u2a[0x7F^uval]-1));
   }

   
   /** PCM ecoder/decoder tests. */
   /*public static void main(String[] args)
   {
      for (int i=0; i<0xFF; i++)
      {  int pcmu,pcma,linear;
         pcmu=i;
         System.out.print("  pcmu:"+pcmu);
         pcma=ulaw2alaw(pcmu);
         System.out.print("  pcma:"+pcma);
         pcmu=alaw2ulaw(pcma);
         System.out.print("  pcmu:"+pcmu);
         linear=alaw2linear(pcma);
         System.out.print("  linear:"+linear);
         pcma=linear2alaw(linear);
         System.out.print("  pcma:"+pcma);
         linear=ulaw2linear(pcmu);
         System.out.print("  linear:"+linear);
         pcmu=linear2ulaw(linear);
         System.out.print("  pcmu:"+pcmu);
         System.out.println(" .");
         if (i%20==19)
         try {  System.in.read();  } catch (Exception e) {}
      }
   }*/
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久亚洲影视婷婷| 麻豆久久久久久| 偷拍亚洲欧洲综合| 国产不卡在线播放| 欧美一区二区性放荡片| 日本一二三四高清不卡| 蜜臀av一区二区三区| 色激情天天射综合网| 久久久久国产精品人| 日韩综合一区二区| 成人精品gif动图一区| 欧美一区永久视频免费观看| 亚洲美女电影在线| 成人国产免费视频| 久久午夜羞羞影院免费观看| 日韩二区三区在线观看| 欧美亚洲国产bt| 亚洲青青青在线视频| 成人一二三区视频| 国产日本一区二区| 极品瑜伽女神91| 欧美丰满嫩嫩电影| 亚洲电影在线播放| 欧美丝袜丝交足nylons| 亚洲欧美经典视频| 色综合久久六月婷婷中文字幕| 中文在线资源观看网站视频免费不卡 | 国产传媒日韩欧美成人| 日韩一级片在线观看| 五月婷婷激情综合网| 色综合久久66| 亚洲午夜激情网页| 欧美体内she精视频| 亚洲成av人片在线观看无码| 色又黄又爽网站www久久| 亚洲色图.com| 色悠悠亚洲一区二区| 一区二区三区在线影院| 欧美主播一区二区三区美女| 夜夜嗨av一区二区三区四季av | 懂色av一区二区在线播放| 久久久久青草大香线综合精品| 麻豆成人久久精品二区三区小说| 日韩片之四级片| 久久97超碰国产精品超碰| 久久综合狠狠综合久久激情| 国产精品自在在线| 中文字幕色av一区二区三区| 91黄色免费版| 日本不卡一区二区三区高清视频| 欧美一个色资源| 国产一区二区三区免费看| 欧美国产亚洲另类动漫| 91丝袜美腿高跟国产极品老师 | 国产午夜亚洲精品不卡| 99久久综合精品| 日韩国产精品91| 欧美一级黄色大片| 国产福利91精品| 一区二区三区在线免费| 884aa四虎影成人精品一区| 韩国女主播成人在线观看| 国产精品每日更新| 91精品国产色综合久久不卡电影 | 精品国产99国产精品| 国产不卡在线视频| 亚洲高清在线精品| 国产校园另类小说区| 欧洲一区在线电影| 九色porny丨国产精品| 最新不卡av在线| 精品免费视频一区二区| 成人高清免费观看| 日韩高清在线一区| 亚洲色图制服诱惑| 精品久久久网站| 91久久精品一区二区三区| 久久97超碰色| 一区二区三区精品视频在线| 久久久影视传媒| 欧美少妇一区二区| 成人在线视频一区二区| 日韩精品每日更新| 综合久久一区二区三区| 精品sm在线观看| 欧美色网站导航| 波多野结衣中文字幕一区| 日本aⅴ亚洲精品中文乱码| 国产精品国产三级国产aⅴ原创| 欧美电影在哪看比较好| 91麻豆精东视频| 国产成人aaaa| 国精产品一区一区三区mba桃花| 亚洲一区二区三区视频在线播放| 国产日韩欧美电影| 欧美不卡123| 91麻豆精品国产自产在线 | 国产麻豆视频精品| 三级欧美韩日大片在线看| 亚洲欧美一区二区不卡| 久久久久88色偷偷免费| 在线不卡中文字幕| 色综合久久综合中文综合网| 成人性视频免费网站| 久久成人18免费观看| 亚洲成av人**亚洲成av**| 综合激情成人伊人| 国产精品白丝在线| 国产日韩高清在线| 久久婷婷国产综合国色天香| 欧美片网站yy| 欧美卡1卡2卡| 欧美日韩精品欧美日韩精品| 一本色道亚洲精品aⅴ| 91麻豆精品一区二区三区| 91视视频在线观看入口直接观看www | 成人av综合一区| 成人午夜免费av| av在线不卡免费看| av高清不卡在线| 从欧美一区二区三区| 成人美女视频在线观看18| 丁香婷婷深情五月亚洲| jiyouzz国产精品久久| 99re热视频这里只精品| 日本精品裸体写真集在线观看| 日本丰满少妇一区二区三区| 欧美在线观看视频在线| 欧美日韩三级在线| 欧美一级片在线观看| 欧美大片日本大片免费观看| 精品久久人人做人人爽| 国产色婷婷亚洲99精品小说| 国产日韩欧美综合在线| 亚洲天天做日日做天天谢日日欢| 亚洲素人一区二区| 一级精品视频在线观看宜春院| 午夜伦理一区二区| 久久国产视频网| 成人午夜在线免费| 欧美自拍偷拍午夜视频| 日韩欧美久久久| 中文字幕在线一区二区三区| 亚洲激情图片qvod| 久久精品国产亚洲高清剧情介绍 | 日韩一区二区在线观看| 久久亚区不卡日本| 一区二区三区中文字幕电影| 日本亚洲免费观看| 国产69精品久久777的优势| 一本大道久久a久久精品综合| 欧美一卡二卡在线| 1000精品久久久久久久久| 热久久久久久久| www..com久久爱| 欧美裸体一区二区三区| 中文无字幕一区二区三区| 亚洲成人免费av| 国产精品18久久久久久vr| 在线观看三级视频欧美| 久久亚洲一区二区三区四区| 亚洲国产中文字幕| 大桥未久av一区二区三区中文| 欧美色手机在线观看| 欧美国产精品一区二区三区| 日韩精品乱码av一区二区| 99久久精品一区二区| 欧美精品一区二区蜜臀亚洲| 一级女性全黄久久生活片免费| 国产成人精品aa毛片| 91精品国产综合久久福利| 亚洲精品国产精品乱码不99| 国产精品18久久久| 日韩视频一区在线观看| 一卡二卡欧美日韩| 成人91在线观看| 国产亚洲自拍一区| 精一区二区三区| 欧美二区三区91| 一二三区精品福利视频| 99视频精品在线| 国产精品乱码一区二区三区软件| 人禽交欧美网站| 欧美高清dvd| 亚洲18色成人| 欧美日韩国产综合久久| 亚洲精品中文字幕在线观看| 国产成人啪免费观看软件| 26uuu欧美日本| 理论片日本一区| 欧美一级片免费看| 日韩精品一区第一页| 日本丶国产丶欧美色综合| 亚洲视频香蕉人妖| 一本久道中文字幕精品亚洲嫩| 亚洲色图在线看| 色婷婷av一区二区三区gif| 最好看的中文字幕久久| 91蜜桃视频在线| 樱桃国产成人精品视频|