Forum: GNU Radio compiling atsc_trellis_encoder.cc

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Dc48f9c00e3e6de9640898a531c26d89?d=identicon&s=25 Charles Swiger (Guest)
on 2006-04-10 23:28
(Received via mailing list)
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 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*)

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

--Chuck
Dc48f9c00e3e6de9640898a531c26d89?d=identicon&s=25 Charles Swiger (Guest)
on 2006-04-11 15:54
(Received via mailing list)
On Mon, 2006-04-10 at 17:26 -0400, Charles Swiger 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
Dc48f9c00e3e6de9640898a531c26d89?d=identicon&s=25 Charles Swiger (Guest)
on 2006-04-12 00:07
(Received via mailing list)
On Tue, 2006-04-11 at 09:52 -0400, Charles Swiger 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)
3719f4fea703e38bcbf8de6fe6bcdf55?d=identicon&s=25 Martin Dvh (Guest)
on 2006-04-12 01:27
(Received via mailing list)
Charles Swiger wrote:
>>atsci_trellis_encoder::NCODERS){
>
> Would that be 12 * sizeof_atsc_data_segment ?
> (NCODERS = 12)
>
>
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
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
Dc48f9c00e3e6de9640898a531c26d89?d=identicon&s=25 Charles Swiger (Guest)
on 2006-04-12 17:02
(Received via mailing list)
On Wed, 2006-04-12 at 01:23 +0200, Martin Dvh 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
745d8202ef5a58c1058d0e5395a78f9c?d=identicon&s=25 Eric Blossom (Guest)
on 2006-04-12 22:41
(Received via mailing list)
On Tue, Apr 11, 2006 at 06:05:11PM -0400, Charles Swiger 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
This topic is locked and can not be replied to.