1207753Smm///////////////////////////////////////////////////////////////////////////////
2207753Smm//
3207753Smm/// \file       filter_common.c
4207753Smm/// \brief      Filter-specific stuff common for both encoder and decoder
5207753Smm//
6207753Smm//  Author:     Lasse Collin
7207753Smm//
8207753Smm//  This file has been put into the public domain.
9207753Smm//  You can do whatever you want with this file.
10207753Smm//
11207753Smm///////////////////////////////////////////////////////////////////////////////
12207753Smm
13207753Smm#ifndef LZMA_FILTER_COMMON_H
14207753Smm#define LZMA_FILTER_COMMON_H
15207753Smm
16207753Smm#include "common.h"
17207753Smm
18207753Smm
19207753Smm/// Both lzma_filter_encoder and lzma_filter_decoder begin with these members.
20207753Smmtypedef struct {
21207753Smm	/// Filter ID
22207753Smm	lzma_vli id;
23207753Smm
24207753Smm	/// Initializes the filter encoder and calls lzma_next_filter_init()
25207753Smm	/// for filters + 1.
26207753Smm	lzma_init_function init;
27207753Smm
28207753Smm	/// Calculates memory usage of the encoder. If the options are
29207753Smm	/// invalid, UINT64_MAX is returned.
30207753Smm	uint64_t (*memusage)(const void *options);
31207753Smm
32207753Smm} lzma_filter_coder;
33207753Smm
34207753Smm
35207753Smmtypedef const lzma_filter_coder *(*lzma_filter_find)(lzma_vli id);
36207753Smm
37207753Smm
38207753Smmextern lzma_ret lzma_raw_coder_init(
39207753Smm		lzma_next_coder *next, lzma_allocator *allocator,
40207753Smm		const lzma_filter *filters,
41207753Smm		lzma_filter_find coder_find, bool is_encoder);
42207753Smm
43207753Smm
44207753Smmextern uint64_t lzma_raw_coder_memusage(lzma_filter_find coder_find,
45207753Smm		const lzma_filter *filters);
46207753Smm
47207753Smm
48207753Smm#endif
49