www.pudn.com > bf533_decoder_mpeg4.rar > test_arith_decoder_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_decoder_mpeg4 
Description : This file contains test cases to test arithmetic decoder for shape 
              codeing (MPEG4) 
*******************************************************************************/ 
#include 
#include"bin_ar_decode.h" 
#include"test_input.h" 
 
int error_flag = 0; 
void (*f1)(); 
int cycle_count[513]; 
 
extern void _StartArDecoder(); 
extern void _StopArDecoder(); 
extern int _arith_decoder_mpeg4(); 
 
void main() 
{ 
 
int i,j,k,C,D; 
int error; 
 
decoder=&code; 
 
 
// test 1 
 
    f1 = _StartArDecoder; 
 
    _StartArDecoder(decoder,&input0[0],&bit_output[0]); 
 
    cycle_count[0] = Compute_Cycle_Count(decoder,&input0[0],&bit_output[0]); 
                            //This function inturn calls StartArDecoder() 
//    f1 = _arith_decoder_mpeg4; 
 
    for(i=0;iMAX_PERMISSIBLE_ERROR) 
        { 
            error_flag = error_flag | 1; 
        } 
   } 
 
// test 2 
 
    _StartArDecoder(decoder,&input1[0],&bit_output[0]); 
 
    for(i=0;iMAX_PERMISSIBLE_ERROR) 
        { 
            error_flag = error_flag | 2; 
        } 
    } 
 
// test 3 
 
    _StartArDecoder(decoder,&input3[0],&bit_output[0]); 
 
    f1 = _StartArDecoder; 
    for(i=0;iMAX_PERMISSIBLE_ERROR) 
        { 
            error_flag = error_flag | 4; 
        } 
   } 
 
// test 4 
 
    _StartArDecoder(decoder,&input3[0],&bit_output[0]); 
    for(i=0;iMAX_PERMISSIBLE_ERROR) 
        { 
            error_flag = error_flag | 8; 
        } 
    } 
 
// test 5 
 
    _StartArDecoder(decoder,&input4[0],&bit_output[0]); 
    for(i=0;iMAX_PERMISSIBLE_ERROR) 
        { 
            error_flag = error_flag | 16; 
        } 
    } 
 
//test 6 
 
    _StartArDecoder(decoder,&input5[0],&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 
     
    printf("cycle_count[0]=%d,cycle_count[1]=%d,cycle_count[2]=%dcycle_count[3]=%d,cycle_count[4]=%d,cycle_count[5]=%dcycle_count[6]=%d\n",cycle_count[0],cycle_count[1],cycle_count[2],cycle_count[3],cycle_count[4],cycle_count[5],cycle_count[6]); 
     
}