as-is: It really depend of the source....
assuming you want to use an opamp in between: it's a totally different thing.

You already use some averaging thing, Try the code modification, I'm pretty confident it will solve the problem.

You could also use the ADC in 8 bit mode instead of 10...

Anyways, have a look at this document
http://ww1.microchip.com/downloads/e...Doc/adn007.pdf