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

📄 test_ztw_mpeg4.c

📁 用于视频图像的解压缩
💻 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_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
    
    printf("cycle_count[0] = %d\n",cycle_count[0]);
} 

⌨️ 快捷键说明

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