-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Working branch #34
base: master
Are you sure you want to change the base?
Working branch #34
Conversation
MLsmd
commented
Dec 18, 2017
- Improvements, additions and bug fixes for DABstep
- New Synchronization approach and OFDM Demodulation
- Remove all elements from previous Synchronization
git-subtree-dir: fdk-aac-dab git-subtree-split: 89639e36b29a622c641c3de3a4737a4c848dc365
grc: fixed category naming
add a std::runtime_error if aac enc init fails.
imported dab_swig as dab in tests
Thanks for the review.! |
…to working_branch
lib/fib_source_b_impl.cc
Outdated
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; | ||
// 000 00110 000 00000 0100000000000000 00 0 0000000000000 00000000 | ||
//ensemble info, CIF counter has to increase with each CIF | ||
const char fib_source_b_impl::d_ensemble_info[56] = {0, 0, 0, 0, 0, 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the line breaks have a "semantic" here? the array "formatting" doesn't seem to reflect the spaces in the binary string comment above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is caused to autoformat. I think we can cross the 80 column border in this case.
lib/fib_sink_vb_impl.cc
Outdated
break; | ||
case FIB_SI_EXTENSION_DATA_SERVICE_LABEL: | ||
memcpy(label, &data[5], 16); | ||
GR_LOG_DEBUG(d_logger, format("[data service label]: %s") % label); | ||
GR_LOG_DEBUG(d_logger, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My happiness about this kind of line breaks is limited, but it's up to your coding style, for sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is outstanding in quality! Thank you, Luca!
So, the only things I think need changing are:
- you forgot to fix python/GUI/CMakeLists
- you actually reformatted third-party code, and should revert that. Same goes for modtool-generated test_dab.cc
- you used an autoformatter that very strictly breaks, but not very cleverly, which actually hurts readability. Not quite sure I want you to spend time on improving that - seemingly, you didn't do that in an isolated commit (....).
Fix 1 and 2, and we have a merge. Come up with a solution for 3, and I'd be even more happy than now!
lib/fib_source_b_impl.cc
Outdated
} | ||
if (data_rate_n.size() != num_subch) { | ||
throw std::invalid_argument((boost::format( | ||
"size of vector data_rate_n (%d) does not fit with number of subchannels (%d)") % |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the way you added line breaks here isn't really improving readability of the statement.
throw std::invalid_argument((boost::format( | ||
"size of service label strings is (%d) but should be %d * 16 = %d") % | ||
programme_service_labels.size() % | ||
num_subch % (16 * num_subch)).str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you do it like this, why not directly go for one argument per line? Better than to just mechanically break at N characters.
lib/fib_source_b_impl.cc
Outdated
//increase CIF counter | ||
if (d_transmission_mode != 3) | ||
CIF_counter(out + d_offset, d_nFIBs_written / 3); | ||
else CIF_counter(out + d_offset, d_nFIBs_written / 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
statement1;
else statement2;
statement3;
is no good. I'd generally advertise usage of {}
, even on single-line blocks, but more importantly, never do the "inline else"; on a scan, it looks like statement3
is only executed conditionally.
lib/fib_source_b_impl.cc
Outdated
} | ||
} | ||
d_offset += 8; | ||
while (d_offset % (8 * FIB_LENGTH) != |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Um, no, there shouldn't be a line break before 0)
.
lib/fib_source_b_impl.cc
Outdated
5); | ||
//subchannel orga field | ||
for (int subch_count = 0; subch_count < | ||
d_num_subch; subch_count++) {//iterate over all subchannels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
um, no, when adding a line break (if at all) in a for
, do it at the ;
, not in the middle of a comparison.
lib/sum_phasor_trig_vcc_impl.cc
Outdated
out[j] = in[j] * d_last_symbol[j]; | ||
} else { | ||
for (unsigned int j = 0; j < d_length; j++) { | ||
// printf("%p\n", &lastout[j]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove printf comments.
lib/test_dab.cc
Outdated
CppUnit::TextTestRunner runner; | ||
std::ofstream xmlfile(get_unittest_path("dab.xml").c_str()); | ||
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); | ||
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an autogenerated file. Why did you reformat it?
lib/time_interleave_bb_impl.cc
Outdated
//*out++ = in[vec_length * (i + (scrambling_length-1) - d_scrambling_vector[j % scrambling_length]) + j]; | ||
*out++ = in[d_vector_length * (i + (d_scrambling_length - 1) - d_scrambling_vector[j % d_scrambling_length]) + | ||
*out++ = in[d_vector_length * (i + (d_scrambling_length - 1) - | ||
d_scrambling_vector[j % |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
um, no, not really the place to break this line.
@@ -23,15 +23,26 @@ GR_PYTHON_INSTALL( | |||
FILES | |||
usrp_dab_rx.py | |||
usrp_dab_tx.py | |||
user_frontend.py | |||
${GUI_PY} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm under the impression that you forgot to move the set(GUI_PY…
lines above this line, so that this works?
python/__init__.py
Outdated
# this might fail if the module is python-only | ||
from dab_swig import * | ||
# this might fail if the module is python-only | ||
from dab_swig import * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if you touch these lines, you might as well remove the try/except ImportError: pass
, as this module is definitily not python-only.
So, formally OK, now we just have to fix the build failures:
I think you meant to use |
(also, hint, maintainers love code that is going to merge smoothly into master, so a |
I am not yet finished with reformatting and documenting the whole code. I will give you a hint here when I finished the work. |
I am now finally finished with reformatting and documenting the rest of the code and ready for the merge. |
Juche!
Will review tomorrow :)
|
relative_rate: cast integer values to float before division
Fix the memory allocation problem and add ofdm_sync & diff_phasor speed improvements