Mercurial > hg > audiostuff
comparison spandsp-0.0.6pre17/src/spandsp/private/g722.h @ 4:26cd8f1ef0b1
import spandsp-0.0.6pre17
| author | Peter Meerwald <pmeerw@cosy.sbg.ac.at> |
|---|---|
| date | Fri, 25 Jun 2010 15:50:58 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 3:c6c5a16ce2f2 | 4:26cd8f1ef0b1 |
|---|---|
| 1 /* | |
| 2 * SpanDSP - a series of DSP components for telephony | |
| 3 * | |
| 4 * private/g722.h - The ITU G.722 codec. | |
| 5 * | |
| 6 * Written by Steve Underwood <steveu@coppice.org> | |
| 7 * | |
| 8 * Copyright (C) 2005 Steve Underwood | |
| 9 * | |
| 10 * All rights reserved. | |
| 11 * | |
| 12 * This program is free software; you can redistribute it and/or modify | |
| 13 * it under the terms of the GNU Lesser General Public License version 2.1, | |
| 14 * as published by the Free Software Foundation. | |
| 15 * | |
| 16 * This program is distributed in the hope that it will be useful, | |
| 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 * GNU Lesser General Public License for more details. | |
| 20 * | |
| 21 * You should have received a copy of the GNU Lesser General Public | |
| 22 * License along with this program; if not, write to the Free Software | |
| 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 24 * | |
| 25 * Based on a single channel G.722 codec which is: | |
| 26 * | |
| 27 ***** Copyright (c) CMU 1993 ***** | |
| 28 * Computer Science, Speech Group | |
| 29 * Chengxiang Lu and Alex Hauptmann | |
| 30 * | |
| 31 * $Id: g722.h,v 1.2 2009/04/12 09:12:11 steveu Exp $ | |
| 32 */ | |
| 33 | |
| 34 | |
| 35 /*! \file */ | |
| 36 | |
| 37 #if !defined(_SPANDSP_PRIVATE_G722_H_) | |
| 38 #define _SPANDSP_PRIVATE_G722_H_ | |
| 39 | |
| 40 /*! The per band parameters for both encoding and decoding G.722 */ | |
| 41 typedef struct | |
| 42 { | |
| 43 int16_t nb; | |
| 44 int16_t det; | |
| 45 int16_t s; | |
| 46 int16_t sz; | |
| 47 int16_t r; | |
| 48 int16_t p[2]; | |
| 49 int16_t a[2]; | |
| 50 int16_t b[6]; | |
| 51 int16_t d[7]; | |
| 52 } g722_band_t; | |
| 53 | |
| 54 /*! | |
| 55 G.722 encode state | |
| 56 */ | |
| 57 struct g722_encode_state_s | |
| 58 { | |
| 59 /*! TRUE if the operating in the special ITU test mode, with the band split filters | |
| 60 disabled. */ | |
| 61 int itu_test_mode; | |
| 62 /*! TRUE if the G.722 data is packed */ | |
| 63 int packed; | |
| 64 /*! TRUE if encode from 8k samples/second */ | |
| 65 int eight_k; | |
| 66 /*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */ | |
| 67 int bits_per_sample; | |
| 68 | |
| 69 /*! Signal history for the QMF */ | |
| 70 int16_t x[12]; | |
| 71 int16_t y[12]; | |
| 72 int ptr; | |
| 73 | |
| 74 g722_band_t band[2]; | |
| 75 | |
| 76 uint32_t in_buffer; | |
| 77 int in_bits; | |
| 78 uint32_t out_buffer; | |
| 79 int out_bits; | |
| 80 }; | |
| 81 | |
| 82 /*! | |
| 83 G.722 decode state | |
| 84 */ | |
| 85 struct g722_decode_state_s | |
| 86 { | |
| 87 /*! TRUE if the operating in the special ITU test mode, with the band split filters | |
| 88 disabled. */ | |
| 89 int itu_test_mode; | |
| 90 /*! TRUE if the G.722 data is packed */ | |
| 91 int packed; | |
| 92 /*! TRUE if decode to 8k samples/second */ | |
| 93 int eight_k; | |
| 94 /*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */ | |
| 95 int bits_per_sample; | |
| 96 | |
| 97 /*! Signal history for the QMF */ | |
| 98 int16_t x[12]; | |
| 99 int16_t y[12]; | |
| 100 int ptr; | |
| 101 | |
| 102 g722_band_t band[2]; | |
| 103 | |
| 104 uint32_t in_buffer; | |
| 105 int in_bits; | |
| 106 uint32_t out_buffer; | |
| 107 int out_bits; | |
| 108 }; | |
| 109 | |
| 110 #endif | |
| 111 /*- End of file ------------------------------------------------------------*/ |
