filter_common.h revision 302408
179110Sjoerg///////////////////////////////////////////////////////////////////////////////
279110Sjoerg//
379110Sjoerg/// \file       filter_common.c
479110Sjoerg/// \brief      Filter-specific stuff common for both encoder and decoder
579110Sjoerg//
679110Sjoerg//  Author:     Lasse Collin
779110Sjoerg//
879110Sjoerg//  This file has been put into the public domain.
979110Sjoerg//  You can do whatever you want with this file.
1079110Sjoerg//
1179110Sjoerg///////////////////////////////////////////////////////////////////////////////
1279110Sjoerg
1379110Sjoerg#ifndef LZMA_FILTER_COMMON_H
1479110Sjoerg#define LZMA_FILTER_COMMON_H
1579110Sjoerg
1679110Sjoerg#include "common.h"
1779110Sjoerg
1879110Sjoerg
1979110Sjoerg/// Both lzma_filter_encoder and lzma_filter_decoder begin with these members.
2079110Sjoergtypedef struct {
2179110Sjoerg	/// Filter ID
2279110Sjoerg	lzma_vli id;
2379110Sjoerg
2479110Sjoerg	/// Initializes the filter encoder and calls lzma_next_filter_init()
2579110Sjoerg	/// for filters + 1.
2679110Sjoerg	lzma_init_function init;
2779110Sjoerg
2879110Sjoerg	/// Calculates memory usage of the encoder. If the options are
2987992Sjoerg	/// invalid, UINT64_MAX is returned.
3087992Sjoerg	uint64_t (*memusage)(const void *options);
3179110Sjoerg
3279110Sjoerg} lzma_filter_coder;
3387992Sjoerg
3479110Sjoerg
3587992Sjoergtypedef const lzma_filter_coder *(*lzma_filter_find)(lzma_vli id);
3679110Sjoerg
3787992Sjoerg
3879110Sjoergextern lzma_ret lzma_raw_coder_init(
3979110Sjoerg		lzma_next_coder *next, const lzma_allocator *allocator,
4079110Sjoerg		const lzma_filter *filters,
4187992Sjoerg		lzma_filter_find coder_find, bool is_encoder);
4287992Sjoerg
4387992Sjoerg
4487992Sjoergextern uint64_t lzma_raw_coder_memusage(lzma_filter_find coder_find,
4587992Sjoerg		const lzma_filter *filters);
4679110Sjoerg
4779110Sjoerg
4879110Sjoerg#endif
4979110Sjoerg