View Single Post
Old 17th August 2016, 18:52   #9  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,554
Here's my modified source and x64 dll that should be compilable on linux if you have a float fftw3 lying around. I didn't test it though. Report your findings and so on. Just done as a 30 min code stabbing session while eating dinner.

Changes:
Removes the loadlibrary loading of fftw3 and instead uses the official fftw3.h
Replaced all homegrown pi constants with the more accurate M_PI
Removed all unused variables where it was obvious no use was ever intended
Fixed an extreme number of type conversion warnings, some of them by making sure all calculations stay in float precision

And can someone check this piece of code?
Code:
void pointNotchFilter2D( float * freqFilter, int* spec, int ht, int wd)
{
	// point centered notch filter
	float xf = spec[2] * wd / (NYQUIST);

	float yf = spec[3] * ht / (NYQUIST );

	int degree = 2 * spec[4];

	// calculate notch radial sqr
	float d0sq = sqrt (xf*xf + yf*yf);
	d0sq = (ht * ht + wd * wd)/ 4;
It looks very suspect. Like it should be multiplied or divided or something instead of the first value assigned to d0sq just being discarded.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 9th April 2018 at 13:17. Reason: Updated link
Myrsloik is offline   Reply With Quote