MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / encode

Method encode

GSMShare/AmrCoder.cpp:43–63  ·  view source on GitHub ↗

void BitVector::encode(const ViterbiTCH_AFS12_2& coder, BitVector& target) const

Source from the content-addressed store, hash-verified

41
42//void BitVector::encode(const ViterbiTCH_AFS12_2& coder, BitVector& target) const
43void ViterbiTCH_AFS12_2::encode(const BitVector& in, BitVector& target) const
44{
45 assert(in.size() == 250);
46 assert(target.size() == 508);
47 const char *u = in.begin();
48 char *C = target.begin();
49 const unsigned H = 4;
50 BitVector r(254+H);
51 for (int k = -H; k <= -1; k++) r[k+H] = 0;
52 for (unsigned k = 0; k <= 249; k++) {
53 r[k+H] = u[k] ^ r[k-3+H] ^ r[k-4+H];
54 C[2*k] = u[k];
55 C[2*k+1] = r[k+H] ^ r[k-1+H] ^ r[k-3+H] ^ r[k-4+H];
56 }
57 // termination
58 for (unsigned k = 250; k <= 253; k++) {
59 r[k+H] = 0;
60 C[2*k] = r[k-3+H] ^ r[k-4+H];
61 C[2*k+1] = r[k+H] ^ r[k-1+H] ^ r[k-3+H] ^ r[k-4+H];
62 }
63}
64
65
66

Callers 7

encode41Method · 0.45
generateMethod · 0.45
encodeTCH_GSMMethod · 0.45
encodeTCH_AFSMethod · 0.45
origTestFunction · 0.45
testEncodeDecodeFunction · 0.45
testEncodeDecodeFunction · 0.45

Calls 2

sizeMethod · 0.45
beginMethod · 0.45

Tested by 3

origTestFunction · 0.36
testEncodeDecodeFunction · 0.36
testEncodeDecodeFunction · 0.36