Acaila
5th May 2002, 17:17
Since a lot of people have this problem with DivX5 I decided to write an explanation of why it happens and what to do if it happens to you.
Before the days of DivX5 it was quite common to get either undersized or oversized files with DivX4. The reason for this was that DivX4's size prediction algo's weren't functioning very well. The difference between predicted and achieved filesize for DivX4 was somewhere between 0-10MB. The new DivX5 no longer possesses this fault, its size prediction is quite accurate now. So most of the time when you enter a target bitrate the codec will hit this size very closely. However with some movies you end up with a final filesize that is over 50MB too small.
What's the deal here?
Once you get a file that is more than say 50MB under your target filesize, there's a very big chance the movie is 'maxed out'. This means that the codec has used every bit you gave it and has produced a file that is at the maximum quality, and therefor maximum filesize, and it just can't make it any bigger. In this case increasing the bitrate will not make the file any bigger, because the codec has already reached the max. The codec uses the bits you gave it to determine which quantizer to use to compress each frame. The higher the quantizer the more the frame will get compressed. With a so-called 'saturated' movie the codec will have used the lowest possible compression, which is a quantizer of 2, and it will still be compressed too much for the bitrate you entered. But because the codec can't use a quantizer lower than 2 the file will end up too small.
Some of the most common factors that play a part in getting a saturated file:
- Resolution
- B-frames
- Low motion movie
- Dark movie
- Span a movie on >1 CD's
- Filters
Resolution:
The lower the resolution of a video, the fewer detail it has and the fewer bits are required to compress each frame. Increasing the resolution will increase the amount of detail in each picture and thus the need for extra bits increases also.
B-frames:
This one of the main reasons why more people get saturated movies with DivX5 than with DivX4. Since B-frames get their information from two surrounding frames instead of just one surrounding frame for a P-frame, they will have a lower compression error. Because of this, each frame that is targeted to become a B-frame will be compressed much more than if it were a normal P-frame. So, even if the codec wants to use a quantizer of 2 on a frame (to keep the size as large as possible), if the frame will become a B-frame it will get a higher quantizer, namely 2x2=4. A file at maximum quality with B-frames will have a quantizer of 2 for P-frames and 4 for B-frames.
Disabling the Bidirectional Encoding feature will give you a bigger file, because now every frame will be get a quantizer of 2.
Low Motion:
DivX5 uses the MPEG compression scheme to get as little a file as possible with high quality. To achieve this it tries to limit the size by only encoding the differences between each frame instead of the entire frame. The more the difference between one frame and the next, the more will be encoded. So it stands to reason that a high action movie will need much more bits to get equal quality compared to a low motion movie. This is determined by the movie content, so there's nothing we can do about it.
Dark Movie:
Black is one of the most easy to compress colors, because each color component (at leat in RGB) is 0. Zero's compress easily. The more black in a movie, the easier it can be compressed. Again this is something that is part of the movie content, so there's also nothing we can do aout it.
Span a movie on >1 CD's:
Because you use a much higher bitrate you'll reach the maximum quality (minimum compression) sooner. Simply cut down on the number of CD's you use for the movie and you should be fine.
Filters:
Some encoding filters incease the compressability of a movie. Things like blurring and deinterlacing make things easier on the codec. Also the type of resizing filter has much inpact on filesize. Bilinear for instance increases compression a great deal, Bicubic on the other hand decreases compression. The sharper the resizing filter, the greater the filesize will be. So if you get undersized files with one type of resizing, try a sharper method to get a bigger file.
If anyone has anything useful to add here please reply so I can make it as clear to everyone as possible. This is not an invitation for questions, post them under normal threads (after searching around if your question hasn't been answered before).
Before the days of DivX5 it was quite common to get either undersized or oversized files with DivX4. The reason for this was that DivX4's size prediction algo's weren't functioning very well. The difference between predicted and achieved filesize for DivX4 was somewhere between 0-10MB. The new DivX5 no longer possesses this fault, its size prediction is quite accurate now. So most of the time when you enter a target bitrate the codec will hit this size very closely. However with some movies you end up with a final filesize that is over 50MB too small.
What's the deal here?
Once you get a file that is more than say 50MB under your target filesize, there's a very big chance the movie is 'maxed out'. This means that the codec has used every bit you gave it and has produced a file that is at the maximum quality, and therefor maximum filesize, and it just can't make it any bigger. In this case increasing the bitrate will not make the file any bigger, because the codec has already reached the max. The codec uses the bits you gave it to determine which quantizer to use to compress each frame. The higher the quantizer the more the frame will get compressed. With a so-called 'saturated' movie the codec will have used the lowest possible compression, which is a quantizer of 2, and it will still be compressed too much for the bitrate you entered. But because the codec can't use a quantizer lower than 2 the file will end up too small.
Some of the most common factors that play a part in getting a saturated file:
- Resolution
- B-frames
- Low motion movie
- Dark movie
- Span a movie on >1 CD's
- Filters
Resolution:
The lower the resolution of a video, the fewer detail it has and the fewer bits are required to compress each frame. Increasing the resolution will increase the amount of detail in each picture and thus the need for extra bits increases also.
B-frames:
This one of the main reasons why more people get saturated movies with DivX5 than with DivX4. Since B-frames get their information from two surrounding frames instead of just one surrounding frame for a P-frame, they will have a lower compression error. Because of this, each frame that is targeted to become a B-frame will be compressed much more than if it were a normal P-frame. So, even if the codec wants to use a quantizer of 2 on a frame (to keep the size as large as possible), if the frame will become a B-frame it will get a higher quantizer, namely 2x2=4. A file at maximum quality with B-frames will have a quantizer of 2 for P-frames and 4 for B-frames.
Disabling the Bidirectional Encoding feature will give you a bigger file, because now every frame will be get a quantizer of 2.
Low Motion:
DivX5 uses the MPEG compression scheme to get as little a file as possible with high quality. To achieve this it tries to limit the size by only encoding the differences between each frame instead of the entire frame. The more the difference between one frame and the next, the more will be encoded. So it stands to reason that a high action movie will need much more bits to get equal quality compared to a low motion movie. This is determined by the movie content, so there's nothing we can do about it.
Dark Movie:
Black is one of the most easy to compress colors, because each color component (at leat in RGB) is 0. Zero's compress easily. The more black in a movie, the easier it can be compressed. Again this is something that is part of the movie content, so there's also nothing we can do aout it.
Span a movie on >1 CD's:
Because you use a much higher bitrate you'll reach the maximum quality (minimum compression) sooner. Simply cut down on the number of CD's you use for the movie and you should be fine.
Filters:
Some encoding filters incease the compressability of a movie. Things like blurring and deinterlacing make things easier on the codec. Also the type of resizing filter has much inpact on filesize. Bilinear for instance increases compression a great deal, Bicubic on the other hand decreases compression. The sharper the resizing filter, the greater the filesize will be. So if you get undersized files with one type of resizing, try a sharper method to get a bigger file.
If anyone has anything useful to add here please reply so I can make it as clear to everyone as possible. This is not an invitation for questions, post them under normal threads (after searching around if your question hasn't been answered before).