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

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

?? g711.c

?? The Audio File Library provides a uniform programming interface to standard digital audio file form
?? C
字號:
/*	Audio File Library	Copyright (C) 2000-2001, Silicon Graphics, Inc.	This library is free software; you can redistribute it and/or	modify it under the terms of the GNU Library General Public	License as published by the Free Software Foundation; either	version 2 of the License, or (at your option) any later version.	This library 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	Library General Public License for more details.	You should have received a copy of the GNU Library General Public	License along with this library; if not, write to the	Free Software Foundation, Inc., 59 Temple Place - Suite 330,	Boston, MA  02111-1307  USA.*//*	g711.c*/#ifdef HAVE_CONFIG_H#include <config.h>#endif#include <errno.h>#include <string.h>#include <assert.h>#include <audiofile.h>#include "afinternal.h"#include "modules.h"#include "units.h"#include "compression.h"#include "g711.h"#include "byteorder.h"#include "util.h"#include "../g711.h"#define CHNK(X)static void ulaw2linear_buf (unsigned char *ulaw, signed short int *linear,	int nsamples){	int i;	for (i=0; i < nsamples; i++)	{		linear[i] = _af_ulaw2linear(ulaw[i]);	}}static void linear2ulaw_buf (signed short int *linear, unsigned char *ulaw,	int nsamples){	int i;	for (i=0; i < nsamples; i++)	{		ulaw[i] = _af_linear2ulaw(linear[i]);	}}static void alaw2linear_buf (unsigned char *alaw, signed short int *linear,	int nsamples){	int i;	for (i=0; i < nsamples; i++)	{		linear[i] = _af_alaw2linear(alaw[i]);	}}static void linear2alaw_buf (signed short int *linear, unsigned char *alaw,	int nsamples){	int i;	for (i=0; i < nsamples; i++)	{		alaw[i] = _af_linear2alaw(linear[i]);	}}bool _af_g711_format_ok (_AudioFormat *f){	if (f->sampleFormat != AF_SAMPFMT_TWOSCOMP || f->sampleWidth != 16)	{		_af_error(AF_BAD_COMPRESSION,		       "G711 compression requires 16-bit signed integer format");		f->sampleFormat = AF_SAMPFMT_TWOSCOMP;		f->sampleWidth = 16;		/* non-fatal */	}	if (f->byteOrder != AF_BYTEORDER_BIGENDIAN)	{		_af_error(AF_BAD_COMPRESSION,		       "G711 compression requires big endian format");		f->byteOrder = AF_BYTEORDER_BIGENDIAN;		/* non-fatal */	}	return AF_TRUE;}static _AFmodule g711compress, g711decompress;typedef unsigned char g711samp;typedef struct g711_data{	_Track *trk;	AFvirtualfile *fh;	bool seekok;	/* saved_fpos_next_frame and saved_nextfframe apply only to writing. */	int saved_fpos_next_frame;	int saved_nextfframe;} g711_data;static void g711compressdescribe (_AFmoduleinst *i){	g711_data *d = (g711_data *)i->modspec;	i->outc->f.compressionType = d->trk->f.compressionType;}_AFmoduleinst _AFg711initcompress (_Track *trk, AFvirtualfile *fh, bool seekok,	bool headerless, AFframecount *chunkframes){	_AFmoduleinst ret = _AFnewmodinst(&g711compress);	g711_data *d;	d = (g711_data *) _af_malloc(sizeof (g711_data));	d->trk = trk;	d->fh = fh;	d->seekok = seekok;	d->trk->fpos_next_frame = d->trk->fpos_first_frame;	ret.modspec = d;	return ret;}static void g711run_push (_AFmoduleinst *i){	g711_data *d = (g711_data *)i->modspec;	AFframecount frames2write = i->inc->nframes;	AFframecount samps2write = i->inc->nframes * i->inc->f.channelCount;	int framesize = sizeof (g711samp) * (i->inc->f.channelCount);	AFframecount nfr;	assert(d->trk->f.compressionType == AF_COMPRESSION_G711_ULAW ||		d->trk->f.compressionType == AF_COMPRESSION_G711_ALAW);	/* Compress frames into i->outc. */	if (d->trk->f.compressionType == AF_COMPRESSION_G711_ULAW)		linear2ulaw_buf(i->inc->buf, i->outc->buf, samps2write);	else		linear2alaw_buf(i->inc->buf, i->outc->buf, samps2write);	/* Write the compressed data. */	nfr = af_fwrite(i->outc->buf, framesize, frames2write, d->fh);	CHNK(printf("writing %d frames to g711 file\n", frames2write));	if (nfr != frames2write)	{		/* report error if we haven't already */		if (d->trk->filemodhappy)		{			/* i/o error */			if (nfr < 0)				_af_error(AF_BAD_WRITE,					"unable to write data (%s) -- "					"wrote %d out of %d frames",					strerror(errno),					d->trk->nextfframe + nfr,					d->trk->nextfframe + frames2write);			/* usual disk full error */			else				_af_error(AF_BAD_WRITE,					"unable to write data (disk full) -- "					"wrote %d out of %d frames",					d->trk->nextfframe + nfr,					d->trk->nextfframe + frames2write);			d->trk->filemodhappy = AF_FALSE;		}	}	d->trk->nextfframe += nfr;	d->trk->totalfframes = d->trk->nextfframe;	d->trk->fpos_next_frame += (nfr>0) ? nfr*framesize : 0;	assert(!d->seekok || (af_ftell(d->fh) == d->trk->fpos_next_frame));}static void g711sync1 (_AFmoduleinst *i){	g711_data *d = (g711_data *)i->modspec;	d->saved_fpos_next_frame = d->trk->fpos_next_frame;	d->saved_nextfframe = d->trk->nextfframe;}static void g711sync2 (_AFmoduleinst *i){	g711_data *d = (g711_data *) i->modspec;	/* sanity check. */	assert(!d->seekok || (af_ftell(d->fh) == d->trk->fpos_next_frame));	/* We can afford to do an lseek just in case because sync2 is rare. */	d->trk->fpos_after_data = af_ftell(d->fh);	d->trk->fpos_next_frame = d->saved_fpos_next_frame;	d->trk->nextfframe = d->saved_nextfframe;}static void g711decompressdescribe(_AFmoduleinst *i){/*	XXXmpruett this is probably the correct way to go, but other things	need to be changed first.	i->outc->f.byteOrder = _AF_BYTEORDER_NATIVE;*/	i->outc->f.compressionType = AF_COMPRESSION_NONE;	i->outc->f.compressionParams = AU_NULL_PVLIST;}_AFmoduleinst _AFg711initdecompress (_Track *trk, AFvirtualfile *fh,	bool seekok, bool headerless, AFframecount *chunkframes){	_AFmoduleinst ret = _AFnewmodinst(&g711decompress);	g711_data *d;	d = (g711_data *) _af_malloc(sizeof(g711_data));	d->trk = trk;	d->fh = fh;	d->seekok = seekok;	d->trk->f.compressionParams = AU_NULL_PVLIST;	d->trk->frames2ignore = 0;	d->trk->fpos_next_frame = d->trk->fpos_first_frame;	ret.modspec = d;	return ret;}static void g711run_pull (_AFmoduleinst *i){	g711_data *d = (g711_data *) i->modspec;	AFframecount frames2read = i->outc->nframes;	AFframecount samps2read = i->outc->nframes * i->outc->f.channelCount;	int framesize = sizeof (g711samp) * (i->outc->f.channelCount);	AFframecount nfr;	/* Read the compressed frames. */	nfr = af_fread(i->inc->buf, framesize, frames2read, d->fh);	/* Decompress into i->outc. */	if (d->trk->f.compressionType == AF_COMPRESSION_G711_ULAW)		ulaw2linear_buf(i->inc->buf, i->outc->buf, samps2read);	else		alaw2linear_buf(i->inc->buf, i->outc->buf, samps2read);	CHNK(printf("reading %d frames from g711 file (got %d)\n",		frames2read, nfr));	d->trk->nextfframe += nfr;	d->trk->fpos_next_frame += (nfr>0) ? nfr*framesize : 0;	assert(!d->seekok || (af_ftell(d->fh) == d->trk->fpos_next_frame));	/*		If we got EOF from read, then we return the actual amount read.		Complain only if there should have been more frames in the file.	*/	if (d->trk->totalfframes != -1 && nfr != frames2read)	{		/* Report error if we haven't already */		if (d->trk->filemodhappy)		{			_af_error(AF_BAD_READ,				"file missing data -- read %d frames, should be %d",				d->trk->nextfframe,				d->trk->totalfframes);			d->trk->filemodhappy = AF_FALSE;		}	}	i->outc->nframes = nfr;}static void g711reset1 (_AFmoduleinst *i){#ifdef DONE	g711_data *d = (g711_data *) i->modspec;#endif	/* This function is supposed to be empty to fit into design. */}static void g711reset2 (_AFmoduleinst *i){	g711_data *d = (g711_data *) i->modspec;	int framesize = sizeof (g711samp) * (i->inc->f.channelCount);	d->trk->fpos_next_frame =	d->trk->fpos_first_frame  +  framesize * d->trk->nextfframe;	d->trk->frames2ignore = 0;}static _AFmodule g711compress ={	"g711compress",	g711compressdescribe,	AF_NULL, AF_NULL,	AF_NULL, AF_NULL, AF_NULL,	g711run_push, g711sync1, g711sync2,	AF_NULL,	_AFfreemodspec};static _AFmodule g711decompress ={	"g711decompress",	g711decompressdescribe,	AF_NULL, AF_NULL,	g711run_pull, g711reset1, g711reset2,	AF_NULL, AF_NULL, AF_NULL,	AF_NULL,	_AFfreemodspec};

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品久久久久一区| 久久99精品视频| 国产精品视频在线看| 久久亚区不卡日本| 精品国产伦一区二区三区观看方式| 欧美二区乱c少妇| 欧美精品一二三四| 欧美丰满一区二区免费视频| 91福利视频在线| 欧美色涩在线第一页| 欧美日韩免费一区二区三区| 欧美日韩免费观看一区二区三区 | 久久成人免费网| 免费人成在线不卡| 蜜臀av一级做a爰片久久| 秋霞影院一区二区| 国内成人精品2018免费看| 国产成人在线观看免费网站| 成人av网在线| 色婷婷久久久综合中文字幕| 欧美日韩电影一区| 久久综合成人精品亚洲另类欧美 | 91精品国产色综合久久不卡蜜臀| 欧美一级理论片| 久久久久久久久久久久久久久99 | 久久97超碰色| 99国产精品久久久久久久久久| 色老汉一区二区三区| 日韩视频一区二区在线观看| 久久综合九色综合欧美98| 中文字幕中文在线不卡住| 亚洲午夜久久久久| 国产综合久久久久影院| 99久久精品国产精品久久| 欧美日韩亚洲综合一区二区三区| 欧美www视频| 亚洲私人影院在线观看| 日本欧美在线观看| 99视频有精品| 日韩视频一区二区三区在线播放| 国产精品素人视频| 首页亚洲欧美制服丝腿| 高清shemale亚洲人妖| 欧美日韩中文字幕一区| 久久久精品日韩欧美| 亚洲资源在线观看| 国产一区三区三区| 欧美主播一区二区三区| 欧美激情综合五月色丁香| 日本最新不卡在线| 高清成人免费视频| 欧美大度的电影原声| 亚洲美女免费在线| 国产精品12区| 日韩精品一区国产麻豆| 亚洲精品福利视频网站| 国产一区二区三区免费看| 欧美日韩中文字幕一区| 亚洲另类在线视频| 国产91丝袜在线播放| 欧美精品在线一区二区| 亚洲最新视频在线观看| 国产精品自在在线| 91精品国产一区二区三区香蕉| 国产精品久久久久久久久果冻传媒| 亚洲高清免费视频| 91在线免费播放| 中文字幕视频一区二区三区久| 国产成人亚洲精品青草天美| 日韩一区二区免费视频| 五月婷婷欧美视频| 欧美日韩一区二区三区在线 | 天堂影院一区二区| 91浏览器在线视频| 国产精品久久久久久久久久久免费看 | 国产精品1区二区.| 日韩午夜av一区| 免费观看日韩电影| 欧美精品久久99久久在免费线| 亚洲国产精品麻豆| 欧美精品一二三| 丝袜亚洲另类丝袜在线| 91麻豆精品国产自产在线 | 日韩精品最新网址| 美女网站视频久久| 日韩午夜在线观看| 国模无码大尺度一区二区三区| 精品欧美久久久| 国产专区综合网| 欧美韩日一区二区三区四区| 国产91精品入口| 最新热久久免费视频| 91麻豆精品在线观看| 亚洲品质自拍视频| 在线精品亚洲一区二区不卡| 午夜一区二区三区视频| 91精品国产色综合久久ai换脸 | 蜜臀av一级做a爰片久久| 日韩一区二区在线播放| 麻豆精品一二三| 亚洲国产高清在线观看视频| 91久久国产综合久久| 免费不卡在线观看| 国产亚洲自拍一区| 色婷婷激情综合| 日韩高清不卡一区二区| 久久精品一区四区| 在线观看欧美日本| 理论电影国产精品| 国产精品久久毛片| 欧美日韩精品一区二区在线播放| 精品一区在线看| 亚洲日本欧美天堂| 日韩一区二区免费在线电影| 国产mv日韩mv欧美| 日韩国产高清影视| 中文字幕亚洲在| 日韩欧美一区二区免费| 91美女片黄在线| 久久99精品国产.久久久久久| 亚洲人成影院在线观看| 欧美videossexotv100| 欧美性色欧美a在线播放| 精品一区二区三区久久| 亚洲第一综合色| 中文字幕中文字幕在线一区| 日韩美女一区二区三区| 在线视频国产一区| 国产成+人+日韩+欧美+亚洲| 午夜精品久久久久久不卡8050| 国产女主播视频一区二区| 欧美一级艳片视频免费观看| 菠萝蜜视频在线观看一区| 激情欧美日韩一区二区| 午夜欧美视频在线观看| 亚洲欧美另类小说| 欧美激情一区二区| 国产区在线观看成人精品 | 日本亚洲三级在线| 亚洲一区电影777| 国产精品福利一区| 久久久久久久网| 精品少妇一区二区三区在线播放| 欧美午夜精品一区| 91麻豆免费在线观看| 不卡高清视频专区| 国产传媒日韩欧美成人| 久久国产福利国产秒拍| 石原莉奈一区二区三区在线观看| 亚洲一区二区在线观看视频 | 久久综合久久综合久久| 日韩一区二区三区精品视频| 欧美日韩免费视频| 欧美日产在线观看| 欧美酷刑日本凌虐凌虐| 欧美日韩精品免费观看视频| 一本色道久久综合亚洲91| 91在线小视频| 欧美在线三级电影| 欧美乱妇20p| 欧美一区二区国产| 亚洲精品一区二区三区蜜桃下载| 日韩手机在线导航| 久久久久久免费毛片精品| 国产亚洲精品免费| 中文字幕制服丝袜一区二区三区 | 亚洲国产精品尤物yw在线观看| 香蕉成人啪国产精品视频综合网| 五月天网站亚洲| 久久精品国产精品亚洲综合| 久久99久久99| 丁香亚洲综合激情啪啪综合| aaa欧美大片| 在线观看日产精品| 日韩免费一区二区三区在线播放| 精品日韩欧美在线| 中文无字幕一区二区三区 | 欧美喷水一区二区| 337p粉嫩大胆色噜噜噜噜亚洲| 国产亚洲人成网站| 国产精品久久久久久久第一福利| 怡红院av一区二区三区| 性做久久久久久| 国产一区二区美女诱惑| 99久久久国产精品| 欧美精品久久99久久在免费线| 日韩免费一区二区| 亚洲欧美偷拍卡通变态| 石原莉奈一区二区三区在线观看| 国产传媒日韩欧美成人| 欧洲精品在线观看| 精品嫩草影院久久| 一区二区三区欧美激情| 精品一二三四在线| 91蝌蚪porny| 26uuu国产一区二区三区| 亚洲精品第一国产综合野| 精品一区二区久久| 欧美日韩高清一区二区| 中文字幕在线一区|