www.pudn.com > Blackfin_Mpeg_2_4.zip > test_arith_encoder_mpeg4.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 : test_arith_encoder_mpeg4.c
Description : This file contains test cases to validate arithmetic encoder for
shape coding (MPEG4)
*******************************************************************************/
#include
#include"bin_ar_code.h"
#include"test_input.h"
int error_flag = 0;
void (*f1)();
void _StartArCoder();
void _arith_encoder_mpeg4();
void _arith_StopArCoder();
void main()
{
int i,j,k,C,D;
int error;
coder=&code;
// test 1;
_StartArCoder(coder,&bit_output[0]) ;
for(i=0;iMAX_PERMISSIBLE_ERROR)
{
error_flag = error_flag | 1;
}
}
// test 2
_StartArCoder(coder,&bit_output[0]) ;
for(i=0;iMAX_PERMISSIBLE_ERROR)
{
error_flag = error_flag | 2;
}
}
// test 3
_StartArCoder(coder,&bit_output[0]) ;
for(i=0;iMAX_PERMISSIBLE_ERROR)
{
error_flag = error_flag | 4;
}
}
// test 4
_StartArCoder(coder,&bit_output[0]) ;
for(i=0;iMAX_PERMISSIBLE_ERROR)
{
error_flag = error_flag | 8;
}
}
// test 5
_StartArCoder(coder,&bit_output[0]) ;
for(i=0;iMAX_PERMISSIBLE_ERROR)
{
error_flag = error_flag | 16;
}
}
// test 6
_StartArCoder(coder,&bit_output[0]) ;
for(i=0;iMAX_PERMISSIBLE_ERROR)
{
error_flag = error_flag | 32;
}
}
#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");
if(error_flag & 16)
printf("Test Case 5 failed\n");
else
printf("Test Case 5 passed\n");
if(error_flag & 32)
printf("Test Case 6 failed\n");
else
printf("Test Case 6 passed\n");
#endif
}