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

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

?? layer12.c

?? linux下MPEG編解碼程序
?? C
字號(hào):
/* * 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 $ */# 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;}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费成人在线观看| 高清视频一区二区| 欧美国产成人精品| 欧美三级中文字幕在线观看| 狠狠色丁香久久婷婷综| 一区二区三区欧美激情| 国产精品三级视频| 久久美女高清视频| 欧美日韩精品专区| 色一情一乱一乱一91av| 成人永久免费视频| 紧缚奴在线一区二区三区| 图片区日韩欧美亚洲| 一区视频在线播放| 久久久www免费人成精品| 91精品国产综合久久香蕉的特点 | 亚洲你懂的在线视频| 精品国产91乱码一区二区三区| 欧美丝袜自拍制服另类| 99久久精品久久久久久清纯| 国产一区二区剧情av在线| 男人的天堂久久精品| 亚洲成人一区在线| 亚洲无线码一区二区三区| 一区二区三区四区不卡视频| **性色生活片久久毛片| 国产精品久久久久国产精品日日 | 中文字幕精品一区二区三区精品| 欧美成人一区二区三区| 91精品国产综合久久香蕉麻豆| 欧美色视频在线观看| 日本精品一区二区三区四区的功能| bt欧美亚洲午夜电影天堂| 国产xxx精品视频大全| 国产黄人亚洲片| 国产乱码精品一品二品| 国产精品一线二线三线精华| 国产一区二区剧情av在线| 国产精品中文有码| 国产69精品久久久久毛片| 成人久久18免费网站麻豆 | 国产精品1024| 粉嫩一区二区三区在线看| 成人一级黄色片| 成人av资源网站| 99久久婷婷国产| 色诱视频网站一区| 欧美亚洲一区二区在线| 欧美电影在线免费观看| 69堂国产成人免费视频| 欧美大片免费久久精品三p | 中文在线免费一区三区高中清不卡| 2020国产精品自拍| 欧美国产精品专区| 亚洲免费资源在线播放| 亚洲成a人片在线不卡一二三区| 性久久久久久久| 久久99国产精品尤物| 成人一区二区三区视频| 日本道色综合久久| 欧美一区二区三区视频在线观看| 欧美成人一级视频| 国产精品乱码一区二三区小蝌蚪| 亚洲视频资源在线| 午夜欧美电影在线观看| 精品一区二区在线看| 成人黄色片在线观看| 欧美日韩mp4| 久久九九99视频| 亚洲综合视频在线观看| 国内一区二区视频| 一本一道波多野结衣一区二区| 欧美日本高清视频在线观看| 久久一区二区三区国产精品| 亚洲精品视频一区二区| 男女性色大片免费观看一区二区| 国产黄色精品网站| 欧美日韩成人综合天天影院| 国产日韩欧美激情| 午夜伦欧美伦电影理论片| 国产成人在线电影| 欧美三区在线视频| 欧美激情自拍偷拍| 五月天丁香久久| 成人污视频在线观看| 91精品欧美一区二区三区综合在| 国产精品青草综合久久久久99| 亚洲福利一区二区三区| 国产乱码精品一区二区三| 欧美日韩另类一区| 欧美国产精品中文字幕| 青青草国产成人99久久| 91国内精品野花午夜精品| 2022国产精品视频| 日韩成人免费电影| 91影院在线免费观看| 久久久久久久精| 日本aⅴ亚洲精品中文乱码| 日本精品视频一区二区三区| 国产亚洲一二三区| 美女网站色91| 精品1区2区3区| 亚洲你懂的在线视频| 国产91精品精华液一区二区三区 | 国产欧美日韩综合| 日韩国产精品久久| 日本韩国欧美在线| 1000精品久久久久久久久| 国产激情一区二区三区桃花岛亚洲| 欧美精品免费视频| 亚洲综合激情小说| aaa国产一区| 国产精品久久久久婷婷| 国产精品一区二区在线看| 欧美成人vps| 奇米精品一区二区三区在线观看 | 日韩一区二区三区免费观看| 亚洲一区二区av在线| 91亚洲男人天堂| 国产精品二区一区二区aⅴ污介绍| 激情综合亚洲精品| 精品电影一区二区三区| 久久99精品久久久久久久久久久久| 欧美日韩大陆一区二区| 亚洲成在线观看| 欧美专区日韩专区| 亚洲动漫第一页| 欧美日韩国产中文| 日韩精品高清不卡| 3d成人动漫网站| 日韩在线a电影| 欧美一区二区三区视频在线观看 | 久久69国产一区二区蜜臀| 制服视频三区第一页精品| 亚洲国产精品久久不卡毛片| 欧美日韩视频在线第一区| 亚洲一区二区三区美女| 欧美三级三级三级| 日本大胆欧美人术艺术动态| 日韩一区二区三区电影在线观看| 麻豆国产精品官网| 久久久www成人免费无遮挡大片| 粉嫩一区二区三区性色av| 国产精品拍天天在线| 色欧美乱欧美15图片| 亚洲bdsm女犯bdsm网站| 91精品国产全国免费观看| 激情深爱一区二区| 久久久精品免费免费| 99在线精品视频| 亚洲v日本v欧美v久久精品| 日韩一级免费观看| 国产一区二区免费看| 国产精品你懂的在线| 91国产免费观看| 免费日本视频一区| 久久久久久夜精品精品免费| 成人avav影音| 亚洲a一区二区| 久久日一线二线三线suv| 北条麻妃国产九九精品视频| 一区二区三国产精华液| 欧美mv日韩mv亚洲| 成人国产精品免费观看视频| 亚洲午夜久久久久久久久久久| 欧美一级高清片在线观看| 成人丝袜18视频在线观看| 亚洲一区二区在线视频| 久久综合久久综合久久| 91在线国内视频| 日韩在线a电影| 国产精品久久久久影视| 欧美日本不卡视频| 国产精品99久久久久久似苏梦涵| 一区二区免费在线| 久久免费国产精品| 欧美在线一二三| 国产一区二区三区免费看| 亚洲一区二区三区影院| 精品久久人人做人人爰| 色综合久久久久网| 国产一区二区不卡| 亚洲成人精品一区| 国产精品久久久久婷婷| 欧美xxxx在线观看| 在线观看不卡一区| 国产精品性做久久久久久| 三级在线观看一区二区| 国产精品毛片大码女人| 日韩欧美精品三级| 日本高清不卡在线观看| 国产久卡久卡久卡久卡视频精品| 亚洲综合小说图片| 国产精品国产自产拍在线| 日韩一二三区视频| 欧美日韩亚洲另类| 91蜜桃免费观看视频| 国产精品69毛片高清亚洲| 奇米亚洲午夜久久精品| 亚洲成人久久影院|