function f=f_pairs_block(image,img_l,img_r,dis_l,dis_r,index,weight)
blocksize=8;
fl(1)=blockvalue_size4_quar(img_l,11,4);
fr(1)=blockvalue_size4_quar(img_r,11,4);

fl(2:6)=blockvalue_size4_new(img_l,blocksize);
fr(2:6)=blockvalue_size4_new(img_r,blocksize);
w=mean2(weight);
if index==1
    f=w*fl'+(1-w)*fr';
else
    f=w*fr'+(1-w)*fl';
end

end