 	const float cost1 = static_cast<float>(unpack_cost(t2.values[1]));
 	const int disp0 = static_cast<int>(unpack_index(t2.values[0]));
 	const int disp1 = static_cast<int>(unpack_index(t2.values[1]));
-	if(cost1 * uniqueness >= cost0){
-		return disp0;
-	}else if(abs(disp1 - disp0) <= 1){
+	if(unpack_uniq(t2.values[0])){
 		return disp0;
 	}else{
 		return 0;

						d / REDUCTION_PER_THREAD,
						WARP_SIZE);
#endif
					right_top2[i].push(recv);
					if(d == MAX_DISPARITY - 1){
						if(0 <= p){
							right_dest[p] = compute_disparity_normal<MAX_DISPARITY>(right_top2[i], uniqueness);

		values[1] = 0xffffffffu;
	}

	__device__ void push(uint32_t x, float uniqueness){
		update_top2(values[0], values[1], x, uniqueness);
	}
};

template <unsigned int GROUP_SIZE, unsigned int STEP>
struct subgroup_merge_top2_impl {
	static __device__ Top2 call(Top2 x, float uniqueness){
#if CUDA_VERSION >= 9000
		const uint32_t a = __shfl_xor_sync(0xffffffffu, x.values[0], STEP / 2, GROUP_SIZE);
		const uint32_t b = __shfl_xor_sync(0xffffffffu, x.values[1], STEP / 2, GROUP_SIZE);
