00001 /* 00002 * SpanDSP - a series of DSP components for telephony 00003 * 00004 * t81_t82_arith_coding.h - ITU T.81 and T.82 QM-coder arithmetic encoding 00005 * and decoding 00006 * 00007 * Written by Steve Underwood <steveu@coppice.org> 00008 * 00009 * Copyright (C) 2009 Steve Underwood 00010 * 00011 * All rights reserved. 00012 * 00013 * This program is free software; you can redistribute it and/or modify 00014 * it under the terms of the GNU Lesser General Public License version 2.1, 00015 * as published by the Free Software Foundation. 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU Lesser General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU Lesser General Public 00023 * License along with this program; if not, write to the Free Software 00024 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00025 */ 00026 00027 /*! \file */ 00028 00029 #if !defined(_SPANDSP_T81_T82_ARITH_CODING_H_) 00030 #define _SPANDSP_T81_T82_ARITH_CODING_H_ 00031 00032 /*! \page t81_t82_arith_coding_page T.81 and T.82 QM-coder arithmetic encoding and decoding 00033 00034 \section t81_t82_arith_coding_page_sec_1 What does it do? 00035 A similar arithmetic coder, called the QM-coder, is used by several image compression 00036 schemes. These routines implement this coder in a (hopefully) reusable way. 00037 00038 \section t81_t82_arith_coding_page_sec_1 How does it work? 00039 */ 00040 00041 /* State of a working instance of the arithmetic encoder */ 00042 typedef struct t81_t82_arith_encode_state_s t81_t82_arith_encode_state_t; 00043 00044 /* State of a working instance of the arithmetic decoder */ 00045 typedef struct t81_t82_arith_decode_state_s t81_t82_arith_decode_state_t; 00046 00047 #if defined(__cplusplus) 00048 extern "C" 00049 { 00050 #endif 00051 00052 SPAN_DECLARE(t81_t82_arith_encode_state_t *) t81_t82_arith_encode_init(t81_t82_arith_encode_state_t *s, 00053 void (*output_byte_handler)(void *, int), 00054 void *user_data); 00055 00056 SPAN_DECLARE(int) t81_t82_arith_encode_restart(t81_t82_arith_encode_state_t *s, int reuse_st); 00057 00058 SPAN_DECLARE(int) t81_t82_arith_encode_release(t81_t82_arith_encode_state_t *s); 00059 00060 SPAN_DECLARE(int) t81_t82_arith_encode_free(t81_t82_arith_encode_state_t *s); 00061 00062 SPAN_DECLARE(void) t81_t82_arith_encode(t81_t82_arith_encode_state_t *s, int cx, int pix); 00063 00064 SPAN_DECLARE(void) t81_t82_arith_encode_flush(t81_t82_arith_encode_state_t *s); 00065 00066 00067 SPAN_DECLARE(t81_t82_arith_decode_state_t *) t81_t82_arith_decode_init(t81_t82_arith_decode_state_t *s); 00068 00069 SPAN_DECLARE(int) t81_t82_arith_decode_restart(t81_t82_arith_decode_state_t *s, int reuse_st); 00070 00071 SPAN_DECLARE(int) t81_t82_arith_decode_release(t81_t82_arith_decode_state_t *s); 00072 00073 SPAN_DECLARE(int) t81_t82_arith_decode_free(t81_t82_arith_decode_state_t *s); 00074 00075 SPAN_DECLARE(int) t81_t82_arith_decode(t81_t82_arith_decode_state_t *s, int cx); 00076 00077 #if defined(__cplusplus) 00078 } 00079 #endif 00080 00081 #endif 00082 /*- End of file ------------------------------------------------------------*/
1.6.1