Log in

View Full Version : the best settings for DivX 5.2.1


CQ
12th September 2004, 21:45
hei. i`m running a codecs test for a pc magazine (yeah, PC Magazine Ro) and i wanted to know wich are the best settings for this codec. Speed isn't important, quality... yes! So do youre best. gmc, slow, adaptive multiple, 3 pass encoding... everyone, wich settings do you use and why.
bye. please answer!

DigitAl56K
12th September 2004, 22:20
That is a very open-ended question! :)

It is possible to run tests with many different goals. Do you want:

The best possible PSNR score
The best possible SSIM score
The best perceptual quality
Fixed quality encoding with no regard for a target file size
Consistent quality encoding with a target file size
Video that uses features only supported on a computer
Video that is designed to play on DivX Certified CE devices (DivX Certified DVD Players etc.)


It's possible to configure the codec differently depending on what your goal is and get differing results. Also consider that if you are testing the DivX codec against other popular codecs there may be fundamental differences between the implementations that are not recognized by any statistical results you might derive. For example: The DivX Codec can create video streams that are guaranteed to play back on DivX Certified CE devices. To do this, some features which are unsupported by certified CE devices are disabled, and other limitations are imposed (such as the VBV, which controls how the codec can allocate data so as to respect the capabilities of the CE device). Other codecs may not support such features, and thus results can be flawed.

Typically, we want to encode video using the Home Theater DivX Certified Profile. This ensures that DivX Certified DVD players will be able to play back the video we encode. This imposes the following limitations on us:


No GMC
No QPel
Bi-directional Coding: Adaptive Single or Off
No 1-Pass, Quality-Based encoding
H.263 quantization matrix
VBV is enforced


When you select the Home Theater profile from the encoder configuration GUI, options will be disabled/hidden as appropriate for that profile, making it easy to create video that will work in your DivX Certified device.

Encode Performance should be "Slow", and you should do a "Multipass, 1st Pass" followed by at least one "Multipass, nth Pass". You may wish to do more than 2 passes where there are periods of extreme motion complexity in the source (or the source is poor quality), but often this is unecessary. Bi-directional coding should be "Adaptive Single".

(Basically: Restore Defaults, Set "Slow" mode, Set Multipass mode, Enter your target bitrate)

Two features that may improve perceptual quality, but decrease PSNR and SSIM scores, are Source Pre-processing and Psychovisual Enhancements.

Source Pre-processing will try to remove temporal and spatial noise from the source (such as color inconsistency, flickering, and film grain) in order to improve compressability. However, because it manipulates the picture, even though the output may look better to the human eye, to statistical analysis tools that compute PSNR/other statistics the resulting "score" will drop.

Psychovisual Enhancements can significantly enhance fine details in the picture, and its effect is most significant at lower bitrates. The recommended PVE mode is "Fast", not "Slow" (slower is not always better!). Again, even though this feature may improve the perceived video quality, it will cause lower PSNR scores during statistical analysis, making its effects difficult to quantify by simple statistical analysis.

Remember that most codecs (including ours) prefer progressive sources (i.e. not interlaced), so unless your source is already progressive you will either need to ivtc/de-interlace as appropriate prior to sending video to the codec, or set the codec to "De-interlace source". You can also "Preserve interlace" if you desire, but this is usually not done in real world encoding or codec testing.

Hope this helps, please feel free to contact me for more information - I'll send my e-mail address via private message.

CQ
12th September 2004, 23:11
time is not important, neither the compatibility (there are very few dvd players DivX compatible here in our litlle :) country - do you know that we invented the argon laser? a literature writer from us :) but... we are to small (and to insignificant for somebody to recognize that). what are we talking...

The best possible PSNR score

The best possible SSIM score

The best perceptual quality

Video that uses features only supported on a computer

these are important. i dont have the hardware to do some compatibility test and... i`m sticking to these. sorry for youre wonderful codec (i like it a lot, but i'll be objective :D )

manono
13th September 2004, 04:20
Hi-

That was a helluva post, DigitAl56K. Thank you very much for taking the time to do it for CQ. Now, if you're willing to do it again for the best quality for computer playback (shouldn't take nearly as long this time), using all the bells and whistles available, then you'll have put out the best concise "how-to" for DivX encoding for both DVD/MPEG-4 players and computer playback I've seen.

CQ, I hope you appreciate what you've been handed. It's my guess that you might be surprised by the number of DVD/MPEG-4 players in use in your country already, and the number is sure to grow. Even if they're not readily available in stores, there are plenty of them available from nearby countries by online ordering or mail ordering. You might consider reserving a part of your article to discuss encoding for standalone units, since only DivX so far has something like a Home Theater Profile.

CQ
13th September 2004, 09:22
manono, I see and learn. Most of the online shops doesn't send out here because we are with the .sk, .hu, .ru... I mean, a lot of carders out here. And most of shops doesn't take that risk :(. I have seen 2 models (maybe are more but... these are all what I saw). I will describe the advantages and disadvantages (i ain't goona say: X is good. Use It!) of each CoDec and so on.

Here is what i'm planning ---> http://forum.doom9.org/showthread.php?postid=544162

Gannjunior
13th September 2004, 10:07
Originally posted by DigitAl56K

.....Psychovisual Enhancements can significantly enhance fine details in the picture, and its effect is most significant at lower bitrates. The recommended PVE mode is "Fast", not "Slow" (slower is not always better!). Again, even though this feature may improve the perceived video quality, it will cause lower PSNR scores during statistical analysis, making its effects difficult to quantify by simple statistical analysis....
[/B]

Until 5.02 release, PE had a similar behaviour as you described.(it incresased compressibility while PSNR and SSIM dropped down, but you didn't percived basically that with your eyes).
In last revisions ( 5.11 etc.), PE works in the opposite way: it increases drastically saturation level (so decrases compressibility), and it seems to be useful only at compressibility level over 85% of saturation (Q=2).In particular, at saturation level, you can see its pretty work: sharp and mellow image (very similar effect of dvd mpeg-2 compression).In this case, it's simple to verify that, not only with your eys, but also by SSIM index that grows and it's in agree with your eyes...
At low and very low bitrate (or better, at compressibility level lower than 45-50%), PE doesn't have a good impact on visual quality.(and with SSIM too...).

HERE (http://www.quellicheilpc.com/forum/viewtopic.php?t=16184) a bit of datas about one of my tests...

Ciao!

DigitAl56K
13th September 2004, 17:39
Originally posted by Gannjunior
In last revisions ( 5.11 etc.), PE works in the opposite way: it increases drastically saturation level (so decrases compressibility)


PV is designed to work only with RC-controlled modes. If you use it with Q=x mode you will see higher bitspend.


PE doesn't have a good impact on visual quality.(and with SSIM too...).


SSIM may drop, but visual quality should increase with average bitate encoding.


HERE (http://www.quellicheilpc.com/forum/viewtopic.php?t=16184) a bit of datas about one of my tests...


Your tests seem to indicate the expected results for PV - i.e. PSNR or SSIM drops slightly. However, there are only two tests that actually investigate PV. Nice work there, though :)

DigitAl56K
13th September 2004, 19:21
Originally posted by CQ
time is not important, neither the compatibility (there are very few dvd players DivX compatible here in our litlle :) country


It's a little disheartening to hear this when we are striving to build an ecosystem around DivX video that will allow you to take your DivX media to any DivX Certified device. I would urge you to reconsider your stance on this issue. Consider that if you create content you intend to distribute, that content may end up in countries where DivX Certified devices are becoming prolific, and the value of your work to content consumers may be substantially increased should you choose to produce profile-compatible output.

Also, consider that back in the day before DivX Certified hardware was readily available, everyone was always striving for the next best thing in terms of PSNR - almost regardless of any possibility for transporting the output beyond the PC. Today, we see massive consumer demand for DivX Certified devices and the ability to take DivX content into the living room and home entertainment systems. There is still strong demand for DivX 3.11 and DivX 4.x files today, even though these are legacy formats and that content was created without concern for CE support. There must come some point were there is a reasonable tradeoff between PSNR/SSIM/other and portability of the content created. When does the compression and perceptual quality become high enough that compatibility outweighs statistical metrics? Unless you are the only person who will ever use the content created, and you will never have any need for CE support, this is something you should think about.


what are we talking...

The best possible PSNR score

The best possible SSIM score

The best perceptual quality

Video that uses features only supported on a computer


Once again, items 1 & 2 conflict with 3 for the reasons I mentioned above (Psychovisual Enhancement and Source Pre-Processing). I will assume that you want to target a specific file size/fixed average bitrate, rather than perform constant quality encoding.

Set up the codec as follows:

Disable profiles
Turn on GMC
Turn off QPel
Set Multiple Consecutive Adaptive Bi-directional coding
Use Multipass encoding
Set "Slow" mode


Unofficial tweak: You can use "Slowest" mode (ala 5.1.1) by manually modifying the -pq value on the CLI to 192. However, Slow mode will give near identical results and is an officially supported/tested mode.

Note on QPel: QPel is only supported in Standard p/q mode, which means you can't use it in combination with the rate-distortion algorithm. Its benefits vary depending on the source, and normally Slow mode + multiple adaptive B-frames will give you better results. QPel is most useful when encoding clips with very low spatial resolution - i.e. regardless of the actual dimensions of the clip you are encoding, the actual spatial resolution of the video is low (objects are very small/video looks like it's been shot with a wide lens). It can actually be detrimental to High-Definition encoding, where video often has high spatial resolution.

Note on Multipass encoding: Create a text file C:\FrameLevelControl.txt before encoding. As the encoder works, various statistics will be written to this file. Most important of these for multipass is the Quantizer distribution, which is written at the end of the file at the close of each pass. Ideally, you should continue performing nth passes until the quantizer distribution is minimal.

Note on PV: This may increase SSIM score according to Eagle (one of our engineers), though I haven't had time to test this yet :) It should certainly increase JND substantially.

SeeMoreDigital
13th September 2004, 20:05
Originally posted by manono
Hi-

That was a helluva post, DigitAl56K. Thank you very much for taking the time to do it for CQ. Now, if you're willing to do it again for the best quality for computer playback (shouldn't take nearly as long this time), using all the bells and whistles available, then you'll have put out the best concise "how-to" for DivX encoding for both DVD/MPEG-4 players and computer playback I've seen. Agreed

I'm pleased to see that DivX are becoming more pro-active with these kinds of topics.


Nice one.... Cheers

CQ
13th September 2004, 20:19
DigitAl56k... thats a true valuable post!
look out here to see what i'm planning.
And man, i'm tellin you, this is a good thing (divx certified...) but like i said most of the users... dont have or cant afford one (a maestro player is about 200+ euros... the medium sallary 100 euros. its a litlle hard to buy one and many of them dont know why should he buy one (instead a 35$ dvd player). the magazine workers gives them no infos for that and... anyway il reconsider doing this to.

And i'll see you here (all of you)

http://forum.doom9.org/showthread.php?postid=544162

obieobieobie
19th September 2004, 14:12
Just wanted to commend DigitAl56K on the great posts.

Two thumbs up. :)