aboutsummaryrefslogtreecommitdiffstats
path: root/lib/decoding
diff options
context:
space:
mode:
authorRoman Khassraf <roman@khassraf.at>2015-06-02 13:19:01 +0200
committerRoman Khassraf <roman@khassraf.at>2015-06-02 13:19:01 +0200
commite159333f8f6c2de7ef42e4f86f3a9bf3c7f527aa (patch)
tree083ca180e9fd2640b222e4e5eb705dad24bf970c /lib/decoding
parentfa7058b64b115f72fcdf63b05dcba0f3e6163f7c (diff)
Moved variable declaration to header file
Diffstat (limited to 'lib/decoding')
-rw-r--r--lib/decoding/tch_f_decoder_impl.cc32
-rw-r--r--lib/decoding/tch_f_decoder_impl.h18
2 files changed, 30 insertions, 20 deletions
diff --git a/lib/decoding/tch_f_decoder_impl.cc b/lib/decoding/tch_f_decoder_impl.cc
index c8265ea..c989151 100644
--- a/lib/decoding/tch_f_decoder_impl.cc
+++ b/lib/decoding/tch_f_decoder_impl.cc
@@ -49,7 +49,16 @@ namespace gr {
gr::io_signature::make(0, 0, 0),
gr::io_signature::make(0, 0, 0)),
d_tch_mode(mode),
- d_collected_bursts_num(0)
+ d_collected_bursts_num(0),
+ mBlockCoder(0x10004820009ULL, 40, 224),
+ mU(228),
+ mP(mU.segment(184,40)), mD(mU.head(184)), mDP(mU.head(224)),
+ mC(CONV_SIZE),
+ mClass1_c(mC.head(378)),
+ mClass2_c(mC.segment(378, 78)),
+ mTCHU(189),
+ mTCHD(260),
+ mClass1A_d(mTCHD.head(50))
{
d_speech_file = fopen( file.c_str(), "wb" );
if (d_speech_file == NULL)
@@ -89,15 +98,6 @@ namespace gr {
if (d_collected_bursts_num == 8)
{
- unsigned char iBLOCK[2*BLOCKS*iBLOCK_SIZE];
- SoftVector mC(CONV_SIZE);
- SoftVector mClass1_c(mC.head(378));
- SoftVector mClass2_c(mC.segment(378, 78));
- BitVector mTCHU(189);
- BitVector mTCHD(260);
- BitVector mClass1A_d(mTCHD.head(50));
- ViterbiR2O4 mVCoder;
-
d_collected_bursts_num = 0;
// reorganize data
@@ -127,14 +127,7 @@ namespace gr {
// Decode stolen frames as FACCH/F
if (stolen)
{
- BitVector mU(228);
- BitVector mP(mU.segment(184,40));
- BitVector mD(mU.head(184));
- BitVector mDP(mU.head(224));
- Parity mBlockCoder(0x10004820009ULL, 40, 224);
-
-// mC.decode(mVCoder, mU);
- mVCoder.decode(mC, mU);
+ mVR204Coder.decode(mC, mU);
mP.invert();
unsigned syndrome = mBlockCoder.syndrome(mDP);
@@ -166,8 +159,7 @@ namespace gr {
}
}
- mVCoder.decode(mClass1_c, mTCHU);
-// mClass1_c.decode(mVCoder, mTCHU);
+ mVR204Coder.decode(mClass1_c, mTCHU);
mClass2_c.sliced().copyToSegment(mTCHD, 182);
// 3.1.2.1
diff --git a/lib/decoding/tch_f_decoder_impl.h b/lib/decoding/tch_f_decoder_impl.h
index bb55afb..90854cb 100644
--- a/lib/decoding/tch_f_decoder_impl.h
+++ b/lib/decoding/tch_f_decoder_impl.h
@@ -55,6 +55,24 @@ namespace gr {
enum tch_mode d_tch_mode;
void decode(pmt::pmt_t msg);
const unsigned char amr_nb_magic[6] = { 0x23, 0x21, 0x41, 0x4d, 0x52, 0x0a };
+
+ ViterbiR2O4 mVR204Coder;
+
+ BitVector mU;
+ BitVector mP;
+ BitVector mD;
+ BitVector mDP;
+ Parity mBlockCoder;
+
+ unsigned char iBLOCK[2*BLOCKS*iBLOCK_SIZE];
+ SoftVector mC;
+ SoftVector mClass1_c;
+ SoftVector mClass2_c;
+ BitVector mTCHU;
+ BitVector mTCHD;
+ BitVector mClass1A_d;
+
+
public:
tch_f_decoder_impl(tch_mode mode, const std::string &file);
~tch_f_decoder_impl();