03-30-2004, 09:11 PM
|
Free Member
|
|
Join Date: Feb 2003
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Dialhot,
I suspected that, but I wasn't sure so I just used two functions. I was not sure if AviSynth would properly keep track of multilple variables with the same name. It is great to have experts like you helping out.
|
Someday, 12:01 PM
|
|
Site Staff / Ad Manager
|
|
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
|
|
|
03-30-2004, 09:15 PM
|
Free Member
|
|
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Peter1234
I was not sure if AviSynth would properly keep track of multilple variables with the same name
|
Actually there you are not instanciating a variable, but a parameter. And for sure, that is why function are made for : don't have to repeat something used more than one time.
|
03-30-2004, 09:46 PM
|
Free Member
|
|
Join Date: Feb 2003
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ok. This seems to work also. Thanks Dialhot.
### for interlaced source only
### DV codec required if AVI is DV
LoadPlugin("C:\Filters25\undot.dll")
LoadPlugin("C:\Filters25\STMedianFilter.dll")
LoadPlugin("C:\Filters25\Convolution3DYV12.dll")
AVISource("C:\Documents and Settings\user\Desktop\type2.avi")
ConvertToYV12
Levels(0,0.94,255,0,255)
SeparateFields()
odd=SelectOdd().Kwag_MA()
even=SelectEven().Kwag_MA()
Interleave(even,odd)
Weave()
Function Kwag_MA(clip input) {
undot(input)
Limiter(input)
STMedianFilter(input,3, 3, 1, 1 )
MergeChroma(input,blur(1.5))
MergeLuma(input,blur(0.1))
ScriptClip(" nf = YDifferenceToNext()" +chr(13)+
\ "unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2,
\ 100)) ).TemporalSoften( fmin( round(2/nf), 6),
\ round(1/nf) , round(3/nf) , 1, 1) ")
Convolution3D(input,preset="movieLQ")
Limiter(input)}
Function fmin( int f1, int f2) {return ( f1<f2 ) ? f1 : f2}
EDIT: Do not actually use the above script. Concept is correct but function is not correct. The corrected script follows:
### for AviSynth 2.5
### for interlaced source only
### DV codec required if AVI is DV
LoadPlugin("C:\Filters25\undot.dll")
LoadPlugin("C:\Filters25\asharp.dll")
LoadPlugin("C:\Filters25\UnFilter.dll")
LoadPlugin("C:\Filters25\STMedianFilter.dll")
LoadPlugin("C:\Filters25\Convolution3DYV12.dll")
AVISource("C:\Documents and Settings\user\Desktop\type2.avi")
ConvertToYV12
SeparateFields()
odd=SelectOdd().Kwag_MA()
even=SelectEven().Kwag_MA()
Interleave(odd,even)
Weave()
Function Kwag_MA(clip input) {
undot(input)
Limiter()
asharp(1, 4)
STMedianFilter(3, 3, 1, 1 )
MergeChroma(blur(1.5))
MergeLuma(blur(0.1))
ScriptClip(" nf = YDifferenceToNext()" +chr(13)+
\ "unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2,
\ 100)) ).TemporalSoften( fmin( round(2/nf), 6),
\ round(1/nf) , round(3/nf) , 1, 1) ")
Convolution3D(preset="movieLQ")
Limiter()}
Function fmin( int f1, int f2) {return ( f1<f2 ) ? f1 : f2}
|
04-02-2004, 12:43 PM
|
Free Member
|
|
Join Date: Jan 2003
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I had tried this interlaced MA script with Incredible's modifications (suggested in this thread). The result was ok though I didn't think it was any better than the classic fixed script. My final CQ was still low (around 34) so I just went for a higher CQ anyway.
|
04-02-2004, 01:27 PM
|
Free Member
|
|
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by cweb
My final CQ was still low (around 34) so I just went for a higher CQ anyway.
|
Thats cause of interlacing encoding! Interlaced mpeg2 needs much more bitrate!
|
04-02-2004, 07:31 PM
|
Free Member
|
|
Join Date: Feb 2003
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The following
Kwag_MA()
was used in palce of
SeparateFields()
odd=SelectOdd().Kwag_MA()
even=SelectEven().Kwag_MA()
Interleave(even,odd)
Weave()
in my corrected script above to produce an output file using Kwag's original script at CQ70 (from an interlaced DV test clip). This file was then compared to a file generated using CQ70 and the corrected scrlpt above. Both files looked the same visually to my non-expert eyes, but the file generated using separated fields was 5.7% smaller. My conclusion is that it is better to use the script with separated fields for interlaced inputs. I assume that this is because the 1/2 frame image from separated fields is smoother since it does not have the inconsistencies between adjacent rows that the non-separated full frame has and therefore can be compressed using less bits. But, I am not an expert. Does that seem reasonable to anyone else?
|
04-02-2004, 08:03 PM
|
Free Member
|
|
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Peter1234
I assume that this is because the 1/2 frame image from separated fields is smoother since it does not have the inconsistencies between adjacent rows that the non-separated full frame has and therefore can be compressed using less bits. But, I am not an expert. Does that seem reasonable to anyone else?
|
I think the reason is elsewhere : the "YDifferenceToNext" can't work correcly when "next frame" is in fact "half frame from current frame + half frame from next frame" (that is what interlacing is, isn't it ?).
Thus, the MA part of the script is less efficient.
|
04-02-2004, 09:08 PM
|
Free Member
|
|
Join Date: Feb 2003
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Dialhot,
I think you must be correct. My theory does not make sense because the fields are recombined again before encoding. Therefore the difference must be something in Kwag's MA script. Thanks for your answer.
|
04-02-2004, 09:13 PM
|
Free Member
|
|
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The MA script, as is, was never intended for interlaced sources
-kwag
|
04-02-2004, 09:46 PM
|
Free Member
|
|
Join Date: Feb 2003
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Kwag,
Doesn't separating the fields get around the problems MA has with interlaced sources? With separated fields, doesn't the MA script only see non-interlaced source and so it be happy?
|
04-02-2004, 10:04 PM
|
Free Member
|
|
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yes, but fields are different, and the encoder will see artifacts (jagged lines, etc.). So the results will be a mess
-kwag
|
04-03-2004, 07:36 AM
|
Free Member
|
|
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The problem with separate fields is the "temporalSmoother" and also teh Temporal component of StmedianFilter(xx,1,1)! Means ... by just separating the fields, the temporal radius "reference" would just compare to the next field which isnt correct .... he should compare with every second field.
Thats why boulder posted some time ago the MA-interlaced modding .. where fields will be treated by selectodd/seelecteven and afterwards being interleaved.
|
04-03-2004, 02:47 PM
|
Free Member
|
|
Join Date: Feb 2003
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
incredible,
I thought what I posted was just another version of that, at least that was the intent. Apparently, Kwag is saying that is still not a good thing to do. Am I missing something?
|
All times are GMT -5. The time now is 03:40 PM — vBulletin © Jelsoft Enterprises Ltd
|