Added SDL.
Use memcpy.
Fixed a problem with overlapping segments and improved speed.