diffvideo
2.19 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/usr/bin/perl
#
# Script to extract images from vi.tab file and displays it
#
# Usage: diffvideo -i in.tab -g golden.rgb -h hblank -v vblank [-f N] [-n]
# -f N specifies number of fields per image
# -n means don't call vparse on the input tab file
#
# This script does require customization for different video formats!!!
# vparse/monitor arguments must be adjusted to decipher the correct video format
#
require "/usr/lib/perl/getopts.pl";
sub GetArguments
{
&Getopts('i:g:h:v:f:n');
if (!defined($opt_i))
{
printf("!!!ERROR: must specify input tab file \n");
exit;
}
else
{
$FILE = $opt_i;
}
if (!defined($opt_g))
{
printf("!!!ERROR: must specify golden rgb file \n");
exit;
}
else
{
$GOLDFILE = $opt_g;
}
if (!defined($opt_h))
{
printf("!!!ERROR: must specify horizontal blanking information \n");
exit;
}
if (!defined($opt_v))
{
printf("!!!ERROR: must specify vertical blanking information \n");
exit;
}
if (!defined($opt_f))
{
$NumFields = 2;
}
else
{
$NumFields = $opt_f;
}
if (!defined($opt_n))
{
$SkipVparse = 0;
}
else
{
$SkipVparse = 1;
}
}
$error = 0;
$Count = 0;
&GetArguments;
$OUT = $FILE;
$OUT =~ s/\..*$//;
if (! $SkipVparse)
{
open(TABFILES, "$ENV{'ROOT'}/usr/sbin/vparse -i $FILE -o $OUT.tab -f $NumFields |");
$temp = <TABFILES>;
@OutFiles = split(/[ \t\n]+/,$temp);
printf("outfiles: @OutFiles \n");
}
else
{
@OutFiles = "$FILE";
}
foreach $intab (@OutFiles)
{
$rgbfile = $intab;
$rgbfile =~ s/\..*$//;
$rgbfile = sprintf("$rgbfile.rgb%.3d",$Count);
$diffile = sprintf("diff%.3d.rgb", $Count++);
$monitorError = (system("$ENV{'ROOT'}/usr/sbin/monitor -i $intab -o $rgbfile -h $opt_h -v $opt_v"))/256;
if ($monitorError)
{
printf("!!!ERROR monitor had problems \n");
}
$idfError = (system("$ENV{'ROOT'}/usr/sbin/idf $rgbfile $GOLDFILE $diffile"))/256;
if ($monitorError || $idfError)
{
$error = 1;
printf("!!!Error in comparing $rgbfile and $GOLDFILE \n");
}
else
{
printf("images $rgbfile and $GOLDFILE equate \n");
}
}
exit $error;