8
88888 Dihedral
BGBæ–¼ 2012å¹´8月22日星期三UTC+8上åˆ9時01分49秒寫é“:
It is easy to implement the LZW codec in C.
The problem is just equivalent to a hash table implementation in C.
I've been looking for algorithms/code to render gif's
from in-memory pixel rasters, and gif/rbtree from
http://www.malcolmmclean.site11.com/www/datadensity/
seems among the best. Anybody used that, have comments
or alternative/better recommendations?
My interest mostly stems from forkosh.com/lineart.html whose
C source currently uses http://shh.thathost.com/pub-unix/#gifsave
and then system()'s imagemagick convert for animations.
But I now need to render animated gif's internally, and
modify somebody's gif code for that purpose (or develop it from
scratch). The better functional decomposition of gif/rbtree
seems to make that easier for me than gifsave.
But I noticed some occasionally-nasty comments about that on
http://bytes.com/topic/c/answers/682627-malcolms-new-book
while googling (some of them by frequent posters in this ng.
Does gif/rbtree work pretty robustly (that "looking-for-comma"
at the start of loadgif() seems a little risky, though I haven't
read the gif specification carefully yet, and wouldn't need that
half of the code, anyway)?
While testing savegif() myself, just using the embedded test
driver, I did find a trivial bug which always replaces the
savegif(loadgif(argv[1])) with an empty image. Just a "return"
at the end of if(argc==2){...}, or a guard for the empty-image
savegif() with else{...} or if(argc!=2){...} is needed.
But then my own tests worked fine, except that it occasionally
gets the background color wrong. But I haven't looked into that yet,
or even studied the code carefully. Before I start, any other
recommendations for this kind of little project? Thanks,
I think the LZW patents of Unysis and the arithmetic coding patentsof IBM are all expired long time ago.
the LZW patent expired in 2006 IIRC.
I think many other forms of arithmetic coding are also in the clear as
well. the main downside of AC though is that it generally isn't as fast
as Huffman, so it is more a small gain in compression for a loss in speed..
although, it isn't that bad, for example, the H.264 / MPEG-4 AVC codec
successfully uses arithmetic coding.
Those are not too difficult to implement in C for a losslessdata compression in 199X.
I got paid well for those trivial easy jobs from my old image processinglibrary with those technitians who can't even write a 64 bit by 64 bitinteger multiplication in the 80386 instructin set.
It's kind of slow and boring except the pay in the small scale casino park.
Google and Facebook proved that the US Hi-tech casinos are much morewell paid for the funders.
still annoyingly hard to get paid as a programmer though.
"the money" is always far away and one lives life generally being
regarded as useless by any potential employers.
this is partly why I am looking into trying to develop and market
something myself...
It is easy to implement the LZW codec in C.
The problem is just equivalent to a hash table implementation in C.