diff options
author | Szymon Tokarz <wsx22@o2.pl> | 2012-10-17 21:05:02 +0000 |
---|---|---|
committer | Szymon Tokarz <wsx22@o2.pl> | 2012-10-17 21:05:02 +0000 |
commit | fd67a89688262e4e58337c33728488f5f29196a8 (patch) | |
tree | b6f8d04257ce002aaf251d586d27253db3755c42 /protocols/Tlen/src/codec/gsm.h | |
parent | 1099f914b0eb16acdcbf594ac4105224a6dfb2fd (diff) |
Tlen protocol adopted
- code moved to trunk\protocols folder
- update project files (based on rev: 27, 228, 204, 350, 279, 280, 1374, 278)
- changed code organisation to c++ convention (based on rev: 1092, 503, 504)
- changed code to Miranda NG convention (based on rev: 49, 54, 312, 401, 321, 358, 410, 441, 477, 483, 496, 507, 515, 644, 652, 743, 956, 1206, 667, 1040, 1590, 1857)
- folders restructurization (based on rev: 1890)
- code cleaning (based on rev: 270, 398, 409)
- this commit includes adopted sources of tlen_czaty.dll (former mucc.dll) plugin witch is now deprecated and will be removed
--
wsx22{at}o2.pl
git-svn-id: http://svn.miranda-ng.org/main/trunk@1972 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tlen/src/codec/gsm.h')
-rw-r--r-- | protocols/Tlen/src/codec/gsm.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/protocols/Tlen/src/codec/gsm.h b/protocols/Tlen/src/codec/gsm.h new file mode 100644 index 0000000000..f522739d10 --- /dev/null +++ b/protocols/Tlen/src/codec/gsm.h @@ -0,0 +1,65 @@ +/*
+
+Tlen Protocol Plugin for Miranda NG
+Copyright (C) 2004 Piotr Piastucki
+
+This program is based on GSM 06.10 source code developed by
+Jutta Degener and Carsten Bormann,
+Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann,
+Technische Universitaet Berlin
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+#include <windows.h>
+
+#define P_MAX 8 /* order p of LPC analysis, typically 8..14 */
+
+typedef struct {
+ int LARpp[2][8]; /* LAR coefficients for previous and current frame */
+ int j; /* current frame index in LARpp[j][] */
+ int qLARs[8]; /* quantized LARs for current frame */
+ int u[8]; /* used by short term analysis filter */
+ int v[9]; /* used by short term synthesis filter */
+ int subframe; /* subframe index (0..3)*/
+ short dp0[ 280 ]; /* previous short-term filter output/prediction, used by long term analysis*/
+ int e[160]; /* errors (residuals) */
+ int nrp; /* long term synthesis */
+ int Nc[4], bc[4]; /* long-term lag and gain for current frame */
+ int Mc[4]; /* RPE grid index (0..3) */
+ int xMaxc[4]; /* RPE maximum error quantized and encoded (mantissa + exp) */
+ int xMc[52]; /* quantized residuals (errors) 4 * 13 */
+
+ int z1; /* preprocessing.c, Offset_com. */
+ int z2; /* Offset_com. */
+ int mp; /* Preemphasis */
+ int msr; /* decoder.c, Postprocessing */
+
+ unsigned char gsmFrame[33];
+}gsm_state;
+
+extern gsm_state * gsm_create() ;
+extern void gsm_release(gsm_state *ptr);
+extern void gsm_encode(gsm_state *state, short *in);
+extern void gsm_decode(gsm_state *state, short *out);
+
+extern void gsm_preprocessing( gsm_state *state, short *in, short *out);
+extern void shortTermAnalysis(gsm_state *state, short *in);
+extern void longTermAnalysis(gsm_state *state, short *in);
+extern void encodeRPE(gsm_state *state);
+extern void decodeRPE(gsm_state *state);
+extern void longTermSynthesis(gsm_state *state);
+extern void shortTermSynthesis(gsm_state *state, short *in, short *out);
+extern void gsm_postprocessing( gsm_state *state, short *in, short *out);
|