1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#include <math.h>
#include <stddef.h>
#include "ts.h"
bool ts_test_vertical_horizontal_filter( void )
{
uint_t k = 3;
fp_t const o[] = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
fp_t const h[] = { 12, 14, 13, 15, 16, 14, 17, 18, 16, 19 };
fp_t const l[] = { 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 };
fp_t const c[] = { 11, 13, 12, 14, 15, 13, 16, 17, 15, 18 };
fp_t const * const x[] = { o, h, l, c };
/* k=3, offset=3
* i=3: hh=15,ll=10,num=5, den=|13-14|+|11-10|+|15-13|+|12-11|+|16-15|+|13-12|=1+1+2+1+1+1=7, VHF=5/7=0.71429
* i=4: hh=16,ll=11,num=5, den=|15-13|+|12-11|+|16-15|+|13-12|+|14-16|+|14-13|=2+1+1+1+2+1=8, VHF=5/8=0.625
* i=5: hh=16,ll=12,num=4, den=|14-15|+|14-13|+|17-16|+|15-14|+|14-14|+|14-14|=1+1+1+1+0+0=4, VHF=4/4=1.0
* ...
*/
fp_t const e[] = { 0.625, 0.71429, 0.5, 0.44444, 0.44444, 0.33333, 0.33333 };
fp_t const * const exp[1] = { e };
return ts_test(ts_vertical_horizontal_filter, ts_vertical_horizontal_filter_offset, x, exp, sizeof( o ) / sizeof( *o ), (ts_constant_t *)&k, &ts_vertical_horizontal_filter_p);
}
|