Log in

View Full Version : @dvd2svcd : why temporal smoother before resize ?


nick ctrl
1st March 2002, 23:22
I'm just wondering why in the avisynth script the temporal smoother filter is called before the resize ?

if you invert both, the script goes faster, as the smoothing effect is generated on only 2/3 of the pixels ...

is there any difference about quality ? or is it possible to add an option to decide of that order ?

cheers

nick ctrl
4th March 2002, 23:40
Anyone having an answer to my questions ?

Kedirekin
5th March 2002, 03:11
I think it's more a matter of personal preference than any concrete reason.

Some feel that you get better quality (i.e. cleaner detail) if you do all your de-noising before resize (which is a pretty good argument).

Others feel that resize itself eliminates noise to a large extent, therefore you can lower the intensity of the filter settings if you put the de-noising after resize, and thereby realize better quality (also a good argument). And of course you get better speed.

For myself, I can't tell any difference in quality, so I'd go with whatever is fastest. It's quite easy to accomplish this via the avs edit capability. Admitedly having it as an option would be convenient, but it's not worth making a stink over and endless proliferation of options would clutter the interface.

sandchar99
5th March 2002, 19:01
I always use TemporalSmoother because most of my encodes are CBR or 1 Pass VBR even though I try to keep the bitrates in the 2100 to 2400 range. At this bitrate TemporalSmoother may not be necessary but I continue to use use it out of habit. Of course this slows the RT down significantly.

So Kedirekin, thanks for the explanation.

I plan to do some tests at these higher bitrates and see how much quality difference I notice and if a significant impact is made on RT.

Kedirekin
6th March 2002, 01:45
Good point. For myself, I try to target a total encode time less than 22 hours on my box. I feel 3-pass VBR with TS is better than 5-pass without, so I usually use TS (and I'm usually too lazy to swap the resize/TS order, so I just live with the slightly lower rt).

Of course, for most movies I can do 5-pass VBR with TS and still finish within 22 hours, so no complaints here. :p

role
6th March 2002, 19:57
Admitedly having it as an option would be convenient, but it's not worth making a stink over and endless proliferation of options would clutter the interface.

What about adding an option to edit the avs script before the ripping?

In this way those of us that who would like to experiment with different settings could do this without having to wait for the ripping procedures. And the interface would not have to be cluttered and confusing to newbies.

DVDHack
6th March 2002, 22:26
The edit before the rip would be a god sent for me. I often kick an encode process off before I go to work and must wait for the rip and dvd2avi process to compete so I can do my edit else it all hangs until I get back. (I delete the resize line - do anamorphic)

It seems you always get the movies that rip slowly whan you are in a hurry... Is this an extension to Murphy's Law?

Kedirekin
6th March 2002, 22:46
The problem with edit before rip is that you wouldn't be able to preview your script changes. I can just imagine the fall-out from people complaining that an entire encoding session was trashed because of one minor typo in the avs file (even though it'd be their own damn fault).

If I were DVD2SVCD, I definately wouldn't introduce a feature like this, at least not one that is easily available via the GUI. That'd be just asking for grief.

Perhaps a hidden switch in the ini file, like the one done for iAuthor support a while back, and therefore only available to advanced users at their own risk (and I'd include big warnings in the ini file, in all caps, to that effect).

Or better yet, just change the coding of DVD2SVCD to use a pre-existing avs file if one exists. Then you could just copy/paste your preferred script before you even start DVD2SVCD. Of course, that'd invalidate many of the settings in DVD2SVCD (IVTC, deinterlace, 4:3 vs 16:9, permanent subs, etc), but again, that'd be your fault.

DVDHack
7th March 2002, 00:03
I'd be happy if DVD2VCD just used a predefined script file since my settings are always identical. I never resize, I never downsample, I always use the same ecoding directory etc.

If I do something specific (pretty rare) e.g. Sub Mux I would be happy to hang around and do my edits manually as I do today.

@DVD2SVCD
Can't the script file simply be built right at the beginning of the process. This would just change the order the process gets done in rather than adding additional code.

I'm happy with the way things work at the moment, its just aiming for that utopia.

role
7th March 2002, 10:18
I agree with DVDHack!
My script is allso identical from time to time. (Obviously becasue I usually backup the same type of movie).
So I´m kind of hoping for an option like:

Do not change avs file (not recomended).

I realize this may cause problem for some titles, but thats bad luck for those of us that choose this option. (In that case we would know why these problems may occur).

I allso agree with DVDHack in the sence that DVD2SVCD is a great program as is, but lets face it, once you get used to good stuff you want more... ;) (Greed)

role
7th March 2002, 10:32
Correction:

"Do not change avs file" should (obviously) be something like "Use predefined avs file" or "Use existing avs file".

@Kedirekin, I see your point. I would not mind having this option in the ini file instead of in the GUI.

sandchar99
13th May 2002, 20:13
Previously, I had always used the default of TS (2,1) before the resize.

Recently I did an encode, XMEN, region 1, NTSC and place the TemporalSmoother command after the resize. It is 2.35:1, a 16:9 with black borders (56 pixels) above and below.
________________________________
LoadPlugin("C:\*YOUR PATH*\mpeg2dec.dll")
mpeg2source("C:\Movie....")
BicubicResize(480,280,0.00,0.60,0,56,720,368)
TemporalSmoother(2,1)
AddBorders(0,100,0,100)
________________________________


I did this because you can combine crop and resize statements in Bicubic and I wanted to see if combining the statements would speed things up. When they are separate (Crop.... and Resize.......) I would put the TS command in between (ie before the resize). But since Crop and Resize were combined in a single Bicubic command I did not know where to put the TS line so I put it afterwards.

Well, lo and behold, RT was 0.98.

So I repeated the encode this time doing it my usual way:
________________________________
LoadPlugin("C:\*YOUR PATH*\mpeg2dec.dll")
mpeg2source("C:\Movie....")
Crop(0,56,720,368)
TemporalSmoother(2,1)
BicubicResize(480,280,0.00,0.60)
AddBorders(0,100,0,100)
________________________________

RT was 0.78

The encodes looked identical.

A search of forums yielded this thread:

see this thread (http://forum.doom9.org/showthread.php?s=&threadid=21942)

Basically, it says that TemporalSmoother might be better after resize, especially if it is Bicubic resize. From a speed of encode viewpoint, there is a clear advantage.

So I bring this to the attention of DVD2SVCD. Might it be possible to include an option on the Frameserver tab "Place Temporal Smoother after Resize" when the user selects DVD2SVCD level "Advanced". This would be helpful when the user elects not to Preview the AVS script in Frameserver tab.

Thanks

markrb
13th May 2002, 20:19
I have always used any filters before the resize if at all possible. This way anything bad happening to the video will be less noticable.
I don't use TS anymore since most of my sources are pretty clean and I already use a filter that slows my encoding down so this double hit would be too much for me.

Mark

chainsaw135
13th May 2002, 22:42
I myself dont use ts at all dont need to with my settings and like markrb said the dvd source is clean anyways so with the right settings and knowing how 2 setup your encoding i find that ts is something that i dont need, i'm sure others feel the need thats preference at best:)

Juhan
17th May 2002, 07:07
Well, if TemporalSmoother is used on very complex scenes it helps a lot. It is easier to encode a scene if very small details are smoothed (left out). I had a scene with a lot of smoke. Without TS the scene was a little bit pixelated (blocky) and when I used TS the scene looked fine. Also picture was sharp as usual.

sandchar99
23rd May 2002, 20:40
Ok.

I've tried doing filtering before and after Bicubic. Both TS and Smart Deinterlace. I have not done it with Sharpen.

TS: faster by about 0.25 RT when filter after resize. No appreciable difference in quality.

Smart Deinterlace (default settings): faster by 0.25 when filter after resize. Possibly noticeable improvement as well.

I know very well that Multipass wins over CBR and 1 pass VBR. This isn't an issue of whether or not to use certain filters. However, many of us use TS and there are many instances where Smart Deinterlace must be used.

So....

1) I find that there is no reason not to place the filter after the resize when using Bicubic Resize.

2) DVD2SVCD is all about automating SVCD creation.

3) Because many are now using the BAT function of DVD2SVCD, it would be helpful ( :) ) to have the ability to automate the AVS script generation when setting-up the project(s) by having the ability to check a box "Place Filters after resize".

Respectfully,

sandchar99

PS Most recent version, DVD2SVCSD 1.09 build 2, ROCKS. Thanks again, DVD2SVCD. :)

PPS Not a demand/request for a feature. Merely a humble suggestion...

wmansir
26th May 2002, 10:46
Originally posted by sandchar99

Smart Deinterlace (default settings): faster by 0.25 when filter after resize. Possibly noticeable improvement as well.


As long as you are not resizing verticaly, this shouldn't be a problem, but if you do, the resize would blend the interlaced lines together and cause problems. I believe the SimpleResize dll contains an InterlacedResize function, which preserves the interlacing, but I have not used it. check the readme for more info.

MITSUI_1
31st May 2002, 01:11
I think that there is a good reason to do temporalsmoother AFTER all filters, at the very end of the encoding.

Temporalsmoother takes each pixel in a frame, and as to that pixel x,y location, compares the pixel with the same pixel in the NEXT frame. If the colors are very close (within the threshold you set), then it sets them to be EXACTLY the same). This improves compression in light of the use of I, P and B frames in MPEG.

If you do the temporal smooth before the resize, it seems possible to me that the changes effected by doing equating the pixel values might be wiped out.

To see if this really makes a difference in the encoding quality, you could do two test runs on the same video using a CQ encode (say, at 16 Q factor) and change only where you put the temporalsmoother filter in the chain. My prediction is that if its the last filter and if you do not use CCE's own noise reduction in either one, the one with the smoother at the end of the chain will give better compression at the same quality.