Mercurial > mplayer.hg
comparison DOCS/xml/en/encoding-guide.xml @ 16085:c1dd920e736c
New item: "Choosing resolution and bitrate", from Rich's encoding guide
author | gpoirier |
---|---|
date | Sun, 24 Jul 2005 20:53:54 +0000 |
parents | baae7cdb0726 |
children | 6c16b60516f3 |
comparison
equal
deleted
inserted
replaced
16084:84171054b840 | 16085:c1dd920e736c |
---|---|
948 should be done on playback, and the player will use the aspect stored in | 948 should be done on playback, and the player will use the aspect stored in |
949 the AVI to determine the correct resolution. | 949 the AVI to determine the correct resolution. |
950 Unfortunately, not all players enforce this auto-scaling information, | 950 Unfortunately, not all players enforce this auto-scaling information, |
951 therefore you may still want to rescale. | 951 therefore you may still want to rescale. |
952 </para> | 952 </para> |
953 | 953 </sect2> |
954 | |
955 | |
956 <sect2 id="menc-feat-dvd-mpeg4-resolution-bitrate"> | |
957 <title>Choosing resolution and bitrate</title> | |
958 | |
959 <para> | |
960 If you will not be encoding in constant quantizer mode, you need to | |
961 select a bitrate. | |
962 The concept of bitrate is quite simple. | |
963 It's the (average) number of bits that will be consumed to store your | |
964 movie, per second. | |
965 Normally bitrate is measured in kilobits (1000 bits) per second. | |
966 The size of your movie on disk is the bitrate times the length of the | |
967 movie in time, plus a small amount of "overhead" (see the section on | |
968 <link linkend="menc-feat-dvd-mpeg4-muxing-avi-limitations">the AVI container</link> | |
969 for instance). | |
970 Other parameters such as scaling, cropping, etc. will | |
971 <emphasis role="bold">not</emphasis> alter the file size unless you | |
972 change the bitrate as well!. | |
973 </para> | |
974 <para> | |
975 Bitrate does <emphasis role="bold">not</emphasis> scale proportional | |
976 to resolution. | |
977 That is to say, a 320x240 file at 200 kbit/sec will not be the same | |
978 quality as the same movie at 640x480 and 800 kbit/sec! | |
979 There are two reasons for this: | |
980 <orderedlist> | |
981 <listitem><para> | |
982 <emphasis role="bold">Perceptual</emphasis>: You notice MPEG | |
983 artifacts more if they're scaled up bigger! | |
984 Artifacts appear on the scale of blocks (8x8). | |
985 Your eye will not see errors in 4800 small blocks as easily as it | |
986 sees errors in 1200 large blocks (assuming you'll be scaling both | |
987 to fullscreen). | |
988 </para></listitem> | |
989 <listitem><para> | |
990 <emphasis role="bold">Theoretical</emphasis>: When you scale down | |
991 an image but still use the same size (8x8) blocks for the frequency | |
992 space transform, you move more data to the high frequency bands. | |
993 Roughly speaking, each pixel contains more of the detail than it | |
994 did before. | |
995 So even though your scaled-down picture contains 1/4 the information | |
996 in the spacial directions, it could still contain a large portion | |
997 of the information in the frequency domain (assuming that the high | |
998 frequencies were underutilized in the original 640x480 image). | |
999 </para></listitem> | |
1000 </orderedlist> | |
1001 </para> | |
1002 <para> | |
1003 Past guides have recommended choosing a bitrate and resolution based | |
1004 on a "bits per pixel" approach, but this is usually not valid due to | |
1005 the above reasons. | |
1006 A better estimate seems to be that bitrates scale proportional to the | |
1007 square root of resolution, so that 320x240 and 400 kbit/sec would be | |
1008 comparable to 640x480 at 800 kbit/sec. | |
1009 However this has not been verified with theoretical or empirical | |
1010 rigor. | |
1011 Further, given that movies vary greatly with regard to noise, detail, | |
1012 degree of motion, etc., it's futile to make general recommendations | |
1013 for bits per length-of-diagonal (the analogue of bits per pixel, | |
1014 using the square root). | |
1015 </para> | |
1016 <para> | |
1017 So far we have discussed the difficulty of choosing a bitrate and | |
1018 resolution. | |
1019 </para> | |
1020 | |
1021 | |
1022 <sect3 id="menc-feat-dvd-mpeg4-resolution-bitrate-compute"> | |
1023 <title>Computing the resolution</title> | |
954 <para> | 1024 <para> |
955 First, you should compute the encoded aspect ratio: | 1025 First, you should compute the encoded aspect ratio: |
956 <systemitem>ARc = (Wc x (ARa / PRdvd )) / Hc</systemitem> | 1026 <systemitem>ARc = (Wc x (ARa / PRdvd )) / Hc</systemitem> |
957 <itemizedlist> | 1027 <itemizedlist> |
958 <title>where:</title> | 1028 <title>where:</title> |
1006 the encoded content, a CQ of 0.18 may look just fine for a Bergman, contrary | 1076 the encoded content, a CQ of 0.18 may look just fine for a Bergman, contrary |
1007 to a movie such as The Matrix, which contains many high-motion scenes. | 1077 to a movie such as The Matrix, which contains many high-motion scenes. |
1008 On the other hand, it is worthless to raise CQ higher than 0.30 as you would | 1078 On the other hand, it is worthless to raise CQ higher than 0.30 as you would |
1009 be wasting bits without any noticeable quality gain. | 1079 be wasting bits without any noticeable quality gain. |
1010 </para> | 1080 </para> |
1081 </sect3> | |
1011 | 1082 |
1012 </sect2> | 1083 </sect2> |
1013 | 1084 |
1014 <sect2 id="menc-feat-dvd-mpeg4-audio"> | 1085 <sect2 id="menc-feat-dvd-mpeg4-audio"> |
1015 <title>Audio</title> | 1086 <title>Audio</title> |