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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? layer12.c

?? symbian下mp3文件的解碼源代碼
?? C
字號:
/* * libmad - MPEG audio decoder library * Copyright (C) 2000-2004 Underbit Technologies, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * * $Id: layer12.c,v 1.17 2004/02/05 09:02:39 rob Exp $ */#include "mad.h"# ifdef HAVE_CONFIG_H#  include "config.h"# endif# include "global.h"# ifdef HAVE_LIMITS_H#  include <limits.h># else#  define CHAR_BIT  8# endif# include "fixed.h"# include "bit.h"# include "stream.h"# include "frame.h"# include "layer12.h"/* * scalefactor table * used in both Layer I and Layer II decoding */staticmad_fixed_t const sf_table[64] = {# include "sf_table.dat"};/* --- Layer I ------------------------------------------------------------- *//* linear scaling table */staticmad_fixed_t const linear_table[14] = {  MAD_F(0x15555555),  /* 2^2  / (2^2  - 1) == 1.33333333333333 */  MAD_F(0x12492492),  /* 2^3  / (2^3  - 1) == 1.14285714285714 */  MAD_F(0x11111111),  /* 2^4  / (2^4  - 1) == 1.06666666666667 */  MAD_F(0x10842108),  /* 2^5  / (2^5  - 1) == 1.03225806451613 */  MAD_F(0x10410410),  /* 2^6  / (2^6  - 1) == 1.01587301587302 */  MAD_F(0x10204081),  /* 2^7  / (2^7  - 1) == 1.00787401574803 */  MAD_F(0x10101010),  /* 2^8  / (2^8  - 1) == 1.00392156862745 */  MAD_F(0x10080402),  /* 2^9  / (2^9  - 1) == 1.00195694716243 */  MAD_F(0x10040100),  /* 2^10 / (2^10 - 1) == 1.00097751710655 */  MAD_F(0x10020040),  /* 2^11 / (2^11 - 1) == 1.00048851978505 */  MAD_F(0x10010010),  /* 2^12 / (2^12 - 1) == 1.00024420024420 */  MAD_F(0x10008004),  /* 2^13 / (2^13 - 1) == 1.00012208521548 */  MAD_F(0x10004001),  /* 2^14 / (2^14 - 1) == 1.00006103888177 */  MAD_F(0x10002000)   /* 2^15 / (2^15 - 1) == 1.00003051850948 */};/* * NAME:	I_sample() * DESCRIPTION:	decode one requantized Layer I sample from a bitstream */staticmad_fixed_t I_sample(struct mad_bitptr *ptr, unsigned int nb){  mad_fixed_t sample;  sample = mad_bit_read(ptr, nb);  /* invert most significant bit, extend sign, then scale to fixed format */  sample ^= 1 << (nb - 1);  sample |= -(sample & (1 << (nb - 1)));  sample <<= MAD_F_FRACBITS - (nb - 1);  /* requantize the sample */  /* s'' = (2^nb / (2^nb - 1)) * (s''' + 2^(-nb + 1)) */  sample += MAD_F_ONE >> (nb - 1);  return mad_f_mul(sample, linear_table[nb - 2]);  /* s' = factor * s'' */  /* (to be performed by caller) */}/* * NAME:	layer->I() * DESCRIPTION:	decode a single Layer I frame */int mad_layer_I(struct mad_stream *stream, struct mad_frame *frame){  struct mad_header *header = &frame->header;  unsigned int nch, bound, ch, s, sb, nb;  unsigned char allocation[2][32], scalefactor[2][32];  nch = MAD_NCHANNELS(header);  bound = 32;  if (header->mode == MAD_MODE_JOINT_STEREO) {    header->flags |= MAD_FLAG_I_STEREO;    bound = 4 + header->mode_extension * 4;  }  /* check CRC word */  if (header->flags & MAD_FLAG_PROTECTION) {    header->crc_check =      mad_bit_crc(stream->ptr, 4 * (bound * nch + (32 - bound)),		  header->crc_check);    if (header->crc_check != header->crc_target &&	!(frame->options & MAD_OPTION_IGNORECRC)) {      stream->error = MAD_ERROR_BADCRC;      return -1;    }  }  /* decode bit allocations */  for (sb = 0; sb < bound; ++sb) {    for (ch = 0; ch < nch; ++ch) {      nb = mad_bit_read(&stream->ptr, 4);      if (nb == 15) {	stream->error = MAD_ERROR_BADBITALLOC;	return -1;      }      allocation[ch][sb] = nb ? nb + 1 : 0;    }  }  for (sb = bound; sb < 32; ++sb) {    nb = mad_bit_read(&stream->ptr, 4);    if (nb == 15) {      stream->error = MAD_ERROR_BADBITALLOC;      return -1;    }    allocation[0][sb] =    allocation[1][sb] = nb ? nb + 1 : 0;  }  /* decode scalefactors */  for (sb = 0; sb < 32; ++sb) {    for (ch = 0; ch < nch; ++ch) {      if (allocation[ch][sb]) {	scalefactor[ch][sb] = mad_bit_read(&stream->ptr, 6);# if defined(OPT_STRICT)	/*	 * Scalefactor index 63 does not appear in Table B.1 of	 * ISO/IEC 11172-3. Nonetheless, other implementations accept it,	 * so we only reject it if OPT_STRICT is defined.	 */	if (scalefactor[ch][sb] == 63) {	  stream->error = MAD_ERROR_BADSCALEFACTOR;	  return -1;	}# endif      }    }  }  /* decode samples */  for (s = 0; s < 12; ++s) {    for (sb = 0; sb < bound; ++sb) {      for (ch = 0; ch < nch; ++ch) {	nb = allocation[ch][sb];	frame->sbsample[ch][s][sb] = nb ?	  mad_f_mul(I_sample(&stream->ptr, nb),		    sf_table[scalefactor[ch][sb]]) : 0;      }    }    for (sb = bound; sb < 32; ++sb) {      if ((nb = allocation[0][sb])) {	mad_fixed_t sample;	sample = I_sample(&stream->ptr, nb);	for (ch = 0; ch < nch; ++ch) {	  frame->sbsample[ch][s][sb] =	    mad_f_mul(sample, sf_table[scalefactor[ch][sb]]);	}      }      else {	for (ch = 0; ch < nch; ++ch)	  frame->sbsample[ch][s][sb] = 0;      }    }  }  return 0;}/* --- Layer II ------------------------------------------------------------ *//* possible quantization per subband table */staticstruct {  unsigned int sblimit;  unsigned char const offsets[30];} const sbquant_table[5] = {  /* ISO/IEC 11172-3 Table B.2a */  { 27, { 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3,	/* 0 */	  3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0 } },  /* ISO/IEC 11172-3 Table B.2b */  { 30, { 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3,	/* 1 */	  3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0 } },  /* ISO/IEC 11172-3 Table B.2c */  {  8, { 5, 5, 2, 2, 2, 2, 2, 2 } },				/* 2 */  /* ISO/IEC 11172-3 Table B.2d */  { 12, { 5, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 } },		/* 3 */  /* ISO/IEC 13818-3 Table B.1 */  { 30, { 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1,	/* 4 */	  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }};/* bit allocation table */staticstruct {  unsigned short nbal;  unsigned short offset;} const bitalloc_table[8] = {  { 2, 0 },  /* 0 */  { 2, 3 },  /* 1 */  { 3, 3 },  /* 2 */  { 3, 1 },  /* 3 */  { 4, 2 },  /* 4 */  { 4, 3 },  /* 5 */  { 4, 4 },  /* 6 */  { 4, 5 }   /* 7 */};/* offsets into quantization class table */staticunsigned char const offset_table[6][15] = {  { 0, 1, 16                                             },  /* 0 */  { 0, 1,  2, 3, 4, 5, 16                                },  /* 1 */  { 0, 1,  2, 3, 4, 5,  6, 7,  8,  9, 10, 11, 12, 13, 14 },  /* 2 */  { 0, 1,  3, 4, 5, 6,  7, 8,  9, 10, 11, 12, 13, 14, 15 },  /* 3 */  { 0, 1,  2, 3, 4, 5,  6, 7,  8,  9, 10, 11, 12, 13, 16 },  /* 4 */  { 0, 2,  4, 5, 6, 7,  8, 9, 10, 11, 12, 13, 14, 15, 16 }   /* 5 */};/* quantization class table */staticstruct quantclass {  unsigned short nlevels;  unsigned char group;  unsigned char bits;  mad_fixed_t C;  mad_fixed_t D;} const qc_table[17] = {# include "qc_table.dat"};/* * NAME:	II_samples() * DESCRIPTION:	decode three requantized Layer II samples from a bitstream */staticvoid II_samples(struct mad_bitptr *ptr,		struct quantclass const *quantclass,		mad_fixed_t output[3]){  unsigned int nb, s, sample[3];  if ((nb = quantclass->group)) {    unsigned int c, nlevels;    /* degrouping */    c = mad_bit_read(ptr, quantclass->bits);    nlevels = quantclass->nlevels;    for (s = 0; s < 3; ++s) {      sample[s] = c % nlevels;      c /= nlevels;    }  }  else {    nb = quantclass->bits;    for (s = 0; s < 3; ++s)      sample[s] = mad_bit_read(ptr, nb);  }  for (s = 0; s < 3; ++s) {    mad_fixed_t requantized;    /* invert most significant bit, extend sign, then scale to fixed format */    requantized  = sample[s] ^ (1 << (nb - 1));    requantized |= -(requantized & (1 << (nb - 1)));    requantized <<= MAD_F_FRACBITS - (nb - 1);    /* requantize the sample */    /* s'' = C * (s''' + D) */    output[s] = mad_f_mul(requantized + quantclass->D, quantclass->C);    /* s' = factor * s'' */    /* (to be performed by caller) */  }}/* * NAME:	layer->II() * DESCRIPTION:	decode a single Layer II frame */int mad_layer_II(struct mad_stream *stream, struct mad_frame *frame){  struct mad_header *header = &frame->header;  struct mad_bitptr start;  unsigned int index, sblimit, nbal, nch, bound, gr, ch, s, sb;  unsigned char const *offsets;  unsigned char allocation[2][32], scfsi[2][32], scalefactor[2][32][3];  mad_fixed_t samples[3];  nch = MAD_NCHANNELS(header);  if (header->flags & MAD_FLAG_LSF_EXT)    index = 4;  else if (header->flags & MAD_FLAG_FREEFORMAT)    goto freeformat;  else {    unsigned long bitrate_per_channel;    bitrate_per_channel = header->bitrate;    if (nch == 2) {      bitrate_per_channel /= 2;# if defined(OPT_STRICT)      /*       * ISO/IEC 11172-3 allows only single channel mode for 32, 48, 56, and       * 80 kbps bitrates in Layer II, but some encoders ignore this       * restriction. We enforce it if OPT_STRICT is defined.       */      if (bitrate_per_channel <= 28000 || bitrate_per_channel == 40000) {	stream->error = MAD_ERROR_BADMODE;	return -1;      }# endif    }    else {  /* nch == 1 */      if (bitrate_per_channel > 192000) {	/*	 * ISO/IEC 11172-3 does not allow single channel mode for 224, 256,	 * 320, or 384 kbps bitrates in Layer II.	 */	stream->error = MAD_ERROR_BADMODE;	return -1;      }    }    if (bitrate_per_channel <= 48000)      index = (header->samplerate == 32000) ? 3 : 2;    else if (bitrate_per_channel <= 80000)      index = 0;    else {    freeformat:      index = (header->samplerate == 48000) ? 0 : 1;    }  }  sblimit = sbquant_table[index].sblimit;  offsets = sbquant_table[index].offsets;  bound = 32;  if (header->mode == MAD_MODE_JOINT_STEREO) {    header->flags |= MAD_FLAG_I_STEREO;    bound = 4 + header->mode_extension * 4;  }  if (bound > sblimit)    bound = sblimit;  start = stream->ptr;  /* decode bit allocations */  for (sb = 0; sb < bound; ++sb) {    nbal = bitalloc_table[offsets[sb]].nbal;    for (ch = 0; ch < nch; ++ch)      allocation[ch][sb] = mad_bit_read(&stream->ptr, nbal);  }  for (sb = bound; sb < sblimit; ++sb) {    nbal = bitalloc_table[offsets[sb]].nbal;    allocation[0][sb] =    allocation[1][sb] = mad_bit_read(&stream->ptr, nbal);  }  /* decode scalefactor selection info */  for (sb = 0; sb < sblimit; ++sb) {    for (ch = 0; ch < nch; ++ch) {      if (allocation[ch][sb])	scfsi[ch][sb] = mad_bit_read(&stream->ptr, 2);    }  }  /* check CRC word */  if (header->flags & MAD_FLAG_PROTECTION) {    header->crc_check =      mad_bit_crc(start, mad_bit_length(&start, &stream->ptr),		  header->crc_check);    if (header->crc_check != header->crc_target &&	!(frame->options & MAD_OPTION_IGNORECRC)) {      stream->error = MAD_ERROR_BADCRC;      return -1;    }  }  /* decode scalefactors */  for (sb = 0; sb < sblimit; ++sb) {    for (ch = 0; ch < nch; ++ch) {      if (allocation[ch][sb]) {	scalefactor[ch][sb][0] = mad_bit_read(&stream->ptr, 6);	switch (scfsi[ch][sb]) {	case 2:	  scalefactor[ch][sb][2] =	  scalefactor[ch][sb][1] =	  scalefactor[ch][sb][0];	  break;	case 0:	  scalefactor[ch][sb][1] = mad_bit_read(&stream->ptr, 6);	  /* fall through */	case 1:	case 3:	  scalefactor[ch][sb][2] = mad_bit_read(&stream->ptr, 6);	}	if (scfsi[ch][sb] & 1)	  scalefactor[ch][sb][1] = scalefactor[ch][sb][scfsi[ch][sb] - 1];# if defined(OPT_STRICT)	/*	 * Scalefactor index 63 does not appear in Table B.1 of	 * ISO/IEC 11172-3. Nonetheless, other implementations accept it,	 * so we only reject it if OPT_STRICT is defined.	 */	if (scalefactor[ch][sb][0] == 63 ||	    scalefactor[ch][sb][1] == 63 ||	    scalefactor[ch][sb][2] == 63) {	  stream->error = MAD_ERROR_BADSCALEFACTOR;	  return -1;	}# endif      }    }  }  /* decode samples */  for (gr = 0; gr < 12; ++gr) {    for (sb = 0; sb < bound; ++sb) {      for (ch = 0; ch < nch; ++ch) {	if ((index = allocation[ch][sb])) {	  index = offset_table[bitalloc_table[offsets[sb]].offset][index - 1];	  II_samples(&stream->ptr, &qc_table[index], samples);	  for (s = 0; s < 3; ++s) {	    frame->sbsample[ch][3 * gr + s][sb] =	      mad_f_mul(samples[s], sf_table[scalefactor[ch][sb][gr / 4]]);	  }	}	else {	  for (s = 0; s < 3; ++s)	    frame->sbsample[ch][3 * gr + s][sb] = 0;	}      }    }    for (sb = bound; sb < sblimit; ++sb) {      if ((index = allocation[0][sb])) {	index = offset_table[bitalloc_table[offsets[sb]].offset][index - 1];	II_samples(&stream->ptr, &qc_table[index], samples);	for (ch = 0; ch < nch; ++ch) {	  for (s = 0; s < 3; ++s) {	    frame->sbsample[ch][3 * gr + s][sb] =	      mad_f_mul(samples[s], sf_table[scalefactor[ch][sb][gr / 4]]);	  }	}      }      else {	for (ch = 0; ch < nch; ++ch) {	  for (s = 0; s < 3; ++s)	    frame->sbsample[ch][3 * gr + s][sb] = 0;	}      }    }    for (ch = 0; ch < nch; ++ch) {      for (s = 0; s < 3; ++s) {	for (sb = sblimit; sb < 32; ++sb)	  frame->sbsample[ch][3 * gr + s][sb] = 0;      }    }  }  return 0;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲va国产天堂va久久en| 亚洲精品大片www| 在线免费视频一区二区| 久久99精品国产麻豆婷婷| 亚洲精选视频在线| 中文字幕第一区综合| 欧美一区二区视频在线观看| 日本电影欧美片| 成人黄色免费短视频| 另类小说一区二区三区| 亚洲国产色一区| 亚洲欧美日韩国产综合在线 | 欧美日韩亚洲丝袜制服| 国产成都精品91一区二区三| 裸体在线国模精品偷拍| 香蕉加勒比综合久久| 亚洲精品成人在线| 亚洲欧洲成人精品av97| 亚洲国产精品二十页| 久久久久久亚洲综合影院红桃| 日韩美女一区二区三区| 欧美一区二区三区日韩| 欧美男同性恋视频网站| 欧美影院一区二区| 色狠狠综合天天综合综合| 色综合久久久久| 91免费观看视频在线| www.视频一区| 99综合影院在线| 波多野结衣视频一区| 成人福利在线看| 丁香婷婷综合激情五月色| 国产精品亚洲专一区二区三区| 韩国三级在线一区| 国产麻豆精品视频| 国产激情一区二区三区四区| 国产精品正在播放| 成人一区二区三区视频| 成人毛片在线观看| av一本久道久久综合久久鬼色| av动漫一区二区| 91日韩精品一区| 在线观看av一区二区| 欧美日韩国产经典色站一区二区三区 | 欧美大片日本大片免费观看| 精品福利一二区| 国产亚洲欧美日韩日本| 中文字幕精品一区二区精品绿巨人 | 久久久久88色偷偷免费| 中文字幕精品一区二区三区精品| 国产精品不卡一区二区三区| 亚洲精品中文字幕乱码三区| 亚洲va韩国va欧美va| 久久精品72免费观看| 国产成人午夜99999| 99r国产精品| 欧美日韩国产一级片| 日韩精品在线一区二区| 国产精品网站在线| 亚洲一区二区在线播放相泽 | 国产91富婆露脸刺激对白| 成人性生交大片免费看在线播放| 91蜜桃视频在线| 欧美日韩一区二区欧美激情| 精品三级av在线| 日韩伦理电影网| 日本午夜精品视频在线观看| 国产精品白丝jk白祙喷水网站| 97久久人人超碰| 日韩西西人体444www| 欧美激情一区不卡| 亚洲动漫第一页| 国产精品一级二级三级| 欧美在线视频日韩| wwwwxxxxx欧美| 一区二区三区四区不卡在线| 美女视频网站久久| 一本色道综合亚洲| 日韩免费在线观看| 曰韩精品一区二区| 国产主播一区二区三区| 在线一区二区三区四区五区| 欧美成人国产一区二区| 亚洲人成电影网站色mp4| 男人的j进女人的j一区| 色综合久久99| 国产欧美日本一区视频| 亚洲v中文字幕| 成人avav在线| 精品久久久久久久久久久久久久久| 国产精品欧美一级免费| 麻豆成人综合网| 欧美三级中文字幕在线观看| 中文一区二区完整视频在线观看 | 丁香婷婷综合网| 日韩精品一区二区在线观看| 亚洲影视在线播放| 丁香另类激情小说| 日韩欧美成人激情| 水蜜桃久久夜色精品一区的特点| 成人网在线免费视频| 精品电影一区二区三区| 日日骚欧美日韩| 一本色道久久综合亚洲91| 欧美国产综合一区二区| 麻豆视频观看网址久久| 欧美另类变人与禽xxxxx| 亚洲女人小视频在线观看| 国产高清久久久久| 久久综合色之久久综合| 日韩电影在线一区二区三区| 欧美三级日韩三级| 亚洲人成网站影音先锋播放| www.av精品| 欧美国产欧美亚州国产日韩mv天天看完整 | 欧美欧美午夜aⅴ在线观看| 亚洲免费观看在线观看| 成人性生交大片免费看视频在线| 久久新电视剧免费观看| 美日韩一级片在线观看| 欧美一区二区三区性视频| 亚洲国产视频一区二区| 欧美最新大片在线看| 亚洲激情网站免费观看| 色综合久久久久久久| 亚洲乱码国产乱码精品精的特点| 9色porny自拍视频一区二区| 国产精品乱子久久久久| 国产成人欧美日韩在线电影| 久久中文字幕电影| 国产成人啪午夜精品网站男同| 久久久久久一二三区| 国产成人亚洲综合a∨婷婷图片| 久久九九国产精品| 成人理论电影网| 综合网在线视频| 欧美最新大片在线看| 亚洲成人av免费| 欧美一区二区日韩| 久久成人久久鬼色| 国产色91在线| aaa欧美日韩| 亚洲午夜影视影院在线观看| 欧美精品在线视频| 看电影不卡的网站| 久久久久久夜精品精品免费| 成人av电影在线播放| 亚洲女与黑人做爰| 91精品国产高清一区二区三区 | 日韩国产精品久久| 欧美三级电影精品| 亚洲成人av一区二区三区| 欧美精三区欧美精三区| 免费的成人av| 中文字幕免费不卡| 在线观看一区二区视频| 青青草国产精品亚洲专区无| 久久久久久久久久久久电影| 成人成人成人在线视频| 一区二区三区久久久| 日韩欧美中文字幕一区| 成人18视频在线播放| 亚洲精品欧美综合四区| 日韩一级片网站| 国产69精品久久久久毛片| 一个色综合av| 日韩精品一区二区三区在线播放| 国产成人自拍网| 亚洲一区二区三区国产| 337p粉嫩大胆噜噜噜噜噜91av| 成人激情小说乱人伦| 丝袜亚洲另类丝袜在线| 欧美激情中文字幕| 91麻豆精品国产自产在线观看一区 | 国产精品 欧美精品| 一区二区三区精品久久久| 精品美女一区二区| 91色porny蝌蚪| 捆绑变态av一区二区三区| 亚洲男人都懂的| 亚洲精品在线三区| 欧美三级资源在线| 成人动漫一区二区三区| 秋霞电影网一区二区| 亚洲男同性视频| 欧美精品一区二区三区蜜桃 | 男女男精品视频网| 中文字幕在线一区二区三区| 7777精品伊人久久久大香线蕉最新版| 国产高清亚洲一区| 日本女人一区二区三区| 一区二区三区在线观看网站| 久久免费视频一区| 91精品国产全国免费观看| 91女厕偷拍女厕偷拍高清| 精品亚洲国产成人av制服丝袜| 亚洲图片有声小说| ●精品国产综合乱码久久久久 | 一卡二卡三卡日韩欧美| 亚洲国产高清aⅴ视频|