The following warnings occurred:
Warning [2] Undefined array key 1 - Line: 313 - File: inc/plugins/google_seo/redirect.php PHP 8.3.12-nmm1 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/google_seo/redirect.php 313 errorHandler->error_callback
/inc/class_plugins.php 142 google_seo_redirect_hook
/global.php 100 pluginSystem->run_hooks
/showthread.php 28 require_once
Warning [2] Undefined array key 1 - Line: 314 - File: inc/plugins/google_seo/redirect.php PHP 8.3.12-nmm1 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/google_seo/redirect.php 314 errorHandler->error_callback
/inc/class_plugins.php 142 google_seo_redirect_hook
/global.php 100 pluginSystem->run_hooks
/showthread.php 28 require_once
Warning [2] Undefined array key "" - Line: 327 - File: inc/plugins/google_seo/redirect.php PHP 8.3.12-nmm1 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/google_seo/redirect.php 327 errorHandler->error_callback
/inc/class_plugins.php 142 google_seo_redirect_hook
/global.php 100 pluginSystem->run_hooks
/showthread.php 28 require_once



This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[BUG] LSFmod in VapourSynth sets incorrect values
#1
Bug 
Hope you are having a good holiday, I've got nothing to do but work with Hybrid and find bugs. Tongue

Looking at LSFMod script, from here --> https://github.com/HomeOfVapourSynthEvol...avsfunc.py

First, Lmode.

According to the above linked Vapoursynth script, Lmode only has positive values of 1-4, with 0 being none.

AviSynth seems to generate the correct Lmodes. But Vapoursynth does not. It has Lmode 5-7 (positive values) which should not exist. Selecting "Limit to over/undershoot on edges and to over/undershoot2 on not-edges" in Vapoursynth sets Lmode=7 when it should be Lmode=4. Setting Lmode to "Limit to over/undershoot" in VapourSynth sets Lmode=4 when it should set Lmode=1. Setting "No Limit" in Vapoursynth sets no Lmode, which implies default, but setting "No Limit" in AviSynth sets Lmode=0; in AviSynth, setting "Limit to over/undershoot" does **not** set Lmode=1, implying default. I'm not sure what the defaults actually are as the above linked script doesn't say, so maybe it should always get set?


4601  ### Lmode [int: ...,0,1,2,3,4]
4602  ### --------------------------
4603  ### Limit mode:
4604  ###    <0 : Limit with repair (ex: Lmode=-1 --> repair(1), Lmode=-5 --> repair(5)...)
4605  ###    =0 : No limit
4606  ###    =1 : Limit to over/undershoot
4607  ###    =2 : Limit to over/undershoot on edges and no limit on not-edges
4608  ###    =3 : Limit to zero on edges and to over/undershoot on not-edges
4609  ###    =4 : Limit to over/undershoot on edges and to over/undershoot2 on not-edges


Second, Smethod.

4533  ### Smethod [int: 1,2,3]
4534  ### --------------------
4535  ### Sharpen method: (only used in Smode=1,2)
4536  ###    =1 : 3x3 kernel
4537  ###    =2 : Min/Max
4538  ###    =3 : Min/Max + 3x3 kernel

Smethod is valid for Smode=2, but Vapoursynth does not set it when Smode=2... it only sets it when Smode=1. In both AviSynth and VapourSynth, Smethod=2 is **not** set, implying default, but LSFmod in AviSynth has more Smodes and Smethods (it includes older ones), so again, since the havsfunc.py script doesn't specify what the defaults actually are, it might be a good idea to specify them always.


So, in AviSynth, clicking the button to load "Slow" defaults and turning PreBlur on, gives:

LSFmod(Smode=5,Smethod=3,Lmode=4,preblur="ON",soft=-2,edgemaskHQ=true)


Doing the same in VapourSynth (I believe MinBlur(1) is the equivalent of PreBlur on in the AviSynth version) gives:

clip = havsfunc.LSFmod(input=clip, Smode=2, secure=True, Lmode=7, soft=-2, edgemaskHQ=True, preblur=1)
  • Smode=2 is correct and is the same as Smode=5 in AviSynth
  • Loading slow defaults in AviSynth selects Min/Max (enh) which sets Smethod=3; in Vapoursynth it selects Min/Max + 3x3 Kernel, which should set Smethod=3 but it doesn't. If it should be the same as AviSynth, then it should actually be Smethod=2, but if AviSynth is wrong and havsfunc.py is correct, then in AviSynth it should actually be setting Smethod=5 for Min/Max (enh) + 3x3 Kernel.
  • secure=true is not set in AviSynth implying it's the default setting (not sure if that's correct or not); it's the opposite in VapourSynth, which if that's correct, then setting secure=true is necessary
  • Lmode=7 is definitely wrong, it should be Lmode=4
  • soft and edgemaskHQ settings are correct in both AviSynth and VapourSynth


Here's the list of what defaults should be for slow, from havsfunc.py:

4725  ### defaults="slow" : - strength    = 100
4726  ### ----------------- - Smode       = 2
4727  ###                   - Smethod     = 3
4728  ###                   - kernel      = 11
4729  ###
4730  ###                   - preblur     = -1
4731  ###                   - secure      = true
4732  ###                   - source      = undefined
4733  ###
4734  ###                   - Szrp        = 16
4735  ###                   - Spwr        = 4
4736  ###                   - SdmpLo      = 4
4737  ###                   - SdmpHi      = 48
4738  ###
4739  ###                   - Lmode       = 4
4740  ###                   - overshoot   = strength/100
4741  ###                   - undershoot  = overshoot
4742  ###                   - overshoot2  = overshoot*2
4743  ###                   - undershoot2 = overshoot2
4744  ###
4745  ###                   - soft        = -2
4746  ###                   - soothe      = true
4747  ###                   - keep        = 20
4748  ###
4749  ###                   - edgemode    = 0
4750  ###                   - edgemaskHQ  = true
4751  ###
4752  ###                   - ss_x        = Smode==3?1.00:1.50
4753  ###                   - ss_y        = ss_x
4754  ###                   - dest_x      = ox
4755  ###                   - dest_y      = oy
4756  ###
4757  ###

This is all I have checked so far so of course there could be more...  Sick



If I'm reading the defaults correctly for "slow" then it should have ss_x=1.5 if Smode=2 or Smode=1 (?):

clip = havsfunc.LSFmod(input=clip, strength=100, Smode=2, Smethod=3, secure=True, Lmode=4, soft=-2, edgemaskHQ=True, preblur=1, ss_x=1.5)

Tongue
Reply


Messages In This Thread
LSFmod in VapourSynth sets incorrect values - by The_Tinkerer - 25.12.2021, 00:49

Forum Jump:


Users browsing this thread: 1 Guest(s)