




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Ecshop中插件icoolmedia的相關(guān)算法,不同的效果我們想要達(dá)到很簡(jiǎn)單需要找到一個(gè)平衡點(diǎn),利用代碼結(jié)構(gòu)完成ifndef NS_H,從而達(dá)到一個(gè)有效利用率的提升。下面就上代碼、 spx_ifft(inHandle->fft_table,inHandle->ft,szAudio); / overlap and add for(i = 0; i < inHandle->frame_size; i+) ioPcmi = inHandle->outbufi + szAudioi; for(i = 0; i < inHandle->frame_size;
2、i+) inHandle->outbufi = szAudioinHandle->frame_size+i*inHandle->win_gain; / limit value of adapt_count if(inHandle->adapt_count > 16000) inHandle->adapt_count = 2;文件 ns.h 455B / 本文來(lái)自于icoolmedia,相關(guān)算法請(qǐng)參考ifndef NS_H#define NS_H#include "Platform.h"#ifdef _cplusplusextern &qu
3、ot;C" #endiftypedef struct NoiseReduction_t NoiseReduction;NoiseReduction* NoiseReductionCreate(OsInt32 inSampleRate,OsInt32 inFrameSize);void NoiseReductionDestroy(NoiseReduction *inHandle);void NoiseReductionProcess(NoiseReduction *inHandle,OsInt16 *ioPcm);#ifdef _cplusplus#endif#endif文件 Plat
4、form.h 6KB /* * Copyright (c) 2013 劉志鵬. All Rights Reserved. */#ifndef PLATFORM_H#define PLATFORM_H#if defined(_WIN32) | defined(WIN32) | defined(_WIN64)#define OS_WINSYS 1#elif defined(_linux_) | defined(_linuxppc_) | defined(_FreeBSD_)#define OS_LINUX 2#elif defined(_MacOSX_) | defined(_APPLE_) |
5、defined(_MACH_)#define OS_APPLE 3#endif/ Windows system's version#define OS_NONE 0 / 錯(cuò)誤#define OS_WIN2000 1 / Windows 2000#define OS_WINXP 2 / Windows XP#define OS_WINVISTA 3 / Windows Vista#define OS_WIN7 4 / Win7#define OS_WIN8 5 / Win8#define OS_WIN8_1 6 / Win8.1#include <stdio.h>#inclu
6、de <stdlib.h>#include <math.h>#include <memory.h>#include <assert.h>#include <errno.h>#include <stdarg.h>#ifdef _cplusplus#include <string>#include <vector>#include <map>#include <list>#include <deque>#include <algorithm>#includ
7、e <functional>#else#include <string.h>#include <ctype.h>#endif#ifdef OS_WINSYS/ for CoInitializeEx#define _WIN32_DCOM/#include <WinSock2.h>/#include <MSWSock.h>#include <windows.h>#include <mmsystem.h>#include <conio.h>#ifndef _MINGW32_#ifdef _cplusplu
8、s#include <atlbase.h>#endif#endif#include <time.h>#include <io.h>#include <sys/timeb.h>#include <sys/stat.h>#include <fcntl.h>#elif OS_LINUX#include <unistd.h>#include <sys/types.h>#include <semaphore.h>#include <pthread.h>#include <arpa
9、/inet.h>#include <net/if.h>#include <sys/ioctl.h>#include <sys/time.h>#include <sys/socket.h>#include <netinet/in.h>#include <fcntl.h>#include <linux/rtc.h>#include <sys/uio.h>#include <netinet/tcp.h>#include <netdb.h>#include <dlfcn.
10、h>#elif OS_APPLE/* type defines for all platforms */#else#error "No platform defined for OS (Platform.h)"#endif Shopnc中對(duì)于鏈接器使用代碼是很復(fù)雜的,好多鏈接器的代碼實(shí)現(xiàn)功能的同時(shí)會(huì)大量占用內(nèi)存管理的crp,同時(shí)產(chǎn)生crp磁盤碎片,對(duì)于這個(gè)的利用一直是一個(gè)難題,這里舉例一個(gè)小功能讓他實(shí)現(xiàn)的更加完善。#if _GNUC_ >= 4#define likely(x) _builtin_expect(!(x),1)#define unlikely(x)
11、 _builtin_expect(!(x),0)#else#define likely(x) (x)#define unlikely(x) (x)#endif#define OS_INLINE _attribute_(_always_inline_) inline#define OS_NOINLINE _attribute_(noinline)#endif#ifdef OS_WINSYS#define OS_EXTERN _declspec(dllexport)#else#if _GNUC_ >= 4#define OS_EXTERN _attribute_(visibility(&qu
12、ot;default")/ 配合鏈接器選項(xiàng):-fvisibility=hidden#else#define OS_EXTERN / nothing#endif#endif#ifdef OS_DEBUG#define OsLog(inFile,inFormat,.) fprintf(inFile,inFormat,_VA_ARGS_)/ fprintf(inFile,inFormat#" %d:%sn",_VA_ARGS_,_LINE_,_FUNCTION_)/ fprintf(inFile,inFormat#" %d:%s -> %sn"
13、,_VA_ARGS_,_LINE_,_FUNCTION_,_FILE_)#else#define OsLog(inFile,inFormat,.)#endif#endif / PLATFORM_H文件 TestNs.cpp 1KB / 本文來(lái)自于icoolmedia,相關(guān)算法QQ交流群為:374737122#include "ns.h"#include "WavReader.h"#include "WavWriter.h" #define OsLog(inFile,inFormat,.) (fprintf,VA_ARGS_)/ fpr
14、intf(inFile,inFormat#" %d:%sn",_VA_ARGS_,_LINE_,_FUNCTION_)/ fprintf(inFile,inFormat#"int main(int argc,char* argv) OsInt32 nLen = 160; OsInt32 nSampleRate = 8000; WavWriter *pWriter = new WavWriter(); while(nReadLen > 0) short szPcm160 = 0; nReadLen = pReader->Read(szPcm,nLen);
15、 if(nReadLen > 0) NoiseReductionProcess(pInst,szPcm); pWriter->Write(szPcm,nReadLen); assert(true = bRet); assert(0 != pWriter); bool bRet = pWriter->Open(".降噪后.wav",nSampleRate,16,1); assert(true = bRet); assert(0 != pReader); WavReader *pReader = WavReader(); NoiseReduction *pIn
16、st = NoiseReductionCreate(nSampleRate,nLen); assert(0 != pInst); bRet = pReader->Open(".帶噪語(yǔ)音.wav"); printf("開始降噪.n"); int nReadLen = nLen; printf("降噪完成!n"); NoiseReductionDestroy(pInst); delete pWriter; delete pReader; return 0;Ecshop代碼發(fā)展中的實(shí)現(xiàn)單鏈接做法,下面進(jìn)行深入代碼分析,所以大家請(qǐng)看代碼
17、結(jié)構(gòu)變化,注意下面列出了所有單鏈表的操作實(shí)例:文件 main.c 780B #include <stdlib.h>#include <string.h>#include "SingleLinkListOperator.h"int main(int argc, char *argv) /*,需要用個(gè)那個(gè)操作,請(qǐng)關(guān)閉其他無(wú)關(guān)的操作函數(shù)*/ int ret; SLIST *sList = NULL; /*創(chuàng)建單鏈表,輸出-1結(jié)束*/ sList = createSigLinkList(); /*打印單鏈表*/ ret = printSigLinkList(
18、sList); /*在值為20的節(jié)點(diǎn)后添加值為25的節(jié)點(diǎn)*/ ret = insertDataToList(sList,20,25); /*刪除值為20的節(jié)點(diǎn),沒(méi)有就不刪*/ ret = deleteDataToList(sList,20); /*修改值為20的節(jié)點(diǎn)值為60,沒(méi)有就不修改*/ ret = modefyDataToList(sList,20,60); /*逆置單鏈表*/ ret = reverseList(sList); /*打印單鏈表*/ ret = printSigLinkList(sList); /*釋放單鏈表的資源*/ ret = destoryList(sList);
19、return 0;文件 SingleLinkListOperator.h 808B #ifndef _SINGLELINKLIST_H_#define _SINGLELINKLIST_H_#ifdef _cplusplusextern "C" #endif/單鏈表的數(shù)據(jù)結(jié)構(gòu)struct SLIST int data; struct SLIST *pNext; ;typedef struct SLIST SLIST; /新建單鏈表 SLIST * createSigLinkList(); /打印單鏈表 int printSigLinkList(SLIST *sList); /
20、插入,在x值的節(jié)點(diǎn)后面插入y的節(jié)點(diǎn) int insertDataToList(SLIST *sList/*in and out*/,int x/*in*/,int y/*in*/); /刪除,刪除x值節(jié)點(diǎn) int deleteDataToList(SLIST *sList/*in and out*/,int x/*in*/); /修改,將x值節(jié)點(diǎn)的data修改為y值 int modefyDataToList(SLIST *sList/*inq and out*/,int x/*in*/,int y/*in*/); /釋放單鏈表 int destoryList(SLIST *sList /*in
21、*/); /逆置 int reverseList(SLIST *sList/*in and out*/); #ifdef _cplusplus #endif#endif文件 SingleLinkListOperator.c 4KB #include <stdlib.h>#include <string.h>#include "SingleLinkListOperator.h" /新建單鏈表 SLIST * createSigLinkList() head = (SLIST *)malloc(sizeof(SLIST); printf("Pl
22、ease input a node of data:");int insertDataToList(SLIST *sList/*in and out*/,int x/*in*/,int y/*in*/); /刪除,刪除x值節(jié)點(diǎn) int deleteDataToList(SLIST *sList/*in and out*/,int x/*in*/); /修改,將x值節(jié)點(diǎn)的data修改為y值 int modefyDataToList(SLIST *sList/*inq and out*/,int x/*in*/,int pNode = (SLIST *)malloc /(sizeof(S
23、LIST); printf("Please input a node of data:");int insertDataToList(SLIST *sList/*in and out*/,int x/*in*/,int y/*in*/); /刪除,刪除x值節(jié)點(diǎn) int deleteDataToList(SLIST *sList/*in and out*/,int x/*in*/); /修改,將x值節(jié)點(diǎn)的data修改為y值 int modefyDataToList(SLIST *sList/*inq and out*/,int int data; SLIST *pCur =
24、NULL; /創(chuàng)建頭結(jié)點(diǎn)(空的單鏈表) SLIST *head = NULL; head = (SLIST *)malloc(sizeof(SLIST); head->data = 0; head->pNext = NULL; pCur = head; /接受用戶的輸入節(jié)點(diǎn)數(shù)據(jù) printf("Please input a node of data:"); scanf("%d",&data); while(data != -1) SLIST *pNode = NULL; pNode = (SLIST *)malloc(sizeof(S
25、LIST); pNode->data = data; pNode->pNext = NULL; pCur->pNext = pNode; pCur = pNode; /接受用戶的輸入節(jié)點(diǎn)數(shù)據(jù) printf("Please input a node of data:"); scanf("%d",&data); return head; /打印單鏈表 int printSigLinkList(SLIST *sList) SLIST *pCur = sList->pNext; if( pCur = NULL) printf(&q
26、uot;This SingleLinkList is null !n"); return 0; printf("begin: "); while(pCur->pNext != NULL) printf("%d ",pCur->data); pCur = pCur->pNext; printf("%d endn",pCur->data); return 0; /插入,在x值的節(jié)點(diǎn)后面插入y的節(jié)點(diǎn) ,這些就是代碼ecshop單鏈接的表單處理方式,大家可以做個(gè)參考。使用libjpeg開源庫(kù),采用apr的內(nèi)存
27、管理,使用cJSON組裝json數(shù)據(jù),依賴opencv的函數(shù)庫(kù),linux平臺(tái)文件 endecode.cpp 14KB #include "endecode.h"int main(int argc, char *argv) unsigned long long int i;Create_Pool(); /MG_DT_HANDLE handle_start1 = MG_DT_CreateHandle(); /handle_result = MG_DT_CreateResult(NULL); RECT result_rect; char jsondata100 = ""left":269,"top":359,"width":259,"height":259" parseJson(jsondata, &result_rect); for(;) int len = ftell(pFile) char *dst = Detect_Face(0, NULL); delete pBuff; printf("dst json is: %srn", dst); Decode(p
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 學(xué)科培訓(xùn)課件模板圖片
- 肌肉激活技術(shù)課件
- 福田區(qū)中考數(shù)學(xué)試卷
- 波譜分析課件-核磁共振碳譜
- 飛翔四年級(jí)數(shù)學(xué)試卷
- 2025年06月江蘇泰州海陵區(qū)基層醫(yī)療衛(wèi)生單位招聘?jìng)浒钢迫藛T78人筆試歷年專業(yè)考點(diǎn)(難、易錯(cuò)點(diǎn))附帶答案詳解
- 銷售線纜技巧培訓(xùn)課件
- 山東海洋集團(tuán)有限公司招聘和招聘考試真題2024
- 2024年宿州市第二中學(xué)招聘教師筆試真題
- 2024年安康白河縣人民醫(yī)院招聘筆試真題
- 2025年廣東省中考生物試卷真題(含答案解析)
- 第10課+遼夏金元的統(tǒng)治(大概念教學(xué)課件)2024-2025學(xué)年高一歷史上冊(cè)教學(xué)課件(統(tǒng)編版2019)
- 2024年中國(guó)甘肅省能源行業(yè)調(diào)查報(bào)告
- 中國(guó)聚丙烯酰胺行業(yè)市場(chǎng)發(fā)展分析及前景趨勢(shì)與投資研究報(bào)告2025-2028版
- 青年教師教學(xué)工作坊組織計(jì)劃
- 中廣核培訓(xùn)課件
- 百度公司環(huán)境管理制度
- 特殊工時(shí)制管理制度
- 駐非洲員工管理制度
- 統(tǒng)編版三年級(jí)語(yǔ)文下冊(cè)同步高效課堂系列第一單元復(fù)習(xí)課件
- 2025年高考生物真題(安徽)含答案
評(píng)論
0/150
提交評(píng)論