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

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

?? rate.c

?? 優龍2410linux2.6.8內核源代碼
?? C
字號:
/* *  Rate conversion Plug-In *  Copyright (c) 1999 by Jaroslav Kysela <perex@suse.cz> * * *   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 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 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 * */  #include <sound/driver.h>#include <linux/time.h>#include <sound/core.h>#include <sound/pcm.h>#include "pcm_plugin.h"#define SHIFT	11#define BITS	(1<<SHIFT)#define R_MASK	(BITS-1)/* *  Basic rate conversion plugin */typedef struct {	signed short last_S1;	signed short last_S2;} rate_channel_t; typedef void (*rate_f)(snd_pcm_plugin_t *plugin,		       const snd_pcm_plugin_channel_t *src_channels,		       snd_pcm_plugin_channel_t *dst_channels,		       int src_frames, int dst_frames);typedef struct rate_private_data {	unsigned int pitch;	unsigned int pos;	rate_f func;	int get, put;	snd_pcm_sframes_t old_src_frames, old_dst_frames;	rate_channel_t channels[0];} rate_t;static void rate_init(snd_pcm_plugin_t *plugin){	unsigned int channel;	rate_t *data = (rate_t *)plugin->extra_data;	data->pos = 0;	for (channel = 0; channel < plugin->src_format.channels; channel++) {		data->channels[channel].last_S1 = 0;		data->channels[channel].last_S2 = 0;	}}static void resample_expand(snd_pcm_plugin_t *plugin,			    const snd_pcm_plugin_channel_t *src_channels,			    snd_pcm_plugin_channel_t *dst_channels,			    int src_frames, int dst_frames){	unsigned int pos = 0;	signed int val;	signed short S1, S2;	char *src, *dst;	unsigned int channel;	int src_step, dst_step;	int src_frames1, dst_frames1;	rate_t *data = (rate_t *)plugin->extra_data;	rate_channel_t *rchannels = data->channels;#define GET_S16_LABELS#define PUT_S16_LABELS#include "plugin_ops.h"#undef GET_S16_LABELS#undef PUT_S16_LABELS	void *get = get_s16_labels[data->get];	void *put = put_s16_labels[data->put];	signed short sample = 0;		for (channel = 0; channel < plugin->src_format.channels; channel++) {		pos = data->pos;		S1 = rchannels->last_S1;		S2 = rchannels->last_S2;		if (!src_channels[channel].enabled) {			if (dst_channels[channel].wanted)				snd_pcm_area_silence(&dst_channels[channel].area, 0, dst_frames, plugin->dst_format.format);			dst_channels[channel].enabled = 0;			continue;		}		dst_channels[channel].enabled = 1;		src = (char *)src_channels[channel].area.addr + src_channels[channel].area.first / 8;		dst = (char *)dst_channels[channel].area.addr + dst_channels[channel].area.first / 8;		src_step = src_channels[channel].area.step / 8;		dst_step = dst_channels[channel].area.step / 8;		src_frames1 = src_frames;		dst_frames1 = dst_frames;		while (dst_frames1-- > 0) {			if (pos & ~R_MASK) {				pos &= R_MASK;				S1 = S2;				if (src_frames1-- > 0) {					goto *get;#define GET_S16_END after_get#include "plugin_ops.h"#undef GET_S16_END				after_get:					S2 = sample;					src += src_step;				}			}			val = S1 + ((S2 - S1) * (signed int)pos) / BITS;			if (val < -32768)				val = -32768;			else if (val > 32767)				val = 32767;			sample = val;			goto *put;#define PUT_S16_END after_put#include "plugin_ops.h"#undef PUT_S16_END		after_put:			dst += dst_step;			pos += data->pitch;		}		rchannels->last_S1 = S1;		rchannels->last_S2 = S2;		rchannels++;	}	data->pos = pos;}static void resample_shrink(snd_pcm_plugin_t *plugin,			    const snd_pcm_plugin_channel_t *src_channels,			    snd_pcm_plugin_channel_t *dst_channels,			    int src_frames, int dst_frames){	unsigned int pos = 0;	signed int val;	signed short S1, S2;	char *src, *dst;	unsigned int channel;	int src_step, dst_step;	int src_frames1, dst_frames1;	rate_t *data = (rate_t *)plugin->extra_data;	rate_channel_t *rchannels = data->channels;	#define GET_S16_LABELS#define PUT_S16_LABELS#include "plugin_ops.h"#undef GET_S16_LABELS#undef PUT_S16_LABELS	void *get = get_s16_labels[data->get];	void *put = put_s16_labels[data->put];	signed short sample = 0;	for (channel = 0; channel < plugin->src_format.channels; ++channel) {		pos = data->pos;		S1 = rchannels->last_S1;		S2 = rchannels->last_S2;		if (!src_channels[channel].enabled) {			if (dst_channels[channel].wanted)				snd_pcm_area_silence(&dst_channels[channel].area, 0, dst_frames, plugin->dst_format.format);			dst_channels[channel].enabled = 0;			continue;		}		dst_channels[channel].enabled = 1;		src = (char *)src_channels[channel].area.addr + src_channels[channel].area.first / 8;		dst = (char *)dst_channels[channel].area.addr + dst_channels[channel].area.first / 8;		src_step = src_channels[channel].area.step / 8;		dst_step = dst_channels[channel].area.step / 8;		src_frames1 = src_frames;		dst_frames1 = dst_frames;		while (dst_frames1 > 0) {			S1 = S2;			if (src_frames1-- > 0) {				goto *get;#define GET_S16_END after_get#include "plugin_ops.h"#undef GET_S16_END			after_get:				S2 = sample;				src += src_step;			}			if (pos & ~R_MASK) {				pos &= R_MASK;				val = S1 + ((S2 - S1) * (signed int)pos) / BITS;				if (val < -32768)					val = -32768;				else if (val > 32767)					val = 32767;				sample = val;				goto *put;#define PUT_S16_END after_put#include "plugin_ops.h"#undef PUT_S16_END			after_put:				dst += dst_step;				dst_frames1--;			}			pos += data->pitch;		}		rchannels->last_S1 = S1;		rchannels->last_S2 = S2;		rchannels++;	}	data->pos = pos;}static snd_pcm_sframes_t rate_src_frames(snd_pcm_plugin_t *plugin, snd_pcm_uframes_t frames){	rate_t *data;	snd_pcm_sframes_t res;	snd_assert(plugin != NULL, return -ENXIO);	if (frames == 0)		return 0;	data = (rate_t *)plugin->extra_data;	if (plugin->src_format.rate < plugin->dst_format.rate) {		res = (((frames * data->pitch) + (BITS/2)) >> SHIFT);	} else {		res = (((frames << SHIFT) + (data->pitch / 2)) / data->pitch);			}	if (data->old_src_frames > 0) {		snd_pcm_sframes_t frames1 = frames, res1 = data->old_dst_frames;		while (data->old_src_frames < frames1) {			frames1 >>= 1;			res1 <<= 1;		}		while (data->old_src_frames > frames1) {			frames1 <<= 1;			res1 >>= 1;		}		if (data->old_src_frames == frames1)			return res1;	}	data->old_src_frames = frames;	data->old_dst_frames = res;	return res;}static snd_pcm_sframes_t rate_dst_frames(snd_pcm_plugin_t *plugin, snd_pcm_uframes_t frames){	rate_t *data;	snd_pcm_sframes_t res;	snd_assert(plugin != NULL, return -ENXIO);	if (frames == 0)		return 0;	data = (rate_t *)plugin->extra_data;	if (plugin->src_format.rate < plugin->dst_format.rate) {		res = (((frames << SHIFT) + (data->pitch / 2)) / data->pitch);	} else {		res = (((frames * data->pitch) + (BITS/2)) >> SHIFT);	}	if (data->old_dst_frames > 0) {		snd_pcm_sframes_t frames1 = frames, res1 = data->old_src_frames;		while (data->old_dst_frames < frames1) {			frames1 >>= 1;			res1 <<= 1;		}		while (data->old_dst_frames > frames1) {			frames1 <<= 1;			res1 >>= 1;		}		if (data->old_dst_frames == frames1)			return res1;	}	data->old_dst_frames = frames;	data->old_src_frames = res;	return res;}static snd_pcm_sframes_t rate_transfer(snd_pcm_plugin_t *plugin,			     const snd_pcm_plugin_channel_t *src_channels,			     snd_pcm_plugin_channel_t *dst_channels,			     snd_pcm_uframes_t frames){	snd_pcm_uframes_t dst_frames;	rate_t *data;	snd_assert(plugin != NULL && src_channels != NULL && dst_channels != NULL, return -ENXIO);	if (frames == 0)		return 0;#ifdef CONFIG_SND_DEBUG	{		unsigned int channel;		for (channel = 0; channel < plugin->src_format.channels; channel++) {			snd_assert(src_channels[channel].area.first % 8 == 0 &&				   src_channels[channel].area.step % 8 == 0,				   return -ENXIO);			snd_assert(dst_channels[channel].area.first % 8 == 0 &&				   dst_channels[channel].area.step % 8 == 0,				   return -ENXIO);		}	}#endif	dst_frames = rate_dst_frames(plugin, frames);	if (dst_frames > dst_channels[0].frames)		dst_frames = dst_channels[0].frames;	data = (rate_t *)plugin->extra_data;	data->func(plugin, src_channels, dst_channels, frames, dst_frames);	return dst_frames;}static int rate_action(snd_pcm_plugin_t *plugin,		       snd_pcm_plugin_action_t action,		       unsigned long udata ATTRIBUTE_UNUSED){	snd_assert(plugin != NULL, return -ENXIO);	switch (action) {	case INIT:	case PREPARE:		rate_init(plugin);		break;	default:		break;	}	return 0;	/* silenty ignore other actions */}int snd_pcm_plugin_build_rate(snd_pcm_plug_t *plug,			      snd_pcm_plugin_format_t *src_format,			      snd_pcm_plugin_format_t *dst_format,			      snd_pcm_plugin_t **r_plugin){	int err;	rate_t *data;	snd_pcm_plugin_t *plugin;	snd_assert(r_plugin != NULL, return -ENXIO);	*r_plugin = NULL;	snd_assert(src_format->channels == dst_format->channels, return -ENXIO);	snd_assert(src_format->channels > 0, return -ENXIO);	snd_assert(snd_pcm_format_linear(src_format->format) != 0, return -ENXIO);	snd_assert(snd_pcm_format_linear(dst_format->format) != 0, return -ENXIO);	snd_assert(src_format->rate != dst_format->rate, return -ENXIO);	err = snd_pcm_plugin_build(plug, "rate conversion",				   src_format, dst_format,				   sizeof(rate_t) + src_format->channels * sizeof(rate_channel_t),				   &plugin);	if (err < 0)		return err;	data = (rate_t *)plugin->extra_data;	data->get = getput_index(src_format->format);	data->put = getput_index(dst_format->format);	if (src_format->rate < dst_format->rate) {		data->pitch = ((src_format->rate << SHIFT) + (dst_format->rate >> 1)) / dst_format->rate;		data->func = resample_expand;	} else {		data->pitch = ((dst_format->rate << SHIFT) + (src_format->rate >> 1)) / src_format->rate;		data->func = resample_shrink;	}	data->pos = 0;	rate_init(plugin);	data->old_src_frames = data->old_dst_frames = 0;	plugin->transfer = rate_transfer;	plugin->src_frames = rate_src_frames;	plugin->dst_frames = rate_dst_frames;	plugin->action = rate_action;	*r_plugin = plugin;	return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美国产高清| 精品久久一区二区| 亚洲免费伊人电影| 99久久婷婷国产综合精品电影| 国产精品激情偷乱一区二区∴| 福利电影一区二区| 一区二区三区日韩欧美| 欧美在线一区二区三区| 日日噜噜夜夜狠狠视频欧美人 | 国产精品一区二区三区99| 亚洲成在人线在线播放| 精品美女被调教视频大全网站| 久久精品欧美一区二区三区麻豆| 精品制服美女丁香| 国产女同性恋一区二区| 91社区在线播放| 亚洲成a人v欧美综合天堂下载 | 激情综合色综合久久| 久久久久久久久久久久久夜| 99久久伊人网影院| 亚洲福中文字幕伊人影院| 日韩美女一区二区三区四区| 成人免费毛片片v| 午夜免费欧美电影| 国产精品视频你懂的| 欧美日韩美女一区二区| 国产一区二区伦理片| 亚洲精品ww久久久久久p站| 日韩一区二区三区免费看| 成人白浆超碰人人人人| 日本不卡123| 亚洲精品乱码久久久久久久久| 日韩一区二区免费在线电影| 波多野结衣在线aⅴ中文字幕不卡| 亚洲成av人在线观看| 久久精品亚洲精品国产欧美kt∨| 欧美性猛交一区二区三区精品 | 懂色av一区二区三区免费观看| 一区二区三区欧美亚洲| 日韩精品在线网站| 欧美色网一区二区| 豆国产96在线|亚洲| 蜜臀av一级做a爰片久久| 亚洲图片欧美激情| 久久久久久9999| 91精品婷婷国产综合久久性色| 成人视屏免费看| 美女视频一区在线观看| 曰韩精品一区二区| 欧美国产97人人爽人人喊| 日韩视频免费观看高清在线视频| 欧洲另类一二三四区| 成人一区二区三区视频在线观看| 免费成人在线播放| 婷婷综合在线观看| 亚洲影视在线播放| 亚洲卡通动漫在线| 国产精品女主播av| 国产三级精品三级在线专区| 91精品国产综合久久精品麻豆| 91久久精品一区二区| 暴力调教一区二区三区| 高清beeg欧美| 国产福利视频一区二区三区| 国产资源在线一区| 激情深爱一区二区| 九九精品视频在线看| 精品一区二区三区av| 奇米综合一区二区三区精品视频| 亚洲国产综合在线| 亚洲图片欧美视频| 亚洲r级在线视频| www.欧美日韩| 成人视屏免费看| 成人av在线资源网| 91在线观看视频| 一本色道久久综合亚洲aⅴ蜜桃 | 成人av电影免费在线播放| 极品少妇xxxx精品少妇偷拍| 久久狠狠亚洲综合| 国产一区二区在线看| 国产精品18久久久久久vr| 卡一卡二国产精品| 国产精选一区二区三区| 国产成人啪免费观看软件 | 99国产精品久久久久久久久久 | 久久久三级国产网站| 国产亚洲精品免费| 一区精品在线播放| 亚洲男帅同性gay1069| 亚洲精品免费播放| 日韩二区三区在线观看| 久久不见久久见免费视频1| 国内不卡的二区三区中文字幕| 国产揄拍国内精品对白| 成人中文字幕电影| 在线观看一区不卡| 日韩一区二区三区在线| 国产色产综合产在线视频| 亚洲欧美偷拍另类a∨色屁股| 亚洲欧美色一区| 日本视频一区二区三区| 国产麻豆精品95视频| 成人黄色软件下载| 欧美日韩午夜在线| wwwwww.欧美系列| 欧美国产精品一区| 亚洲h动漫在线| 国产成人欧美日韩在线电影| 欧美中文字幕一区二区三区| 日韩欧美一区二区免费| 中文av一区二区| 亚洲国产精品精华液网站| 国精品**一区二区三区在线蜜桃| av成人动漫在线观看| 91精品国产色综合久久不卡蜜臀 | 国产精品久久综合| 亚洲大型综合色站| 国产精品一区在线| 欧美在线观看视频一区二区| 欧美不卡激情三级在线观看| 亚洲少妇最新在线视频| 久久精品国产免费| 在线免费精品视频| 国产三级三级三级精品8ⅰ区| 亚洲一二三四区| 成人听书哪个软件好| 欧美一区二区三区在线电影| 综合av第一页| 国产一区二区视频在线播放| 欧洲另类一二三四区| 国产精品美女久久久久久久| 日本不卡高清视频| 色噜噜久久综合| 欧美国产乱子伦 | 日韩精品亚洲专区| av高清不卡在线| 久久久久久久久久久黄色| 偷拍自拍另类欧美| 在线精品视频一区二区| 日本一二三不卡| 久久97超碰色| 欧美一级日韩免费不卡| 亚洲国产毛片aaaaa无费看| 丁香六月综合激情| 欧美不卡一二三| 日韩高清一区二区| 欧美视频中文一区二区三区在线观看| 蜜臀a∨国产成人精品| 欧美在线999| 亚洲蜜桃精久久久久久久| 国产91高潮流白浆在线麻豆| xfplay精品久久| 久久精品国产久精国产爱| 欧美一区二区福利在线| 日韩在线观看一区二区| 精品视频在线视频| 午夜在线成人av| 欧美在线不卡一区| 亚洲电影一区二区| 欧美日韩不卡一区| 亚洲成人第一页| 欧美日韩一区二区三区免费看 | 亚洲一区二区三区四区中文字幕| 成人av网址在线| 国产精品久久久一本精品 | 伊人婷婷欧美激情| 91在线观看下载| 亚洲欧洲综合另类| 在线日韩一区二区| 天堂午夜影视日韩欧美一区二区| 欧美日韩国产精选| 免费久久精品视频| 精品第一国产综合精品aⅴ| 看电视剧不卡顿的网站| 久久夜色精品国产噜噜av | 六月丁香婷婷色狠狠久久| 欧美日本一区二区在线观看| 日韩在线一区二区| 欧美成人bangbros| 国产69精品久久久久777| 久久久不卡网国产精品二区| 成人午夜av在线| 亚洲欧美国产三级| 欧美精品v国产精品v日韩精品 | 亚洲黄色小视频| 亚洲欧洲韩国日本视频| 91丨九色porny丨蝌蚪| 亚洲综合一区二区三区| 51精品视频一区二区三区| 极品少妇一区二区| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 99精品黄色片免费大全| 一区二区三区视频在线观看| 欧美电影一区二区三区| 黄色精品一二区| 亚洲精品国产a久久久久久 | 日韩一区二区电影网| 国产91露脸合集magnet| 亚洲444eee在线观看|