spandsp  3.0.0
t81_t82_arith_coding.h
Go to the documentation of this file.
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * t81_t82_arith_coding.h - ITU T.81 and T.82 QM-coder arithmetic encoding
5  * and decoding
6  *
7  * Written by Steve Underwood <steveu@coppice.org>
8  *
9  * Copyright (C) 2009 Steve Underwood
10  *
11  * All rights reserved.
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License version 2.1,
15  * as published by the Free Software Foundation.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this program; if not, write to the Free Software
24  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  */
26 
27 /*! \file */
28 
29 #if !defined(_SPANDSP_T81_T82_ARITH_CODING_H_)
30 #define _SPANDSP_T81_T82_ARITH_CODING_H_
31 
32 /*! \page t81_t82_arith_coding_page T.81 and T.82 QM-coder arithmetic encoding and decoding
33 
34 \section t81_t82_arith_coding_page_sec_1 What does it do?
35 A similar arithmetic coder, called the QM-coder, is used by several image compression
36 schemes. These routines implement this coder in a (hopefully) reusable way.
37 
38 \section t81_t82_arith_coding_page_sec_1 How does it work?
39 */
40 
41 /* State of a working instance of the arithmetic encoder */
43 
44 /* State of a working instance of the arithmetic decoder */
46 
47 #if defined(__cplusplus)
48 extern "C"
49 {
50 #endif
51 
52 SPAN_DECLARE(t81_t82_arith_encode_state_t *) t81_t82_arith_encode_init(t81_t82_arith_encode_state_t *s,
53  void (*output_byte_handler)(void *, int),
54  void *user_data);
55 
56 SPAN_DECLARE(int) t81_t82_arith_encode_restart(t81_t82_arith_encode_state_t *s, int reuse_st);
57 
58 SPAN_DECLARE(int) t81_t82_arith_encode_release(t81_t82_arith_encode_state_t *s);
59 
60 SPAN_DECLARE(int) t81_t82_arith_encode_free(t81_t82_arith_encode_state_t *s);
61 
62 SPAN_DECLARE(void) t81_t82_arith_encode(t81_t82_arith_encode_state_t *s, int cx, int pix);
63 
64 SPAN_DECLARE(void) t81_t82_arith_encode_flush(t81_t82_arith_encode_state_t *s);
65 
66 SPAN_DECLARE(t81_t82_arith_decode_state_t *) t81_t82_arith_decode_init(t81_t82_arith_decode_state_t *s);
67 
68 SPAN_DECLARE(int) t81_t82_arith_decode_restart(t81_t82_arith_decode_state_t *s, int reuse_st);
69 
70 SPAN_DECLARE(int) t81_t82_arith_decode_release(t81_t82_arith_decode_state_t *s);
71 
72 SPAN_DECLARE(int) t81_t82_arith_decode_free(t81_t82_arith_decode_state_t *s);
73 
74 SPAN_DECLARE(int) t81_t82_arith_decode(t81_t82_arith_decode_state_t *s, int cx);
75 
76 #if defined(__cplusplus)
77 }
78 #endif
79 
80 #endif
81 /*- End of file ------------------------------------------------------------*/
Definition: private/t81_t82_arith_coding.h:55
Definition: private/t81_t82_arith_coding.h:34