📄 tr8x8dct.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.
********************************************************************************
File name : tr8x8dct.c
Description : This is the test file for the testing of functionality of
of forward 8x8 DCT.
*******************************************************************************/
#include <stdio.h>
#include "tr8x8dct.h"
/*
All the buffers input, temp and coeff are allocated here. The alignment for
4096 gaurantees for the different memory bank.
*/
int error_flag = 0;
void (*f1)();
int cycle_count[10];
void _r8x8dct();
void main (void)
{
int n, i, j, error;
f1 = _r8x8dct;
n = 8;
//Test case 1 : when all the input values are set to zero.
for(i=0; i<64; i++)
in[i] = zero_in;
cycle_count[0] = Compute_Cycle_Count(in, coeff,temp);
//This function inturn calls r8x8dct()
for (i = 0; i < 64; i++)
{
if (in[i] != 0)
{
error_flag = error_flag | 1;
break;
}
}
//Test case 2 : when there is an impulse value of 255.
for(i=0; i<64; i++)
in[i] = zero_in;
in[0] = const_data1;
cycle_count[1] = Compute_Cycle_Count(in, coeff,temp);
//This function inturn calls r8x8dct()
for (i = 0; i < 64; i++)
{
error = in[i] - Testcase2_out[i];
if (abs(error) > 1)
{
error_flag = error_flag | 2;
break;
}
}
//Test case 3 : when all the input value are set to 25 (DC).
for(i=0; i<64; i++)
in[i] = const_data2;
cycle_count[2] = Compute_Cycle_Count(in, coeff,temp);
//This function inturn calls r8x8dct()
for (i = 0; i < 64; i++)
{
error = in[i] - Testcase3_out[i];
if (abs(error) > 1)
{
error_flag = error_flag | 4;
break;
}
}
//Test Case 4 : when the input is multifrequency.
for(i=0; i<64; i++)
in[i] = Testcase4_In[i];
cycle_count[3] = Compute_Cycle_Count(in, coeff,temp);
//This function inturn calls r8x8dct()
for (i = 0; i < 64; i++)
{
error = in[i] - Testcase4_out[i];
if (abs(error) > 4)
{
error_flag = error_flag | 8;
break;
}
}
#ifdef PRINTF_SUPPORT
if(error_flag & 1)
printf("Test Case 1 failed\n");
else
printf("Test Case 1 passed\n");
if(error_flag & 2)
printf("Test Case 2 failed\n");
else
printf("Test Case 2 passed\n");
if(error_flag & 4)
printf("Test Case 3 failed\n");
else
printf("Test Case 3 passed\n");
if(error_flag & 8)
printf("Test Case 4 failed\n");
else
printf("Test Case 4 passed\n");
#endif
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -