add average smooth filter c++ implementation