TheAvalanche / MATLAB-Jpeg-encoder

JPEG compression implementation in MATLAB. With writing into file.
39 stars 12 forks source link

Program doesn't work for qualities bigger than 1 #2

Open pwszebor opened 6 years ago

pwszebor commented 6 years ago

https://github.com/TheAvalanche/MATLAB-Jpeg-encoder/blob/0baedb91507c9dfe22bcab3dd7514c8bc6a28758/huffman.m#L90

This line should be: PutBuffer = bitand(bitshift(1, 24) - 1, bitshift(PutBuffer, 8)); Bits that were already written and shifted should be deleted, so that data buffer is never bigger than 24 bits.

gitofoy commented 5 years ago

Thank you very much!!(´▽`ʃ♡ƪ)