SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
leansdr::s2_fecenc Struct Reference

#include <dvbs2.h>

+ Inheritance diagram for leansdr::s2_fecenc:
+ Collaboration diagram for leansdr::s2_fecenc:

Public Types

typedef ldpc_engine< bool, hard_sb, 8, uint16_ts2_ldpc_engine
 

Public Member Functions

 s2_fecenc (scheduler *sch, pipebuf< bbframe > &_in, pipebuf< fecframe< hard_sb >> &_out)
 
void run ()
 
- Public Member Functions inherited from leansdr::runnable
 runnable (scheduler *_sch, const char *name)
 
- Public Member Functions inherited from leansdr::runnable_common
 runnable_common (const char *_name)
 
virtual ~runnable_common ()
 
virtual void shutdown ()
 

Private Member Functions

void run_frame (const bbframe *pin, fecframe< hard_sb > *pout)
 

Private Attributes

pipereader< bbframein
 
pipewriter< fecframe< hard_sb > > out
 
s2_bbscrambling bbscrambling
 
s2_bch_engines s2bch
 
s2_ldpc_engines< bool, hard_sbs2ldpc
 

Additional Inherited Members

- Public Attributes inherited from leansdr::runnable_common
const char * name
 
- Protected Attributes inherited from leansdr::runnable
schedulersch
 

Detailed Description

Definition at line 2034 of file dvbs2.h.

Member Typedef Documentation

◆ s2_ldpc_engine

Definition at line 2036 of file dvbs2.h.

Constructor & Destructor Documentation

◆ s2_fecenc()

leansdr::s2_fecenc::s2_fecenc ( scheduler sch,
pipebuf< bbframe > &  _in,
pipebuf< fecframe< hard_sb >> &  _out 
)
inline

Definition at line 2037 of file dvbs2.h.

References leansdr::scheduler::debug.

2039  : runnable(sch, "S2 fecenc"),
2040  in(_in), out(_out)
2041  {
2042  if (sch->debug)
2044  }
runnable(scheduler *_sch, const char *name)
Definition: framework.h:193
pipewriter< fecframe< hard_sb > > out
Definition: dvbs2.h:2079
s2_ldpc_engines< bool, hard_sb > s2ldpc
Definition: dvbs2.h:2082
pipereader< bbframe > in
Definition: dvbs2.h:2078
scheduler * sch
Definition: framework.h:199

Member Function Documentation

◆ run()

void leansdr::s2_fecenc::run ( )
inlinevirtual

Reimplemented from leansdr::runnable_common.

Definition at line 2045 of file dvbs2.h.

References leansdr::pipereader< T >::rd(), leansdr::pipereader< T >::read(), leansdr::pipereader< T >::readable(), leansdr::pipewriter< T >::wr(), leansdr::pipewriter< T >::writable(), and leansdr::pipewriter< T >::written().

2046  {
2047  while (in.readable() >= 1 && out.writable() >= 1)
2048  {
2049  bbframe *pin = in.rd();
2050  fecframe<hard_sb> *pout = out.wr();
2051  run_frame(in.rd(), out.wr());
2052  in.read(1);
2053  out.written(1);
2054  }
2055  }
void run_frame(const bbframe *pin, fecframe< hard_sb > *pout)
Definition: dvbs2.h:2058
pipewriter< fecframe< hard_sb > > out
Definition: dvbs2.h:2079
pipereader< bbframe > in
Definition: dvbs2.h:2078
+ Here is the call graph for this function:

◆ run_frame()

void leansdr::s2_fecenc::run_frame ( const bbframe pin,
fecframe< hard_sb > *  pout 
)
inlineprivate

Definition at line 2058 of file dvbs2.h.

References leansdr::fecframe< SOFTBYTE >::bytes, leansdr::bbframe::bytes, leansdr::check_modcod(), leansdr::bch_interface::encode(), leansdr::ldpc_engine< SOFTBIT, SOFTWORD, SWSIZE, Taddr >::encode(), leansdr::s2_pls::framebits(), leansdr::s2_pls::modcod, leansdr::fecframe< SOFTBYTE >::pls, leansdr::bbframe::pls, leansdr::modcod_info::rate, and leansdr::s2_pls::sf.

2059  {
2060  const modcod_info *mcinfo = check_modcod(pin->pls.modcod);
2061  const fec_info *fi = &fec_infos[pin->pls.sf][mcinfo->rate];
2062  pout->pls = pin->pls;
2063  hard_sb *pbytes = pout->bytes;
2064  bbscrambling.transform(pin->bytes, fi->Kbch / 8, pbytes);
2065  { // BCH
2066  size_t msgbytes = fi->Kbch / 8;
2067  size_t cwbytes = fi->kldpc / 8;
2068  bch_interface *bch = s2bch.bchs[pin->pls.sf][mcinfo->rate];
2069  bch->encode(pbytes, msgbytes, pbytes + msgbytes);
2070  }
2071  { // LDPC
2072  size_t msgbits = fi->kldpc;
2073  size_t cwbits = pin->pls.framebits();
2074  s2_ldpc_engine *ldpc = s2ldpc.ldpcs[pin->pls.sf][mcinfo->rate];
2075  ldpc->encode(fi->ldpc, pbytes, msgbits, cwbits, pbytes + msgbits / 8);
2076  }
2077  }
bch_interface * bchs[2][FEC_COUNT]
Definition: dvbs2.h:1966
s2_bbscrambling bbscrambling
Definition: dvbs2.h:2080
virtual void encode(const uint8_t *msg, size_t msgbytes, uint8_t *out)=0
s2_ldpc_engine * ldpcs[2][FEC_COUNT]
Definition: dvbs2.h:1927
void encode(const ldpc_table< Taddr > *table, const SOFTWORD *msg, int k, int n, SOFTWORD *parity, int integrate=true)
Definition: ldpc.h:199
SOFTBYTE bytes[64800/8]
Definition: dvbs2.h:1221
void transform(const uint8_t *in, int bbsize, uint8_t *out)
Definition: dvbs2.h:186
s2_bch_engines s2bch
Definition: dvbs2.h:2081
s2_ldpc_engines< bool, hard_sb > s2ldpc
Definition: dvbs2.h:2082
uint8_t hard_sb
Definition: softword.h:21
const modcod_info * check_modcod(int m)
Definition: dvbs2.h:285
ldpc_engine< bool, hard_sb, 8, uint16_t > s2_ldpc_engine
Definition: dvbs2.h:2036
+ Here is the call graph for this function:

Member Data Documentation

◆ bbscrambling

s2_bbscrambling leansdr::s2_fecenc::bbscrambling
private

Definition at line 2080 of file dvbs2.h.

◆ in

pipereader<bbframe> leansdr::s2_fecenc::in
private

Definition at line 2078 of file dvbs2.h.

◆ out

pipewriter<fecframe<hard_sb> > leansdr::s2_fecenc::out
private

Definition at line 2079 of file dvbs2.h.

◆ s2bch

s2_bch_engines leansdr::s2_fecenc::s2bch
private

Definition at line 2081 of file dvbs2.h.

◆ s2ldpc

s2_ldpc_engines<bool, hard_sb> leansdr::s2_fecenc::s2ldpc
private

Definition at line 2082 of file dvbs2.h.


The documentation for this struct was generated from the following file: