00001 /* 00002 * SpanDSP - a series of DSP components for telephony 00003 * 00004 * private/g722.h - The ITU G.722 codec. 00005 * 00006 * Written by Steve Underwood <steveu@coppice.org> 00007 * 00008 * Copyright (C) 2005 Steve Underwood 00009 * 00010 * All rights reserved. 00011 * 00012 * This program is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU Lesser General Public License version 2.1, 00014 * as published by the Free Software Foundation. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00024 * 00025 * Based on a single channel G.722 codec which is: 00026 * 00027 ***** Copyright (c) CMU 1993 ***** 00028 * Computer Science, Speech Group 00029 * Chengxiang Lu and Alex Hauptmann 00030 * 00031 * $Id: g722.h,v 1.2 2009/04/12 09:12:11 steveu Exp $ 00032 */ 00033 00034 00035 /*! \file */ 00036 00037 #if !defined(_SPANDSP_PRIVATE_G722_H_) 00038 #define _SPANDSP_PRIVATE_G722_H_ 00039 00040 /*! The per band parameters for both encoding and decoding G.722 */ 00041 typedef struct 00042 { 00043 int16_t nb; 00044 int16_t det; 00045 int16_t s; 00046 int16_t sz; 00047 int16_t r; 00048 int16_t p[2]; 00049 int16_t a[2]; 00050 int16_t b[6]; 00051 int16_t d[7]; 00052 } g722_band_t; 00053 00054 /*! 00055 G.722 encode state 00056 */ 00057 struct g722_encode_state_s 00058 { 00059 /*! TRUE if the operating in the special ITU test mode, with the band split filters 00060 disabled. */ 00061 int itu_test_mode; 00062 /*! TRUE if the G.722 data is packed */ 00063 int packed; 00064 /*! TRUE if encode from 8k samples/second */ 00065 int eight_k; 00066 /*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */ 00067 int bits_per_sample; 00068 00069 /*! Signal history for the QMF */ 00070 int16_t x[12]; 00071 int16_t y[12]; 00072 int ptr; 00073 00074 g722_band_t band[2]; 00075 00076 uint32_t in_buffer; 00077 int in_bits; 00078 uint32_t out_buffer; 00079 int out_bits; 00080 }; 00081 00082 /*! 00083 G.722 decode state 00084 */ 00085 struct g722_decode_state_s 00086 { 00087 /*! TRUE if the operating in the special ITU test mode, with the band split filters 00088 disabled. */ 00089 int itu_test_mode; 00090 /*! TRUE if the G.722 data is packed */ 00091 int packed; 00092 /*! TRUE if decode to 8k samples/second */ 00093 int eight_k; 00094 /*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */ 00095 int bits_per_sample; 00096 00097 /*! Signal history for the QMF */ 00098 int16_t x[12]; 00099 int16_t y[12]; 00100 int ptr; 00101 00102 g722_band_t band[2]; 00103 00104 uint32_t in_buffer; 00105 int in_bits; 00106 uint32_t out_buffer; 00107 int out_bits; 00108 }; 00109 00110 #endif 00111 /*- End of file ------------------------------------------------------------*/