GithubHelp home page GithubHelp logo

bitbank2 / giflib-turbo Goto Github PK

View Code? Open in Web Editor NEW
36.0 4.0 7.0 52 KB

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

License: Apache License 2.0

Makefile 1.14% C 97.21% 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

Stargazers

李明 avatar  avatar Jason avatar Ger Hobbelt avatar Clinton Ingram avatar  avatar Russell Jahn avatar Gaëtan L. H.-F. avatar William Adams avatar  avatar Tweak avatar aaaaaaaaaaaaaaaaaa avatar Noel Towa avatar  avatar Cynthia avatar Joel avatar Colin Avrech avatar  avatar Shiimizu avatar Amit D. avatar Jae Hoon, Lim avatar Nguyen Phi Hung avatar  avatar David Capello avatar Larry Gritz avatar Karim Salman avatar Matt Ronge avatar Zhao Xiaohong avatar  avatar Uday Kumar Adusumilli avatar Sean Stevens avatar Saket Dandawate avatar Jeremi M Gosney avatar  avatar Kenny Umenthum avatar tobozo avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

giflib-turbo's Issues

HOW TO BUILD

When trying to build this project using the command "gcc -o test test.c" i have the error : "-lgif not found"
Event by using the Makefile
How can i fix this ?

Deprecated usage of S_IREAD and S_IWRITE

For anyone having issues with undeclared constants S_IREAD and S_IWRITE, simply swap them in the gif_lib.c code by S_IRUSR and S_IWUSR, respectively, and that ought to solve it.

Not sure if there's any particular reason why they're being used here. The glibc docs suggest they're only there for obsolete compatibility with BSD systems.

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.