image-rs / image-gif

GIF en- and decoder
Apache License 2.0
148 stars 42 forks source link

Decode without buffering #153

Closed kornelski closed 6 months ago

kornelski commented 8 months ago

Fixes #87

Closes #150 and #151.

Instead of decoding LZW data into an internal buffer, and copying that buffer into another buffer, and then into a frame, it decodes the LZW data directly into the frame where possible.

RGBA data is processed in one place, in a regular function, without a need for a big macro.

Weezl Decoder is recycled if min_code_size doesn't change (which is more efficient according to weezl's docs).

Overall 2%-5% improvement in benchmarks.

kornelski commented 7 months ago

@HeroicKatora ping