




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、-作者xxxx-日期xxxxEcshop中插件icoolmedia的相關(guān)算法【精品文檔】Ecshop中插件icoolmedia的相關(guān)算法,不同的效果我們想要達到很簡單需要找到一個平衡點,利用代碼結(jié)構(gòu)完成ifndef NS_H,從而達到一個有效利用率的提升。下面就上代碼、 spx_ifft(inHandle-fft_table,inHandle-ft,szAudio); / overlap and add for(i = 0; i frame_size; i+) ioPcmi = inHandle-outbufi + szAudioi; for(i = 0; i frame_size; i+)
2、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 / 本文來自于icoolmedia,相關(guān)算法請參考ifndef NS_H#define NS_H#include Platform.h#ifdef _cplusplusextern C #endiftypedef struct NoiseReduction_t Nois
3、eReduction;NoiseReduction* NoiseReductionCreate(OsInt32 inSampleRate,OsInt32 inFrameSize);void NoiseReductionDestroy(NoiseReduction *inHandle);void NoiseReductionProcess(NoiseReduction *inHandle,OsInt16 *ioPcm);#ifdef _cplusplus#endif#endif文件 Platform.h 6KB /* * Copyright (c) 2013 劉志鵬. All Rights Re
4、served. */#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_) | defined(_MACH_)#define OS_APPLE 3#endif/ Windows syst
5、ems version#define OS_NONE 0 / 錯誤#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#include #include #include #include #include #include #include #ifdef _cplusplus#include #include #include #include
6、#include #include #include #else#include #include #endif#ifdef OS_WINSYS/ for CoInitializeEx#define _WIN32_DCOM/#include /#include #include #include #include #ifndef _MINGW32_#ifdef _cplusplus#include #endif#endif#include #include #include #include #include #elif OS_LINUX#include #include #include #
7、include #include #include #include #include #include #include #include #include #include #include #include #include #elif OS_APPLE/* type defines for all platforms */#else#error No platform defined for OS (Platform.h)#endif Shopnc中對于鏈接器使用代碼是很復(fù)雜的,好多鏈接器的代碼實現(xiàn)功能的同時會大量占用內(nèi)存管理的crp,同時產(chǎn)生crp磁盤碎片,對于這個的利用一直是一個難
8、題,這里舉例一個小功能讓他實現(xiàn)的更加完善。#if _GNUC_ = 4#define likely(x) _builtin_expect(!(x),1)#define unlikely(x) _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
9、_EXTERN _declspec(dllexport)#else#if _GNUC_ = 4#define OS_EXTERN _attribute_(visibility(default)/ 配合鏈接器選項:-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
10、_,_FUNCTION_)/ fprintf(inFile,inFormat# %d:%s - %sn,_VA_ARGS_,_LINE_,_FUNCTION_,_FILE_)#else#define OsLog(inFile,inFormat,.)#endif#endif / PLATFORM_H文件 TestNs.cpp 1KB / 本文來自于icoolmedia,相關(guān)算法QQ交流群為:374737122#include ns.h#include WavReader.h#include WavWriter.h #define OsLog(inFile,inFormat,.) (fprintf
11、,VA_ARGS_)/ fprintf(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); if(nReadLen
12、 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 *pInst = NoiseReductionCreate(nSampleRate
13、,nLen); assert(0 != pInst); bRet = pReader-Open(.帶噪語音.wav); printf(開始降噪.n); int nReadLen = nLen; printf(降噪完成!n); NoiseReductionDestroy(pInst); delete pWriter; delete pReader; return 0;Ecshop代碼發(fā)展中的實現(xiàn)單鏈接做法,下面進行深入代碼分析,所以大家請看代碼結(jié)構(gòu)變化,注意下面列出了所有單鏈表的操作實例:文件 main.c 780B #include #include #include SingleLinkLi
14、stOperator.hint main(int argc, char *argv) /*,需要用個那個操作,請關(guān)閉其他無關(guān)的操作函數(shù)*/ int ret; SLIST *sList = NULL; /*創(chuàng)建單鏈表,輸出-1結(jié)束*/ sList = createSigLinkList(); /*打印單鏈表*/ ret = printSigLinkList(sList); /*在值為20的節(jié)點后添加值為25的節(jié)點*/ ret = insertDataToList(sList,20,25); /*刪除值為20的節(jié)點,沒有就不刪*/ ret = deleteDataToList(sList,20);
15、 /*修改值為20的節(jié)點值為60,沒有就不修改*/ ret = modefyDataToList(sList,20,60); /*逆置單鏈表*/ ret = reverseList(sList); /*打印單鏈表*/ ret = printSigLinkList(sList); /*釋放單鏈表的資源*/ ret = destoryList(sList); return 0;文件 SingleLinkListOperator.h 808B #ifndef _SINGLELINKLIST_H_#define _SINGLELINKLIST_H_#ifdef _cplusplusextern C #
16、endif/單鏈表的數(shù)據(jù)結(jié)構(gòu)struct SLIST int data; struct SLIST *pNext; ;typedef struct SLIST SLIST; /新建單鏈表 SLIST * createSigLinkList(); /打印單鏈表 int printSigLinkList(SLIST *sList); /插入,在x值的節(jié)點后面插入y的節(jié)點 int insertDataToList(SLIST *sList/*in and out*/,int x/*in*/,int y/*in*/); /刪除,刪除x值節(jié)點 int deleteDataToList(SLIST *sL
17、ist/*in and out*/,int x/*in*/); /修改,將x值節(jié)點的data修改為y值 int modefyDataToList(SLIST *sList/*in and out*/,int x/*in*/,int y/*in*/); /釋放單鏈表 int destoryList(SLIST *sList /*in*/); /逆置 int reverseList(SLIST *sList/*in and out*/); #ifdef _cplusplus #endif#endif文件 SingleLinkListOperator.c 4KB #include #include
18、#include SingleLinkListOperator.h /新建單鏈表 SLIST * createSigLinkList() head = (SLIST *)malloc(sizeof(SLIST); printf(Please input a node of data:);int insertDataToList(SLIST *sList/*in and out*/,int x/*in*/,int y/*in*/); /刪除,刪除x值節(jié)點 int deleteDataToList(SLIST *sList/*in and out*/,int x/*in*/); /修改,將x值節(jié)點
19、的data修改為y值 int modefyDataToList(SLIST *sList/*inq and out*/,int x/*in*/,int pNode = (SLIST *)malloc /(sizeof(SLIST); printf(Please input a node of data:);int insertDataToList(SLIST *sList/*in and out*/,int x/*in*/,int y/*in*/); /刪除,刪除x值節(jié)點 int deleteDataToList(SLIST *sList/*in and out*/,int x/*in*/);
20、 /修改,將x值節(jié)點的data修改為y值 int modefyDataToList(SLIST *sList/*inq and out*/,int int data; SLIST *pCur = NULL; /創(chuàng)建頭結(jié)點(空的單鏈表) SLIST *head = NULL; head = (SLIST *)malloc(sizeof(SLIST); head-data = 0; head-pNext = NULL; pCur = head; /接受用戶的輸入節(jié)點數(shù)據(jù) printf(Please input a node of data:); scanf(%d,&data); while(dat
21、a != -1) SLIST *pNode = NULL; pNode = (SLIST *)malloc(sizeof(SLIST); pNode-data = data; pNode-pNext = NULL; pCur-pNext = pNode; pCur = pNode; /接受用戶的輸入節(jié)點數(shù)據(jù) printf(Please input a node of data:); scanf(%d,&data); return head; /打印單鏈表 int printSigLinkList(SLIST *sList) SLIST *pCur = sList-pNext; if( pCur
22、 = NULL) printf(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é)點后面插入y的節(jié)點 ,這些就是代碼ecshop單鏈接的表單處理方式,大家可以做個參考。使用libjpeg開源庫,采用apr的內(nèi)存管理,使用cJSON組裝json數(shù)據(jù),依賴opencv的函數(shù)庫,linux平臺文件 ende
23、code.cpp 14KB #include endecode.hint 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(pBuff, image, len); Get_Feature_
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024-2025學(xué)年下學(xué)期高二語文第二單元A卷
- 推進新型城鎮(zhèn)化的主要戰(zhàn)略
- 高中歷史復(fù)習(xí)課堂的實踐與思考
- 2017-2018學(xué)年化學(xué)蘇教必修2講義專題1微觀結(jié)構(gòu)與物質(zhì)的多樣性專題核心素養(yǎng)整合1
- 廣東省珠海市普通高中2017-2018學(xué)年高一數(shù)學(xué)1月月考試題08
- 2018-2019學(xué)年高中一輪復(fù)習(xí)化學(xué)專題綜合檢測(十一)物質(zhì)結(jié)構(gòu)與性質(zhì)
- 2025年真空管太陽集熱器合作協(xié)議書
- 江蘇省鹽城市阜寧縣三校聯(lián)考2024-2025學(xué)年八年級3月月考道德與法治試題(原卷版+解析版)
- 基于解空間樹的組合測試并行測試算法的研究
- 天津市某二級醫(yī)院2013-2015年糖尿病患者用藥現(xiàn)狀及合理性分析
- 2025年貴州貴安新區(qū)產(chǎn)業(yè)發(fā)展控股集團有限公司招聘筆試參考題庫附帶答案詳解
- 機械制造技術(shù)基礎(chǔ)(課程課件完整版)
- 肇慶市勞動合同
- 電力施工安全技術(shù)交底記錄表
- E4A使用手冊(DOC)
- (民法典版)離婚登記申請受理回執(zhí)單
- 食品質(zhì)量控制管理方案
- ISO9001_2016年[全套]質(zhì)量管理體系文件
- 普通中專畢業(yè)生登記表格模板(共4頁)
- 電子病歷及病歷信息標準化(第五講)
- 鐵路建設(shè)項目工程試驗室管理標準TB104422009
評論
0/150
提交評論