Skip to content
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

Open
wants to merge 148 commits into
base: master
Choose a base branch
from
Open

Working branch #34

wants to merge 148 commits into from

Conversation

MLsmd
Copy link
Member

@MLsmd MLsmd commented Dec 18, 2017

  • Improvements, additions and bug fixes for DABstep
  • New Synchronization approach and OFDM Demodulation
  • Remove all elements from previous Synchronization

MLsmd and others added 30 commits August 11, 2017 16:12
git-subtree-dir: fdk-aac-dab
git-subtree-split: 89639e36b29a622c641c3de3a4737a4c848dc365
add a std::runtime_error if aac enc init fails.
imported dab_swig as dab in tests
@MLsmd
Copy link
Member Author

MLsmd commented Jan 18, 2018

Thanks for the review.!
I did the requested changes and some more wrap up, docu, ...
I think we are ready for merge in master now.

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,
Copy link
Member

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

Copy link
Member Author

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.

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,
Copy link
Member

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.

Copy link
Member

@marcusmueller marcusmueller left a 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:

  1. you forgot to fix python/GUI/CMakeLists
  2. you actually reformatted third-party code, and should revert that. Same goes for modtool-generated test_dab.cc
  3. 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!

}
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)") %
Copy link
Member

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());
Copy link
Member

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.

//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);
Copy link
Member

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.

}
}
d_offset += 8;
while (d_offset % (8 * FIB_LENGTH) !=
Copy link
Member

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).

5);
//subchannel orga field
for (int subch_count = 0; subch_count <
d_num_subch; subch_count++) {//iterate over all subchannels
Copy link
Member

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.

out[j] = in[j] * d_last_symbol[j];
} else {
for (unsigned int j = 0; j < d_length; j++) {
// printf("%p\n", &lastout[j]);
Copy link
Member

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(),
Copy link
Member

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?

//*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 %
Copy link
Member

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}
Copy link
Member

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?

# 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 *
Copy link
Member

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.

@marcusmueller
Copy link
Member

So, formally OK, now we just have to fix the build failures:

../lib/fib_sink_vb_impl.cc:84:23: error: return type of out-of-line definition of 'gr::dab::fib_sink_vb_impl::process_fig' differs from that in the declaration
    fib_sink_vb_impl::process_fig(uint8_t type, const char *data, uint8_t length) {
                      ^
../lib/fib_sink_vb_impl.h:51:11: note: previous declaration is here
      int process_fig(uint8_t type, const char *data, uint8_t length);
      ~~~ ^

I think you meant to use void here, as the actual implementation never returns a value?

@marcusmueller
Copy link
Member

(also, hint, maintainers love code that is going to merge smoothly into master, so a git rebase -s ours might be a good idea)

@MLsmd
Copy link
Member Author

MLsmd commented Feb 26, 2018

I am not yet finished with reformatting and documenting the whole code. I will give you a hint here when I finished the work.
And thanks for the tip with rebase -s ours, I am going to try it out :)

@MLsmd
Copy link
Member Author

MLsmd commented Mar 6, 2018

I am now finally finished with reformatting and documenting the rest of the code and ready for the merge.

@marcusmueller
Copy link
Member

marcusmueller commented Mar 6, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants