Open pwszebor opened 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.
PutBuffer = bitand(bitshift(1, 24) - 1, bitshift(PutBuffer, 8));
Thank you very much!!(´▽`ʃ♡ƪ)
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.