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

Implement predictor-aware ZSTD streaming compression. More...

#include "tiffiop.h"
#include "tif_predict.h"
#include "zstd.h"
#include <stdio.h>
Include dependency graph for tif_zstd.c:

Go to the source code of this file.

Data Structures

struct  ZSTDState
 Own ZSTD streams predictor prefix and output cursor. More...
 

Macros

#define LSTATE_INIT_DECODE   0x01
 Bit 0x01 of the codec state field: decoding has been set up.
 
#define LSTATE_INIT_ENCODE   0x02
 Bit 0x02 of the codec state field: encoding has been set up.
 
#define GetZSTDState(tif)   ((ZSTDState *)(tif)->tif_data)
 Cast tif->tif_data to the ZSTDState.
 
#define ZSTDDecoderState(tif)   GetZSTDState(tif)
 Alias of GetZSTDState(), returning the ZSTDState for decoding.
 
#define ZSTDEncoderState(tif)   GetZSTDState(tif)
 Alias of GetZSTDState(), returning the ZSTDState for encoding.
 

Functions

static int ZSTDEncode (TIFF *tif, uint8_t *bp, tmsize_t cc, uint16_t s)
 Compress input through the active ZSTD stream.
 
static int ZSTDDecode (TIFF *tif, uint8_t *op, tmsize_t occ, uint16_t s)
 Decompress cached ZSTD input into caller output.
 
static int ZSTDFixupTags (TIFF *tif)
 Accept ZSTD tag fixup without changes.
 
static int ZSTDSetupDecode (TIFF *tif)
 Switch ZSTD state into decode mode.
 
static int ZSTDPreDecode (TIFF *tif, uint16_t s)
 Create or reset the ZSTD decompression stream for a strile.
 
static int ZSTDSetupEncode (TIFF *tif)
 Switch ZSTD state into encode mode.
 
static int ZSTDPreEncode (TIFF *tif, uint16_t s)
 Create and initialise a ZSTD compression stream for a strile.
 
static int ZSTDPostEncode (TIFF *tif)
 Finish the ZSTD frame and flush its remaining output.
 
static void ZSTDCleanup (TIFF *tif)
 Release ZSTD streams state and chained codec methods.
 
static int ZSTDVSetField (TIFF *tif, uint32_t tag, va_list ap)
 Store ZSTD compression level or delegate another tag assignment.
 
static int ZSTDVGetField (TIFF *tif, uint32_t tag, va_list ap)
 Retrieve ZSTD compression level or delegate another tag query.
 
static uint64_t ZSTDGetMaxCompressionRatio (TIFF *tif)
 Report the ZSTD expansion allocation heuristic.
 
int TIFFInitZSTD (TIFF *tif, int scheme)
 Allocate ZSTD state and install predictor-aware streaming methods.
 

Variables

static const TIFFField ZSTDFields []
 Define the ZSTD compression-level pseudo-tag.
 

Detailed Description

Implement predictor-aware ZSTD streaming compression.

Definition in file tif_zstd.c.