Refactor and unroll upscaling to surface operations
Fix non-local variable
Fix fast copy buffer sizes
Unroll morphological operator inner loops