[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 02/16: fec: some initial refactoring for be
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 02/16: fec: some initial refactoring for ber_bf |
Date: |
Tue, 21 Jul 2015 19:27:51 +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 ad6d9ca46e5d6a24ba9625ab93e0c48b78f57e9e
Author: Johannes Demel <address@hidden>
Date: Fri Jul 17 14:10:04 2015 +0200
fec: some initial refactoring for ber_bf
---
gr-fec/lib/ber_bf_impl.cc | 35 ++++++++++++++---------------------
1 file changed, 14 insertions(+), 21 deletions(-)
diff --git a/gr-fec/lib/ber_bf_impl.cc b/gr-fec/lib/ber_bf_impl.cc
index ebc19bc..375844b 100644
--- a/gr-fec/lib/ber_bf_impl.cc
+++ b/gr-fec/lib/ber_bf_impl.cc
@@ -53,26 +53,25 @@ namespace gr {
}
int
- ber_bf_impl::general_work(int noutput_items,
- gr_vector_int& ninput_items,
+ ber_bf_impl::general_work(int noutput_items, gr_vector_int& ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
+ unsigned char *inbuffer0 = (unsigned char *) input_items[0];
+ unsigned char *inbuffer1 = (unsigned char *) input_items[1];
+ float *outbuffer = (float *) output_items[0];
+
+ int items = ninput_items[0] <= ninput_items[1] ? ninput_items[0] :
ninput_items[1];
+
if(d_test_mode) {
if(d_total_errors >= d_berminerrors) {
return -1;
}
else {
- unsigned char *inbuffer0 = (unsigned char *)input_items[0];
- unsigned char *inbuffer1 = (unsigned char *)input_items[1];
- float *outbuffer = (float *)output_items[0];
-
- int items = ninput_items[0] <= ninput_items[1] ? ninput_items[0] :
ninput_items[1];
-
if(items > 0) {
uint32_t ret;
for(int i = 0; i < items; i++) {
- volk_32u_popcnt(&ret,
static_cast<uint32_t>(inbuffer0[i]^inbuffer1[i]));
+ volk_32u_popcnt(&ret, static_cast<uint32_t>(inbuffer0[i] ^
inbuffer1[i]));
d_total_errors += ret;
}
d_total += items;
@@ -80,12 +79,12 @@ namespace gr {
consume_each(items);
if(d_total_errors >= d_berminerrors) {
- outbuffer[0] = log10(((double)d_total_errors)/(d_total * 8.0));
- GR_LOG_INFO(d_logger, boost::format(" %1% over %2% --> %3%") \
- % d_total_errors % (d_total * 8) % outbuffer[0]);
+ outbuffer[0] = log10(((double) d_total_errors) / (d_total * 8.0));
+ GR_LOG_INFO(d_logger, boost::format(" %1% over %2% --> %3%")
+ % d_total_errors % (d_total * 8) % outbuffer[0]);
return 1;
}
- else if(log10(((double)d_berminerrors)/(d_total * 8.0)) <
d_ber_limit) {
+ else if(log10(((double) d_berminerrors) / (d_total * 8.0)) <
d_ber_limit) {
GR_LOG_INFO(d_logger, " Min. BER limit reached");
outbuffer[0] = d_ber_limit;
d_total_errors = d_berminerrors + 1;
@@ -97,21 +96,15 @@ namespace gr {
}
}
else { // streaming mode
- unsigned char *inbuffer0 = (unsigned char *)input_items[0];
- unsigned char *inbuffer1 = (unsigned char *)input_items[1];
- float *outbuffer = (float *)output_items[0];
-
- int items = ninput_items[0] <= ninput_items[1] ? ninput_items[0] :
ninput_items[1];
-
if(items > 0) {
uint32_t ret;
for(int i = 0; i < items; i++) {
- volk_32u_popcnt(&ret,
static_cast<uint32_t>(inbuffer0[i]^inbuffer1[i]));
+ volk_32u_popcnt(&ret, static_cast<uint32_t>(inbuffer0[i] ^
inbuffer1[i]));
d_total_errors += ret;
}
d_total += items;
- outbuffer[0] = log10(((double)d_total_errors)/(d_total * 8.0));
+ outbuffer[0] = log10(((double) d_total_errors) / (d_total * 8.0));
consume_each(items);
return 1;
- [Commit-gnuradio] [gnuradio] branch master updated (55d8f48 -> cc973de), git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 05/16: fec: extended encoder now appends unpack_k_bits(8) block after encoder to satisfy get_output_conversion() = unpack behaviour, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 02/16: fec: some initial refactoring for ber_bf,
git <=
- [Commit-gnuradio] [gnuradio] 03/16: fec: fixed QA for ber_bf., git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 04/16: fec: code clean-up for block 'ber_bf'., git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 08/16: fec: added tests for extended_encoder input/output conversion., git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 15/16: Merge remote-tracking branch 'fewu/crc32_unpack', git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 01/16: updates to waterfall for suchsamples, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 10/16: Merge remote-tracking branch 'namccart/master' into master_waterfall_pdu, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 07/16: digital: added an option to the crc32_bb block that adds the unpacked CRC to the bit stream, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 12/16: qtgui: protect PDU handling waterfall port for wrong data type., git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 09/16: Merge remote-tracking branch 'jdemel/fec/fix-extended_encoder', git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 16/16: Merge branch 'maint', git, 2015/07/21