avfilter/vf_neighbor: rewrite without using temp memory