Mercurial > mplayer.hg
annotate TOOLS/countquant.pl @ 27146:a8681ded2d41
r25756: Document vo gl lscale=3
r25757: Add experimental unsharp-mask OpenGL scaler.
r25767: misc spelling fixes
r25768: misc markup fixes
r25769: better ao/vo profile examples
r25786: Add a fragment program for 5x5 unsharp masking
r25821: (instead of adding quotation mark, this added a missing paragraph!)
r25955: (previously applied)
r25973: Hint about possible libmpeg2 problems with -hardframedrop
r25984: Slightly document alpha for OSD color
r26014: -dumpstream will not dump chapters anymore
r26015: Document that framedrop needs -no-correct-pts
r26017: removed wrong example
author | kraymer |
---|---|
date | Mon, 30 Jun 2008 19:35:36 +0000 |
parents | 85ebbeeb913b |
children | 32725ca88fed |
rev | line source |
---|---|
8464 | 1 #!/usr/bin/perl -w |
2 | |
3 sub display_quants { | |
4 $frames = 0; | |
5 foreach $key (sort(keys(%quants))) { | |
6 $frames += $quants{$key}; | |
7 } | |
8 foreach $key (sort({ $a <=> $b } keys(%quants))) { | |
9 printf("q=%d:\t% 6d, % 6.2f%%\n", $key, $quants{$key}, $quants{$key} * | |
10 100 / $frames); | |
11 } | |
12 print("$lines lines processed, $frames frames found\n"); | |
13 printf("average quant. is: %f\n", $quant_total/$frames); | |
14 } | |
15 | |
16 $lines = 0; | |
17 $thislines = 0; | |
18 $quant_total = 0; | |
19 | |
20 while (<STDIN>) { | |
21 $lines++; | |
22 $thislines++; | |
23 if (/ q:([0-9]+) /) { | |
24 $quants{$1}++; | |
25 } elsif (/ q:(([0-9]+)\.[0-9]+) /) { | |
26 $quants{$2}++; | |
27 $quant_total += $1; | |
28 } | |
29 if ((scalar(@ARGV) > 0) && ($thislines > $ARGV[0])) { | |
30 display_quants(); | |
31 $thislines = 0; | |
32 } | |
33 } | |
34 | |
35 display_quants(); | |
36 | |
37 |