image-rs / image-gif

GIF en- and decoder
Apache License 2.0
150 stars 40 forks source link

Decode without buffering #153

Closed kornelski closed 11 months ago

kornelski commented 1 year 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 12 months ago

@HeroicKatora ping