Compiling atsc_trellis_encoder.cc

I’m getting this error compiling a new file in atsc, copied from
atsc_rs_encoder.cc:

atsc_trellis_encoder.cc: In member function virtual int atsc_trellis_encoder::work(int, gr_vector_const_void_star&, gr_vector_void_star&)': atsc_trellis_encoder.cc:55: error: no matching function for call toatsci_trellis_encoder::encode(atsc_data_segment&, const
atsc_mpeg_packet_rs_encoded&)’
./atsci_trellis_encoder.h:50: note: candidates are: void
atsci_trellis_encoder::encode(atsc_data_segment*, const
atsc_mpeg_packet_rs_encoded*)

the failing line is:

d_trellis_encoder.encode(out[i], in[i]);

in atsc_trellis_encoder.h there is:

class atsc_trellis_encoder : public gr_sync_block
{
friend atsc_trellis_encoder_sptr atsc_make_trellis_encoder();

atsci_trellis_encoder d_trellis_encoder;

atsc_trellis_encoder();

and atsci_trellis_encoder.cc,h does have class atsci_trellis_encoder
with a function ‘encode’.

Gee, it worked for cloning atsc_rs_encoder --> atsc_interleaver :wink:

–Chuck

On Mon, 2006-04-10 at 17:26 -0400, Charles S. wrote:

I’m getting this error compiling a new file in atsc, copied from
atsc_rs_encoder.cc:

atsc_trellis_encoder.cc:55: error: no matching function for call to
`atsci_trellis_encoder::encode(atsc_data_segment&, const
atsc_mpeg_packet_rs_encoded&)’
./atsci_trellis_encoder.h:50: note: candidates are: void
atsci_trellis_encoder::encode(atsc_data_segment*, const
atsc_mpeg_packet_rs_encoded*)

Spotted this difference - in a working compile atsci_data_interleaver.cc
the arguments are addresses:

atsci_data_interleaver::interleave (atsc_mpeg_packet_rs_encoded &out,
const atsc_mpeg_packet_rs_encoded
&in)

but in the failing compile atsci_trellis_encoder.cc
they are not:

atsci_trellis_encoder::encode (atsc_data_segment out[NCODERS],
const atsc_mpeg_packet_rs_encoded
in[NCODERS])

(thinking)

Oh OK - got it too compile by changing atsc_trellis_encoder.cc
from d_trellis_encoder.encode(out[i], in[i]);
to d_trellis_encoder.encode(&out[i], &in[i]);

Well, it compiles but there are likely still issues since the 0.9 work
function in GrAtscTrellisEncoder.cc has stuff to deal with an array
of encoders that I don’t understand:

// We must produce output.size units of output.

for (unsigned int i = 0; i < output.size; i +=
atsci_trellis_encoder::NCODERS){
// primitive does 12 segments at a time.
// pipeline info is handled in the primitive.
encoder.encode (&out[i], &in[i + start]);
}

Guess I’ll look at where output.size comes from and what start does.

–Chuck

On Tue, 2006-04-11 at 09:52 -0400, Charles S. wrote:

// pipeline info is handled in the primitive.
encoder.encode (&out[i], &in[i + start]);

}

Guess I’ll look at where output.size comes from and what start does.

–Chuck

Yeah, if anybody has a clue how to implement the work function for
an atsc_trellis_encoder.cc - I’m stuck. The code compiles but
segfaults, very likely due to using a simple:

for (int i = 0; i < noutput_items; i++){
d_trellis_encoder.encode(&out[i], &in[i]);

Mainly, I have no idea how output.size is created from
setOutputSize(atsci_trellis_encoder::NCODERS);

Would that be 12 * sizeof_atsc_data_segment ?
(NCODERS = 12)

On Wed, 2006-04-12 at 01:23 +0200, Martin D. wrote:

Did you check that the type of &out[i] is atsc_data_segment
and the type of &in[i] is atsc_mpeg_packet_rs_encoded?

OK - atsc_trellis_encoder.cc compiles and runs and produces
reasonable looking output:

00000000 01 00 34 00 06 01 01 06 06 02 06 06 06 02 06 00
00000010 00 00 04 06 03 03 03 05 01 03 05 04 02 00 02 01
00000020 01 05 01 04 00 07 00 02 01 06 05 04 05 05 03 03

(our 8VSB symbols I guess)

By using:

for (int i = 0; i < atsci_trellis_encoder::NCODERS; i +=
atsci_trellis_encoder::NCODERS){
d_trellis_encoder.encode(&out[i], &in[i]);

assuming Eric put enough magic in atsci_trellis_encoder,
AND skipping 52 packets for the interleaver to fill up
to pass sanity checks.

–Chuck

Charles S. wrote:

atsci_trellis_encoder::NCODERS){

Would that be 12 * sizeof_atsc_data_segment ?
(NCODERS = 12)


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page

Did you check that the type of &out[i] is atsc_data_segment
and the type of &in[i] is atsc_mpeg_packet_rs_encoded?

from GrAtscTrellisEncoder.h
atsci_trellis_encoder encoder;

from atsci_trellis_encoder.h:

/*!

  • Take 12 RS encoded, convolutionally interleaved segments and
  • produce 12 trellis coded data segments. We work in groups of 12
  • because that’s the smallest number of segments that composes a
  • single full cycle of the encoder mux.
    */
    void encode (atsc_data_segment out[NCODERS],
    const atsc_mpeg_packet_rs_encoded in[NCODERS]);

from atsc_types.h:
//! contains 832 3 bit symbols. The low 3 bits in the byte hold the
symbol.

class atsc_data_segment {
public:
static const int NPAD = 188;
plinfo pli;
unsigned char data[ATSC_DATA_SEGMENT_LENGTH];
unsigned char pad[NPAD]; // pad to power of 2 (1024)

// overload equality operator
bool operator== (const atsc_data_segment &other) const {
return std::memcmp (data, other.data, sizeof (data)) == 0;
}

bool operator!= (const atsc_data_segment &other) const {
return !(std::memcmp (data, other.data, sizeof (data)) == 0);
}
};

Greetings,
Martin

On Tue, Apr 11, 2006 at 06:05:11PM -0400, Charles S. wrote:

// primitive does 12 segments at a time.

an atsc_trellis_encoder.cc - I’m stuck. The code compiles but
segfaults, very likely due to using a simple:

for (int i = 0; i < noutput_items; i++){
d_trellis_encoder.encode(&out[i], &in[i]);

Mainly, I have no idea how output.size is created from
setOutputSize(atsci_trellis_encoder::NCODERS);

Hi Chuck,

Off the top of my head (haven’t looked at the code), I think you just
need to set_output_multiple(atsci_trellis_encoder::NCODERS) in the
constructor.

Eric