Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 ASP
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th September 2003, 19:09   #1  |  Link
Space@pe
Registered User
 
Space@pe's Avatar
 
Join Date: Jul 2002
Location: Denmark
Posts: 19
A few questions

I have a few questions about the quality of DivX/XviD Movies!


1. If Your Bits/(Pixel*Frame) Is higher than 0.25 (2cd kval) (example 0.288) It shouldnt be nessesary to use Psychovisual Enhancements (DivX) or Lumi Masking (XviD)!?

2. Is It possible change the DivX´ B-Frame amount to 2 or 3 instead of 1?Should I just use the settings file ("Bidirectional Encoding"=dword:00000001) and change the 1 to 2 or 3?

3. Does The DivX Nth pass (multipass option) do the same as XviD´s VHQ Mode?

4.Is the compressibility test procentage more important than the Bits/(Pixel*Frame)?Why?

5.Why does the mediaplayer options like "Disable logo", "Postprocessing", "Double Buffering" and "Smooth Playback" stand In the DivX settings file?I cant see any logic in that!?

6. trellis R-D quantisation (XviD)?

7. If the input in DVD2AVI shows that the frame type Is interlaced what should U then set the "source interlace" option to in the "general parameters" option page (DivX Codec settings) .Should U keep It at "encode as progressive" even If It allso have fields frames or should I choose the "encode as Interlaced"..maybe I should do neither and just use fielddeinterlace (In field Operations).

8. Does VirtualDubMod have a Interleaving option like ordinary VirtualDub?maybe the future version will be getting that!?

THX;-)
Space@pe is offline   Reply With Quote
Old 10th September 2003, 20:58   #2  |  Link
KpeX
Registered User
 
KpeX's Avatar
 
Join Date: Jun 2003
Location: Great Lakes, USA
Posts: 1,433
0. Don't cross post.

1. That's up to you, do what you think looks better.

2. No, Xvid only.

3. No, the two features are completely unrelated.

4. They are based on each other IIRC (some GKnot guru could probably answer this better than I could.)

5. Those are directshow options, the player you use calls the divx decoder (unless you use ffdshow or some other third party filter). Not totally sure what you're asking here.

6. What are you asking? It's just an advanced feature relating to how the video is quantized, doesn't change anything on the decoding end - See Koepis first post in this thread for some trellis quant info and this thread for some trellis test results.

7. It's better to deinterlace/ivtc with avisynth or Vdub rather than using the feature built in to DivX IMO.

8. Yes. Streams, stream list, right click on the stream to get interleaving and delay values.

All probably solvable through a quick search.
hth,
__________________
KpeX
Audio FAQs: General | BeSweet | SVCD/MP2 | MP3 | Vorbis | AC3 | DTS | AAC
Linux Audio/Video FAQ

Last edited by KpeX; 10th September 2003 at 21:00.
KpeX is offline   Reply With Quote
Old 10th September 2003, 23:25   #3  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
Hi-

4. b/pf is only loosely correlated with compressibility. The results of the compress test are a much more accurate indicator of the quality of the final encode. Not completely accurate; just more accurate.

You're a mighty patient man, KpeX.
manono is offline   Reply With Quote
Old 11th September 2003, 12:58   #4  |  Link
sysKin
Registered User
 
sysKin's Avatar
 
Join Date: Jun 2002
Location: Adelaide, Australia
Posts: 1,167
Re: A few questions

Quote:
Originally posted by Space@pe
[B]4.Is the compressibility test procentage more important than the Bits/(Pixel*Frame)?Why?
Bits per pixel is a general information about bitrate used, with respect to resolution and framerate. Just like bitrate, it's not something codec-specific, but rather a general video compression term.
"Compressability" is quite contrary - something very codec specific. Once some feature of compression changes (quantization matrix, b-frames, qpel... but not only, not to mention a different codec) it starts to have a different values and different meaning.

This is why I always say, "compressability" can only tell you if your settings (resolution, mostly) is incorrect (if above 80% or below 30%, more or less. the values depend on resolution and sharpness too). It cannot be used to compare different codec settings.

Radek
__________________
Visit #xvid or #x264 at irc.freenode.net
sysKin is offline   Reply With Quote
Old 20th September 2003, 16:48   #5  |  Link
Tuning
I'm back! :D
 
Tuning's Avatar
 
Join Date: Aug 2003
Location: The Matrix
Posts: 1,029
yesterday when i tried to reply to this topic,The forum showed this is a closed thread and today it is right up here.!I could answer some questions some cannot.The questions to which i got answers is below.

If Your Bits/(Pixel*Frame) Is higher than 0.25 (2cd kval) (example 0.288) It shouldnt be nessesary to use Psychovisual Enhancements (DivX) or Lumi Masking (XviD)!?

The psycovisual enhancement is a method by which the Eyes style of viewing is recreated.it doesn't increase quality.It generally distributes bits over noticable area and refuses over unnoticable regions.similar is the lumimasking.This is what doom9 says "which tries to give less bitrate to scenes that the human eye can't see very well.".So if u are not creating very low bitrate movies(2hr 15min) on single CD it is not necessary to turn Psychovisual ON.(2CDs or more).This helps slight increase in encoding speed.


Is It possible change the DivX´ B-Frame amount to 2 or 3 instead of 1?Should I just use the settings file ("Bidirectional Encoding"=dword:00000001) and change the 1 to 2 or 3?

Quote from Doom 9's XVID manual guide:

You can use the Maximum B-frames option to set the number of consecutive B-frames. Unlike DivX5 you can go higher than 1, though it's suggested that you do not go higher than 3. B-frame quantizer ratio indicates the additional compression a B-frame gets as compared to a P-frame (the precise formula is ((quantizer of previous p-frame + quantizer of following p-frame)* (bframe quant ration)) / 200 + (b-frame offset / 100)). Leave these values at their default.


Why does the mediaplayer options like "Disable logo", "Postprocessing", "Double Buffering" and "Smooth Playback" stand In the DivX settings file?I cant see any logic in that!?

The DivX 5 > has got these settings.The first setting disable logo defined for disabling the divX logo shown in start of divx avi(if u use divx decoder and not ffdshow).Postprocessing -> the video displayed in the directshow player is processed by the decoder in order to perform some video accelaration(making sharper).smooth playback.Some slow computers cannot decode to perfection as because more CPU power will be utilised.When this option is enabled the decoder tries to reduce the CPU power(automatically) and the video doesn't jerk.



If the input in DVD2AVI shows that the frame type Is interlaced what should U then set the "source interlace" option to in the "general parameters" option page (DivX Codec settings) .Should U keep It at "encode as progressive" even If It allso have fields frames or should I choose the "encode as Interlaced"..maybe I should do neither and just use fielddeinterlace (In field Operations).

These options are of general use .This options are required if u encoded a video without deinterlacing.The video or DVDrips created using GK nandub etc are deinterlaced(progressive).so u need not set to "encode as Interlaced" instead use "encode as progressive".which is the default setting.


Does VirtualDubMod have a Interleaving option like ordinary VirtualDub?maybe the future version will be getting that!?

VirtualDubMod is created from the Averlee's Virtual Dub.So ti needs to have all of the previous features.From the first version of Vdubmode interleaving option is possible.It is available in the streams list an Right click the audio stream >>there u are interleaving is shown.


Is the compressibility test procentage more important than the Bits/(Pixel*Frame)?Why?

The compressibility test is based on varoius parameters including the darkness(Being black there is no requirement of allocation of bits to that region).resolution etc.Thus if video is darker the more bits can be reserved for video objects that require more bits.Thus the percentage is higher than the calculated count.

Does The DivX Nth pass (multipass option) do the same as XviD´s VHQ Mode?

No the setting ensures what can be used for n th pass.
Quote from doom9's guide:

VHQ mode can be used to increase compressibility while not having an impact on quality (but it will decrease speed). The higher the number, the slower it gets and don't go higher than 3.
__________________
My Blog
Tuning is offline   Reply With Quote
Old 20th September 2003, 17:11   #6  |  Link
sysKin
Registered User
 
sysKin's Avatar
 
Join Date: Jun 2002
Location: Adelaide, Australia
Posts: 1,167
Quote:
Originally posted by Tuning
Quote from doom9's guide:

VHQ mode can be used to increase compressibility while not having an impact on quality (but it will decrease speed). The higher the number, the slower it gets and don't go higher than 3.
Huh? Something like this in a guide? OMG where...

Before anyone remembers this sentence: untrue... and in fact completely illogical (if something does not have impact on quality it doesn't do anything)

Radek

[edit]
OK, it's been two minutes and I think I understood. It looks like an exaplanation of the very first VHQ, which really did something like that... more or less.

It's not valid anymore. Now VHQ improves quality while keeping the "compressablity" (or "fixed quantizer filesize" to be clear) almost the same.

There are so many absolete information around... dammit. Just look at the FAQ sticky, it still says something about b-frames to be available in the future.....
[/edit]
__________________
Visit #xvid or #x264 at irc.freenode.net

Last edited by sysKin; 20th September 2003 at 17:19.
sysKin is offline   Reply With Quote
Old 20th September 2003, 17:11   #7  |  Link
Nibor
Registered User
 
Nibor's Avatar
 
Join Date: Apr 2003
Location: Switzerland
Posts: 140
Quote:
The higher the number, the slower it gets and don't go higher than 3.
Use 4 if the speed doesn't matter
If it does matter, use 1 or even 0...
__________________
Nobody but you... and me.
Nibor is offline   Reply With Quote
Old 20th September 2003, 17:31   #8  |  Link
Sirber
retired developer
 
Sirber's Avatar
 
Join Date: Oct 2002
Location: Canada
Posts: 8,978
About #2, RV9 goes up to 3
__________________
Detritus Software
Sirber is offline   Reply With Quote
Old 21st September 2003, 04:16   #9  |  Link
Joe Fenton
Registered User
 
Join Date: Jul 2003
Location: In a house.
Posts: 663
So many questions over such a wide range...

B-frames of 1 was for OLD DivX codecs. DivX has been able to handle higher numbers for ages. The only reason you would stick to 1 b-frame is for supposed "compatibility" with upcoming hardware players which only implement baseline DivX.

The reason the guide said to not go above VHQ = 3 was that 4 had a bug in earlier versions of XviD. It would create spherical aberration artifacts in low light scenes. I verified that while encoding Harry Potter 2. The latest XviD codecs out have that fixed, so it is safe to encode at VHQ = 4. It IS slow, however. Some people don't understand what the setting VHQ = 1 does. VHQ = 1 implements a brute-force method that encodes both intra and inter macroblocks, then picks the one that gives the best quality. It may or may not compress better. Settings above 1 use an algorithm to choose to encode either intra or inter, but not both. The criteria is for compressibility, although recent versions of the XviD codec take quality more into consideration than older versions.

bits/pixel of .255?! Good Lord! I rarely go beyond .15, and that looks near DVD to me. At my "normal" encoding resolution of 640x480, that usually equates to a bitrate of about 1100kbps.

Remember that when using Psychovisual Enhancements/Lumi Masking, you're only supposed to enable it in the second pass, not the first.

Trellis encoding is only suggested for low bitrates. At your rates, you should probably be using MPEG quantization.

The interlace option in the codec is intended for this purpose: you have interlaced video that you will play back as interlaced (out the TV port to a TV set). Any other usage and you should deinterlace the video before encoding.

Remember, when in doubt, take a five minute section from the video in question and try it out. General rules of thumb may not be best for everything. For example, I said I use .15 bpp, but that is with "clean" video. Noisy video will need to be filtered or .15 won't hack it. Even with filtering, you might have to go higher.
Joe Fenton is offline   Reply With Quote
Old 21st September 2003, 05:18   #10  |  Link
kxy
Registered User
 
Join Date: Oct 2001
Posts: 343
Quote:
Originally posted by Joe Fenton
The reason the guide said to not go above VHQ = 3 was that 4 had a bug in earlier versions of XviD. It would create spherical aberration artifacts in low light scenes. I verified that while encoding Harry Potter 2. The latest XviD codecs out have that fixed, so it is safe to encode at VHQ = 4. It IS slow, however. Some people don't understand what the setting VHQ = 1 does. VHQ = 1 implements a brute-force method that encodes both intra and inter macroblocks, then picks the one that gives the best quality. It may or may not compress better. Settings above 1 use an algorithm to choose to encode either intra or inter, but not both. The criteria is for compressibility, although recent versions of the XviD codec take quality more into consideration than older versions.

Thanks for your explanation!!! Syskin mentioned a while ago that you can use VHQ=1 for first pass and VHQ=4 for the second, and the rate control of xvid would compensate that. Now with you explantion this seems quite conflicting, would you care to comment on that?
kxy is offline   Reply With Quote
Old 21st September 2003, 06:40   #11  |  Link
BoNz1
Registered User
 
BoNz1's Avatar
 
Join Date: Dec 2002
Location: Great White North
Posts: 522
Quote:
Originally posted by Joe Fenton
So many questions over such a wide range...

B-frames of 1 was for OLD DivX codecs. DivX has been able to handle higher numbers for ages. The only reason you would stick to 1 b-frame is for supposed "compatibility" with upcoming hardware players which only implement baseline DivX.
No, not necessarily. One b-frame may be more compatible but it may still have problems since DXN uses packed bitstream for b-frames and packed bitstream in XviD is currently broken.

Quote:

Some people don't understand what the setting VHQ = 1 does. VHQ = 1 implements a brute-force method that encodes both intra and inter macroblocks, then picks the one that gives the best quality. It may or may not compress better. Settings above 1 use an algorithm to choose to encode either intra or inter, but not both. The criteria is for compressibility, although recent versions of the XviD codec take quality more into consideration than older versions.
IFAIK, latest version the criteria is PSNR. So VHQ 4 is fine although slow and should be the best, I usually use 1 though.

Quote:

Remember that when using Psychovisual Enhancements/Lumi Masking, you're only supposed to enable it in the second pass, not the first.
Don't use Luma Masking it doesn't work properly in the latest build. If it did work properly you could use it for first and second pass.

Quote:

Trellis encoding is only suggested for low bitrates. At your rates, you should probably be using MPEG quantization.
Trellis is useful at all bitrates. Unfortunately, trellis is not working with MPEG quants ATM so use it only with h.263 quant which is in most cases low bitrate.
BTW you can use VHQ1 in the first pass and 4 in the second with no problems.
BoNz1 is offline   Reply With Quote
Old 21st September 2003, 13:25   #12  |  Link
sysKin
Registered User
 
sysKin's Avatar
 
Join Date: Jun 2002
Location: Adelaide, Australia
Posts: 1,167
Quote:
Originally posted by Joe Fenton
B-frames of 1 was for OLD DivX codecs. DivX has been able to handle higher numbers for ages.
I admit that I'm not too well informed, but "for ages" must be "for a month" ie. since 5.1 version. As far as I can tell, it wasn't able to do that before.
Quote:
The only reason you would stick to 1 b-frame is for supposed "compatibility" with upcoming hardware players which only implement baseline DivX.
The worse excuse ever, simply because even hardware players have no problems handling more b-frames in packed mode (which is used by divx). In other words, this is just untrue.
Quote:
The reason the guide said to not go above VHQ = 3 was that 4 had a bug in earlier versions of XviD. It would create spherical aberration artifacts in low light scenes.
LOL, a what???
Initial version of VHQ was trying to minimize bits used but ignored the resulting picture quality (it was still within quantizer "limitations", never below). As a result, psnr dropped.
It wasn't a bug, just a bad idea.
Quote:
VHQ = 1 implements a brute-force method that encodes both intra and inter macroblocks, then picks the one that gives the best quality. It may or may not compress better.
The actual value that is minimized is R-D, which means rate (bits used) and distortion (quality) as in formula: rd = bits + lambda*distortion.
Inter/intra part is the least important - inter/inter4v is the one that actually does something useful. Also inter/GMC in dev-api-4 does a good job.
Quote:
Settings above 1 use an algorithm to choose to encode either intra or inter, but not both.
You're completely wrong here. Settings higher than 1 perform a small-scale to medium-scale motion search, still using R-D as the value to be minimized.
Quote:
Remember that when using Psychovisual Enhancements/Lumi Masking, you're only supposed to enable it in the second pass, not the first.
Any reason for this? Looks pretty weird to me.
Quote:
Trellis encoding is only suggested for low bitrates. At your rates, you should probably be using MPEG quantization.
Yes, but only because we don't have trellis for MPEG yet. After we have it, you should just use it all the time (except when speed matters).

Radek
__________________
Visit #xvid or #x264 at irc.freenode.net

Last edited by sysKin; 21st September 2003 at 13:31.
sysKin is offline   Reply With Quote
Old 21st September 2003, 16:11   #13  |  Link
Th3-S4int
Registered User
 
Join Date: Mar 2003
Location: Germany
Posts: 18
@syskin
is it right, that i can use vhq 1 in the first pass and in the second vhq 4? Give this any problems or quality loose?
Th3-S4int is offline   Reply With Quote
Old 21st September 2003, 18:16   #14  |  Link
sysKin
Registered User
 
sysKin's Avatar
 
Join Date: Jun 2002
Location: Adelaide, Australia
Posts: 1,167
Quote:
Originally posted by Th3-S4int
is it right, that i can use vhq 1 in the first pass and in the second vhq 4? Give this any problems or quality loose?
Yes, it was I who came up with this solution. It should work without any problems, simply because the difference in size between VHQ1 and VHQ4 is minimal (and it's frame size that matters in first pass. only that).

I actually use VHQ0, no CM and motion 5 for super-fast first pass. Works just as well but in theory, this is where things might get ugly. In theory.

Radek
__________________
Visit #xvid or #x264 at irc.freenode.net
sysKin is offline   Reply With Quote
Old 21st September 2003, 19:00   #15  |  Link
Koepi
Moderator
 
Koepi's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 4,454
Quote:
Yes, it was I who came up with this solution. It should work without any problems, simply because the difference in size between VHQ1 and VHQ4 is minimal (and it's frame size that matters in first pass. only that).

I actually use VHQ0, no CM and motion 5 for super-fast first pass. Works just as well but in theory, this is where things might get ugly. In theory.
I'd like to object here. Just because the ratecontrol of XviD can cope with it and the difference is very little (a few frames getting a too low quantizer, a few frames getting a too high quantizer) it doesn't mean that you won't notice the difference.

It is likely for example that iframes get quantized too high. This will be noticable. Even if there is now much bitrate to spare for the following p- and bframes, where the pframes can compensate a little for that. but the overall quality will be.... different.

You can abuse this behaviour of xvid's rate-control, but you have to know the consequences it has, and you should judge for yourself what you prefer: total control and _in theory_ best possible quality (-> most possible constant quality), or _in theory_ some random but high quality (not as constant as the "strict" doing-both-passes-the-same-way encoding).

Ok, in dev-api-3 (current public dev-builds) we are dependant on the non-controllable mode-decision when using bframes and thus already abuse that rate-control-behaviour, but with dev-api-4 we get back our control above the encoding frame types.

I feel like I have to mention this. (Don't hate me for that, Radek ).

Best regards
Koepi
Koepi is offline   Reply With Quote
Old 21st September 2003, 21:29   #16  |  Link
Joe Fenton
Registered User
 
Join Date: Jul 2003
Location: In a house.
Posts: 663
Quote:
Originally posted by sysKin
I admit that I'm not too well informed, but "for ages" must be "for a month" ie. since 5.1 version. As far as I can tell, it wasn't able to do that before.
The DivX decoder has handled more than 1 b-frame since 5.0.2 or 5.0.3. I've been using 2 b-frames with XviD with the 4cc set to DX50 since 5.0.3 with no problem. Don't know if the encoder in DivX would generate more than 1 b-frame, but who cares about that. It's the decoder that people make use of.

Quote:
Originally posted by sysKin
The worse excuse ever, simply because even hardware players have no problems handling more b-frames in packed mode (which is used by divx). In other words, this is just untrue.
The DivX website lists levels of compatibility they call "profiles." They suggest not using the higher level profiles for best compatibility with upcoming players. Their suggestion, not mine.

Quote:
Originally posted by sysKin
LOL, a what???
Initial version of VHQ was trying to minimize bits used but ignored the resulting picture quality (it was still within quantizer "limitations", never below). As a result, psnr dropped.
It wasn't a bug, just a bad idea.
That was the term coined for the distortion agreed on in the threads I read on it. A semi-circular patch of bad video toward the bottom of the display. I would call experimental code that doesn't do what you think/want a bug. Just not a fatal bug - more of an annoyance.

Quote:
Originally posted by sysKin
The actual value that is minimized is R-D, which means rate (bits used) and distortion (quality) as in formula: rd = bits + lambda*distortion.
Inter/intra part is the least important - inter/inter4v is the one that actually does something useful. Also inter/GMC in dev-api-4 does a good job.
Okay, that's good to know. I haven't bothered to look at the core code myself, I just go by what I see reported by folks on the threads who are supposed to know. I imagine that sometimes they "dumb things down" to make them more understandable to people, even if the explanation is no longer technically correct.

Quote:
Originally posted by sysKin
Any reason for this? Looks pretty weird to me.
It was the suggestion by the folks in the thread concerning the Koepi Encoder Guide.
Joe Fenton is offline   Reply With Quote
Old 22nd September 2003, 00:30   #17  |  Link
Prettz
easily bamboozled user
 
Prettz's Avatar
 
Join Date: Sep 2002
Location: Atlanta
Posts: 373
Quote:
Originally posted by Joe Fenton
The DivX website lists levels of compatibility they call "profiles." They suggest not using the higher level profiles for best compatibility with upcoming players. Their suggestion, not mine.
On a side note, DXN did not "invent" these profiles. They are profiles from the MPEG4 standard.
You won't need to use lower profiles: newer players should easily be able to handle the full ASP profile, if they can't then you shouldn't be buying that player anyway.
Prettz is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:18.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.