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

Implement filtered predictor-aware LZMA2 streaming. More...

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

Go to the source code of this file.

Data Structures

struct  LZMAState
 Own a filtered liblzma stream and predictor-prefixed methods. 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 GetLZMAState(tif)   ((LZMAState *)(tif)->tif_data)
 Cast tif->tif_data to the LZMAState.
 
#define LZMADecoderState(tif)   GetLZMAState(tif)
 Alias of GetLZMAState(), returning the LZMAState for decoding.
 
#define LZMAEncoderState(tif)   GetLZMAState(tif)
 Alias of GetLZMAState(), returning the LZMAState for encoding.
 

Functions

static int LZMAEncode (TIFF *tif, uint8_t *bp, tmsize_t cc, uint16_t s)
 Consume input through the active liblzma encoder.
 
static int LZMADecode (TIFF *tif, uint8_t *op, tmsize_t occ, uint16_t s)
 Expand cached liblzma input into caller output.
 
static const char * LZMAStrerror (lzma_ret ret)
 Describe a liblzma status using immutable text.
 
static int LZMAFixupTags (TIFF *tif)
 Accept LZMA tag fixup without changes.
 
static int LZMASetupDecode (TIFF *tif)
 Switch the liblzma stream to decode mode.
 
static int LZMAPreDecode (TIFF *tif, uint16_t s)
 Initialise the liblzma decoder for one strile.
 
static int LZMASetupEncode (TIFF *tif)
 Switch the liblzma stream to encode mode.
 
static int LZMAPreEncode (TIFF *tif, uint16_t s)
 Initialise a filtered LZMA2 stream for one output strile.
 
static int LZMAPostEncode (TIFF *tif)
 Finish the LZMA2 stream and flush produced output.
 
static void LZMACleanup (TIFF *tif)
 End the dependency stream and release LZMA codec state.
 
static int LZMAVSetField (TIFF *tif, uint32_t tag, va_list ap)
 Store LZMA preset or delegate a tag assignment.
 
static int LZMAVGetField (TIFF *tif, uint32_t tag, va_list ap)
 Retrieve LZMA preset or delegate a tag query.
 
static uint64_t LZMAGetMaxCompressionRatio (TIFF *tif)
 Report the empirical LZMA expansion heuristic.
 
int TIFFInitLZMA (TIFF *tif, int scheme)
 Allocate predictor-aware LZMA2 codec state and install callbacks.
 

Variables

static const TIFFField lzmaFields []
 Define the LZMA compression-preset pseudo-tag.
 

Detailed Description

Implement filtered predictor-aware LZMA2 streaming.

Definition in file tif_lzma.c.