📄 test_three_step_search.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_three_step_search.c
Description : This C file is used to test the Three step search motion
estimation. The target and reference data are generated. It
initializes the input/output structure to be passed to the TSS
routine and calls it. The output is checked against the expected
result.
*******************************************************************************/
#include <stdio.h>
#include "ttss.h"
void three_step_search();
void _init_tss();
void (*f1)();
int cycle_count[10];
int error_flag = 0;
main()
{
int i,j,p;
short *exp_vmv, *exp_hmv;
f1 = three_step_search;
tss_in_out.winwidth = WINWIDTH;
tss_in_out.step_size = SS;
tss_in_out.ptr_tss = &tss;
//Test case 1 :
/****************** Initialization of tss specific structure ******************/
_init_tss(&tss, WINWIDTH, SS);
/******************************************************************************/
if (SS == 4)
{
exp_vmv = exp_vmv_4;
exp_hmv = exp_hmv_4;
}
else if (SS == 9)
{
exp_vmv = exp_vmv_9;
exp_hmv = exp_hmv_9;
}
else
{
// printf("Test results not available (Specify 4, or 9)\n");
// exit(0);
}
/**************** Target and Reference block initialization *****************/
for(i=0;i<16;i++)
for(j=0;j<16;j++)
target[i*16+j] = 100;
for(i = 0;i < ROWS; i++)
for(j = 0;j < COLUMNS; j++)
reference[i*COLUMNS+j] = 0;
for(i = 0;i < 16; i++)
for(j = 32;j < 32 + 16; j++)
{
reference[i*COLUMNS+j] = 80;
reference[(i+16)*COLUMNS+(j-16)] = 80;
reference[(i+32)*COLUMNS+(j+32)] = 80;
}
ptr = reference + 16*(COLUMNS+1) - (SR*(COLUMNS+1));
for(p=0;p<4;p++)
{
for(i=0;i<WINWIDTH;i++)
for(j=0;j<WINWIDTH;j++)
ref_window[i*WINWIDTH+j] = ptr[i*COLUMNS+j];
/**************************** Function Call *******************************/
tss_in_out.ptr_target = target;
tss_in_out.ptr_reference = ref_window;
three_step_search(&tss_in_out);
/******************************* Testing **********************************/
if(tss_in_out.mv_y != exp_vmv[p] || tss_in_out.mv_x != exp_hmv[p])
{
error_flag = error_flag | 1;
}
ptr = ptr + 16;
}
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -