⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.c

📁 TMS320VC55XX图像处理程序
💻 C
字号:
#include<stdio.h>  
#include<imagelib.h> 
#include"test.h" // hold test data
short PIBlock[612]; // output result 

#pragma DATA_SECTION(searchWindowAlign0,"search_window");  
#pragma DATA_SECTION(searchWindowAlign1,"search_window");  
#pragma DATA_SECTION(searchWindowAlign2,"search_window");  
#pragma DATA_SECTION(searchWindowAlign3,"search_window");  
#pragma DATA_SECTION(PIBlock,"dst_block");  
// refx(x=0,1,2,3) holds the expected result for test.
#pragma DATA_SECTION(ref0,"ref_block");
#pragma DATA_SECTION(ref1,"ref_block");
#pragma DATA_SECTION(ref2,"ref_block");
#pragma DATA_SECTION(ref3,"ref_block");


void main()
{
   int i;
   int offset;  // offset of the searchBlock for the base of searchwIndow
   short alignV; // alignment parameter =0,1,2,3
   int error; // test error
  
  alignV=0;
  offset=0x1BC; 
  IMG_pix_inter_16x16(searchWindowAlign0,PIBlock,offset,alignV);
  
  //result test
  error=0;
  for(i=0;i<612;i++) 
   if(PIBlock[i]!=ref0[i]) error+=1;
  
  //result test
  alignV=1;
  offset=0x172;
  IMG_pix_inter_16x16(searchWindowAlign1,PIBlock,offset,alignV);
  
  //result test
    error=0;
  for(i=0;i<612;i++) 
   if(PIBlock[i]!=ref1[i]) error+=1;
  
   alignV=2;
   offset=0x1BC;
   IMG_pix_inter_16x16(searchWindowAlign2,PIBlock,offset,alignV);
  
  //result test
    error=0;
  for(i=0;i<612;i++) 
   if(PIBlock[i]!=ref2[i]) error+=1;
 
   alignV=3;
   offset=0x16E; 
   IMG_pix_inter_16x16(searchWindowAlign3,PIBlock,offset,alignV);
 //result test
       error=0;
   for(i=0;i<612;i++) 
    if(PIBlock[i]!=ref3[i]) error+=1;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -