Add merging stage to downsampling pipeline.