Learning to super-resolve images using self-similarities