summaryrefslogtreecommitdiff
path: root/gsm-receiver/src/lib/decoder/openbtsstuff/VocoderFrame.h
blob: 0c80973f2242856f3a2aa4beed311028b9c4c2da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef _VOCODERFRAME_H
#define _VOCODERFRAME_H

#include "BitVector.h" 
//#include "GSMCommon.h"

class VocoderFrame : public BitVector {

        public:

        VocoderFrame()
                :BitVector(264)
        { fillField(0,0x0d,4); }

        /** Construct by unpacking a char[33]. */
        VocoderFrame(const unsigned char *src)
                :BitVector(264)
        { unpack(src); }

        BitVector payload() { return tail(4); }
        const BitVector payload() const { return tail(4); }

};

class VocoderAMRFrame : public BitVector {

        public:

        VocoderAMRFrame()
                :BitVector(244+8)
        { fillField(0,0x3c,8); /* AMR-NB 12.2 */ }

        /** Construct by unpacking a char[32]. */
        VocoderAMRFrame(const unsigned char *src)
                :BitVector(244+8)
        { unpack(src); }

        BitVector payload() { return tail(8); }
        const BitVector payload() const { return tail(8); }

};

#endif
personal git repositories of Harald Welte. Your mileage may vary