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. |
Quote:
|
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} |
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.
|
Quote:
|
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? |
Quote:
Thus, the MA part of the script is less efficient. |
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. |
The MA script, as is, was never intended for interlaced sources :!:
-kwag |
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? |
Yes, but fields are different, and the encoder will see artifacts (jagged lines, etc.). So the results will be a mess :!:
-kwag |
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. |
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? |
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.