LibTIFF 4.7.2
TIFF library public API and implementation reference
Loading...
Searching...
No Matches
Macros | Functions | Variables
tif_predict.c File Reference

Implement integer and floating-point Predictor tag transforms. More...

#include "tif_predict.h"
#include "tiffiop.h"
Include dependency graph for tif_predict.c:

Go to the source code of this file.

Macros

#define PredictorState(tif)   ((TIFFPredictorState *)(tif)->tif_data)
 Borrow the predictor prefix of codec-owned tif_data.
 
#define REPEAT4(n, op)
 Repeat a statement using an unrolled small-count switch.
 
#define OP
 Accumulate the next byte in the floating-point fast path.
 
#define FIELD_PREDICTOR   (FIELD_CODEC + 0) /* XXX */
 Reserve the codec field bit for Predictor.
 

Functions

static int horAcc8 (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Accumulate 8-bit horizontal predictor samples in place.
 
static int horAcc16 (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Accumulate 16-bit horizontal predictor samples in place.
 
static int horAcc32 (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Accumulate 32-bit horizontal predictor samples in place.
 
static int horAcc64 (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Accumulate 64-bit horizontal predictor samples in place.
 
static int swabHorAcc16 (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Swap and accumulate 16-bit horizontal predictor samples in place.
 
static int swabHorAcc32 (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Swap and accumulate 32-bit horizontal predictor samples in place.
 
static int swabHorAcc64 (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Swap and accumulate 64-bit horizontal predictor samples in place.
 
static int horDiff8 (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Difference 8-bit horizontal predictor samples in place.
 
static int horDiff16 (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Difference 16-bit horizontal predictor samples in place.
 
static int horDiff32 (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Difference 32-bit horizontal predictor samples in place.
 
static int horDiff64 (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Difference 64-bit horizontal predictor samples in place.
 
static int swabHorDiff16 (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Swap and difference 16-bit horizontal predictor samples in place.
 
static int swabHorDiff32 (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Swap and difference 32-bit horizontal predictor samples in place.
 
static int swabHorDiff64 (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Swap and difference 64-bit horizontal predictor samples in place.
 
static int fpAcc (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Undo floating-point byte-plane prediction on one row.
 
static int fpDiff (TIFF *tif, uint8_t *cp0, tmsize_t cc)
 Apply floating-point byte-plane prediction on one row.
 
static int PredictorDecodeRow (TIFF *tif, uint8_t *op0, tmsize_t occ0, uint16_t s)
 Decode one row then undo prediction in place.
 
static int PredictorDecodeTile (TIFF *tif, uint8_t *op0, tmsize_t occ0, uint16_t s)
 Decode a strile then undo prediction row by row.
 
static int PredictorEncodeRow (TIFF *tif, uint8_t *bp, tmsize_t cc, uint16_t s)
 Transform a temporary row copy then call the parent encoder.
 
static int PredictorEncodeTile (TIFF *tif, uint8_t *bp0, tmsize_t cc0, uint16_t s)
 Transform a temporary strile copy then call the parent encoder.
 
static int PredictorSetup (TIFF *tif)
 Validate predictor format and cache stride and row extent.
 
static int PredictorSetupDecode (TIFF *tif)
 Chain parent decoder setup and install predictor decoding.
 
static int PredictorSetupEncode (TIFF *tif)
 Chain parent encoder setup and install predictor encoding.
 
static TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW void PredictorAccumulate16NativeUnaligned (uint8_t *current, const uint8_t *previous)
 Add two unaligned native-order 16-bit samples modulo their width.
 
static TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW void PredictorAccumulate32NativeUnaligned (uint8_t *current, const uint8_t *previous)
 Add two unaligned native-order 32-bit samples modulo their width.
 
static TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW void PredictorAccumulate64NativeUnaligned (uint8_t *current, const uint8_t *previous)
 Add two unaligned native-order 64-bit samples modulo their width.
 
static void PredictorSwabByteStream16 (uint8_t *cp, tmsize_t n)
 Reverse each 16-bit sample in an unaligned byte stream.
 
static void PredictorSwabByteStream32 (uint8_t *cp, tmsize_t n)
 Reverse each 32-bit sample in an unaligned byte stream.
 
static void PredictorSwabByteStream64 (uint8_t *cp, tmsize_t n)
 Reverse each 64-bit sample in an unaligned byte stream.
 
static int PredictorVSetField (TIFF *tif, uint32_t tag, va_list ap)
 Store Predictor or delegate another variadic tag assignment.
 
static int PredictorVGetField (TIFF *tif, uint32_t tag, va_list ap)
 Fetch Predictor or delegate another variadic tag query.
 
static void PredictorPrintDir (TIFF *tif, FILE *fd, long flags)
 Print predictor information then chain the parent printer.
 
int TIFFPredictorInit (TIFF *tif)
 Install Predictor tag and setup hooks around a codec.
 
int TIFFPredictorCleanup (TIFF *tif)
 Restore saved Predictor tag print and setup hooks.
 

Variables

static const TIFFField predictFields []
 Define the codec-owned Predictor field metadata.
 

Detailed Description

Implement integer and floating-point Predictor tag transforms.

Definition in file tif_predict.c.