Ecshop中插件icoolmedia的相關(guān)算法_第1頁
Ecshop中插件icoolmedia的相關(guān)算法_第2頁
Ecshop中插件icoolmedia的相關(guān)算法_第3頁
Ecshop中插件icoolmedia的相關(guān)算法_第4頁
Ecshop中插件icoolmedia的相關(guān)算法_第5頁
已閱讀5頁,還剩5頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(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. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論