AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
April 2006

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2006.04.07 07:34 "application supplied JPEGTables", by <yourpattern@126.com>
2006.04.07 09:01 "Re: application supplied JPEGTables", by Joris Van Damme
2006.04.07 10:05 "Re: application supplied JPEGTables", by <yourpattern@126.com>
2006.04.10 14:21 "Re: application supplied JPEGTables", by Gerben Vos
2006.04.11 06:45 "Re: application supplied JPEGTables", by <yourpattern@126.com>
2006.04.11 08:33 "Re: application supplied JPEGTables", by Joris Van Damme
2006.04.11 09:54 "Re: application supplied JPEGTables", by Gerben Vos
2006.04.11 10:12 "Re: application supplied JPEGTables", by Joris Van Damme

2006.04.07 07:34 "application supplied JPEGTables", by <yourpattern@126.com>

Hi, All

Currently, whether in "tif_ojpeg.c" or "tif_jpeg.c" we can a comment like
this:

/* We do not support application-supplied JPEG tables, so mark the
field not present".       */

I don't know why this was not implemented in the very first time.
and after i go through the code that related to this area (support
application supplied JPEGTables).
It seems not so complicated, for IJG in TIFF can perform
application-supplied JPEG tables easily.
for example, like cjpeg.c in IJG does, we just use function
jpeg_add_quant_table to do this.
 
and in LibTIFF side ,we can define some pseudo tags along with(like)
JPEGTABLESMODE_QUANT for specified different TIFFTAG_JPEGTABLESMODE(that's
application-supplied),
for i see some the code in libtiff like this:
 
 /* Create a JPEGTables field if appropriate */
 if (sp->jpegtablesmode & (JPEGTABLESMODE_QUANT|JPEGTABLESMODE_HUFF)) {
  if (!prepare_JPEGTables(tif))
   return (0);
  /* Mark the field present */
  /* Can't use TIFFSetField since BEENWRITING is already set! */
  TIFFSetFieldBit(tif, FIELD_JPEGTABLES);
  tif->tif_flags |= TIFF_DIRTYDIRECT;
 } else {
  /* We do not support application-supplied JPEGTables, */
  /* so mark the field not present */
  TIFFClrFieldBit(tif, FIELD_JPEGTABLES);
 }
 
It's quit useful if the use can  specified it's own quantization tables for
JPEG compression.
and I would like to propose the addition of the capablity of supporting
application supplied JPEGTables. this would make the control of image
quality of JPEG compress more powerful. currently , the only way to control
the jpeg quality is TIFFSetField(tif, TIFFTAG_JPEGQUALITY, nQuality);
and if we supply a way like :
TIFFSedField(tif,TIFFTAG_JPEGQUALITYTABLE,nTableType,nTableData,nTableDataSize);
or something else.
 
I think it's useful.
anyone, who have simliar ideas pls share with me.
and I am curiously to know why this feature was not implemented until these
days, 
Do i neglect some difficult problems ?
anyone who have abundance knowledge in this field,It's great appreciated
that you can post your comments here .
thanks ,all.
 
yourpattern@126.com