JPEG compression implementation in MATLAB. With writing into file.