ROHC compression/decompression library
|
00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 2 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * This program is distributed in the hope that it will be useful, 00008 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 * GNU General Public License for more details. 00011 * 00012 * You should have received a copy of the GNU General Public License 00013 * along with this program; if not, write to the Free Software 00014 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00015 */ 00016 00027 #ifndef TS_SC_COMP_H 00028 #define TS_SC_COMP_H 00029 00030 #include "rohc.h" 00031 00032 00039 typedef enum 00040 { 00042 INIT_TS = 1, 00044 INIT_STRIDE = 2, 00046 SEND_SCALED = 3, 00047 } ts_sc_state; 00048 00049 00056 struct ts_sc_comp 00057 { 00059 int ts_stride; 00060 00062 int ts_scaled; 00064 struct c_wlsb *scaled_window; 00065 00067 int ts_offset; 00068 00070 unsigned int ts; 00072 unsigned int old_ts; 00073 00075 unsigned int sn; 00077 unsigned int old_sn; 00078 00080 int is_deductible; 00081 00083 ts_sc_state state; 00084 00086 int ts_delta; 00087 }; 00088 00089 00090 00091 /* 00092 * Function prototypes 00093 */ 00094 00095 int c_create_sc(struct ts_sc_comp *ts_sc); 00096 void c_destroy_sc(struct ts_sc_comp *ts_sc); 00097 00098 void c_add_ts(struct ts_sc_comp *ts_sc, unsigned int ts, unsigned int sn); 00099 00100 int nb_bits_stride(struct ts_sc_comp ts_sc); 00101 int nb_bits_scaled(struct ts_sc_comp ts_sc); 00102 00103 void add_stride(struct ts_sc_comp *ts_sc, int sn); 00104 void add_scaled(struct ts_sc_comp *ts_sc, int sn); 00105 00106 int get_ts_stride(struct ts_sc_comp ts_sc); 00107 int get_ts_scaled(struct ts_sc_comp ts_sc); 00108 int get_ts_offset(struct ts_sc_comp ts_sc); 00109 00110 int is_deductible(struct ts_sc_comp ts_sc); 00111 int is_ts_constant(struct ts_sc_comp ts_sc); 00112 00113 00114 #endif 00115