33#define PredictorState(tif) ((TIFFPredictorState*) (tif)->tif_data)
55 static const char module[] =
"PredictorSetup";
60 switch (
sp->predictor)
69 "Horizontal differencing \"Predictor\" not supported with %d-bit samples",
77 "Floating point \"Predictor\" not supported with %d data format",
86 "Floating point \"Predictor\" not supported with %d-bit samples",
93 "\"Predictor\" value %d not supported",
106 if (
sp->rowsize == 0)
124 if (
sp->predictor == 2) {
126 case 8:
sp->decodepfunc =
horAcc8;
break;
162 else if (
sp->predictor == 3) {
203 if (
sp->predictor == 2) {
241 else if (
sp->predictor == 3) {
261#define REPEAT4(n, op) \
264 tmsize_t i; for (i = n-4; i > 0; i--) { op; } } \
284 unsigned char*
cp = (
unsigned char*) cp0;
288 "%s",
"(cc%stride)!=0");
297 unsigned int cr =
cp[0];
298 unsigned int cg =
cp[1];
299 unsigned int cb =
cp[2];
303 cp[0] = (
unsigned char) ((cr +=
cp[0]) & 0xff);
304 cp[1] = (
unsigned char) ((cg +=
cp[1]) & 0xff);
305 cp[2] = (
unsigned char) ((
cb +=
cp[2]) & 0xff);
310 unsigned int cr =
cp[0];
311 unsigned int cg =
cp[1];
312 unsigned int cb =
cp[2];
313 unsigned int ca =
cp[3];
317 cp[0] = (
unsigned char) ((cr +=
cp[0]) & 0xff);
318 cp[1] = (
unsigned char) ((cg +=
cp[1]) & 0xff);
319 cp[2] = (
unsigned char) ((
cb +=
cp[2]) & 0xff);
320 cp[3] = (
unsigned char) ((
ca +=
cp[3]) & 0xff);
357 "%s",
"cc%(2*stride))!=0");
392 "%s",
"cc%(4*stride))!=0");
422 "%s",
"cc%(bps*stride))!=0");
440 for (
byte = 0;
byte < bps;
byte++) {
445 tmp[(bps -
byte - 1) * wc +
count];
465 if ((*
sp->decoderow)(tif, op0, occ0,
s)) {
466 return (*
sp->decodepfunc)(tif, op0, occ0);
486 if ((*
sp->decodetile)(tif, op0, occ0,
s)) {
489 if((occ0%rowsize) !=0)
492 "%s",
"occ0%rowsize != 0");
497 if( !(*
sp->decodepfunc)(tif, op0, rowsize) )
513 unsigned char*
cp = (
unsigned char*) cp0;
518 "%s",
"(cc%stride)!=0");
528 unsigned int r1, g1,
b1;
529 unsigned int r2 =
cp[0];
530 unsigned int g2 =
cp[1];
531 unsigned int b2 =
cp[2];
534 g1 =
cp[4];
cp[4] = (
unsigned char)((g1-g2)&0xff); g2 = g1;
537 }
while ((
cc -= 3) > 0);
539 unsigned int r1, g1,
b1,
a1;
540 unsigned int r2 =
cp[0];
541 unsigned int g2 =
cp[1];
542 unsigned int b2 =
cp[2];
543 unsigned int a2 =
cp[3];
546 g1 =
cp[5];
cp[5] = (
unsigned char)((g1-g2)&0xff); g2 = g1;
550 }
while ((
cc -= 4) > 0);
573 "%s",
"(cc%(2*stride))!=0");
613 "%s",
"(cc%(4*stride))!=0");
658 "%s",
"(cc%(bps*stride))!=0");
669 for (
byte = 0;
byte < bps;
byte++) {
673 cp[(bps -
byte - 1) * wc +
count] =
674 tmp[bps *
count +
byte];
697 if( !(*
sp->encodepfunc)(tif, bp,
cc) )
699 return (*
sp->encoderow)(tif, bp,
cc,
s);
705 static const char module[] =
"PredictorEncodeTile";
721 if( working_copy ==
NULL )
728 memcpy( working_copy, bp0, cc0 );
731 rowsize =
sp->rowsize;
736 "%s",
"(cc0%rowsize)!=0");
741 (*
sp->encodepfunc)(tif, bp, rowsize);
745 result_code = (*
sp->encodetile)(tif, working_copy, cc0,
s);
752#define FIELD_PREDICTOR (FIELD_CODEC+0)
755 {
TIFFTAG_PREDICTOR, 1, 1,
TIFF_SHORT, 0,
TIFF_SETGET_UINT16,
TIFF_SETGET_UINT16,
FIELD_PREDICTOR,
FALSE,
FALSE,
"Predictor",
NULL },
772 return (*
sp->vsetparent)(tif,
tag,
ap);
804 switch (
sp->predictor) {
806 case 2:
fprintf(
fd,
"horizontal differencing ");
break;
807 case 3:
fprintf(
fd,
"floating point predictor ");
break;
828 "Merging Predictor codec-specific tags failed");
GLuint GLuint GLsizei count
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define memcpy(s1, s2, n)
static const struct update_accum a1
static const struct update_accum a2
static CRYPT_DATA_BLOB b2[]
static CRYPT_DATA_BLOB b1[]
static HMODULE MODULEINFO DWORD cb
uint16 td_samplesperpixel
TIFFCodeMethod tif_encodestrip
TIFFCodeMethod tif_encodetile
TIFFTagMethods tif_tagmethods
TIFFCodeMethod tif_decodestrip
TIFFPostMethod tif_postdecode
TIFFCodeMethod tif_decoderow
TIFFBoolMethod tif_setupencode
TIFFCodeMethod tif_encoderow
TIFFBoolMethod tif_setupdecode
TIFFCodeMethod tif_decodetile
#define TIFF_SSIZE_FORMAT
#define TIFFFieldSet(tif, field)
#define TIFFSetFieldBit(tif, field)
int _TIFFMergeFields(TIFF *tif, const TIFFField info[], uint32 n)
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
static int swabHorAcc16(TIFF *tif, uint8 *cp0, tmsize_t cc)
static int PredictorDecodeRow(TIFF *tif, uint8 *op0, tmsize_t occ0, uint16 s)
#define PredictorState(tif)
int TIFFPredictorCleanup(TIFF *tif)
static int swabHorDiff16(TIFF *tif, uint8 *cp0, tmsize_t cc)
static int PredictorDecodeTile(TIFF *tif, uint8 *op0, tmsize_t occ0, uint16 s)
static int fpDiff(TIFF *tif, uint8 *cp0, tmsize_t cc)
static void PredictorPrintDir(TIFF *tif, FILE *fd, long flags)
static int PredictorSetupDecode(TIFF *tif)
static int PredictorEncodeRow(TIFF *tif, uint8 *bp, tmsize_t cc, uint16 s)
static int horAcc16(TIFF *tif, uint8 *cp0, tmsize_t cc)
static int swabHorDiff32(TIFF *tif, uint8 *cp0, tmsize_t cc)
static int horDiff8(TIFF *tif, uint8 *cp0, tmsize_t cc)
static int PredictorSetupEncode(TIFF *tif)
static int PredictorSetup(TIFF *tif)
int TIFFPredictorInit(TIFF *tif)
static int PredictorEncodeTile(TIFF *tif, uint8 *bp0, tmsize_t cc0, uint16 s)
static const TIFFField predictFields[]
static int horAcc32(TIFF *tif, uint8 *cp0, tmsize_t cc)
static int fpAcc(TIFF *tif, uint8 *cp0, tmsize_t cc)
static int horDiff16(TIFF *tif, uint8 *cp0, tmsize_t cc)
static int PredictorVGetField(TIFF *tif, uint32 tag, va_list ap)
static int horAcc8(TIFF *tif, uint8 *cp0, tmsize_t cc)
static int swabHorAcc32(TIFF *tif, uint8 *cp0, tmsize_t cc)
static int PredictorVSetField(TIFF *tif, uint32 tag, va_list ap)
static int horDiff32(TIFF *tif, uint8 *cp0, tmsize_t cc)
void _TIFFNoPostDecode(TIFF *tif, uint8 *buf, tmsize_t cc)
tmsize_t TIFFScanlineSize(TIFF *tif)
void TIFFSwabArrayOfShort(register uint16 *wp, tmsize_t n)
void TIFFSwabArrayOfLong(register uint32 *lp, tmsize_t n)
tmsize_t TIFFTileRowSize(TIFF *tif)
void * _TIFFmalloc(tmsize_t s)
void _TIFFmemcpy(void *d, const void *s, tmsize_t c)
#define PREDICTOR_FLOATINGPOINT
#define SAMPLEFORMAT_IEEEFP
#define TIFFTAG_PREDICTOR
#define PREDICTOR_HORIZONTAL
#define PLANARCONFIG_CONTIG
#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
#define TIFFArrayCount(a)
void int int ULONGLONG int va_list * ap