]> git.sesse.net Git - narabu/blob - curve.pl
Encoder with 4x4 blocks (using TF switching).
[narabu] / curve.pl
1 #! /usr/bin/perl
2 use strict;
3 use warnings;
4
5 my @alts = ();
6 while (<>) {
7         chomp;
8         my @x = split / /;
9         push @x, 0;
10         push @alts, \@x; 
11 }
12
13 for my $i (0..$#alts) {
14         next if ($alts[$i]->[4]);
15         for my $j (($i+1)..$#alts) {
16                 if ($alts[$i]->[2] <= $alts[$j]->[2] && $alts[$i]->[3] >= $alts[$j]->[3]) {
17                         $alts[$j]->[4] = 1;
18                 }
19         }
20 }
21
22 @alts = sort { $a->[2] <=> $b->[2] } @alts;
23 for my $i (0..$#alts) {
24         next if ($alts[$i]->[4]);
25         print join(' ', @{$alts[$i]}), "\n";
26 }