Debian Codegraph @

README.encoder

raw
1 This is a small explanation of the statistics tables generated by encodedv:
2
3 CYCLE are the cycles in the quantization loop until a matching QNO is found
4 (affects speed)
5
6 RUNS/CYCLE (for 3-pass VLC) : Tries to skip quantisation steps if it is
7 clear that a _lot_ more bits are needed. Makes things faster but
8 maybe quality drops a little bit. Smaller values mean better quality and
9 larger values mean that you gained some speed.
10
11 QNO is the quantization number. Larger values mean lesser quantization
12 (15=no quantization at all!) and better quality. You will notice, that
13 there are gaps between the values in the statistics. (Especially if
14 you choose "--vlc-passes=3", where qnos are most likely 15 or 8.)
15 This is normal behaviour since depending on the quantization CLASS
16 some QNOs don't gain you anything and are therefore skipped. There are
17 even codes, that _never_ gain you anything regardless of the chosen
18 classes.
19
20 CLASS is the quantization class. (Greater values mean higher quantization.)
21 This is used to quantizise larger AC coefficients more than smaller ones.
22 For now, we use the following table
23
24 max AC-value
25 0 - 11 | 12 - 23 | 24 - 35 | >35
26 -----------------------------------------
27 Y 0 | 1 | 2 | 3
28 CR 1 | 2 | 3 | 3
29 CB 2 | 3 | 3 | 3
30
31 from the IEC documentation (which is only given for reference.)
32 If you want to improve this, keep the following in mind:
33 * These classes are chosen with the vlc code lengths in mind.
34 There is one code length for codes between 0..11, for 12..23 etc.
35 * You _have_ to use class 3 for AC coeffs. larger than 255, since they
36 can't get encoded otherwise.
37 * It is sensible to quantizise CR and CB values more than Y values.
38 (a) they don't matter that much and b) their bit budget is therefore
39 smaller!)
40 * Larger classes give you finer control over the QNO.
41 * Smaller classes don't have necessarily better quality since you may
42 be encoding quantization noise. That's from the IEC document. I don't
43 know, why they consider picture details with extremely small
44 coefficients as noise, but I agree that large coefficients don't
45 really need all the lower bits.
46 VLC OVERF is the number of vlc_encoder overflows you encountered. That means
47 that some AC coefficients simply aren't encoded!
48 At best it means your picture is somewhat blurred and at worst it has
49 a very psychedelic touch...
50 This should only happen in two cases
51 a) if you use "--vlc-passes==1,2" and QNO 0
52 b) static_qno since the simple heuristic used can fail easily
53
54 DCT MODE is the DCT mode chosen. DCT248 is used for fast moving sequences,
55 where the two fields encoded differ a lot. DCT88 has generally better
56 quality. The decision is based on the accumulated differences between
57 the two fields that are larger than a hard coded threshold divided
58 by the same difference in x direction. This makes sure that spotlights
59 are encoded with DCT 88 and not with DCT 248.
60 Something like (sum_i abs(field1[i] - field2[i])) /
61 sum_i abs(block[i+1] - block[i])) > dct_248_limit
62 TODO:
63 - finally go to the library and get the header block specifications ;-)
64 - think of a better way to implement static_qno for 1,3 vlc passes
65 - do correct synchronisation between audio and video (synchronise
66 against system clock since we can't be sure, that the soundcard
67 clock is 100% accurate)
68 - skip frames correctly
69 - find a way to detect NTSC / PAL for video or finally add a
70 force-video-format option.
71
72