Coder Social home page Coder Social logo

edelkas / giflib-turbo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bitbank2/giflib-turbo

0.0 0.0 0.0 52 KB

A faster drop-in replacement for giflib. It uses more RAM, but you get more speed.

License: Apache License 2.0

C 97.21% Makefile 1.14% CMake 1.65%

giflib-turbo's Introduction

GIFLIB-Turbo

What is it?

A faster drop-in replacement for GIFLIB

Why did you write it?

Starting in the late 80's, I was fascinated with computer graphics and code optimization. I wrote my own GIF codec and kept it for myself mostly due to the legal issues surrounding the LZW patents. Over the years I improved it and experimented with new ideas for speeding it up. I got busy with other projects and it sat untouched for a long time. I recently picked up this code again to port it to run well on embedded processors. Out of curiousity, I researched the situation with giflib and found that it's not only still in use and running on billions of devices daily, but it's very inefficient code. I think my project can make a useful contribution to the open source community and actually have a positive impact on the usability and environmental impact of working with GIF files.

What's special about it?

The original GIF codecs were written for a much different world and took great pains to use as little memory as possible and to accommodate a slow and unreliable input stream of data. Those constraints are no longer a problem for the vast majority of users and they were hurting the performance. Another feature holding back the performance was that the original codec was designed to work with image data a line at a time and used a separate LZW dictionary to manage the strings of repeating symbols. My codec uses the output image as the dictionary; this allows much faster 'unwinding' of the codes since they are all stored in the right direction to just be copied to the new location.

Are there any downsides to rocking this boat?

The aim of this code is to allow for a painless transition to more speed. The function names, parameters and output are identical to the original giflib. The potential problems that loom ahead are security vulnerabilities and incompatibilities with different target CPUs. These can eventually be tested and fixed, but it may take a long time before this code is adopted by large stake holders.

Where else can this be beneficial?

The slower LZW algorithm is in wide use in popular projects like ffmpeg, ImageMagick and others. It would benefit a lot of people to implement the fast algorithm in those projects too, but I don't have the time to code/test/support all of those projects.

giflib-turbo's People

Contributors

bitbank2 avatar drfiemost avatar edelkas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.