Correct PPTP server firewall rules chain.
[tomato/davidwu.git] / release / src / router / libvorbis / vq / auxpartition.pl
blob05c5ed942f9201bc3779b2b737dcbd0726be43ca
1 #!/usr/bin/perl
3 if($#ARGV<0){
4 &usage;
7 $|=1;
9 $bands=0;
11 foreach $arg (@ARGV){
12 ($entries[$bands],$file[$bands])=split(/,/,$arg);
13 $bands++;
16 # no time to deal with globs right now
17 if($bands>0){
18 die unless open(ONE,"<".$file[0]);
20 if($bands>1){
21 die unless open(TWO,"<".$file[1]);
23 if($bands>2){
24 die unless open(THREE,"<".$file[2]);
28 while (<ONE>) {
29 my@nums = ();
30 @nums = split(/,/);
31 my$cols=$#nums;
32 for($i=0;$i<$cols;$i++){
33 print 0+$nums[$i].", ";
35 if($bands>1){
36 $_=<TWO>;
37 @nums = ();
38 @nums = split(/,/);
39 $cols=$#nums;
40 for($i=0;$i<$cols;$i++){
41 print $nums[$i]+$entries[0].", ";
43 if($bands>2){
44 $_=<THREE>;
45 @nums = ();
46 @nums = split(/,/);
47 $cols=$#nums;
48 for($i=0;$i<$cols;$i++){
49 print $nums[$i]+$entries[0]+$entries[1].", ";
53 print "\n";
57 if($bands>0){
58 close ONE;
60 if($bands>1){
61 close TWO;
63 if($bands>2){
64 close THREE;
67 sub usage{
68 print "\nOggVorbis auxbook spectral partitioner\n\n";
69 print "auxpartition.pl <part_entries>,file [<part_entries>,file...]\n\n";
70 exit(1);