Commit 94fb7a56 authored by michael's avatar michael

cubic filter instead of truncated sinc

looks much better for upscaling & scaling where src and dst size are quite similar


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3201 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 5e2263a9
......@@ -554,12 +554,18 @@ static void build_filter(int16_t *filter, float factor)
for(ph=0;ph<NB_PHASES;ph++) {
norm = 0;
for(i=0;i<NB_TAPS;i++) {
#if 1
const float d= -0.5; //first order derivative = -0.5
x = fabs(((float)(i - FCENTER) - (float)ph / NB_PHASES) * factor);
if(x<1.0) y= 1 - 3*x*x + 2*x*x*x + d*( -x*x + x*x*x);
else y= d*(-4 + 8*x - 5*x*x + x*x*x);
#else
x = M_PI * ((float)(i - FCENTER) - (float)ph / NB_PHASES) * factor;
if (x == 0)
y = 1.0;
else
y = sin(x) / x;
#endif
tab[i] = y;
norm += y;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment