Mercurial > mplayer.hg
annotate TOOLS/countquant.pl @ 15915:b3924612667a
Update of the x264 encoding guide:
- Reorganized things, options are now divided into "speed vs quality"
and "other" (more or less). subq is now where it belongs.
- subq=6 is documented
- explanation of what 2-pass really does, and why you'd better use it
- mention 3-pass (and the fact that it usually doesn't help)
- documented qcomp
- documented keyint (not like it needed any more explanation, though)
- deblocking parameter tweaking no longer categorized as options that
"affect speed and quality ;)
- updated example cpu requirements for decoding, in codecs.xml
(720x480 @ 1500kbps 50%->35%, for my CPU)
author | gpoirier |
---|---|
date | Mon, 04 Jul 2005 05:37:27 +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 |