enigma-dev/enigma-dev — pull request #897 by sorlok (2014-12-19 00:38:25+00:00)
Title: Animated GIF decoder.

The animated GIF decoder is finally ready to be merged. I've integrated all of Josh's recommendations except the last one:

```
From a readability standpoint, I'd extract these phases into their own functions...
```

I'd rather not shuffle things around unless you're very concerned about future maintainability. The massive for loop, for example, does bit unpacking, code table construction, index stream reconstruction, and tiled output all at once, so segmenting that into functions will not improve readability. Anyway, let me know if you really do prefer a refactoring.

Note that GIFs are usually loaded by specifying an image count of "0", so I had to change the image loading code to pass a pointer to img_num (the algorithm updates it).

Ran it through valgrind; found nothing suspicious.