Log in

View Full Version : how-to fix edge "fuzziness" ?


sdsalsero
18th December 2003, 19:08
I've been backing-up my kid's DVDs to CDs for about a year now, using Xvid 5/22/02 (or 10/26/02) to do a 2-pass encode with the default settings. A common problem I see is that the edges of objects will have 'speckles' around them. I used to assume that it was just lack of bitrate but now I realize that it happens on short movies (<90 minutes), too, and on a 700MB .AVI file.

So far, all I've tried is boosting the VHQ to 4 but that didn't seem to affect it.

Is this still just a function of available bits, or is this something that can be fixed with one of the 'advanced' MPEG4 features, e.g. quarter-pels, B-frames, GMC ? I've read several of the Xvid guides posted here but all they ever seem to discuss is how these features affect "motion estimation" and I don't know if that has anything to do with the 'speckles'.

Thanks for any help!

Manao
18th December 2003, 19:31
That speckle is called 'ringing' or 'mosquito noise'. It is inherent to MPEG compression mechanism. As soon as you drop too much fourier's coefficients, you may face it in zone where there are discontinuities ( edges ).

A better motion estimation will reduce the phenomenon indirectly, because it will give the codec more bits to encode the edge itself ( and then will follow it precisely )

If you can raise the bitrate, these artifacts we'll of course be reduced. But they may not disappear. They also ( alas ! ) may be present on the source itself ( it happens more often than it should )

What has a great influence on this phenomenon, encoding wise , is the quantization matrix, but as soon as you're playing with it, you're trading sharpness to less artifacts ( MPEG will lead to a pleasant sharpness but a lot of ringing ( in case of a limited bitrate ), H263 will do the contrary, and the custom quand will have intermediary effects ( which are imha a lot more sensible than both H263 and MPEG )). So it's up to you to choose whether you can live with mosquito noise or not.

So, to summarize : use VHQ 4, ME 6, chroma motion. Choose the matrix by yourself. GMC, QPel, Treillis are a matter of personnal taste, and they won't do wonders considering mosquito noise. Adaptive quant may help ( because it will give more bits to part of the movie where you would see mosquito noise easily )

sdsalsero
18th December 2003, 20:27
Great explanation, thanks!

So, is there any reason these 'advanced' motion-estimation functions aren't all enabled by default?

Hopefully, future versions of the Xvid GUI will clarify all of this better, e.g.:
- label the various quantization options on a Sharpness-vs-Noise slider
- use a separate tab for Motion Estimation Debug where you can selectively *disable* functions which you think are misbehaving

Manao
18th December 2003, 21:15
There aren't enabled because :
- they take a lot of times in calculation ( Qpel, GMC, b-frames )
- they may not be compatible with most of the current hardware MPEG-4 players ( GMC 3-points, QPel )
- their effect may not be unanimously liked ( QPel, Treillis, Chroma optimizer, adaptive quant, GMC, custom matrices )

In a XviD 1.0, your idea of a debug tab for motion estimation should not be required, since it all should work.

And for the sharpness Vs noise, it's a good idea, but they are not the only parameters to come into account : there are also the blocking issue, the stability of the background. And some other things : for example, a matrix like HVS_GOOD will almost always lower PSNR value ( a way of measuring the distorsion brought by the encoding ) compared to H263, yet the results will be more pleasant to your eyes ( at least, to mine ).

sdsalsero
18th December 2003, 21:51
Well, clearly they need some kind of non-technical explanation. If something has a debatable effect, it shouldn't be enabled by default but it still needs to be categorized, e.g.
- Sharpness/Noise
- Accuracy/Compression
- Encoding Speed
If something isn't enabled simply because of the time involved, it would be nice if it was clearly labeled as such so that people who weren't in any hurry would know that they could benefit from it.

Also, why do you say that advanced motion-estimation features are incompatible with certain players -- aren't they limited to the encoding process? Maybe there could be a Compatibility status-window which would change 'state' as you enabled/disabled different functions. There could be a row of icons or labels, e.g. "MPEG4 Adv Simple" or "DivX-5 Home Theatre", which would grey-out if you enabled GMC or whatever.

Manao
18th December 2003, 22:17
Also, why do you say that advanced motion-estimation features are incompatible with certain players -- aren't they limited to the encoding process?No : QPel and GMC ( and B-frames ) are adding information in the bitstream that belongs to a specific MPEG-profile which need to be understood by the player. In case of QPel, it's the fact that motion estimation is precise up to a quarter of a pixel instead of to the half, in GMC it's much more complex ( meaning I don't know the details :D ); On the contrary, VHQ, ME,Chroma Motion, Chroma Optimizer, Adaptive quants have an influence only on the coding, not on the decoding.There could be a row of icons or labels, e.g. "MPEG4 Adv Simple" or "DivX-5 Home Theatre", which would grey-out if you enabled GMC or whateverThat is the purpose of the different profile. But instead of greying the profile if you activate an option, the codec makes you choose a profile and disables the incompatible options. It's clearer this way.

And for all the other things, don't forget it's just a beta, meaning it is not fit for the people in a hurry / which aren't aware of its betas status. And it would overcrowd the GUI. So it's better for such consideration to be all regrouped in a user's guide.

sdsalsero
18th December 2003, 23:54
Manao,
I think you misunderstood the direction of my comments. Obviously, anyone using the beta should expect to spend time researching how to use it. But, since we're approaching "1.0" shouldn't we also be considering ease-of-use? To my mind, my suggestions don't add any clutter but instead reduce clutter by grouping and categorizing all the options that already exist. Remember, the ideal GUI is one that doesn't need a user guide.

re the profiles, your description/method works too! But I've never seen any selections grey-out as the result of a profile selection.

Manao
19th December 2003, 00:22
Remember, the ideal GUI is one that doesn't need a user guide. That's true. But in that case, some settings are so intricated that you can't explain concisely what are their effects.To my mind, my suggestions don't add any clutter but instead reduce clutter by grouping and categorizing all the options that already existIt has already been done. But it's quite subtile :

- the button right to the profile contains settings that are profile dependants ( GMC, QPel, B-frames, Reduced resolution, matrix choice, interlaced, adaptive quant ). All can be grayed by selecting a very restrictive profile ( try simple@L0 for example )
- the advanced options contain every global setting which concerns only the encoder and both passes. On the first tab, motion estimation ( MSP, VHQ, CM, and cartoon mode ( almost )) and i-frame interval ( you don't want to touch frame drop ratio ). Second tab, quant restrictions and treillis ( another motion estimation algorithm, I would have put it on the first tab ), and the third tab is a debug one.
- When encoding type is set to second pass, you find all the settings concerning how you will map the bitrate curve in order to achieve the specified size. There also, it only concerns encoder.
- In the zones, you can set options that can be useful if tweaked in specific portion of the movie : chroma optimizer ( it's a prefiltering ), greyscale ( also ), force key-frames, and BVOP ratio ( it's astonishing at first sight to find it here, but it's in fact very logical ).

Some settings could have been put elsewhere ( quant restriction inside zones for example ), but this way of organization is quite sensible ( imho ).I think you misunderstood the direction of my comments.Not at all, I understood your concerns in regards of the GUI ( I don't like it myself ). But at still think in-depth explanations ( which are alas always required when speaking of the choice some of the settings ) should be put in a user's guide.

Let me precise why. Let's take QPel for example : there are cases where it does wonders, others where it degrades picture's quality. It almost always lower the PSNR. It costs time. How should we explain that to a user inside the GUI ? He would immediatly think that the codec is unusable because of such uncertainties.

Nibor
19th December 2003, 18:32
@Manao

I think the GUI doesn't need any reallocation, IMO it's good how it is now.

But:

Originally posted by Manao
On the contrary, VHQ, ME,Chroma Motion, Chroma Optimizer, Adaptive quants have an influence only on the coding, not on the decoding.
-> the AQ option is not related to the profile

the button right to the profile contains settings that are profile dependants ( GMC, QPel, B-frames, Reduced resolution, matrix choice, interlaced, adaptive quant ).
-> but here you say the contrary

Does it affect the way the stream is decoded or not?

When it doesn't, the option should be put in the 'Advanced' tab...

Manao
19th December 2003, 19:27
Nibor : I've faced the same incomprehension. I thought adaptive quants concerned only the encoding part, however, there is a profile choice that deactivates it. After having made a search, I didn't find any information on that particular profile, so we should wait for someone was a better knowledge on this subject than me.

powerslave
19th December 2003, 22:21
Also you can use avisynth filters to help filter out some of that mosquito noise and noise in general. I think koepi listed a script that he found works well with mosquito noise and ive used it ever since. Do a search on mosquito noise and see if you can find that post somewhere.

DevilsChild
20th December 2003, 07:53
Originally posted by sdsalsero
Manao,
I think you misunderstood the direction of my comments. Obviously, anyone using the beta should expect to spend time researching how to use it. But, since we're approaching "1.0" shouldn't we also be considering ease-of-use? To my mind, my suggestions don't add any clutter but instead reduce clutter by grouping and categorizing all the options that already exist. Remember, the ideal GUI is one that doesn't need a user guide.

I agree. The XviD GUI is pretty cumbersome. The user has to spend lots of time messing with features whose effects on video quality are poorly documented at best. What's more, you have to change quite a few settings from movie to movie.

I just don't see why they can't make an XviD GUI similar to the one on DivX 5. It would simplify the process considerably.

Koepi
20th December 2003, 09:53
XviD is about tweaking, the possibility to change everything you can. It's impossible with a "simple GUI".

Though we deliver very good defaults, it's unnecessary to tweak it much, you won't gain too much by tweaking (usually it's the opposite, you get worse quality when messing around with values you don't understand).

Beta3 will have overhauled dafaults for sure - only little changes - which work like charme for usual encodes (like they do now).

If you want ease of use, use DivX. If you're feeling that those options aren't enough, use XviD. _That's simple_, isn't it? :)

Regards
Koepi

sysKin
20th December 2003, 12:02
Originally posted by Manao
I thought adaptive quants concerned only the encoding part, however, there is a profile choice that deactivates it. After having made a search, I didn't find any information on that particular profile, so we should wait for someone was a better knowledge on this subject than me. Adaptive quantization means changing quantizer in a frame, and as such must be supported by decoder, which has to understand switching commands in the bitstream and must, of course, follow them and use correct quantizer for each macroblock. This stuff is easy, so almost all profiles allow it (except simple level 0, which was kinda designed for a wristwatch-grade decoder lol).
Changing quantizer is a bit different than, say, qpel, because you don't in indicate "I'll do it" in the header (like gmc, interlacing, quantization type), you just do it when describing each macroblock. Or not.

Radek

sdsalsero
20th December 2003, 19:45
Koepi,
I'm not asking for a dummy version of the GUI, just one that has better labeling. Grouping the items that are 1st-pass specific, or ME specific, and that affect the playback compatibility.

If you look at Doom9's latest Xvid 1.0 guide (http://www.doom9.org/xvid-vdub-final.htm), for instance, he recommends changing the Quantization Type from "H.263" (for 1-CD rips) to "MPEG" (for 2-CD rips). Why couldn't this kind of info be incorporated into the GUI?

And, thanks for all your hard work!