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

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

?? sec-2.h

?? This a SOFTWARE pbx DRIVER
?? H
字號:
/* * SpanDSP - a series of DSP components for telephony * * echo.c - An echo cancellor, suitable for electrical and acoustic *	    cancellation. This code does not currently comply with *	    any relevant standards (e.g. G.164/5/7/8). One day.... * * Written by Steve Underwood <steveu@coppice.org> * * Copyright (C) 2001 Steve Underwood * * Based on a bit from here, a bit from there, eye of toad, * ear of bat, etc - plus, of course, my own 2 cents. * * All rights reserved. * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * *//* TODO:   Finish the echo suppressor option, however nasty suppression may be   Add an option to reintroduce side tone at -24dB under appropriate conditions.   Improve double talk detector (iterative!)*/#ifndef _ZAPTEL_SEC_H#define _ZAPTEL_SEC_H#ifdef __KERNEL__#include <linux/kernel.h>#include <linux/slab.h>#define MALLOC(a) kmalloc((a), GFP_KERNEL)#define FREE(a) kfree(a)#else#include <stdlib.h>#include <unistd.h>#include <stdint.h>#include <string.h>#define MALLOC(a) malloc(a)#define FREE(a) free(a)#endif#include "fir.h"#ifndef NULL#define NULL 0#endif#ifndef FALSE#define FALSE 0#endif#ifndef TRUE#define TRUE (!FALSE)#endif#define NONUPDATE_DWELL_TIME	600 	/* 600 samples, or 75ms */typedef struct{    int tx_power;    int rx_power;    int clean_rx_power;    int rx_power_threshold;    int nonupdate_dwell;    fir16_state_t fir_state;    int16_t *fir_taps16;	/* 16-bit version of FIR taps */    int32_t *fir_taps32;	 /* 32-bit version of FIR taps */    int curr_pos;	    int taps;    int tap_mask;    int use_nlp;    int use_suppressor;        int32_t supp_test1;    int32_t supp_test2;    int32_t supp1;    int32_t supp2;    int32_t latest_correction;  /* Indication of the magnitude of the latest    				   adaption, or a code to indicate why adaption				   was skipped, for test purposes */} echo_can_state_t;static echo_can_state_t *echo_can_create(int len, int adaption_mode);static void echo_can_free(echo_can_state_t *ec);static int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t rx);/* * According to Jim... */#define MIN_TX_POWER_FOR_ADAPTION   512#define MIN_RX_POWER_FOR_ADAPTION   64/* * According to Steve... *//* #define MIN_TX_POWER_FOR_ADAPTION 4096#define MIN_RX_POWER_FOR_ADAPTION 64 */static inline echo_can_state_t *echo_can_create(int len, int adaption_mode){    echo_can_state_t *ec;    void *ptr;        ptr = ec = (echo_can_state_t *) MALLOC(sizeof(*ec) + len * sizeof(int32_t) +						   len * sizeof(int16_t));    if (ec == NULL)    	return  NULL;    memset(ec, 0, sizeof(*ec) + len * sizeof(int32_t) + len * sizeof(int16_t));    ec->taps = len;    ec->curr_pos = len - 1;    ec->tap_mask = len - 1;    ec->fir_taps32 = (int32_t *) (ptr + sizeof(*ec));    ec->fir_taps16 = (int16_t *) (ptr + sizeof(*ec) + len * sizeof(int32_t));    /* Create FIR filter */    fir16_create(&ec->fir_state, ec->fir_taps16, ec->taps);    ec->rx_power_threshold = 10000000;    ec->use_suppressor = FALSE;    /* Non-linear processor - a fancy way to say "zap small signals, to avoid       accumulating noise". */    ec->use_nlp = FALSE;    return  ec;}/*- End of function --------------------------------------------------------*/static inline void echo_can_free(echo_can_state_t *ec){    fir16_free(&ec->fir_state);    FREE(ec);}/*- End of function --------------------------------------------------------*/static inline int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t rx){    int offset1;    int offset2;    int32_t echo_value;    int clean_rx;    int nsuppr;    int i;    int correction;    /* Evaluate the echo - i.e. apply the FIR filter */    /* Assume the gain of the FIR does not exceed unity. Exceeding unity       would seem like a rather poor thing for an echo cancellor to do :)       This means we can compute the result with a total disregard for       overflows. 16bits x 16bits -> 31bits, so no overflow can occur in       any multiply. While accumulating we may overflow and underflow the       32 bit scale often. However, if the gain does not exceed unity,       everything should work itself out, and the final result will be       OK, without any saturation logic. */    /* Overflow is very much possible here, and we do nothing about it because       of the compute costs */    /* 16 bit coeffs for the LMS give lousy results (maths good, actual sound       bad!), but 32 bit coeffs require some shifting. On balance 32 bit seems       best */    echo_value = fir16 (&ec->fir_state, tx);    /* And the answer is..... */    clean_rx = rx - echo_value;    /* That was the easy part. Now we need to adapt! */    if (ec->nonupdate_dwell > 0)    	ec->nonupdate_dwell--;    /* If there is very little being transmitted, any attempt to train is       futile. We would either be training on the far end's noise or signal,       the channel's own noise, or our noise. Either way, this is hardly good       training, so don't do it (avoid trouble). */    /* If the received power is very low, either we are sending very little or       we are already well adapted. There is little point in trying to improve       the adaption under these circumstanceson, so don't do it (reduce the       compute load). */    if (ec->tx_power > MIN_TX_POWER_FOR_ADAPTION    	&&	ec->rx_power > MIN_RX_POWER_FOR_ADAPTION)    {    	/* This is a really crude piece of decision logic, but it does OK	   for now. */    	if (ec->tx_power > 2*ec->rx_power)	{            /* There is no far-end speech detected */            if (ec->nonupdate_dwell == 0)	    {	    	/* ... and we are not in the dwell time from previous speech. */		//nsuppr = saturate((clean_rx << 16)/ec->tx_power);		nsuppr = clean_rx >> 3;		/* Update the FIR taps */                offset2 = ec->curr_pos + 1;                offset1 = ec->taps - offset2;		ec->latest_correction = 0;                for (i = ec->taps - 1;  i >= offset1;  i--)		{		    correction = ec->fir_state.history[i - offset1]*nsuppr;                    /* Leak to avoid false training on signals with multiple                       strong correlations. */                    ec->fir_taps32[i] -= (ec->fir_taps32[i] >> 12);		    ec->fir_taps32[i] += correction;		    ec->fir_state.coeffs[i] = ec->fir_taps32[i] >> 15;		    ec->latest_correction += abs(correction);        	}                for (  ;  i >= 0;  i--)		{		    correction = ec->fir_state.history[i + offset2]*nsuppr;                    /* Leak to avoid false training on signals with multiple                       strong correlations. */                    ec->fir_taps32[i] -= (ec->fir_taps32[i] >> 12);		    ec->fir_taps32[i] += correction;                    ec->fir_state.coeffs[i] = ec->fir_taps32[i] >> 15;		    ec->latest_correction += abs(correction);    	    	}    	    }	    else	    {        	ec->latest_correction = -1;    	    }	}	else	{            ec->nonupdate_dwell = NONUPDATE_DWELL_TIME;    	    ec->latest_correction = -2;	}    }    else    {        ec->nonupdate_dwell = 0;        ec->latest_correction = -3;    }    /* Calculate short term power levels using very simple single pole IIRs */    /* TODO: Is the nasty modulus approach the fastest, or would a real       tx*tx power calculation actually be faster? */    ec->tx_power += ((abs(tx) - ec->tx_power) >> 5);    ec->rx_power += ((abs(rx) - ec->rx_power) >> 5);    ec->clean_rx_power += ((abs(clean_rx) - ec->clean_rx_power) >> 5);#if defined(XYZZY)    if (ec->use_suppressor)    {    	ec->supp_test1 += (ec->fir_state.history[ec->curr_pos] - ec->fir_state.history[(ec->curr_pos - 7) & ec->tap_mask]);    	ec->supp_test2 += (ec->fir_state.history[(ec->curr_pos - 24) & ec->tap_mask] - ec->fir_state.history[(ec->curr_pos - 31) & ec->tap_mask]);    	if (ec->supp_test1 > 42  &&  ec->supp_test2 > 42)    	    supp_change = 25;    	else    	    supp_change = 50;    	supp = supp_change + k1*ec->supp1 + k2*ec->supp2;	ec->supp2 = ec->supp1;	ec->supp1 = supp;	clean_rx *= (1 - supp);    }#endif    if (ec->use_nlp  &&  ec->rx_power < 32)    	clean_rx = 0;    /* Roll around the rolling buffer */    if (ec->curr_pos <= 0)    	ec->curr_pos = ec->taps;    ec->curr_pos--;    return  clean_rx;}#if 0static inline int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t rx){    int offset;    int limit;    int32_t echo_value;    int clean_rx;    int nsuppr;    int i;    int correction;    ec->tx_history[ec->curr_pos] = tx;    /* Evaluate the echo - i.e. apply the FIR filter */    /* Assume the gain of the FIR does not exceed unity. Exceeding unity       would seem like a rather poor thing for an echo cancellor to do :)       This means we can compute the result with a total disregard for       overflows. 16bits x 16bits -> 31bits, so no overflow can occur in       any multiply. While accumulating we may overflow and underflow the       32 bit scale often. However, if the gain does not exceed unity,       everything should work itself out, and the final result will be       OK, without any saturation logic. */    /* Overflow is very much possible here, and we do nothing about it because       of the compute costs */    /* 16 bit coeffs for the LMS give lousy results (maths good, actual sound       bad!), but 32 bit coeffs require some shifting. On balance 32 bit seems       best */    offset = ec->curr_pos;    limit = ec->taps - offset;    echo_value = 0;    for (i = 0;  i < limit;  i++)        echo_value += (ec->fir_taps[i] >> 16)*ec->tx_history[i + offset];    offset = ec->taps - ec->curr_pos;    for (  ;  i < ec->taps;  i++)        echo_value += (ec->fir_taps[i] >> 16)*ec->tx_history[i - offset];    echo_value >>= 16;    /* And the answer is..... */    clean_rx = rx - echo_value;    /* That was the easy part. Now we need to adapt! */    if (ec->nonupdate_dwell > 0)    	ec->nonupdate_dwell--;    /* If there is very little being transmitted, any attempt to train is       futile. We would either be training on the far end's noise or signal,       the channel's own noise, or our noise. Either way, this is hardly good       training, so don't do it (avoid trouble). */    /* If the received power is very low, either we are sending very little or       we are already well adapted. There is little point in trying to improve       the adaption under these circumstanceson, so don't do it (reduce the       compute load). */    if (ec->tx_power > MIN_TX_POWER_FOR_ADAPTION    	&&	ec->rx_power > MIN_RX_POWER_FOR_ADAPTION)    {    	/* This is a really crude piece of decision logic, but it does OK	   for now. */    	if (ec->tx_power > 2*ec->rx_power)	{            /* There is no far-end speech detected */            if (ec->nonupdate_dwell == 0)	    {	    	/* ... and we are not in the dwell time from previous speech. */		//nsuppr = saturate((clean_rx << 16)/ec->tx_power);		nsuppr = clean_rx >> 3;		/* Update the FIR taps */    	        offset = ec->curr_pos;    	    	limit = ec->taps - offset;		ec->latest_correction = 0;    	    	for (i = 0;  i < limit;  i++)		{		    correction = ec->tx_history[i + offset]*nsuppr;		    ec->fir_taps[i] += correction;		    //ec->latest_correction += abs(correction);        	}		offset = ec->taps - ec->curr_pos;    		for (  ;  i < ec->taps;  i++)		{		    correction = ec->tx_history[i - offset]*nsuppr;		    ec->fir_taps[i] += correction;		    //ec->latest_correction += abs(correction);    	    	}    	    }	    else	    {        	ec->latest_correction = -3;    	    }	}	else	{            ec->nonupdate_dwell = NONUPDATE_DWELL_TIME;    	    ec->latest_correction = -2;	}    }    else    {        ec->nonupdate_dwell = 0;        ec->latest_correction = -1;    }    /* Calculate short term power levels using very simple single pole IIRs */    /* TODO: Is the nasty modulus approach the fastest, or would a real       tx*tx power calculation actually be faster? */    ec->tx_power += ((abs(tx) - ec->tx_power) >> 5);    ec->rx_power += ((abs(rx) - ec->rx_power) >> 5);    ec->clean_rx_power += ((abs(clean_rx) - ec->clean_rx_power) >> 5);#if defined(XYZZY)    if (ec->use_suppressor)    {    	ec->supp_test1 += (ec->tx_history[ec->curr_pos] - ec->tx_history[(ec->curr_pos - 7) & ec->tap_mask]);    	ec->supp_test2 += (ec->tx_history[(ec->curr_pos - 24) & ec->tap_mask] - ec->tx_history[(ec->curr_pos - 31) & ec->tap_mask]);    	if (ec->supp_test1 > 42  &&  ec->supp_test2 > 42)    	    supp_change = 25;    	else    	    supp_change = 50;    	supp = supp_change + k1*ec->supp1 + k2*ec->supp2;	ec->supp2 = ec->supp1;	ec->supp1 = supp;	clean_rx *= (1 - supp);    }#endif    if (ec->use_nlp  &&  ec->rx_power < 32)    	clean_rx = 0;    /* Roll around the rolling buffer */    ec->curr_pos = (ec->curr_pos + 1) & ec->tap_mask;    return clean_rx;}/*- End of function --------------------------------------------------------*/#endifstatic inline int echo_can_traintap(echo_can_state_t *ec, int pos, short val){	/* Reset hang counter to avoid adjustments after	   initial forced training */	ec->nonupdate_dwell = ec->taps << 1;	if (pos >= ec->taps)		return 1;	ec->fir_taps32[pos] = val << 17;	ec->fir_taps16[pos] = val << 1;	if (++pos >= ec->taps)		return 1;	return 0;}/*- End of file ------------------------------------------------------------*/#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
无吗不卡中文字幕| 欧美国产精品一区二区三区| 国产99久久久国产精品免费看| 日韩伦理免费电影| 精品日韩欧美在线| 欧美日韩亚洲综合| 成人国产亚洲欧美成人综合网| 日韩av一级电影| 亚洲精品高清在线观看| 欧美激情中文字幕| 欧美成人国产一区二区| 欧美日韩三级视频| 97se亚洲国产综合自在线不卡| 国产一区视频在线看| 亚洲成av人影院在线观看网| 亚洲欧美在线aaa| 久久亚洲捆绑美女| 日韩一区二区三区免费看| 91成人免费网站| 波多野结衣在线一区| 国内成+人亚洲+欧美+综合在线 | 久久久久久久精| 日韩欧美第一区| 91福利区一区二区三区| 成人精品亚洲人成在线| 激情av综合网| 国内精品伊人久久久久影院对白| 日韩成人免费电影| 丝袜美腿亚洲一区| 天堂影院一区二区| 丝瓜av网站精品一区二区| 亚洲影院理伦片| 亚洲午夜精品17c| 一区二区三区四区不卡视频| 亚洲精品视频自拍| 又紧又大又爽精品一区二区| 亚洲欧美一区二区在线观看| 一区视频在线播放| 日韩一区在线免费观看| ...xxx性欧美| 一区二区三区色| 亚洲永久精品国产| 日韩精品三区四区| 日本在线播放一区二区三区| 蜜桃久久av一区| 精品一区二区三区免费毛片爱 | 亚洲乱码中文字幕| 一区二区三区在线观看国产| 亚洲精品va在线观看| 亚洲成av人片在线| 日韩国产精品久久久| 蜜臀av一区二区| 国产一区二区不卡| 成人国产精品免费观看| 91蜜桃免费观看视频| 欧美日韩电影一区| 欧美一级片免费看| 久久久五月婷婷| 亚洲欧洲美洲综合色网| 亚洲一区二区影院| 日本不卡123| 丰满亚洲少妇av| 91久久精品一区二区二区| 欧美三级电影网站| 欧美精品一区二区三区四区| 国产精品久久久久影院| 亚洲一区二区av在线| 日韩在线卡一卡二| 国产suv精品一区二区三区| 91片在线免费观看| 欧美精品丝袜中出| 久久久精品人体av艺术| 亚洲一区二区在线免费观看视频| 美腿丝袜一区二区三区| 成人性生交大片免费看在线播放 | 国产精品网曝门| 亚洲专区一二三| 久久99精品一区二区三区三区| 成人一区二区三区视频在线观看| 色天天综合色天天久久| 欧美成人免费网站| 亚洲美女偷拍久久| 久久精品999| 一本色道久久综合亚洲aⅴ蜜桃| 日韩三级视频在线看| 一区二区三区四区不卡视频| 麻豆91小视频| 91麻豆国产精品久久| 日韩精品一区二区三区视频| 亚洲欧美国产三级| 国产一二精品视频| 欧美亚洲综合久久| 国产精品欧美久久久久无广告| 日韩成人午夜电影| 在线亚洲+欧美+日本专区| 2023国产一二三区日本精品2022| 亚洲一区二区三区视频在线播放| 国产精品99久久久久| 欧美一区二区在线观看| 亚洲美女少妇撒尿| 国产精品99精品久久免费| 欧美久久久久久久久久| 亚洲免费观看高清完整版在线观看 | 亚洲最新视频在线播放| 国产成人精品一区二区三区网站观看| 欧美日韩在线三级| 中文字幕亚洲精品在线观看| 久久66热偷产精品| 884aa四虎影成人精品一区| 亚洲女与黑人做爰| 国产成人丝袜美腿| 精品国产伦一区二区三区观看方式 | 欧美色欧美亚洲另类二区| 中文幕一区二区三区久久蜜桃| 久久精品噜噜噜成人av农村| 欧美日韩精品三区| 一区二区在线电影| 99久久婷婷国产综合精品| 久久久久久久网| 精品一区二区三区免费播放| 7777精品伊人久久久大香线蕉超级流畅 | 欧美日韩aaa| 一级女性全黄久久生活片免费| 成人国产一区二区三区精品| 久久免费电影网| 国产一区二区免费看| 日韩欧美你懂的| 免费成人美女在线观看.| 欧美日韩aaaaa| 五月天网站亚洲| 欧美猛男gaygay网站| 亚洲第一狼人社区| 欧美日韩国产中文| 石原莉奈在线亚洲三区| 337p亚洲精品色噜噜狠狠| 午夜av一区二区| 欧美色综合久久| 午夜精品一区二区三区免费视频| 欧美性一级生活| 无吗不卡中文字幕| 欧美videofree性高清杂交| 日韩免费看的电影| 亚洲视频一二三| 欧美日韩情趣电影| 精品国产一区二区三区忘忧草| 91超碰这里只有精品国产| 亚洲成精国产精品女| 色综合久久久久综合| 亚洲综合自拍偷拍| 欧美精品丝袜中出| 久久99精品国产麻豆婷婷| 国产亚洲综合色| www.色精品| 夜夜操天天操亚洲| 日韩西西人体444www| 狠狠色丁香久久婷婷综合丁香| 国产欧美一区二区在线| 99精品视频在线观看| 亚洲无人区一区| 日韩欧美国产综合| 成人的网站免费观看| 亚洲一区二区三区小说| 精品少妇一区二区三区视频免付费| 国产精品99久久久久久久vr| 亚洲精品国产无天堂网2021| 欧美二区乱c少妇| 国产成人一区二区精品非洲| 亚洲人成小说网站色在线| 欧美丰满少妇xxxbbb| 国产一区二区三区高清播放| 亚洲日本乱码在线观看| 欧美久久久久久蜜桃| 风间由美一区二区三区在线观看 | 国产精品网曝门| 欧美日韩国产综合视频在线观看| 精品在线一区二区| 亚洲激情图片小说视频| 日韩欧美一级二级| 色综合色综合色综合色综合色综合| 爽好久久久欧美精品| 欧美韩国日本综合| 欧美肥妇free| 99re在线视频这里只有精品| 日本美女一区二区三区视频| 中文字幕欧美激情| 555www色欧美视频| 97精品国产露脸对白| 蜜臀精品久久久久久蜜臀| 亚洲美女屁股眼交| 欧美精品一区二区高清在线观看| 色婷婷激情综合| 国产精品中文欧美| 婷婷成人综合网| 国产精品美女久久久久久2018| 制服.丝袜.亚洲.另类.中文| av资源网一区| 国产在线视频一区二区三区| 亚洲图片欧美一区| 亚洲色图欧洲色图婷婷| 久久久www成人免费无遮挡大片|