Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Macro Block reduction in XviD (Read 5378 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Macro Block reduction in XviD

One big problem i've encountered in XviD encoding is the perceptible presence of macroblocks.I just can't seem to ignore it or reduce it . When the same file was encoded using DivX (Pro 5.2.1), there were negligible or imperceptible presence of macroblocks. (I'm supposing using H.263 quantization matrix smoothens block noise)

I would like to know the following

1)What should be the recommended settings for XviD to avoid them and also to give a better quality encode than DivX? (atleast approach the perfect balance for that perfect encode  )

2)Which settings could be tweaked(with/without the trial and error schema)?

3)Is XviD nearing its end of fast paced development now that its lead developer is leaving?

4)Does the current version of XviD give any quality/performance benefits over DivX? ( the version i'm using in VirtualDub is XviD 1.0.3 [Koepi's CVS build])

5)I know that XviD is fast.There are a lot of people of the opinion that XviD can give better quality encodes than DivX.I too would vouch the same had it not been for the macroblocks. Is there anything i can do to change that?

Macro Block reduction in XviD

Reply #1
Enable post-processing. Divx has it enabled by default and Xvid doesn't if I remember correctly.

Macro Block reduction in XviD

Reply #2
1) You could use AutoGK and not worry about any XviD settings.  Latest beta is here.  If you want to do it manually, (reasonably) good settings are here.  Check out doom9's XviD Guides.

2) See 1)

3) MPEG-4 ASP (Advanced Simple Profile) is now a current generation codec (as apposed to a next generation codec such as AVC - Advanced Video Coding).  It is unlikely that serious improvements will be made to the effiency of XviD, or any other ASP codec in the future.  Minimal improvements and bugfixes will probably continue.  This doesn't mean you should stop using it, as it is now a very stable product with lots of software and hardware support.

4)  With the right settings, I'm inclined to believe XviD 1.0.3/1.1 does offer better quality then DivX.  However, it must be noted that this is an opinion and not supported by any tests I have done (at least not any recent tests).  However, as always Doom9 has done several codec comparison's.  His last one, in which XviD came second to an AVC codec, is here.

5)  Make sure you're using the ffdshow deocder.  After that, enable post-processing.

Macro Block reduction in XviD

Reply #3
Here are  the settings i used(and still continue to use)

Current XviD settings used for single pass

Profile@Level
================================
Quantization Type: MPEG
Adaptive Quantization
Qpel enabled
Global Motion Compensation(GMC)
B-VOPs settings at their defaults

=================================

Encoding Type(Single Pass)

Target Quantizer: 4

Advanced Options
=================
VHQ Mode: 4-Wide Search
Chroma Motion
Turbo
Trellis quantization
=================

These are the options i've used for Xvid encoding. The rest are at  their defaults.

7)Would these settings give me a better quality encoding than DivX?

8)
   a)I couldn't make up my mind on whether to use a quantizer of 3

or 4? (Doesn't seem to show any change in quality)
   b)Further does the quant setting affect final file size?

9)Should i be using the XviD 1.1 codec (even the alpha)?

10)Should i be using the same settings for 2 pass encodes? Are there any  changes i should be making?

11)Is Xvid and DivX passe in terms of quality encoding and should i look towards the next generation AVC?

12)Where can i find more detailed info on AVCs?

Quote
1) You could use AutoGK and not worry about any XviD settings.  Latest beta is here.  If you want to do it manually, (reasonably) good settings are here.  Check out doom9's XviD Guides.



  Yes i had checked out the Doom9 guides and the codec comparison tests
before. The Doom9 guide was kinda general describing options and wasn't
what i was looking for... ie pretty much reliable max quality settings
possible with Xvid.   

13)Also Nero's Recode which came in first is part of the Nero DVD backup
suite. Is there any other codec i can use to encode files with VirtualDub ?

PS: When the same file was encoded using DivX, it gave a slightly
better quality at the expense of file size ... The DivX file was abut  30% bigger.

 

Macro Block reduction in XviD

Reply #4
Quote
Here are  the settings i used(and still continue to use)

Current XviD settings used for single pass

Profile@Level
================================
Quantization Type: MPEG
Adaptive Quantization
Qpel enabled
Global Motion Compensation(GMC)
B-VOPs settings at their defaults

=================================


I would not use adaptive quantization or GMC.  Also, if you are shooting for lower to mid-bitrates the MPEG matrix is a bad choice.  Try h.263.

Quote
Encoding Type(Single Pass)

Target Quantizer: 4

Advanced Options
=================
VHQ Mode: 4-Wide Search
Chroma Motion
Turbo
Trellis quantization
=================


The biggest thing you are doing wrong is your are doing single pass at constant quant.  You should do two pass.


Quote
9)Should i be using the XviD 1.1 codec (even the alpha)?


I have been having some problems with streams playing in my hardware player which were generated with XviD 1.1.  However, 1.1 should give slightly better quality and it should be considerably faster.  I would say it is your call.

Macro Block reduction in XviD

Reply #5
There is no reason to do two-pass unless you need a certain filesize. Constant quantizer can be even better but you can't predict filesize forehand.

Macro Block reduction in XviD

Reply #6
I do single pass encodes mainly for converting mpeg-1 streams(read VCDs) such as 2/3 CD VCD movies, music videos ...etc. For such encodes i really don't need to predict filesize beforehand and is certainly not  worth the trouble for a 2-pass especially on my slow computer(PIII 500Mhz. It is the only computer that isn't occupied all the time at my house.)I've chosen XviD for its higher quality than DivX at the same speed.

Quote
The biggest thing you are doing wrong is your are doing single pass at constant quant. You should do two pass.


Quote
There is no reason to do two-pass unless you need a certain filesize. Constant quantizer can be even better but you can't predict filesize forehand.


Could you elaborate on that??(I thought that even for 2-pass encodes you shouldn't vary settings such as the target quantizer for both passes?)

14)Is VHQ-4 worth it? It seems to be crippling encoding speed for very little increase in quality or none at all.

15)Is quantization matrix h.263 better than MPEG for mpeg-1 encodes?

15)What are the bitrates value caps to be classified as lower,mid and high bitrates? (such as 700Kbs which i usually use to encode comes under what category)

16)What could be the ideal settings for video capture? (I live in PAL land)

Quote
ffdshow can reduce blocking at playback.


17)What abut XviD's built-in decoder?

PS: I've now shifted to Xvid 1.1 beta 3.

Macro Block reduction in XviD

Reply #7
Quote
There is no reason to do two-pass unless you need a certain filesize. Constant quantizer can be even better but you can't predict filesize forehand.
[a href="index.php?act=findpost&pid=295383"][{POST_SNAPBACK}][/a]


Sure, but keep in mind that he is doing two pass at quant 4 which means that all of his b-frames are going to be getting a quant of 6.  It is no wonder there are some blocks.  Of course, if he was doing quant 2 it would probably be ok.  But, he is converting VCDs which probably look bad anyway.  I would use two pass always, the first pass is soo fast anyway, but maybe you might feel a little differently if you have such a slow computer.

Macro Block reduction in XviD

Reply #8
Quote
Could you elaborate on that??(I thought that even for 2-pass encodes you shouldn't vary settings such as the target quantizer for both passes?)


With a 2-pass there is no constant quant, the first pass is normally done at quant 2 (which is usually too low though), but with the second pass the encoder chooses the quant it seems best fitting.

Quote
14)Is VHQ-4 worth it? It seems to be crippling encoding speed for very little increase in quality or none at all.

If you don't see the difference between VHQ1 and 4 its obviously not worth it, as all it does then is slowing everything down for no reason.

Quote
15)Is quantization matrix h.263 better than MPEG for mpeg-1 encodes?

Difficult/Impossible to tell.

Quote
15)What are the bitrates value caps to be classified as lower,mid and high bitrates? (such as 700Kbs which i usually use to encode comes under what category)

Such numbers don't exist, it is completely dependant on the characteristics of your video; what is low for one vid, might be high for another. You COULD say that a quant 2 encoding would be high bit rate, 4 is medium and 8 is low. Other people will probably disagree though.

Quote
16)What could be the ideal settings for video capture? (I live in PAL land)

Ideally you dont capture with XviD at all, but with huffyuv or another lossless codec.

Quote
17)What abut XviD's built-in decoder?

It can do deblocking too... what you like more is up to you, but most people prefer ffdshow.
"We cannot win against obsession. They care, we don't. They win."

Macro Block reduction in XviD

Reply #9
XviD settings for rips of VCDs and DVDs for the uninitiated
(Plz Help! Reached the point of desperation)

To the Pros... please help !

I'm tired of testing/manipulating settings in XviD for squeezing the maximum quality out of VCDs albeit maintaining a small file size. I've reached no where but the point of desperation.
Can u give me accurate/reliable settings for them.

Video
=======
1)Assuming that all settings are at their defaults (for Xvid 1.1 beta3)what changes to the options should i do for the following?

a)For  2 CD VCD movies
b)For a single VCD containing several music videos
c)For DVDs

I've installed ffdshow(2005 sse version) though i never use it. It worsens things when playing mpeg1 streams so i've disabled it.

2)For ripping VCDs do i have to extract it with VCD gear or just copy the dat files from the directory
3)When i open the dat files in VirtualDub i get the error messages "Anachronistic or discontinous timestamp in video and audio found at postion ...". When i encode such videos there is very very poor A/V synchronization. What should i do?

Audio
=======
I'm using the avi container since all the dat files have mp3 224Kbs audio which i compress to 194 Kbs VBR mp3. Would audio quality be degraded extensively or would it not make much of a difference?

PS: I hope u can make this a sticky or put it up int FAQs to help other poor souls who face the same problems with the settings... Once and for all.
I know u must be really tired answering them again and again and again...

Note: I know many people disagree with the concept of encoding VCDs in the first place becuz they are already of poor quality ... but i don't own a DVD/RW to write all of them.

My Objective:
===============
I want to preserve the same video/audio quality of VCDs and DVDsbut with a much smaller file size to store on my HD.


4)In case i wannna ditch XviD for H.264 what would the settings be??

Macro Block reduction in XviD

Reply #10
First of all don't open the dat files directly but process them to mpeg using vcdgear or something similar. Secondly, the audio on vcd isn't mp3. It is mp2. Thirdly, mp3 in avi isn't very recommendable.

Then something for Xvid. I'd use these settings but I haven't really tested this so don't flame me if your computer turns on fire.

- Load defaults
- Single pass/ constant q 4
- VHQ 4 (or 1)
- VHQ for B-frames
- Chroma motion
- Trellis quants
- Chroma optimisation (in zone settings)
- Adaptive Q
- Qpel
- Leave B-vops as is
- Q type: H.263

Macro Block reduction in XviD

Reply #11
Thanks for the help. I was using the above settings except for the quantization matrix The one i was using was MPEG. Maybe that was the one giving me problems.

>>Thirdly, mp3 in avi isn't very recommendable.

Why is mp3 not recommendable in avi? I thought mp3 at CBR was the only format supported in AVI

Macro Block reduction in XviD

Reply #12
Sorry, I meant vbr mp3. It works but is somewhat hacky. Other audio formats support by avi include but not limited to pcm, acelp, gsm, adpcm nd wma.

And yet another suggestion. Use smaller quantizer if you don't like the quality enough.