网站公告列表

  没有公告

加入收藏
设为首页
联系站长
您现在的位置: 61IC中国电子在线 >> DSP >> 代码示例 >> ADI DSP代码示例 >> Blackfin >> 文章正文
  应用于视频解码中的反向DCT变换(在ADSP BLACKFIN533平台上的实现)         ★★★ 【字体:
应用于视频解码中的反向DCT变换(在ADSP BLACKFIN533平台上的实现)
作者:61IC    文章来源:本站原创    点击数:    更新时间:2007-1-22    

/*******************************************************************************
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   : tr8x8invdct.c
Description : This module tests  r8x8invdct() function.
*******************************************************************************/
#include <stdio.h>
#include "tr8x8invdct.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 _r8x8invdct();

void main (void)
{
    int n, i, j, error;

    f1 = _r8x8invdct;      

    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 r8x8invdct()

    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] = Testcase2_In[i];

    cycle_count[1] = Compute_Cycle_Count(in, coeff, temp);
                          //This function inturn calls r8x8invdct()

    for (i = 0; i < 64; i++)
    {
        error = in[i] - Testcase2_out[i];
        if (abs(error) > 6)
        {   
            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] = Testcase3_In[i];

    cycle_count[2] = Compute_Cycle_Count(in, coeff, temp);
                                //This function inturn calls r8x8invdct()

    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 r8x8invdct()

    for (i = 0; i < 64; i++)
    {
        error = in[i] - Testcase4_out[i];
        if (abs(error) > 3)
        {   
            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
   
    printf("cycle_count[0]=%d,cycle_count[1]=%d,cycle_count[2]=%d,cycle_count[3]=%d\n",cycle_count[0],cycle_count[1],cycle_count[2],cycle_count[3]);
   

}

               欢迎点击进入:TI德州中文网   (国内唯一针对TI应用的中文技术网站)    文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
    没有相关文章
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    站长:61IC 湘ICP备05002478号