Quantcast Avisynth: Changes for MA Script for 528x480/576 Resolution? - digitalFAQ.com Forums [Archives]
  #1  
07-07-2003, 05:59 PM
audioslave audioslave is offline
Free Member
 
Join Date: Mar 2003
Location: Sweden
Posts: 725
Thanks: 0
Thanked 0 Times in 0 Posts
Hi kwag and all,
From what I understand the MA script is optimized for resolutions from 528x480/576 and up? What changes do I have to make to the script if I plan encodes at 352x240/288 or 480x480/576? Maybe a stupid question...
__________________
AudioSlave
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
07-07-2003, 06:03 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Hi audioslave,

The only change needed should be the value for switching between blurring and Temporal filtering.
Look at the line: ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= 2 ? \
And change the >= 2 to >=4
That should basically take care of 352x240(28.
For 480x, I think that a value of 3 should be pretty close to ideal.
Give it a try

-kwag
Reply With Quote
  #3  
07-07-2003, 06:09 PM
audioslave audioslave is offline
Free Member
 
Join Date: Mar 2003
Location: Sweden
Posts: 725
Thanks: 0
Thanked 0 Times in 0 Posts
@kwag,
Thank you for your fast reply as always! What parameter am I tampering with if I'm changing the value you described? I mean, what does it do?
__________________
AudioSlave
Reply With Quote
  #4  
07-07-2003, 06:14 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
The value you are tampering with is the value to compare the returned value from the function "YDifferenceToNext()".
The less activity, the lower the value and vice versa. So it's really a "treshold" trigger point to switch between the blurring line "unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) )" and the Temporal line "TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) ,1, 1)"

-kwag
Reply With Quote
  #5  
07-07-2003, 06:21 PM
audioslave audioslave is offline
Free Member
 
Join Date: Mar 2003
Location: Sweden
Posts: 725
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks again! I was just curious. So what will happen if I use the value for 528x480/576 if I'm encoding 352x240/288 for example?
__________________
AudioSlave
Reply With Quote
  #6  
07-07-2003, 08:12 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by audioslave
Thanks again! I was just curious. So what will happen if I use the value for 528x480/576 if I'm encoding 352x240/288 for example?
The value returned by "YDifferenceToNext()" will be different for different resolutions, so you'll be switching filters at non-optimal activity values. You can easily see the value of "nf" variable (the treshold variable) if you insert this line at the end of your script:
Code:
ScriptClip("Subtitle(String(nf),1,30)")
This way you can tune the treshold point by loading your script in Vdub, and sliding to different parts of your movie. Try it

-kwag
Reply With Quote
  #7  
07-08-2003, 12:37 AM
vico1 vico1 is offline
Free Member
 
Join Date: Sep 2002
Location: USA
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
So for fine tuning using a 1/2 DVD Rez, (352x480 ntsc) a value of >=3 or 4 sounds
about right, depending on the movie?


*******************************
The Devil`s always.....in the Details!
Reply With Quote
  #8  
07-08-2003, 08:13 AM
Fiz Fiz is offline
Free Member
 
Join Date: Jan 2003
Location: London, UK
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
Kwag,

Is it possible to use a formula to derive this threshold based on the width of the clip?

I have tried the following code and it assigns the threshold based on the current width of the clip.

Code:
DifferenceThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2

ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= DifferenceThreshold ? \ 
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) ")
The reason I do "<=" is that the overscan parameter of GripCrop will reduce the width so it may be less than 352 etc until GripBorders runs. I used your example (below) to view the value:

Code:
ScriptClip("Subtitle(String(DifferenceThreshold),1,30)")
and I can see the value changing for each resolution I choose. This way the script can be automated further or do you think this would impact performance?

Cheers,

Fiz.
__________________
Fizzy Wizzy Lets get Bizzy!
Reply With Quote
  #9  
07-08-2003, 10:28 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Fiz
Kwag,

Is it possible to use a formula to derive this threshold based on the width of the clip?
Yes
Quote:

I have tried the following code and it assigns the threshold based on the current width of the clip.

Code:
DifferenceThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2

ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= DifferenceThreshold ? \ 
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) ")
The reason I do "<=" is that the overscan parameter of GripCrop will reduce the width so it may be less than 352 etc until GripBorders runs. I used your example (below) to view the value:
That's's correct, and it must be done that way to consider overscan blocks
Quote:

Code:
ScriptClip("Subtitle(String(DifferenceThreshold),1,30)")
and I can see the value changing for each resolution I choose. This way the script can be automated further or do you think this would impact performance?

Cheers,

Fiz.
Hi Fiz,

You just reminded me of what I did a long time ago to automate Blockbuster noise levels, depending on resolution
Your lines are perfect, and just made it to the current script
I'm updating it right now

Thanks,
-kwag
Reply With Quote
  #10  
07-08-2003, 10:53 AM
Fiz Fiz is offline
Free Member
 
Join Date: Jan 2003
Location: London, UK
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
Your lines are perfect, and just made it to the current script
I'm updating it right now
Cool
__________________
Fizzy Wizzy Lets get Bizzy!
Reply With Quote
  #11  
07-08-2003, 10:59 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Fiz,

Script posted
I only changed the variable name "DifferenceThreshold" to "SwitchThreshold", because it seemed more appropiate for the description
I just tried it on a one minute clip, and there are no speed penalties with or without the changes
Probably because it's just comparing constants

-kwag
Reply With Quote
  #12  
07-08-2003, 11:12 AM
Fiz Fiz is offline
Free Member
 
Join Date: Jan 2003
Location: London, UK
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks kwag, being the novice I am I've learnt so much from this forum, not to mention the high quality encodes I'm churning out these days! I'm just glad to be part of it!
__________________
Fizzy Wizzy Lets get Bizzy!
Reply With Quote
  #13  
07-28-2003, 05:29 PM
TLTw TLTw is offline
Free Member
 
Join Date: Jan 2003
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Code:
DifferenceThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
if i understand that right if its <=352 it assigns a 4 if <=480 a 3 and all else is assigned a 2 ?
Reply With Quote
  #14  
07-28-2003, 05:41 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by TLTw
if i understand that right if its <=352 it assigns a 4 if <=480 a 3 and all else is assigned a 2 ?
Yep

-kwag
Reply With Quote
  #15  
07-28-2003, 07:12 PM
DKruskie DKruskie is offline
Free Member
 
Join Date: May 2003
Location: Michigan
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
I have been using the current MA script with 352x240 resolution since it came out and it looks great on my tv. I didnt know I had to change any values for 352x240



David
Reply With Quote
  #16  
07-28-2003, 08:40 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Hi DKruskie,

You should use the line above, because it does make a difference
Check the curent script page, and update you script

-kwag
Reply With Quote
  #17  
07-28-2003, 10:06 PM
DKruskie DKruskie is offline
Free Member
 
Join Date: May 2003
Location: Michigan
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
I updated my script..do I need to change any values for 352x240 or are they already set?


David
Reply With Quote
  #18  
07-28-2003, 10:22 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by DKruskie
I updated my script..do I need to change any values for 352x240 or are they already set?


David
They are automatically set

-kwag
Reply With Quote
  #19  
07-28-2003, 10:26 PM
DKruskie DKruskie is offline
Free Member
 
Join Date: May 2003
Location: Michigan
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
Cool, thanks Kwag



David
Reply With Quote
  #20  
07-28-2003, 10:35 PM
TLTw TLTw is offline
Free Member
 
Join Date: Jan 2003
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks Kwag,

I just took a(brief) look through the avisynth manual its more than just frameserving its a language in its own right.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Intermediate resolution between 352x240 and 528x480 ? jim620 Video Encoding and Conversion 20 04-24-2004 07:54 AM
Avisynth: Optimal Script Resolution? Bchteam Avisynth Scripting 2 04-04-2004 05:34 AM
do i need to increase the resolution to 544x480 or 528x480? enximex Video Encoding and Conversion 6 11-09-2003 11:44 AM
Star Wars on one kvcd with 528x480 resolution? Adder Video Encoding and Conversion 16 02-26-2003 08:37 AM
Capturing 528x480 resolution from vhs with wintv go rendalunit Video Capturing / Recording 5 08-29-2002 03:56 PM

Thread Tools



 
All times are GMT -5. The time now is 06:16 AM  —  vBulletin © Jelsoft Enterprises Ltd