What did you do this on? virtualdub/avisynth?
Avisynth, you need masktools2 and hqdn3d. Just add those to your plugins directory. You can auto load the script easily by saving the text from function to the last } as a .avsi file. Place it in your plugins folder and all you have to do is import your video and type in the function name.
It’s easier done than said 😉