Thread: Avisynth+
View Single Post
Old 10th September 2019, 09:34   #4876  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by poisondeathray View Post
Yes the ConvertToXX "sinc" implementation has issues too . Looks to be more than just down direction. Also occurs with avs classic

avsresize shows expected result with sinc

https://i.postimg.cc/kg7MjBk4/sinc.png
In Avsresize sinc is a (legacy) lanczos with taps=4.
While "sinc" in Avisynth+ has different core from Lanczos.

Which can be a bug or not.

Lanczos and Sinc are different in avisynth+ because
"sinc" does not have the extra calculation of sinc(value) * sinc(value/taps) like Lanczos has.

avs+ Lanczos:
Code:
double LanczosFilter::sinc(double value) {
  if (value > 0.000001) {
    value *= M_PI;
    return sin(value) / value;
  } else {
    return 1.0;
  }
}

double LanczosFilter::f(double value) {
   value = fabs(value);

  if (value < taps) {
    return (sinc(value) * sinc(value / taps));
  } else {
    return 0.0;
  }
}
avs+ sinc filter
Code:
/***********************
 *** Sinc filter ***
 ***********************/
double SincFilter::f(double value) {
   value = fabs(value);

  if (value > 0.000001) {
    value *= M_PI;
    return sin(value)/value;
  } else {
    return 1.0;
  }
}
pinterf is offline