jpayne@69: /* SPDX-License-Identifier: 0BSD */ jpayne@69: jpayne@69: /** jpayne@69: * \file lzma/delta.h jpayne@69: * \brief Delta filter jpayne@69: * \note Never include this file directly. Use instead. jpayne@69: */ jpayne@69: jpayne@69: /* jpayne@69: * Author: Lasse Collin jpayne@69: */ jpayne@69: jpayne@69: #ifndef LZMA_H_INTERNAL jpayne@69: # error Never include this file directly. Use instead. jpayne@69: #endif jpayne@69: jpayne@69: jpayne@69: /** jpayne@69: * \brief Filter ID jpayne@69: * jpayne@69: * Filter ID of the Delta filter. This is used as lzma_filter.id. jpayne@69: */ jpayne@69: #define LZMA_FILTER_DELTA LZMA_VLI_C(0x03) jpayne@69: jpayne@69: jpayne@69: /** jpayne@69: * \brief Type of the delta calculation jpayne@69: * jpayne@69: * Currently only byte-wise delta is supported. Other possible types could jpayne@69: * be, for example, delta of 16/32/64-bit little/big endian integers, but jpayne@69: * these are not currently planned since byte-wise delta is almost as good. jpayne@69: */ jpayne@69: typedef enum { jpayne@69: LZMA_DELTA_TYPE_BYTE jpayne@69: } lzma_delta_type; jpayne@69: jpayne@69: jpayne@69: /** jpayne@69: * \brief Options for the Delta filter jpayne@69: * jpayne@69: * These options are needed by both encoder and decoder. jpayne@69: */ jpayne@69: typedef struct { jpayne@69: /** For now, this must always be LZMA_DELTA_TYPE_BYTE. */ jpayne@69: lzma_delta_type type; jpayne@69: jpayne@69: /** jpayne@69: * \brief Delta distance jpayne@69: * jpayne@69: * With the only currently supported type, LZMA_DELTA_TYPE_BYTE, jpayne@69: * the distance is as bytes. jpayne@69: * jpayne@69: * Examples: jpayne@69: * - 16-bit stereo audio: distance = 4 bytes jpayne@69: * - 24-bit RGB image data: distance = 3 bytes jpayne@69: */ jpayne@69: uint32_t dist; jpayne@69: jpayne@69: /** jpayne@69: * \brief Minimum value for lzma_options_delta.dist. jpayne@69: */ jpayne@69: # define LZMA_DELTA_DIST_MIN 1 jpayne@69: jpayne@69: /** jpayne@69: * \brief Maximum value for lzma_options_delta.dist. jpayne@69: */ jpayne@69: # define LZMA_DELTA_DIST_MAX 256 jpayne@69: jpayne@69: /* jpayne@69: * Reserved space to allow possible future extensions without jpayne@69: * breaking the ABI. You should not touch these, because the names jpayne@69: * of these variables may change. These are and will never be used jpayne@69: * when type is LZMA_DELTA_TYPE_BYTE, so it is safe to leave these jpayne@69: * uninitialized. jpayne@69: */ jpayne@69: jpayne@69: /** \private Reserved member. */ jpayne@69: uint32_t reserved_int1; jpayne@69: jpayne@69: /** \private Reserved member. */ jpayne@69: uint32_t reserved_int2; jpayne@69: jpayne@69: /** \private Reserved member. */ jpayne@69: uint32_t reserved_int3; jpayne@69: jpayne@69: /** \private Reserved member. */ jpayne@69: uint32_t reserved_int4; jpayne@69: jpayne@69: /** \private Reserved member. */ jpayne@69: void *reserved_ptr1; jpayne@69: jpayne@69: /** \private Reserved member. */ jpayne@69: void *reserved_ptr2; jpayne@69: jpayne@69: } lzma_options_delta;