performance enhancements, fix for block size error, tests with Middlebury sequences