imported from http://www.ipol.im/pub/art/2011/bcms-ssdd/