多階Harr小波轉換 有更快的寫法嗎 |
尚未結案
|
swindler
一般會員 發表:13 回覆:22 積分:17 註冊:2003-01-08 發送簡訊給我 |
小弟友執行效率上的困惱 想請問各位大大有更精簡的寫法嗎
//主程式 多階Harr void DWTImage_Haar(short int **img,int Height,int Width,int Layer) { for(int i=0;i<Layer;i ) { HOR_SD_Short(img,Height,Width); VER_SD_Short(img,Height,Width); Height = Height >> 1; Width = Width >> 1; } } //--------2D horizontal sub-band decomposition // img: input image // Height: image height; N: image width N even; static void HOR_SD_Short(short int **img,int Height,int N) { short int *y=NULL, *x=NULL; /* allocate memory for y */ int size=N*sizeof(short int); if ((y = (short int *) malloc(size)) == NULL) { printf("Not enough memory to allocate buffer\n"); exit(1); /* terminate program if out of memory */ } register int i=0,j=0,k=0; int h=N>>1; for(k=0;k承蒙指教 不勝感激 |
pwipwi
版主 發表:68 回覆:629 積分:349 註冊:2004-04-08 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |