Very simple baseline  JPEG encoder written in MATLAB