Log in

View Full Version : Macroblock in dark area and other............


FunMan
27th October 2002, 11:06
Hi to all,

This is the first time I write, but it's long time I read this board. I also wrote in xvid.org encoder development board but I didn't received any reply, so I try here, hopening in better results.....

This is what I wrote:

<<
Hi to all,

I'm Daniele. In the past I made several quality test in audio sector, focusing my attenction on MPEG-2/4 Advanced Audio Coding (AAC). Now, with the same spirit, I'm making video test. I'm particularly interested in *quality* so it's normal to think that I use the settings to obtain it. I thing that XviD is on of the best (if not the one) MPEG4 encoder we have at the moment. And infact I use XviD for my encoding.

I'm not interested in AVI format, i use MPEG4 stream, so MPEG-4 video (XviD) and MPEG-4 AAC audio (Psytel), assembled with MPEG4IP software. For playback I usually use Envivio Plugin, so I've no post processing filter and I can notice some artefacts easily. For example I noticed a very fastidious macroblock artefacts in dark area. I've uploaded an image and a short description, so if you could see it http://www.neowebsite.it/xvid/xvid.htm .

Anyone has any idea about these artefacts?

Last thing: I *always* use 2 pass, and usually alternative curve compression with default values. Now I understand well how linear scaling works, it simply consider statistical values of the first pass (quant 2) and obtain a "linear scaling" depending of desidered target size. Ok. But what about alternative curve compression? I know that probably there are other post about it but I didn't find.... For better quality, usually is better alt-cc or linear scaling?

Waiting for an answer,
Thanks in advanced, and sorry for my bad english!
>>

FunMan

iago
27th October 2002, 11:11
@FunMan

It seems you don't/haven't read this board carefully enough then ;). Take a look at the "lumi masking" thread where exactly the issue you mention has been discussed in full detail for a long while.

regards,
iago

FunMan
27th October 2002, 15:44
Mmmmm, I remember this post, it had so much reply.....but I don't use lumi masking option, I also noticed that when I turn it on some visible macroblocks in light and dark area......

If you said that in this thread there's reply to mi question ok, I'll looking for it. But if you can summarize the thread and reply to me I'll appreciate it very much.....

Thanks,
FunMan

iago
27th October 2002, 23:04
@FunMan

It's literally impossible to summarize that gigantic thread. But shortly, to get rid of ugly blocks in black areas:

* Do not use lumi-masking (you said you already don't, which is good).
* Use Marc's MPEG2Dec3.dll (http://ziquash.chez.tiscali.fr/) in your avs script and set lumoff=-2 parameter.
* Using MPEG2Dec3.dll, you can also set cpu=4 to apply pre-deblocking to the source.

sample script:
--------------------------------------------------
LoadPlugin("C:\FILTERS\MPEG2dec3.dll")
mpeg2source("C:\MOVIE\MOVIE.d2v",cpu=4,lumoff=-2)
crop(2,4,-2,-4)
LanczosResize(576,320)
--------------------------------------------------

* You can also consider using trbarry's UnFilter.dll (sharpening/softening filter) since it seems to help with the issue as well, either with - or + parameters. Just for example: UnFilter(-5,-5) to soften, UnFilter(5,5) to sharpen (slightly). (http://www.trbarry.com/UnFilter.zip)

regards,
iago

Koepi
27th October 2002, 23:27
well, together with lumaoff=-2 and maybe some unsharping I can even use lumi masking and it still looks good/ok in those regions.

Just my oppinion though, and just "simulated" TV by playing with the overlay brightness/contrast... ;)

Regards
Koepi

FunMan
28th October 2002, 10:52
Hi to all,

thanks for replies.......:)

While I'm waiting for an answer, I read the thread on lumi masking. So I tried the lumoff=-2 and the UnFilter(5,5) and the result is very good indeed!

At the moment I made only few tests on the second track of "We will rock you" DVD I said. As I said this DVD (THX certified) has very dark scenes. It's the Queen Concert at Montreal, in '82.

Before using lumoff=-2 and UnFilter, although in 2nd pass I've specified a desired target size of 630 Mb (its a 2cd rip, the aac audio stream is 70 Mb) the real final size was of 560 Mb (and there was the ugly macroblocks). Now I'll try the new settings :)

The question is: the UnFilter(5,5) [sharpening] is equivalent to UnFilter(-5,-5) [smoothing] in reducing/eliminating ugly macroblocks in dark area?

Because smoothing is better than sharping in order to gain compressibility (and so, fixing bitrate to a certain value, this would have to give better results in terms of quality), but how good (qualitatively) is UnFilter smoothing/sharpening?

Regards,
FunMan

iago
28th October 2002, 11:10
@FunMan

First, glad to hear that you got better results in your tests :).

As for UnFilter, use it as to suit your needs, either to sharpen or to soften your encode. Imho, it is very successful in both sharpening and smoothing; and yes, equally effective against macroblocks (together with lumoff=-2) either with - or + parameters, at least in my experience so far.

As for the filesize issue, XviD is actually "one and only" regarding filesize accuracy, as long as you use a stable build without B-frames. Perhaps you got the codec saturated in your previous tries; if so, you can try higher resolution, a sharper resizing method, MPEG quantization, some extra sharpening [UnFilter(+,+)] ;) etc.

regards,
iago

FunMan
29th October 2002, 11:20
Hi,

I made the test I wrote about. Results are very good, there are no macroblocks in dark area... only a few in some scenes, but finally true black in black area, no ugly macroblock.......:)

For the strange final dimension of encoded xvid: I've always used Koepi latest *stable* build, 04102002. In this moment I use my personal VC++ .Net sp2 compiled copy from last CVS source code (obviously last stable version, not b-frame or qpel), setting toosmalllimit to 1. First, with ugly macroblock, final dimension was of 560 Mb.....now, macroblockless and with true black dimension is 530 Mb! The overall quality is very good, but I don't understand *why* this strange thing..... I didn't analyze resulting xvid, but I think that are used some high quant value....but *why* xvid don't use lower quant value considering that I specified dimension of 630 Mb?

I prefer do not use modulated MPEG/H.263 quant type, because I noticed some artefacts in past using modulated (while these artefacts were not present using both MPEG or H.263 separately)

Thanks,
FunMan

iago
29th October 2002, 11:32
@FunMan

First, have you run any compression tests, and what's the 1stPass size of your encode? You can use Koepi's StatsReader, load the stats file, and read the first pass size -> Size (MB):

If first pass size is bigger than 630 mb (your target size), then it's not codec saturation and the problem lies elsewhere. But please, check that first.

regards,
iago

edit: statsreader1.9 is included in Koepi's 04102002-1 stable build.

FunMan
29th October 2002, 14:39
Hi iago,

I'll check it when I'm at home, tnx...

What's the differencies between linear scaling and alt curve scaling for 2nd pass encoding? In terms of bonus/malus.......

'Cause I know that linear scaling (using Koepi statreader per example) works on statistical data retrievied during 1st pass @ fixed quant 2, simply "scaling" it to different quant (usually high) in order to reduce final dimension to the preferred specified.....but what about alt-cc scaling? I think that philosophy is quite the same (scaling considering the 1st pass statistical data), but obviously there are differencies....

Usually I use alt-cc with standard value......(for the problem I've described the target size is exactly the same also using linear scaling)

What can we consider that state-of-the-art of these two methods mentioned above?

Thanks in advance, I'm quite sure you'll reply ;)
FunMan