Log in

View Full Version : Filters and Xvid


Pages : [1] 2

Nasse
27th June 2002, 23:31
Do any of you guys use filters when using xvid? Are there any filter(s) to recomend? or are they all just crap?

MoonWalker
27th June 2002, 23:46
You mean filter in the avisynth file? Well it depends one the movie..If the movie is interlaced you use Decomb or Smartdeinterlace.If it's noisy TemporalSmoother etc..


MoonWalker

Nasse
27th June 2002, 23:48
yeah thats what im talking about... but i heard some guy talking about a group that was using some filter(s) to make better quality... even though it wasnt interlaced nor noisy...

R3g
28th June 2002, 08:14
well, if the original souce is good quality, you don't need to filter. Filtering is intended to make the movie more "compressible", that is to say eliminate noise or interlacing. But the more you filter, the more you lose the original aspect of the movie. If a DVD movie looks noisy, it means (I think) that the director wanted it noisy. If you denoise, the movie doesn't looks like it was intended to (is that sentence english ?)

MoonWalker
28th June 2002, 08:53
Well a thought about filter..Let's say a movie is very very compressible..smaller than 2 cd's.And we want to fit this movie in 2 cd's..Will it be good to add a sharpen filter?Will we gain quality?

MoonWalker

R3g
28th June 2002, 10:36
I don't think it's possible to increase the quality of a movie. sharpening could make it less compressible, so the codec will need more bitrate to compress it, but that's all. Don't forget the source is already MPEG2 compressed, so sharpening such an image could only make some macroblocks more visible.

serbersan
28th June 2002, 10:44
Well I've used sharpenning filtering and I've read it increases compressibility, but I think it doesn't increases quality unless the quality you have after encode was bad.

If the quality is good a sharpenning filter I think it couldn't help.

The author is the same of temp smoother I believe

unplugged
28th June 2002, 10:52
IMHO, would be interesting and useful to find the filters corresponding to DivX 5 pre-processing, that sometimes does the (good) difference.

Acaila
28th June 2002, 12:38
The past week or so I've been searching for ways to clean up a DVD with neglible detail loss. I've always believed that unfiltered looks better, but when you have a movie with bicubic and MPEG quant (to retain the most detail) you'll also introduce noise. Using a softer bicubic or H.263 quants will kill detail so that's not an option.

Right now I've come to a TemporalSmoother on the Luma plane only, and a SmoothHiQ on the Chroma plane only. Both at very low settings of course. The result is quite astounding, 80% noise reduce but no visible quality reduce, however there's a slight color change, and I don't know why yet. Currently encoding it with a series of different Tweak settings, but something like that will probably never be perfect.

R3g
28th June 2002, 13:07
Originally posted by Acaila
I've always believed that unfiltered looks better, but when you have a movie with bicubic and MPEG quant (to retain the most detail) you'll also introduce noise.
Why ? Is that the bicubic resize or the MPEG quant that introduce noise ? Did you notice it sometimes, or every times ? And which setting o you use for your resize filter ?

Acaila
28th June 2002, 14:02
Both bicubic resize and MPEG quant introduce 'noise', both together and it will become quite visible, everytime.
Setting BicubicResize(x,y,0,0.75) is waaay too much, so I always use (x,y,0,0.5) it looks better, but in combination with MPEG still noisy. Using (x,y,0.333,0.333) or H.263 defeats the purpose in my opinion because the blurring they produce is very obvious.

So to keep the highest amount of detail, but the lowest amount of noise we have to resort to careful filtering. Unless someone could make a bicubic resizer that doesn't blur or sharp (so no strength setting). All that's left at that point is messing with the quantizer matrices :D

R3g
28th June 2002, 14:57
I don't really understand how MPEG quant can introduce noise. I thought it just didn't eliminate as much low frequencies as h263 ?

trbarry
28th June 2002, 15:30
Many DVD's and it seems most HDTV upconverts are heavily filtered during mastering.

My previous attempts to use the built-in Avisynth Sharpen command had always crashed but on the newer 1.07 beta it works (slowly) and viewing vobs directly in DVD2AVI/Avisynth/Virtualdub looks better sharpened in some cases, just to remove the excess softening. But I haven't convinced myself yet that the improvement passes through if I am to use Xvid to re-encode the material.

I'm starting to think that except in extreme cases the sharpening should be done at view time by the dshow filter, but not before re-encoding.

- Tom

BTW, yesterday I ported some of my DScaler code that does an "UnFilter" to (very slightly) reduce previous softening or sharpening. I should be able to release it as an Avisynth filter later today or tomorrow. I mostly did it because the built-in Avisynth Sharpen command seems very slow (but nice looking, now it doesn't crash).

edit: now released. See my new UnFilter (http://forum.doom9.org/showthread.php?s=&threadid=28197) thread for sharpening/softening.

wotef
28th June 2002, 15:39
there are some strange discs out there that warrant filtering, imho, like my dune region 2, absolute cruddy gamma and contrast for some reason when opening the d2v project

i used avisynth levels (built-in) and donald graft's tweak plugin to sort out the colour balance

then i was delighted with the extra compression and euphonic enhancements i got with these virtualdub filters:

2d cleaner (10,1,1)
picfix (threshold 4, best)

no doubt some detail is lost (if you magnify the image x4) but duh, there's no question the rip looks hells better than if I had not applied the filters - no debate there!

the trade off is speed, of course, but i reckon i could only have got equivalent quality with that rip (unfiltered) if i'd increased file size by probably 1/5th

R3g
28th June 2002, 15:41
I agree, I always do light sharpening with ffdshow, mostly to compensate the blurrying of deblocking.

kilg0r3
28th June 2002, 16:33
@acaila

i once compared temporalsmoother and temporalsoften2, which is way faster. i did that by comparing frames from an avs file.
then, i was quite astonished to see that the slower TSmooth changed the hue of the material by turning it slightly green. another difference was that TSmooth swallowed a fair amount of detail even with a 2,1,1 setting which TSoft2 didn't. TSooft2 seems to be far less aggresssive. for my last encode i used TSoft2 at 5,3,3 with no vivible loss of detail. nonetheless compressability went up about 15%.

btw what values were you using for your to filters, and, did you apply them before or after resizing?


@wotef
how did you get picfix to work? i remeber downloading it. but the archive contained only one file with some strange extension, or, did it have any extension at all? i treid to rename it to make it a vdub plugin but only got error messages ... in which colorspace do these filters work?

Acaila
28th June 2002, 16:58
@kilg0r3:
This is the script that's worked best so far, I'm still working on it.
Source=MPEG2source("D:\DivX Rip\DivX\X-Men\X-Men_64bit.d2v").Crop(16,74,696,432)

Temporal=TemporalSmoother(Source,1).MergeChroma(Source)

Spatial=SmoothHiQ(Temporal,3,10,15,192,3).MergeLuma(Temporal)

Movie=Spatial.Trim(0,136800).Tweak(hue=2.5,bright=1.0).BicubicResize(672,288,0,0.5)
Credits=Trim(Source,136801,0).TemporalSmoother(10).BilinearResize(672,288)

Return Movie+Credits
Before I used partial merge of luma/chroma. The cleaning was better, but the color shifts were also more pronounced.

As per your suggestion, I'll try out TemporalSoften as well. :)

FFiXx
28th June 2002, 17:01
I think a DNR at 1 or 2 could be in handy, if u got a really bad source... U might wanna try sumthing which changes ur orignal interly as 2d cleaner/smartsmoother/warpsharp <-- use with care :) also dont use billinear resize if u want quality/detail.

wotef
28th June 2002, 17:49
maybe go get a new copy of it
http://vobsub.edensrising.com/picfix/picfix.html

all you need to do is rename picfix.dll to picfix.vdf and put it in the virtualdub plugins directory

i can't use temporal smoother cause it either loses too much detail or introduces ghosting

dynamic noise reduction is old and slow and offers nothing more than 2d cleaner or picfix can do much quicker and with less artifacting, at least with my material

shouldn't strictly need smart smoother if you have a dvd source, but if you're gonna use one, smart smoother high quality (REALLY LIGHTLY) is the way to go

FFiXx
28th June 2002, 18:18
Oh yeah, where did u get SmartsmoothHiQ? I got one which doesnt work :( can u post the link.

DNR works for me especially dnr2.1, they r slow but if they work well for u as it did for me. Then its good, ive never really had any super good experience with picfix (3-4), since it only reduced my finalsize by 3-4mb :rolleyes:

wotef
28th June 2002, 19:06
http://sauron.mordor.net/dgraft/hiq/smoothhiq.html

Bulletproof
28th June 2002, 21:52
Originally posted by Acaila
@kilg0r3:
This is the script that's worked best so far, I'm still working on it.
Source=MPEG2source("D:\DivX Rip\DivX\X-Men\X-Men_64bit.d2v").Crop(16,74,696,432)

Temporal=TemporalSmoother(Source,1).MergeChroma(Source)

Spatial=SmoothHiQ(Temporal,3,10,15,192,3).MergeLuma(Temporal)

Movie=Spatial.Trim(0,136800).Tweak(hue=2.5,bright=1.0).BicubicResize(672,288,0,0.5)
Credits=Trim(Source,136801,0).TemporalSmoother(10).BilinearResize(672,288)

Return Movie+Credits
Before I used partial merge of luma/chroma. The cleaning was better, but the color shifts were also more pronounced.

As per your suggestion, I'll try out TemporalSoften as well. :)

I'm a bit confused here, hoping you can help me out. On the 2nd line you have the "Temporal" variable, but it has ".MergeChroma(Source)" on the end of it. I tried looking this up in the Avisynth reference but it is not there. And you said you wanted to have the Temporalsmoother on the Luma plane but you have MergeChroma on that line..

Acaila
28th June 2002, 22:31
MergeChroma and MergeLuma are external filters.

What that "Temporal=" line does is apply a temporalsmoother to the current frame, and then restore the Chroma channel of that frame once it's done with the temporalsmoother. This will leave only the Luma channel smoothed.

With the "Spatial=" line it's the other way around, it smoothes both channels and restores the Luma part, leaving the Chroma part smoothed.

The MergeChroma() takes the Chroma part of a source and merges it with the current frame (leaving Luma untouched). The MergeLuma() is the opposite.

Both can be found in the avisynth section, just do a search.

MoonWalker
29th June 2002, 13:38
And a little stupid question :) @ acaila..

Why you use all these command for a smoother?Is it better then the TemporalSmother?

And where did you find the MergeChroma and MergeLuma filter??

Thanks,
MoonWalker

Acaila
29th June 2002, 14:22
Answers to both questions can be found if you read my other posts on this thread...

bill_baroud
30th June 2002, 02:56
another stupid question :

i've try to test you're settings and after have got the MergeChroma/Luma dll and the VirtualDub Filter Pack for Avisynth, something was wrong for me...

Since the SmartSmooth HiQ (i suppose it's the filter you use) is a virtual dub filter, it works in RGB mode, true ?

so how could you use it after a separation of Luma and Chroma channel ?

i have try with some ConvertToRGB() but it do nothing...have i missed something ?
(or i don't use the good filter ?)


sorry to bother you, but you're combination of filter look pretty interesting ;)

Acaila
30th June 2002, 09:03
SmoothHiQ is the Avisynth version of the SmartSmoothHiQ filter. You can find it here (http://cultact-server.novi.dk/kpo/avisynth/smooth_hiq_as.html).

soujir0u
30th June 2002, 09:50
I think for anime, SmartSmoother(HiQ) and Warpsharp really makes the picture better for many sources.

bill_baroud
30th June 2002, 13:24
thanks for your quick responses !

for the little test i have run it's great, a gain of about 15Mb on a 190Mb clip, with the same image quality...really great!

octapus
30th June 2002, 14:53
Hey Acaila, your script is doing a good job. But it has its disadvantages too: due to combination of several filters it becomes very,very slow. I tried it with a DVD material and the maximum speed i got was 1,5 fps. I certainly don't have a really fast machine(900 Mhz). I used it with latest Nic's build and fast recompress ticked.

Acaila
30th June 2002, 17:42
Yeah I know it's extremely slow :D. But I guess that's the price we have to pay.

I would really like it if some of you would make some suggestions on how to improve this filter chain. Particularly the color/brightness issue, I don't like correcting things with a Tweak.
Also suggestions on how to retain more detail or how to get rid of more noise would be great.

Ps.
I'm using the following line now instead of what I gave earlier. It seems to be slightly better for retaining detail.
Spatial=SmoothHiQ(Temporal,3,25,10,192,3).MergeLuma(Temporal)

wotef
1st July 2002, 22:20
do you mean you don't like to use avisynth tweak? or that you want a solution to stop your filterchain changing the colour balance in the first place?

Koke
1st July 2002, 22:59
Great debate, folks!
May I suggest that we try some ripping debate
or subtitles here too?

:devil:

Acaila
2nd July 2002, 06:44
do you mean you don't like to use avisynth tweak? or that you want a solution to stop your filterchain changing the colour balance in the first place?
I don't like the chain changing things in the first place.

I already send an email to the creator of the MergeLuma/MergeChroma/SmoothHiQ filters because at that time I was using MergeLuma/MergeChroma with additional paramaters and the color was even further off. Sticking with no extra paramaters has made it much less, but it's still not entirely right.
Maybe a bug in one of the filters?

Bulletproof
2nd July 2002, 08:19
I tried using the extra parameters and even switching between RGB and YUY2 in the same script about 5 times with no color shifting problems, maybe the temporal smoother on your setup is too strong? I made up a similar script to yours to see how it would turn out and it did turn out ok, but not really stellar. My Athlon XP 2100 went down to litterally 1/2fps, 11 hours for 22 minutes of video. I really don't think it's worth it right now to do this, and the filters that are working in Virtualdub natively work pretty decent.

BTW, Does anyone know a filter for correcting bad colorspace video? I actually got a DVD here where the reds are showing checkerboard patterns (Not pixelated red as you usually see in compression). It's from a colorspace problem that originated from the master.

Acaila
2nd July 2002, 08:58
I tried using the extra parameters and even switching between RGB and YUY2 in the same script about 5 times with no color shifting problems,
The effect is only very slight. I've showed it to a few people and they couldn't even notice it, but it's there. You can probably only see it when examining individual frames, not during playback.
maybe the temporal smoother on your setup is too strong?It's the lowest possible setting...
Does anyone know a filter for correcting bad colorspace video?No, sorry. Probably the only thing you can do is smoothing :(

kilg0r3
2nd July 2002, 13:51
@acaila

any feedback on temporalsoften2?

Acaila
2nd July 2002, 14:16
Oops, I forgot all about that :eek:

I'll test it out tonight.

Acaila
2nd July 2002, 19:50
Just finished testing TemporalSoften2 in my filter chain.

I must say it is a little better at preserving quality, but only at very low settings. The color changes are still present however, which lead me to believe they come from the Merge filters...:(

What I've come up with as best setting so far is:
Temporal=Source.TemporalSoften2(1,5,25).MergeChroma(Source)
The Chroma parameter is quite high (just like the Luma value for the SmoothHiQ filter), but I did that on purpose, so the chroma wouldn't be a bottleneck here. Chroma will be taken from original clip anyway, so a value of 255 would give the same result :).
A radius of 2 was already enough to blur more than a TemporalSmoother(1).

Didée
3rd July 2002, 10:08
Hooray, (Acaila),

I am not crazy !!

I have mentioned the slight greenish color shift a couple of times, since those divX 4.02 days. No-one ever understood what I was talking about.

What color shift? Greenish? Must definetly be something with your eyes ...

I even proved it by creating difference images, but no-one believed!

I always knew the color shift was there. But now it is balm on my soul to have another one seeing it.

Okay. On goes the filter discussion ...

Acaila
3rd July 2002, 12:33
And do you know what caused it for you?
TemporalSmoother has been ruled out because with a TemporalSoften2 in my script I get the same effect. I was suspecting the Merge filters, but if you already saw it before that rules them out too.

I remember reading something about greenish frames before, but I believe that was because of YUV->RGB->YUV->RGB etc, and since my control script without any filters doesn't have this effect it can't be avisynth's colorspace conversions either.

Maybe it's Avisynth's buffering when using temporal filters in general? But I can't remember ever having seen it before with just a TemporalSmoother and no other filters in a script.

Nasse
3rd July 2002, 14:22
wow... this thread has certainly got some positive response! i found that temporalsoften2 worked ok for me to... but i still think i loose to much detail... =(

Dark-Cracker
3rd July 2002, 16:09
hi

@Acaila
my english was very poor but it seems to me u have a matter with the mergechroma and the Temporalsoften2 plugin ! i am trying to add an Avisynth GUI to my tool and i have found an avisynth plugin for the Luma and Chroma levels (DeDot v0.3 by thejam) u can found it here :

http://www.eclipsedvd.firstream.net/autodub/DeDot_03.zip

this will perhaps help u. else perhaps i have misunderstand u and u have no matter :)

Ps: sorry again for my poor english.

Bye.

Acaila
3rd July 2002, 18:38
Could be an interesting filter, but I can't find any (readable) documentation anywhere. Even the readme is japanese or chinese or something.
Babelfish can't make heads or tails out of it either.

Dark-Cracker, do you know how to use it, what the parameters are and such?

Dark-Cracker
3rd July 2002, 18:59
i don't have find a readable documentation (my english is very crap and my japanese much more :) ) i only know this :

DeDot(luma2d,lumaT,chromaT1,chromaT2)

Default values : 20,20,15,5

i hope this will help u :-)

PS: i have find a lot of interesting avisynth filters i am actually try to add them in my tool (autodub) to make an Avisynth Gui the most interesting plugin i have found are : a dynamic noise reduction, a 2D cleaner Noise reduc,a Temporal cleaner , a Wavelet Noise reduc.
if one of this plug in interest u i can post it (however most of them have an japanese documentation ).

ARDA
3rd July 2002, 20:20
@Dark-Cracker

If you can download the sources of those filters.I think any of the great developers we have in the forum could manage to understand the algo and theirs parameters.
Maybe you can post a link to where you've got them.

Thanks ARDA

Dark-Cracker
3rd July 2002, 21:10
the DeDot plugin it developped by TheJam, and he don't publish it source, and the documentation it only in japanese :( sorry but the only way it to make some test with random value.

Nasse
4th July 2002, 21:27
when i installed the smartsmoothhiq i installed it to vdub plugins directory... is it something else i need to do to get it it to work in my avs?

Dark-Cracker
4th July 2002, 21:52
for using the Vdub plugin in avisynth u need the Wilbert script.

here : http://forum.doom9.org/showthread.php?s=&threadid=23804

else u can use my tool (url in my signature) who create the .avs file and use some Vdub filters (Smartsmoother Hiq, 2Dcleaner opt, and Warpshap) automaticly .

Bye.

Nasse
5th July 2002, 11:12
@dark-cracker

thanks man... i sometimes use your tool for testing stuff with video...