資源簡介
DSP imlib C64x+ CCS4工程文件 測試函數 sobel 測試圖像 lena 灰度圖512*512

代碼片段和文件信息
#include
#include
#define?BOUNDARY?0
#define?ROWS??512
#define?ROWS1?514
#define?COLS??512
#define?COLS1?514
#define?STEP??514
#define?STEP1?512?
#define?BUFSIZE1?512*512
#define?BUFSIZE2?514*3
#define?BUFSIZE3?514*514
extern?unsigned?char?in_buffer[];
unsigned?char?in_buffer1[BUFSIZE3];???/*ADD?boundary*/
unsigned?char?out_buffer[BUFSIZE1];
unsigned?char?in[BUFSIZE2];
unsigned?char?out[COLS1];
extern?void?IMG_sobel_3x3_8(const?unsigned?char?*in_data?unsigned?char?*out_data?short?cols?short?rows);
void?cpy_img_to_kernel(unsigned?char?*in_datunsigned?char?*out_dat?int?num);
void?add_boundary(unsigned?char?*in_dat?unsigned?char?*out_dat?int?or_rows?int?or_cols);
void?add_result(unsigned?char?*str_in?unsigned?char?*str_out?int?num);
main()
{
clock_t?startoverheadstoptt_boundaryt_initialize;
????
int?i;
unsigned?char?*str_in*str_out*str_i*str_o;
start=clock();
????stop=clock();
????overhead=stop-start;
//====================================Initialize======================================//
start=clock();
printf(“Initialize?out_buffer[];\n“);
for(i=0;i ??out_buffer[i]=0;
printf(“Initialize?in[];\n“);
for(i=0;i ??in[i]=0;
??
printf(“Initialize?in[];\n“);
for(i=0;i ??out[i]=0;
stop=clock();
t_initialize=stop-start-overhead;
printf(“Initialize?finished!?the?time?is?%d\n“t_initialize);
//==================================ADD?BOUNDARY=======================================//
start=clock();
add_boundary(in_buffer?in_buffer1?ROWS?COLS);
stop=clock();
t_boundary?=?stop?-?start?-?overhead;
printf(“Add?boundary?fininsed!?the?time?is?%d\n“t_boundary);
printf(“======Ininalize?fininshed====\n“);
str_in=in_buffer1;
str_out=out_buffer;
str_i=in;
str_o=out;
printf(“Begin?processing!\n“);
//============================================Sobel=======================================///
start=clock();
for(i=0;i {
cpy_img_to_kernel(str_in?str_i?BUFSIZE2);
str_in+=STEP;
str_o=out;
????????IMG_sobel_3x3_8(str_i?str_o?COLS?ROWS);
????????str_o?=?out;
????????str_out?=?out_buffer?+?i*STEP1;
????????add_result(str_o?str_out?COLS);
????????
//????????for(j=0;j //????????{
//???????? *str_out++=*(str_o+1);?
//???????? str_o++;???
//????????
//????????}??
//????????str_out=out_buffer;
//????????str_out+=(i+1)*STEP1;
}
stop=clock();
t=stop-start-overhead;
printf(“Processed?time?=?%d\n“t);
}
/*==============================================================
?*?add_boundary
?*?==============================================================*/
void?add_boundary(unsigned?char?*in_dat?unsigned?char?*out_dat?int?or_rows?int?or_cols)
{
int?ijkl;
int?cols;
cols=or_cols+2;
/*========Add?the?first?row===========*/
for(i=0;i {
*out_dat++=BOUNDARY;
}
/*=======Add?the?begin?and?end?of?eve
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????317??2012-01-05?10:32??IMG_soble_lena\.ccsproject
?????文件???????8333??2012-01-05?15:06??IMG_soble_lena\.cdtbuild
?????文件????????677??2012-01-05?10:32??IMG_soble_lena\.cdtproject
?????文件????????594??2012-01-05?10:32??IMG_soble_lena\.project
?????文件????????640??2012-01-05?14:45??IMG_soble_lena\.settings\org.eclipse.cdt.managedbuilder.core.prefs
?????文件?????????81??2012-01-05?15:22??IMG_soble_lena\Debug\ccsObjs.opt
?????文件?????????28??2012-01-05?15:22??IMG_soble_lena\Debug\ccsSrcs.opt
?????文件??????17029??2012-01-05?15:23??IMG_soble_lena\Debug\IMG_soble_lena.map
?????文件?????422647??2012-01-05?15:23??IMG_soble_lena\Debug\IMG_soble_lena.out
?????文件??????15485??2012-01-05?15:22??IMG_soble_lena\Debug\main.obj
?????文件????????835??2012-01-05?15:23??IMG_soble_lena\Debug\main.pp
?????文件???????3074??2012-01-05?15:22??IMG_soble_lena\Debug\makefile
?????文件????????267??2012-01-05?15:22??IMG_soble_lena\Debug\ob
?????文件???????1637??2012-01-05?15:22??IMG_soble_lena\Debug\sources.mk
?????文件???????1702??2012-01-05?15:22??IMG_soble_lena\Debug\subdir.mk
?????文件?????264710??2012-01-05?15:22??IMG_soble_lena\Debug\test_dat.obj
?????文件?????????59??2012-01-05?15:23??IMG_soble_lena\Debug\test_dat.pp
?????文件?????279202??2011-12-07?17:47??IMG_soble_lena\imglib2.l64P
?????文件?????280610??2011-12-07?17:47??IMG_soble_lena\imglib2_cn.l64P
?????文件???????2889??2012-01-05?14:57??IMG_soble_lena\kernel_test.cmd
?????文件???????4229??2012-01-05?14:44??IMG_soble_lena\main.c
?????文件????9543604??2011-12-07?17:47??IMG_soble_lena\rts64plus.lib
?????文件?????968550??2011-12-21?11:39??IMG_soble_lena\test_dat.c
?????目錄??????????0??2012-01-05?16:55??IMG_soble_lena\.settings
?????目錄??????????0??2012-01-05?16:55??IMG_soble_lena\Debug
?????目錄??????????0??2012-01-05?16:55??IMG_soble_lena
-----------?---------??----------?-----??----
?????????????11817199????????????????????26
- 上一篇:國外超強的網絡修復工具
- 下一篇:progisp166
評論
共有 條評論