From e159333f8f6c2de7ef42e4f86f3a9bf3c7f527aa Mon Sep 17 00:00:00 2001 From: Roman Khassraf Date: Tue, 2 Jun 2015 13:19:01 +0200 Subject: Moved variable declaration to header file --- lib/decoding/tch_f_decoder_impl.cc | 32 ++++++++++++-------------------- lib/decoding/tch_f_decoder_impl.h | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+), 20 deletions(-) (limited to 'lib/decoding') 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(); -- cgit v1.2.3