[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 55/57: fec: wip: fixing up allocated memory
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 55/57: fec: wip: fixing up allocated memory; allowing async encoder deployment to be used with CCSDS (packed input requirement). |
Date: |
Wed, 21 May 2014 03:10:32 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit 81bc67650349bf5a9f770847bde03e530655e068
Author: Tom Rondeau <address@hidden>
Date: Tue May 20 15:46:50 2014 -0400
fec: wip: fixing up allocated memory; allowing async encoder deployment to
be used with CCSDS (packed input requirement).
---
gr-fec/examples/fecapi_async_decoders.grc | 772 +++++++++++++++++------
gr-fec/examples/fecapi_async_packed_decoders.grc | 409 ++++++------
gr-fec/examples/fecapi_async_to_stream.grc | 42 +-
gr-fec/examples/fecapi_decoders.grc | 92 +--
gr-fec/examples/fecapi_tagged_decoders.grc | 38 +-
gr-fec/include/gnuradio/fec/async_encoder.h | 4 +-
gr-fec/lib/async_decoder_impl.cc | 2 +-
gr-fec/lib/async_encoder_impl.cc | 74 ++-
gr-fec/lib/async_encoder_impl.h | 3 +
9 files changed, 944 insertions(+), 492 deletions(-)
diff --git a/gr-fec/examples/fecapi_async_decoders.grc
b/gr-fec/examples/fecapi_async_decoders.grc
index 08a8826..c641ebb 100644
--- a/gr-fec/examples/fecapi_async_decoders.grc
+++ b/gr-fec/examples/fecapi_async_decoders.grc
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
- <timestamp>Mon May 19 19:34:15 2014</timestamp>
+ <timestamp>Tue May 20 15:23:14 2014</timestamp>
<block>
<key>options</key>
<param>
@@ -716,49 +716,6 @@
</param>
</block>
<block>
- <key>blocks_char_to_float</key>
- <param>
- <key>id</key>
- <value>blocks_char_to_float_0_1</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- <param>
- <key>scale</key>
- <value>1</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(408, 375)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
<key>blocks_repack_bits_bb</key>
<param>
<key>id</key>
@@ -1321,57 +1278,6 @@
</param>
</block>
<block>
- <key>fec_async_encoder</key>
- <param>
- <key>id</key>
- <value>fec_async_encoder_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>encoder</key>
- <value>enc_cc</value>
- </param>
- <param>
- <key>packed</key>
- <value>False</value>
- </param>
- <param>
- <key>rev_unpack</key>
- <value>True</value>
- </param>
- <param>
- <key>rev_pack</key>
- <value>True</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(600, 143)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
<key>blocks_tagged_stream_to_pdu</key>
<param>
<key>id</key>
@@ -1662,100 +1568,586 @@
<value>0</value>
</param>
</block>
- <connection>
- <source_block_id>blocks_vector_source_x_0_1_0</source_block_id>
- <sink_block_id>blocks_throttle_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>analog_random_source_x_0</source_block_id>
- <sink_block_id>blocks_throttle_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_throttle_0</source_block_id>
- <sink_block_id>blocks_stream_to_tagged_stream_0_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>digital_map_bb_0</source_block_id>
- <sink_block_id>blocks_char_to_float_0_1</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>fec_async_decoder_0</source_block_id>
- <sink_block_id>blocks_pdu_to_tagged_stream_0_0</sink_block_id>
- <source_key>out</source_key>
- <sink_key>pdus</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_stream_to_tagged_stream_0_0</source_block_id>
- <sink_block_id>blocks_repack_bits_bb_0_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_repack_bits_bb_0_0</source_block_id>
- <sink_block_id>blocks_tagged_stream_to_pdu_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_tagged_stream_to_pdu_0</source_block_id>
- <sink_block_id>fec_async_encoder_0</sink_block_id>
- <source_key>pdus</source_key>
- <sink_key>in</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_pdu_to_tagged_stream_0</source_block_id>
- <sink_block_id>digital_map_bb_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_char_to_float_0_1</source_block_id>
- <sink_block_id>blocks_tagged_stream_to_pdu_1</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_char_to_float_0_0_0_0</source_block_id>
- <sink_block_id>qtgui_time_sink_x_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_repack_bits_bb_0_0</source_block_id>
- <sink_block_id>blocks_char_to_float_0_1_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_char_to_float_0_1_0</source_block_id>
- <sink_block_id>qtgui_time_sink_x_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>1</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_pdu_to_tagged_stream_0_0</source_block_id>
- <sink_block_id>blocks_char_to_float_0_0_0_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_tagged_stream_to_pdu_1</source_block_id>
- <sink_block_id>fec_async_decoder_0</sink_block_id>
- <source_key>pdus</source_key>
- <sink_key>in</sink_key>
- </connection>
- <connection>
- <source_block_id>fec_async_encoder_0</source_block_id>
- <sink_block_id>blocks_pdu_to_tagged_stream_0</sink_block_id>
- <source_key>out</source_key>
- <sink_key>pdus</sink_key>
+ <block>
+ <key>variable_ccsds_encoder_def</key>
+ <param>
+ <key>id</key>
+ <value>enc_ccsds</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>"ok"</value>
+ </param>
+ <param>
+ <key>ndim</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>dim1</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>dim2</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>framebits</key>
+ <value>8000</value>
+ </param>
+ <param>
+ <key>state_start</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>mode</key>
+ <value>fec.CC_TERMINATED</value>
+ </param>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(992, 537)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>fec_async_encoder</key>
+ <param>
+ <key>id</key>
+ <value>fec_async_encoder_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>encoder</key>
+ <value>enc_ccsds</value>
+ </param>
+ <param>
+ <key>packed</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>rev_unpack</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>rev_pack</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>affinity</key>
+ <value></value>
+ </param>
+ <param>
+ <key>minoutbuf</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>maxoutbuf</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(600, 143)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>qtgui_time_sink_x</key>
+ <param>
+ <key>id</key>
+ <value>qtgui_time_sink_x_1</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>float</value>
+ </param>
+ <param>
+ <key>name</key>
+ <value>QT GUI Plot</value>
+ </param>
+ <param>
+ <key>size</key>
+ <value>1024</value>
+ </param>
+ <param>
+ <key>srate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>autoscale</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>ymin</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>ymax</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>nconnections</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>update_time</key>
+ <value>0.10</value>
+ </param>
+ <param>
+ <key>entags</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>gui_hint</key>
+ <value></value>
+ </param>
+ <param>
+ <key>tr_mode</key>
+ <value>qtgui.TRIG_MODE_FREE</value>
+ </param>
+ <param>
+ <key>tr_slope</key>
+ <value>qtgui.TRIG_SLOPE_POS</value>
+ </param>
+ <param>
+ <key>tr_level</key>
+ <value>0.0</value>
+ </param>
+ <param>
+ <key>tr_delay</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>tr_chan</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>tr_tag</key>
+ <value>""</value>
+ </param>
+ <param>
+ <key>label1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>width1</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>color1</key>
+ <value>"blue"</value>
+ </param>
+ <param>
+ <key>style1</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>marker1</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>alpha1</key>
+ <value>1.0</value>
+ </param>
+ <param>
+ <key>label2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>width2</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>color2</key>
+ <value>"red"</value>
+ </param>
+ <param>
+ <key>style2</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>marker2</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>alpha2</key>
+ <value>1.0</value>
+ </param>
+ <param>
+ <key>label3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>width3</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>color3</key>
+ <value>"green"</value>
+ </param>
+ <param>
+ <key>style3</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>marker3</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>alpha3</key>
+ <value>1.0</value>
+ </param>
+ <param>
+ <key>label4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>width4</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>color4</key>
+ <value>"black"</value>
+ </param>
+ <param>
+ <key>style4</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>marker4</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>alpha4</key>
+ <value>1.0</value>
+ </param>
+ <param>
+ <key>label5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>width5</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>color5</key>
+ <value>"cyan"</value>
+ </param>
+ <param>
+ <key>style5</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>marker5</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>alpha5</key>
+ <value>1.0</value>
+ </param>
+ <param>
+ <key>label6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>width6</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>color6</key>
+ <value>"magenta"</value>
+ </param>
+ <param>
+ <key>style6</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>marker6</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>alpha6</key>
+ <value>1.0</value>
+ </param>
+ <param>
+ <key>label7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>width7</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>color7</key>
+ <value>"yellow"</value>
+ </param>
+ <param>
+ <key>style7</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>marker7</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>alpha7</key>
+ <value>1.0</value>
+ </param>
+ <param>
+ <key>label8</key>
+ <value></value>
+ </param>
+ <param>
+ <key>width8</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>color8</key>
+ <value>"dark red"</value>
+ </param>
+ <param>
+ <key>style8</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>marker8</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>alpha8</key>
+ <value>1.0</value>
+ </param>
+ <param>
+ <key>label9</key>
+ <value></value>
+ </param>
+ <param>
+ <key>width9</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>color9</key>
+ <value>"dark green"</value>
+ </param>
+ <param>
+ <key>style9</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>marker9</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>alpha9</key>
+ <value>1.0</value>
+ </param>
+ <param>
+ <key>label10</key>
+ <value></value>
+ </param>
+ <param>
+ <key>width10</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>color10</key>
+ <value>"blue"</value>
+ </param>
+ <param>
+ <key>style10</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>marker10</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>alpha10</key>
+ <value>1.0</value>
+ </param>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>affinity</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(639, 250)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>blocks_char_to_float</key>
+ <param>
+ <key>id</key>
+ <value>blocks_char_to_float_0_1</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>vlen</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>scale</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>affinity</key>
+ <value></value>
+ </param>
+ <param>
+ <key>minoutbuf</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>maxoutbuf</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(408, 375)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <connection>
+ <source_block_id>blocks_vector_source_x_0_1_0</source_block_id>
+ <sink_block_id>blocks_throttle_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>analog_random_source_x_0</source_block_id>
+ <sink_block_id>blocks_throttle_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>blocks_throttle_0</source_block_id>
+ <sink_block_id>blocks_stream_to_tagged_stream_0_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>digital_map_bb_0</source_block_id>
+ <sink_block_id>blocks_char_to_float_0_1</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>fec_async_decoder_0</source_block_id>
+ <sink_block_id>blocks_pdu_to_tagged_stream_0_0</sink_block_id>
+ <source_key>out</source_key>
+ <sink_key>pdus</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>blocks_stream_to_tagged_stream_0_0</source_block_id>
+ <sink_block_id>blocks_repack_bits_bb_0_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>blocks_repack_bits_bb_0_0</source_block_id>
+ <sink_block_id>blocks_tagged_stream_to_pdu_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>blocks_tagged_stream_to_pdu_0</source_block_id>
+ <sink_block_id>fec_async_encoder_0</sink_block_id>
+ <source_key>pdus</source_key>
+ <sink_key>in</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>blocks_pdu_to_tagged_stream_0</source_block_id>
+ <sink_block_id>digital_map_bb_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>blocks_char_to_float_0_1</source_block_id>
+ <sink_block_id>blocks_tagged_stream_to_pdu_1</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>blocks_char_to_float_0_0_0_0</source_block_id>
+ <sink_block_id>qtgui_time_sink_x_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>blocks_repack_bits_bb_0_0</source_block_id>
+ <sink_block_id>blocks_char_to_float_0_1_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>blocks_char_to_float_0_1_0</source_block_id>
+ <sink_block_id>qtgui_time_sink_x_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>1</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>blocks_pdu_to_tagged_stream_0_0</source_block_id>
+ <sink_block_id>blocks_char_to_float_0_0_0_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>blocks_tagged_stream_to_pdu_1</source_block_id>
+ <sink_block_id>fec_async_decoder_0</sink_block_id>
+ <source_key>pdus</source_key>
+ <sink_key>in</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>fec_async_encoder_0</source_block_id>
+ <sink_block_id>blocks_pdu_to_tagged_stream_0</sink_block_id>
+ <source_key>out</source_key>
+ <sink_key>pdus</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>blocks_char_to_float_0_1</source_block_id>
+ <sink_block_id>qtgui_time_sink_x_1</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
</connection>
</flow_graph>
diff --git a/gr-fec/examples/fecapi_async_packed_decoders.grc
b/gr-fec/examples/fecapi_async_packed_decoders.grc
index dc8fdcb..52cda86 100644
--- a/gr-fec/examples/fecapi_async_packed_decoders.grc
+++ b/gr-fec/examples/fecapi_async_packed_decoders.grc
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
- <timestamp>Mon May 19 19:35:27 2014</timestamp>
+ <timestamp>Tue May 20 15:19:00 2014</timestamp>
<block>
<key>options</key>
<param>
@@ -744,49 +744,6 @@
</param>
</block>
<block>
- <key>blocks_tagged_stream_to_pdu</key>
- <param>
- <key>id</key>
- <value>blocks_tagged_stream_to_pdu_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>byte</value>
- </param>
- <param>
- <key>tag</key>
- <value>pkt_len</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(363, 112)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
<key>blocks_pdu_to_tagged_stream</key>
<param>
<key>id</key>
@@ -920,49 +877,6 @@
</param>
</block>
<block>
- <key>blocks_char_to_float</key>
- <param>
- <key>id</key>
- <value>blocks_char_to_float_0_1</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- <param>
- <key>scale</key>
- <value>1</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(372, 367)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
<key>blocks_tagged_stream_to_pdu</key>
<param>
<key>id</key>
@@ -1341,10 +1255,10 @@
</param>
</block>
<block>
- <key>variable_ccsds_encoder_def</key>
+ <key>variable_dummy_decoder_def</key>
<param>
<key>id</key>
- <value>enc_ccsds</value>
+ <value>dec_dummy</value>
</param>
<param>
<key>_enabled</key>
@@ -1371,20 +1285,12 @@
<value>8000</value>
</param>
<param>
- <key>state_start</key>
- <value>0</value>
- </param>
- <param>
- <key>mode</key>
- <value>fec.CC_STREAMING</value>
- </param>
- <param>
<key>alias</key>
<value></value>
</param>
<param>
<key>_coordinate</key>
- <value>(995, 506)</value>
+ <value>(598, 636)</value>
</param>
<param>
<key>_rotation</key>
@@ -1392,50 +1298,42 @@
</param>
</block>
<block>
- <key>fec_async_encoder</key>
+ <key>variable_dummy_encoder_def</key>
<param>
<key>id</key>
- <value>fec_async_encoder_0</value>
+ <value>enc_dummy</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
- <key>encoder</key>
- <value>enc_cc</value>
+ <key>value</key>
+ <value>"ok"</value>
</param>
<param>
- <key>packed</key>
- <value>True</value>
+ <key>ndim</key>
+ <value>0</value>
</param>
<param>
- <key>rev_unpack</key>
- <value>True</value>
+ <key>dim1</key>
+ <value>1</value>
</param>
<param>
- <key>rev_pack</key>
- <value>True</value>
+ <key>dim2</key>
+ <value>1</value>
</param>
<param>
- <key>alias</key>
- <value></value>
+ <key>framebits</key>
+ <value>8000</value>
</param>
<param>
- <key>affinity</key>
+ <key>alias</key>
<value></value>
</param>
<param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
<key>_coordinate</key>
- <value>(599, 112)</value>
+ <value>(599, 538)</value>
</param>
<param>
<key>_rotation</key>
@@ -1443,46 +1341,66 @@
</param>
</block>
<block>
- <key>fec_async_decoder</key>
+ <key>variable_cc_encoder_def</key>
<param>
<key>id</key>
- <value>fec_async_decoder_0</value>
+ <value>enc_cc</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
- <key>decoder</key>
- <value>dec_cc</value>
+ <key>value</key>
+ <value>"ok"</value>
</param>
<param>
- <key>packed</key>
- <value>True</value>
+ <key>ndim</key>
+ <value>0</value>
</param>
<param>
- <key>rev_pack</key>
- <value>True</value>
+ <key>dim1</key>
+ <value>1</value>
</param>
<param>
- <key>alias</key>
- <value></value>
+ <key>dim2</key>
+ <value>1</value>
</param>
<param>
- <key>affinity</key>
- <value></value>
+ <key>framebits</key>
+ <value>8000</value>
</param>
<param>
- <key>minoutbuf</key>
- <value>0</value>
+ <key>k</key>
+ <value>k</value>
</param>
<param>
- <key>maxoutbuf</key>
+ <key>rate</key>
+ <value>rate</value>
+ </param>
+ <param>
+ <key>polys</key>
+ <value>polys</value>
+ </param>
+ <param>
+ <key>state_start</key>
<value>0</value>
</param>
<param>
+ <key>mode</key>
+ <value>fec.CC_TERMINATED</value>
+ </param>
+ <param>
+ <key>padding</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
<key>_coordinate</key>
- <value>(851, 111)</value>
+ <value>(401, 510)</value>
</param>
<param>
<key>_rotation</key>
@@ -1490,10 +1408,10 @@
</param>
</block>
<block>
- <key>variable_dummy_decoder_def</key>
+ <key>variable_cc_decoder_def</key>
<param>
<key>id</key>
- <value>dec_dummy</value>
+ <value>dec_cc</value>
</param>
<param>
<key>_enabled</key>
@@ -1513,19 +1431,47 @@
</param>
<param>
<key>dim2</key>
- <value>1</value>
+ <value>4</value>
</param>
<param>
<key>framebits</key>
<value>8000</value>
</param>
<param>
+ <key>k</key>
+ <value>k</value>
+ </param>
+ <param>
+ <key>rate</key>
+ <value>rate</value>
+ </param>
+ <param>
+ <key>polys</key>
+ <value>polys</value>
+ </param>
+ <param>
+ <key>state_start</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>state_end</key>
+ <value>-1</value>
+ </param>
+ <param>
+ <key>mode</key>
+ <value>fec.CC_TERMINATED</value>
+ </param>
+ <param>
+ <key>padding</key>
+ <value>False</value>
+ </param>
+ <param>
<key>alias</key>
<value></value>
</param>
<param>
<key>_coordinate</key>
- <value>(598, 636)</value>
+ <value>(402, 687)</value>
</param>
<param>
<key>_rotation</key>
@@ -1533,42 +1479,85 @@
</param>
</block>
<block>
- <key>variable_dummy_encoder_def</key>
+ <key>blocks_tagged_stream_to_pdu</key>
<param>
<key>id</key>
- <value>enc_dummy</value>
+ <value>blocks_tagged_stream_to_pdu_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
- <key>value</key>
- <value>"ok"</value>
+ <key>type</key>
+ <value>byte</value>
</param>
<param>
- <key>ndim</key>
+ <key>tag</key>
+ <value>pkt_len</value>
+ </param>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>affinity</key>
+ <value></value>
+ </param>
+ <param>
+ <key>minoutbuf</key>
<value>0</value>
</param>
<param>
- <key>dim1</key>
- <value>1</value>
+ <key>maxoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>dim2</key>
+ <key>_coordinate</key>
+ <value>(363, 112)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>blocks_char_to_float</key>
+ <param>
+ <key>id</key>
+ <value>blocks_char_to_float_0_1</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>vlen</key>
<value>1</value>
</param>
<param>
- <key>framebits</key>
- <value>8000</value>
+ <key>scale</key>
+ <value>1</value>
</param>
<param>
<key>alias</key>
<value></value>
</param>
<param>
+ <key>affinity</key>
+ <value></value>
+ </param>
+ <param>
+ <key>minoutbuf</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>maxoutbuf</key>
+ <value>0</value>
+ </param>
+ <param>
<key>_coordinate</key>
- <value>(599, 538)</value>
+ <value>(372, 367)</value>
</param>
<param>
<key>_rotation</key>
@@ -1576,10 +1565,10 @@
</param>
</block>
<block>
- <key>variable_cc_encoder_def</key>
+ <key>variable_ccsds_encoder_def</key>
<param>
<key>id</key>
- <value>enc_cc</value>
+ <value>enc_ccsds</value>
</param>
<param>
<key>_enabled</key>
@@ -1606,36 +1595,71 @@
<value>8000</value>
</param>
<param>
- <key>k</key>
- <value>k</value>
+ <key>state_start</key>
+ <value>0</value>
</param>
<param>
- <key>rate</key>
- <value>rate</value>
+ <key>mode</key>
+ <value>fec.CC_TERMINATED</value>
</param>
<param>
- <key>polys</key>
- <value>polys</value>
+ <key>alias</key>
+ <value></value>
</param>
<param>
- <key>state_start</key>
+ <key>_coordinate</key>
+ <value>(1032, 503)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
<value>0</value>
</param>
+ </block>
+ <block>
+ <key>fec_async_encoder</key>
<param>
- <key>mode</key>
- <value>fec.CC_TERMINATED</value>
+ <key>id</key>
+ <value>fec_async_encoder_0</value>
</param>
<param>
- <key>padding</key>
- <value>False</value>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>encoder</key>
+ <value>enc_cc</value>
+ </param>
+ <param>
+ <key>packed</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>rev_unpack</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>rev_pack</key>
+ <value>True</value>
</param>
<param>
<key>alias</key>
<value></value>
</param>
<param>
+ <key>affinity</key>
+ <value></value>
+ </param>
+ <param>
+ <key>minoutbuf</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>maxoutbuf</key>
+ <value>0</value>
+ </param>
+ <param>
<key>_coordinate</key>
- <value>(401, 510)</value>
+ <value>(599, 112)</value>
</param>
<param>
<key>_rotation</key>
@@ -1643,62 +1667,65 @@
</param>
</block>
<block>
- <key>variable_cc_decoder_def</key>
+ <key>fec_async_decoder</key>
<param>
<key>id</key>
- <value>dec_cc</value>
+ <value>fec_async_decoder_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
- <key>value</key>
- <value>"ok"</value>
+ <key>decoder</key>
+ <value>dec_cc</value>
</param>
<param>
- <key>ndim</key>
- <value>0</value>
+ <key>packed</key>
+ <value>True</value>
</param>
<param>
- <key>dim1</key>
- <value>1</value>
+ <key>rev_pack</key>
+ <value>True</value>
</param>
<param>
- <key>dim2</key>
- <value>4</value>
+ <key>alias</key>
+ <value></value>
</param>
<param>
- <key>framebits</key>
- <value>8000</value>
+ <key>affinity</key>
+ <value></value>
</param>
<param>
- <key>k</key>
- <value>k</value>
+ <key>minoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>rate</key>
- <value>rate</value>
+ <key>maxoutbuf</key>
+ <value>0</value>
</param>
<param>
- <key>polys</key>
- <value>polys</value>
+ <key>_coordinate</key>
+ <value>(851, 111)</value>
</param>
<param>
- <key>state_start</key>
+ <key>_rotation</key>
<value>0</value>
</param>
+ </block>
+ <block>
+ <key>note</key>
<param>
- <key>state_end</key>
- <value>-1</value>
+ <key>id</key>
+ <value>note_ccsds</value>
</param>
<param>
- <key>mode</key>
- <value>fec.CC_TERMINATED</value>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
- <key>padding</key>
- <value>False</value>
+ <key>note</key>
+ <value>When using CCSDS encoder, turn Rev. Unpacking to Off/False in the
Async Decoder</value>
</param>
<param>
<key>alias</key>
@@ -1706,7 +1733,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(402, 687)</value>
+ <value>(1034, 617)</value>
</param>
<param>
<key>_rotation</key>
diff --git a/gr-fec/examples/fecapi_async_to_stream.grc
b/gr-fec/examples/fecapi_async_to_stream.grc
index 84e10e7..afd6fdb 100644
--- a/gr-fec/examples/fecapi_async_to_stream.grc
+++ b/gr-fec/examples/fecapi_async_to_stream.grc
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
- <timestamp>Mon May 19 17:07:45 2014</timestamp>
+ <timestamp>Tue May 20 15:21:44 2014</timestamp>
<block>
<key>options</key>
<param>
@@ -1889,30 +1889,22 @@
</param>
</block>
<block>
- <key>fec_async_encoder</key>
+ <key>digital_crc32_bb</key>
<param>
<key>id</key>
- <value>fec_async_encoder_0</value>
+ <value>digital_crc32_bb_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
- <key>encoder</key>
- <value>enc_cc</value>
- </param>
- <param>
- <key>packed</key>
- <value>True</value>
- </param>
- <param>
- <key>rev_unpack</key>
+ <key>check</key>
<value>True</value>
</param>
<param>
- <key>rev_pack</key>
- <value>True</value>
+ <key>lengthtagname</key>
+ <value>pkt_len</value>
</param>
<param>
<key>alias</key>
@@ -1932,7 +1924,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(429, 148)</value>
+ <value>(1214, 332)</value>
</param>
<param>
<key>_rotation</key>
@@ -1940,22 +1932,30 @@
</param>
</block>
<block>
- <key>digital_crc32_bb</key>
+ <key>fec_async_encoder</key>
<param>
<key>id</key>
- <value>digital_crc32_bb_0</value>
+ <value>fec_async_encoder_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
- <key>check</key>
+ <key>encoder</key>
+ <value>enc_cc</value>
+ </param>
+ <param>
+ <key>packed</key>
<value>True</value>
</param>
<param>
- <key>lengthtagname</key>
- <value>pkt_len</value>
+ <key>rev_unpack</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>rev_pack</key>
+ <value>True</value>
</param>
<param>
<key>alias</key>
@@ -1975,7 +1975,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1214, 332)</value>
+ <value>(429, 148)</value>
</param>
<param>
<key>_rotation</key>
diff --git a/gr-fec/examples/fecapi_decoders.grc
b/gr-fec/examples/fecapi_decoders.grc
index e48ee59..cec1b05 100644
--- a/gr-fec/examples/fecapi_decoders.grc
+++ b/gr-fec/examples/fecapi_decoders.grc
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
- <timestamp>Mon May 19 20:50:43 2014</timestamp>
+ <timestamp>Tue May 20 13:32:56 2014</timestamp>
<block>
<key>options</key>
<param>
@@ -325,49 +325,6 @@
</param>
</block>
<block>
- <key>variable_dummy_decoder_def</key>
- <param>
- <key>id</key>
- <value>dec_dummy</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>"ok"</value>
- </param>
- <param>
- <key>ndim</key>
- <value>1</value>
- </param>
- <param>
- <key>dim1</key>
- <value>1</value>
- </param>
- <param>
- <key>dim2</key>
- <value>1</value>
- </param>
- <param>
- <key>framebits</key>
- <value>frame_size*8</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(370, 656)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
<key>variable_cc_decoder_def</key>
<param>
<key>id</key>
@@ -1815,7 +1772,7 @@
</param>
<param>
<key>ndim</key>
- <value>2</value>
+ <value>1</value>
</param>
<param>
<key>dim1</key>
@@ -1835,7 +1792,50 @@
</param>
<param>
<key>_coordinate</key>
- <value>(370, 562)</value>
+ <value>(371, 562)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_dummy_decoder_def</key>
+ <param>
+ <key>id</key>
+ <value>dec_dummy</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>"ok"</value>
+ </param>
+ <param>
+ <key>ndim</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>dim1</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>dim2</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>framebits</key>
+ <value>frame_size*8</value>
+ </param>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(371, 656)</value>
</param>
<param>
<key>_rotation</key>
diff --git a/gr-fec/examples/fecapi_tagged_decoders.grc
b/gr-fec/examples/fecapi_tagged_decoders.grc
index d2512ce..bbb8282 100644
--- a/gr-fec/examples/fecapi_tagged_decoders.grc
+++ b/gr-fec/examples/fecapi_tagged_decoders.grc
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
- <timestamp>Tue May 20 10:51:56 2014</timestamp>
+ <timestamp>Tue May 20 15:45:42 2014</timestamp>
<block>
<key>options</key>
<param>
@@ -68,7 +68,7 @@
<key>variable</key>
<param>
<key>id</key>
- <value>rep</value>
+ <value>polys</value>
</param>
<param>
<key>_enabled</key>
@@ -76,7 +76,7 @@
</param>
<param>
<key>value</key>
- <value>3</value>
+ <value>[109, 79]</value>
</param>
<param>
<key>alias</key>
@@ -84,7 +84,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(365, 759)</value>
+ <value>(72, 584)</value>
</param>
<param>
<key>_rotation</key>
@@ -95,7 +95,7 @@
<key>variable</key>
<param>
<key>id</key>
- <value>k</value>
+ <value>rate</value>
</param>
<param>
<key>_enabled</key>
@@ -103,7 +103,7 @@
</param>
<param>
<key>value</key>
- <value>7</value>
+ <value>2</value>
</param>
<param>
<key>alias</key>
@@ -111,7 +111,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(30, 520)</value>
+ <value>(97, 520)</value>
</param>
<param>
<key>_rotation</key>
@@ -122,7 +122,7 @@
<key>variable</key>
<param>
<key>id</key>
- <value>length_tag</value>
+ <value>samp_rate</value>
</param>
<param>
<key>_enabled</key>
@@ -130,7 +130,7 @@
</param>
<param>
<key>value</key>
- <value>"packet_len"</value>
+ <value>50000</value>
</param>
<param>
<key>alias</key>
@@ -138,7 +138,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(101, 73)</value>
+ <value>(12, 73)</value>
</param>
<param>
<key>_rotation</key>
@@ -149,7 +149,7 @@
<key>variable</key>
<param>
<key>id</key>
- <value>samp_rate</value>
+ <value>length_tag</value>
</param>
<param>
<key>_enabled</key>
@@ -157,7 +157,7 @@
</param>
<param>
<key>value</key>
- <value>50000</value>
+ <value>"packet_len"</value>
</param>
<param>
<key>alias</key>
@@ -165,7 +165,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(12, 73)</value>
+ <value>(101, 73)</value>
</param>
<param>
<key>_rotation</key>
@@ -176,7 +176,7 @@
<key>variable</key>
<param>
<key>id</key>
- <value>rate</value>
+ <value>k</value>
</param>
<param>
<key>_enabled</key>
@@ -184,7 +184,7 @@
</param>
<param>
<key>value</key>
- <value>2</value>
+ <value>7</value>
</param>
<param>
<key>alias</key>
@@ -192,7 +192,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(97, 520)</value>
+ <value>(30, 520)</value>
</param>
<param>
<key>_rotation</key>
@@ -203,7 +203,7 @@
<key>variable</key>
<param>
<key>id</key>
- <value>polys</value>
+ <value>rep</value>
</param>
<param>
<key>_enabled</key>
@@ -211,7 +211,7 @@
</param>
<param>
<key>value</key>
- <value>[109, 79]</value>
+ <value>3</value>
</param>
<param>
<key>alias</key>
@@ -219,7 +219,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(72, 584)</value>
+ <value>(365, 759)</value>
</param>
<param>
<key>_rotation</key>
diff --git a/gr-fec/include/gnuradio/fec/async_encoder.h
b/gr-fec/include/gnuradio/fec/async_encoder.h
index 0310ae4..0d31bc4 100644
--- a/gr-fec/include/gnuradio/fec/async_encoder.h
+++ b/gr-fec/include/gnuradio/fec/async_encoder.h
@@ -34,8 +34,8 @@ namespace gr {
/*!
* \brief Creates the encoder block for use in GNU Radio
* flowgraphs with async message from a given FEC API object
- * derived from the generic_encoder class. \ingroup
- * error_coding_blk
+ * derived from the generic_encoder class.
+ * \ingroup error_coding_blk
*
* \details
*
diff --git a/gr-fec/lib/async_decoder_impl.cc b/gr-fec/lib/async_decoder_impl.cc
index 8e97476..f5924ec 100644
--- a/gr-fec/lib/async_decoder_impl.cc
+++ b/gr-fec/lib/async_decoder_impl.cc
@@ -91,7 +91,7 @@ namespace gr {
{
if(d_packed) {
delete d_pack;
- delete d_bits_out;
+ volk_free(d_bits_out);
}
volk_free(d_tmp_f32);
diff --git a/gr-fec/lib/async_encoder_impl.cc b/gr-fec/lib/async_encoder_impl.cc
index 556a8a5..d6ce67d 100644
--- a/gr-fec/lib/async_encoder_impl.cc
+++ b/gr-fec/lib/async_encoder_impl.cc
@@ -60,20 +60,42 @@ namespace gr {
message_port_register_out(d_out_port);
if(d_packed) {
- d_unpack = new blocks::kernel::unpack_k_bits(8);
- d_pack = new blocks::kernel::pack_k_bits(8);
set_msg_handler(d_in_port,
boost::bind(&async_encoder_impl::encode_packed, this ,_1) );
+
+ d_unpack = new blocks::kernel::unpack_k_bits(8);
+
+ int max_bits_out = d_encoder->get_output_size();
+ d_bits_out = (uint8_t*)volk_malloc(max_bits_out*sizeof(uint8_t),
+ volk_get_alignment());
+
}
else {
set_msg_handler(d_in_port,
boost::bind(&async_encoder_impl::encode_unpacked, this ,_1) );
}
+
+ if(d_packed || (strncmp(d_encoder->get_input_conversion(), "pack", 4) ==
0)) {
+ // encode_unpacked: if input conversion is 'pack', pack the input bits
+ // encode_packed: used to repack the output
+ d_pack = new blocks::kernel::pack_k_bits(8);
+
+ // encode_unpacked: Holds packed bits in when input conversion is
packed
+ // encode_packed: holds the output bits of the encoder to be packed
+ int max_bits_in = d_encoder->get_input_size();
+ d_bits_in = (uint8_t*)volk_malloc(max_bits_in*sizeof(uint8_t),
+ volk_get_alignment());
+ }
}
async_encoder_impl::~async_encoder_impl()
{
if(d_packed) {
delete d_unpack;
+ volk_free(d_bits_out);
+ }
+
+ if(d_packed || (strncmp(d_encoder->get_input_conversion(), "pack", 4) ==
0)) {
delete d_pack;
+ volk_free(d_bits_in);
}
}
@@ -96,8 +118,13 @@ namespace gr {
pmt::pmt_t outvec = pmt::make_u8vector(nbits_out, 0x00);
uint8_t* bits_out = pmt::u8vector_writable_elements(outvec, o0);
- // ENCODE!
- d_encoder->generic_work((void*)bits_in, (void*)bits_out);
+ if(strncmp(d_encoder->get_input_conversion(), "pack", 4) == 0) {
+ d_pack->pack(d_bits_in, bits_in, nbits_in/8);
+ d_encoder->generic_work((void*)d_bits_in, (void*)bits_out);
+ }
+ else {
+ d_encoder->generic_work((void*)bits_in, (void*)bits_out);
+ }
pmt::pmt_t msg_pair = pmt::cons(meta, outvec);
message_port_pub(d_out_port, msg_pair);
@@ -114,41 +141,44 @@ namespace gr {
int nbytes_in = pmt::length(bytes);
int nbits_in = 8*nbytes_in;
const uint8_t* bytes_in = pmt::u8vector_elements(bytes, o0);
- uint8_t* bits_in = (uint8_t*)volk_malloc(nbits_in*sizeof(uint8_t),
- volk_get_alignment());
d_encoder->set_frame_size(nbits_in);
int nbits_out = d_encoder->get_output_size();
int nbytes_out = nbits_out/8;
- // Encoder takes a stream of bits, but PDU's are received as
- // bytes, so we unpack them here.
- if(d_rev_unpack)
- d_unpack->unpack_rev(bits_in, bytes_in, nbytes_in);
- else
- d_unpack->unpack(bits_in, bytes_in, nbytes_in);
-
- // buffers for bits/bytes to go to
- uint8_t* bits_out = (uint8_t*)volk_malloc(nbits_out*sizeof(uint8_t),
- volk_get_alignment());
+ if(strncmp(d_encoder->get_input_conversion(), "pack", 4) == 0) {
+ // If the input takes packed, anyways, don't go through the
+ // unpacker. Note that if we need the unpacking to reverse,
+ // we won't get that here and might have to correct for it in
+ // the decoder.
+ // d_bits_in > bytes_in, so we're abusing the existence of
+ // this allocated memory here
+ memcpy(d_bits_in, bytes_in, nbytes_in*sizeof(uint8_t));
+ }
+ else {
+ // Encoder takes a stream of bits, but PDU's are received as
+ // bytes, so we unpack them here.
+ if(d_rev_unpack)
+ d_unpack->unpack_rev(d_bits_in, bytes_in, nbytes_in);
+ else
+ d_unpack->unpack(d_bits_in, bytes_in, nbytes_in);
+ }
+ // buffers for output bytes to go to
pmt::pmt_t outvec = pmt::make_u8vector(nbytes_out, 0x00);
uint8_t* bytes_out = pmt::u8vector_writable_elements(outvec, o0);
// ENCODE!
- d_encoder->generic_work((void*)bits_in, (void*)bits_out);
+ d_encoder->generic_work((void*)d_bits_in, (void*)d_bits_out);
if(d_rev_pack)
- d_pack->pack_rev(bytes_out, bits_out, nbytes_out);
+ d_pack->pack_rev(bytes_out, d_bits_out, nbytes_out);
else
- d_pack->pack(bytes_out, bits_out, nbytes_out);
+ d_pack->pack(bytes_out, d_bits_out, nbytes_out);
pmt::pmt_t msg_pair = pmt::cons(meta, outvec);
message_port_pub(d_out_port, msg_pair);
-
- volk_free(bits_in);
- volk_free(bits_out);
}
int
diff --git a/gr-fec/lib/async_encoder_impl.h b/gr-fec/lib/async_encoder_impl.h
index 7cca623..fe48177 100644
--- a/gr-fec/lib/async_encoder_impl.h
+++ b/gr-fec/lib/async_encoder_impl.h
@@ -47,6 +47,9 @@ namespace gr {
bool d_rev_unpack;
bool d_rev_pack;
+ uint8_t* d_bits_in;
+ uint8_t* d_bits_out;
+
void encode_packed(pmt::pmt_t msg);
void encode_unpacked(pmt::pmt_t msg);
- [Commit-gnuradio] [gnuradio] 48/57: fec: wip: adding extended encoder for async version., (continued)
- [Commit-gnuradio] [gnuradio] 48/57: fec: wip: adding extended encoder for async version., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 47/57: digital: don't need the FEC info for the tagged stream corr access code., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 46/57: blocks: adding an option to swap the order of the output bits of a repack_bits block., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 45/57: fec: wip: using unpack/pack k bits kernels instead of copying logic in here., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 56/57: Merge branch 'fecapi', git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 51/57: Revert "blocks: adding an option to swap the order of the output bits of a repack_bits block.", git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 22/57: fec: wip: adding block that correlates against an access code and produces a tagged stream ofthe payload (stripped access code)., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 53/57: fec: wip: adding qa code., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 50/57: fec: wip: adding concept of padding for CC encoder/decoder., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 54/57: fec: mostly documentation updates, spell check, etc., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 55/57: fec: wip: fixing up allocated memory; allowing async encoder deployment to be used with CCSDS (packed input requirement).,
git <=
- [Commit-gnuradio] [gnuradio] 41/57: digital: adding an async message passsing CRC32 calc/check block for PDUs., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 38/57: fec: wip: cleaning up tagged decoder, rep code., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 57/57: digital: fixing up some work done in the fec api development., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 40/57: fec: wip: adding async (PDU) encoder and decoder blocks., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 36/57: fec: wip: mods for ber plotting. Now adding theoretical BPSK in AWGN curve., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 52/57: fec: wip: async encoder/decoder working deployments., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 16/57: fec: Merging fecapi with support for CC code., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 33/57: fec: wip: adding a dummy encoder/decoder and repetition code to exercise the API., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 49/57: blocks: adding reverse packing/unpacking functions., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 28/57: fec: updating puncturing, adding documentation, adding CCSDS encoder., git, 2014/05/20