Code for the ipol inpainting code