Logo Search packages:      
Sourcecode: ffmpeg version File versions  Download package

SwsVector* sws_getGaussianVec ( double  variance,
double  quality 
)

Returns a normalized Gaussian curve used to filter stuff quality=3 is high quality, lower is lower quality.

Definition at line 2887 of file swscale.c.

References av_malloc().

                                                              {
    const int length= (int)(variance*quality + 0.5) | 1;
    int i;
    double *coeff= av_malloc(length*sizeof(double));
    double middle= (length-1)*0.5;
    SwsVector *vec= av_malloc(sizeof(SwsVector));

    vec->coeff= coeff;
    vec->length= length;

    for (i=0; i<length; i++)
    {
        double dist= i-middle;
        coeff[i]= exp(-dist*dist/(2*variance*variance)) / sqrt(2*variance*PI);
    }

    sws_normalizeVec(vec, 1.0);

    return vec;
}


Generated by  Doxygen 1.6.0   Back to index