KVIrc  4.9.2
DeveloperAPIs
DccVoiceAdpcmCodec.h
Go to the documentation of this file.
1 #ifndef _ADPCMCODEC_H_
2 #define _ADPCMCODEC_H_
3 //=============================================================================
4 //
5 // File : DccVoiceAdpcmCodec.h
6 // Creation date : Wed Aug 22 19:12:46 2001 GMT by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2001-2010 Szymon Stefanek (pragma at kvirc dot net)
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
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.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 //
27 // adpcm.h - include file for adpcm coder.
28 //
29 // Version 1.0, 7-Jul-92.
30 //
31 //
32 // Average compression speed experiment: P166MMX 32MEG
33 //
34 // INPUT | OUTPUT | COMPRESSION TIME
35 // ------------------------------------------------------------------------
36 // shorts bytes | bytes | min msec. avrg. high peak (1 time)
37 // ------------------------------------------------------------------------
38 // 512 1024 | 256 | ~4 4 34
39 // 1024 2048 | 512 | ~7 8 75
40 // 2048 4096 | 1024 | ~13 15 175 (!!!)
41 // 4096 8192 | 2048 | ~26 33 91
42 // 8192 16384 | 4096 | ~57 80 220 (~1 sec of audio)
43 // 16384 32768 | 8192 | ~110 250 290
44 //
45 
46 #include <QString> // fix for qtextstream.h
47 
48 #include "DccVoiceCodec.h"
49 
50 typedef struct adpcm_state
51 {
52  short valprev; /* Previous output value */
53  char index; /* HelpIndex into stepsize table */
54 } ADPCM_state;
55 
57 {
58 public:
60  virtual ~DccVoiceAdpcmCodec();
61 
62 private:
65 
66 public:
67  virtual void encode(KviDataBuffer * signal, KviDataBuffer * stream);
68  virtual void decode(KviDataBuffer * stream, KviDataBuffer * signal);
69  virtual int encodedFrameSize();
70  virtual int decodedFrameSize();
71 };
72 
73 #endif //_ADPCMCODEC_H_
ADPCM_state * m_pEncodeState
Definition: DccVoiceAdpcmCodec.h:63
struct adpcm_state ADPCM_state
virtual int decodedFrameSize()
Definition: DccVoiceAdpcmCodec.cpp:328
virtual ~DccVoiceAdpcmCodec()
Definition: DccVoiceAdpcmCodec.cpp:270
char index
Definition: DccVoiceAdpcmCodec.h:53
Definition: KviDataBuffer.h:30
virtual void encode(KviDataBuffer *signal, KviDataBuffer *stream)
Definition: DccVoiceAdpcmCodec.cpp:276
short valprev
Definition: DccVoiceAdpcmCodec.h:52
Definition: DccVoiceAdpcmCodec.h:50
ADPCM_state * m_pDecodeState
Definition: DccVoiceAdpcmCodec.h:64
virtual int encodedFrameSize()
Definition: DccVoiceAdpcmCodec.cpp:323
Definition: DccVoiceCodec.h:35
virtual void decode(KviDataBuffer *stream, KviDataBuffer *signal)
Definition: DccVoiceAdpcmCodec.cpp:299
Definition: DccVoiceAdpcmCodec.h:56
DccVoiceAdpcmCodec()
Definition: DccVoiceAdpcmCodec.cpp:258