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

📄 testim.c

📁 ADI BF535 DSP 图象直方图计算汇编优化源码
💻 C
字号:
/*******************************************************************************
Copyright(c) 2000 - 2002 Analog Devices. All Rights Reserved.
Developed by Joint Development Software Application Team, IPDC, Bangalore, India
for Blackfin DSPs  ( Micro Signal Architecture 1.0 specification).

By using this module you agree to the terms of the Analog Devices License
Agreement for DSP Software. 
********************************************************************************
  Purpose     : This function tests the Histogram Equalization function using an image data.
                 
******************************************************************************/ 
#include <stdio.h>
#include <math.h>

#define INSIZE 65536
#define ROW 256
#define COL 256

segment ("data1") unsigned char PtrInput[INSIZE];
segment ("data1") unsigned char PtrOutput[INSIZE];


extern void _hist_eq(unsigned char* PtrInput,unsigned char* PtrOutput,int nTotalPixel, short nBins);


FILE *ptr, *ptr1;

main (void)
{
    short nBins=256;

    int nTotalPixel;


    ptr = fopen("baboon256.dat", "rb");

    if(ptr == NULL)
    {
        printf("unable to open input file ptr\n");
    }

    ptr1 = fopen("hist_trial.dat", "wb");


    if(ptr1 == NULL)
    {
        printf("unable to open output file ptr\n");
    }


    nTotalPixel = ROW * COL;

    fread(PtrInput, sizeof(unsigned char), nTotalPixel, ptr);

     _hist_eq(PtrInput, PtrOutput, nTotalPixel, nBins);

    fwrite(PtrOutput, sizeof(unsigned char),nTotalPixel,ptr1);

   fclose(ptr1);
   fclose(ptr);
}

⌨️ 快捷键说明

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