From: Frank W. <war...@po...> - 2009-06-21 20:13:56
|
Tom Lane wrote: > Frank Warmerdam <war...@po...> writes: >> The std_huff_tables() function has a comment reading: > >> /* Set up the standard Huffman tables (cf. JPEG standard section K.3) */ >> /* IMPORTANT: these are only valid for 8-bit data precision! */ > >> So, my question is, does anyone know appropriate comparable tables to use >> for 12bit images? > > AFAIK the JPEG committee never did propose any default Huffman tables > for 12-bit mode :-( ... that's why libjpeg is set up to forcibly compute > a table in that mode. Tom, Thanks. I have successfully developed a huffman table that seems to work ok for a variety of 12 bit images. I basically picked a reference image, computed the symbol histogram, and added "1" to each bucket in the histogram and computed an optimal table based on that. I don't know how good this is, but at least it works and saves me a preprocessing pass which is difficult in the context of libtiff. I have prepared a patch for this, and attached it to a new ticket. I would appreciate feedback on it before I apply it. http://sourceforge.net/tracker/?func=detail&aid=2809979&group_id=159521&atid=812162 Best regards, -- ---------------------------------------+-------------------------------------- I set the clouds in motion - turn up | Frank Warmerdam, war...@po... light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush | Geospatial Programmer for Rent |