some obvious changes
more advanced changes
buf swapping, fps logging, boundary case and 320x240 size