test_ztw_mpeg4.c
来自「ADI BF535 DSP MPEG4嵌入式零树ZTW汇编优化源码」· C语言 代码 · 共 74 行
C
74 行
/*******************************************************************************
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 : test_ztw_mpeg4.c
Description : This function tests the zerotree scanning asm
function. The width, height and no. of decomposition
levels can be set by the user. It fills the input
quantized image with uniformly distributed random nos. whose
prob. of being zero is 9/10.
*******************************************************************************/
#include<stdio.h>
#include<stdlib.h>
#include "tztw_mpeg4.h"
int error_flag = 0;
int (*f1)();
int cycle_count[10];
int _ztw_mpeg4(int levels,int width,int height,unsigned char q_image[],
unsigned char ztmap[],char out_bitstream[],int offsets[]);
void main()
{
int i, j, k, cnt, temp_rand, coord, temp_i, temp_j;
int offsets[17];
float temp_float_var;
short *output_bitstream;
f1 = _ztw_mpeg4;
//Test Case 1
width=64;
height=64;
levels=2;
// The array containing the output bitstream
output_bitstream=(short *)calloc(width*height/2,sizeof(short));
out_bitstream=(char *)&output_bitstream[0];
stream_cnt =_ztw_mpeg4(levels,width,height,q_image,ztmap,out_bitstream,
offsets);
cycle_count[0] = Compute_Cycle_Count(levels,width,height,q_image,ztmap,
out_bitstream,offsets);
//This function inturn calls _ztw_mpeg4()
if(stream_cnt_exp!=stream_cnt)
{
error_flag = error_flag | 1;
}
for( i = 0 ; i < stream_cnt ; i++)
{
if(out_bitstream_exp[i]!=out_bitstream[i])
{
error_flag = error_flag | 1;
}
}
#ifdef PRINTF_SUPPORT
if(error_flag & 1)
printf("Test Case 1 failed\n");
else
printf("Test Case 1 passed\n");
#endif
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?