dloebl / cgif

GIF encoder written in C
MIT License
113 stars 15 forks source link

Don't enqueue duplicate, sequential frames #55

Closed joshuamsager closed 1 year ago

joshuamsager commented 1 year ago

Slight optimization to: cgif_addframe

cgif_addframe now drops sequential frames that are identical to the previous frame and sums the frames' delay. This trick means we are encoding fewer bytes in the final GIF.

It should bring a slight improvement to decoders when decoding GIFs with sequential, duplicate frames as there is now fewer total frames to decode.