![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
Parent class for CPU and GPU implementations of LDGM coding. More...
#include <ldgm-session.h>


Public Member Functions | |
| LDGM_session () | |
| virtual | ~LDGM_session () |
| virtual void * | alloc_buf (int size)=0 |
| void | create_edges (Tanner_graph *g) |
| virtual char * | decode_frame (char *received_data, int buf_size, int *frame_size, std::map< int, int > valid_data)=0 |
| virtual void | encode (char *data, char *parity)=0 |
| char * | encode_frame (char *frame, int frame_size, int *out_buf_size) |
| char * | encode_hdr_frame (char *hdr, int hdr_size, char *frame, int frame_size, int *out_buf_size) |
| virtual void | encode_naive (char *data, char *parity)=0 |
| virtual void | free_out_buf (char *buf)=0 |
| unsigned int | get_packet_size () const |
| bool | needs_decoding (Tanner_graph *tanner_graph) |
| void | set_params (unsigned short k, unsigned short m, unsigned short rw) |
| void | set_pcMatrix (char *matrix) |
Public Member Functions inherited from Coding_session | |
Protected Attributes | |
| double | elapsed_sum2 |
| char * | lost_ptr |
| unsigned short | max_row_weight |
| long | no_frames2 |
| unsigned short | packet_size |
| unsigned short | param_k |
| unsigned short | param_m |
| int * | pcm |
| char * | pcMatrix |
| char * | received_ptr |
| unsigned short | row_weight |
Static Protected Attributes | |
| static const int | HEADER_SIZE = 4 |
Parent class for CPU and GPU implementations of LDGM coding.
This class implements common mechanisms used during LDGM coding, however actual coding implementation has to be provided in child classes.
Definition at line 36 of file ldgm-session.h.
|
inline |
Definition at line 40 of file ldgm-session.h.
|
virtual |
|
pure virtual |
Implemented in LDGM_session_cpu, and LDGM_session_gpu.
Referenced by encode_frame(), and encode_hdr_frame().
| void LDGM_session::create_edges | ( | Tanner_graph * | g | ) |
Definition at line 357 of file ldgm-session.cpp.
References max_row_weight, Tanner_graph::nodes, param_k, param_m, and pcm.
Referenced by LDGM_session_cpu::decode_frame().
|
pure virtual |
Method decode should recover original source data
| received_data | Received data (source and parity) |
| buf_size | Size of the received buffer |
| frame_size | Output parameter for storing size of the decoded frame |
| valid_data | Map storing pairs <offset, number of bytes> of received data |
Implements Coding_session.
Implemented in LDGM_session_cpu, and LDGM_session_gpu.
|
pure virtual |
Implemented in LDGM_session_cpu, and LDGM_session_gpu.
Referenced by encode_frame(), and encode_hdr_frame().
|
virtual |
Method encode should compute parity data for the given source data and add suitable FEC parity header.
| source_data | Data to encode |
| frame_size | Size of the frame being encoded |
| buf_size | Output parameter for storing total size of the returned buffer |
Implements Coding_session.
Definition at line 124 of file ldgm-session.cpp.
References alloc_buf(), elapsed_sum2, Timer_util::elapsed_time_ms(), encode(), Timer_util::end(), frame, HEADER_SIZE, no_frames2, packet_size, param_k, param_m, and Timer_util::start().
Referenced by demo().

| char * LDGM_session::encode_hdr_frame | ( | char * | hdr, |
| int | hdr_size, | ||
| char * | frame, | ||
| int | frame_size, | ||
| int * | out_buf_size ) |
Definition at line 225 of file ldgm-session.cpp.
References alloc_buf(), crc32buf(), elapsed_sum2, Timer_util::elapsed_time_us(), encode(), Timer_util::end(), frame, HEADER_SIZE, no_frames2, packet_size, param_k, param_m, and Timer_util::start().

|
pure virtual |
Implemented in LDGM_session_cpu, and LDGM_session_gpu.
|
pure virtual |
Implemented in LDGM_session_cpu, and LDGM_session_gpu.
|
inline |
Definition at line 59 of file ldgm-session.h.
References packet_size.
Referenced by LDGM_session_gpu::encode().
| bool LDGM_session::needs_decoding | ( | Tanner_graph * | tanner_graph | ) |
This method checks whether the given graph needs further decoding
| tanner_graph | Given Tanner graph |
Definition at line 400 of file ldgm-session.cpp.
References Tanner_graph::nodes, and param_k.
Referenced by LDGM_session_cpu::decode_frame().
|
inline |
Definition at line 92 of file ldgm-session.h.
References param_k, param_m, and row_weight.
Referenced by demo().
| void LDGM_session::set_pcMatrix | ( | char * | matrix | ) |
Definition at line 40 of file ldgm-session.cpp.
References max_row_weight, MAX_W, param_k, param_m, and pcm.
Referenced by demo().
|
protected |
Definition at line 121 of file ldgm-session.h.
Referenced by LDGM_session_cpu::~LDGM_session_cpu(), LDGM_session_gpu::~LDGM_session_gpu(), LDGM_session_cpu::decode_frame(), LDGM_session_gpu::decode_frame(), encode_frame(), and encode_hdr_frame().
|
staticprotected |
Definition at line 124 of file ldgm-session.h.
Referenced by LDGM_session_cpu::decode_frame(), LDGM_session_gpu::decode_frame(), encode_frame(), and encode_hdr_frame().
|
protected |
Definition at line 119 of file ldgm-session.h.
|
protected |
Definition at line 116 of file ldgm-session.h.
Referenced by create_edges(), LDGM_session_gpu::decode_frame(), LDGM_session_cpu::encode(), LDGM_session_gpu::encode(), LDGM_session_cpu::encode_naive(), and set_pcMatrix().
|
protected |
Definition at line 122 of file ldgm-session.h.
Referenced by LDGM_session_cpu::~LDGM_session_cpu(), LDGM_session_gpu::~LDGM_session_gpu(), LDGM_session_cpu::decode_frame(), LDGM_session_gpu::decode_frame(), encode_frame(), and encode_hdr_frame().
|
protected |
Definition at line 115 of file ldgm-session.h.
Referenced by LDGM_session_cpu::decode_frame(), LDGM_session_cpu::encode(), LDGM_session_gpu::encode(), encode_frame(), encode_hdr_frame(), LDGM_session_cpu::encode_naive(), get_packet_size(), and LDGM_session_cpu::iterate().
|
protected |
Definition at line 112 of file ldgm-session.h.
Referenced by create_edges(), LDGM_session_cpu::decode_frame(), LDGM_session_gpu::decode_frame(), LDGM_session_cpu::encode(), LDGM_session_gpu::encode(), encode_frame(), encode_hdr_frame(), LDGM_session_cpu::encode_naive(), LDGM_session_cpu::iterate(), needs_decoding(), set_params(), and set_pcMatrix().
|
protected |
Definition at line 113 of file ldgm-session.h.
Referenced by create_edges(), LDGM_session_cpu::decode_frame(), LDGM_session_gpu::decode_frame(), LDGM_session_cpu::encode(), LDGM_session_gpu::encode(), encode_frame(), encode_hdr_frame(), LDGM_session_cpu::encode_naive(), LDGM_session_cpu::iterate(), set_params(), and set_pcMatrix().
|
protected |
Definition at line 110 of file ldgm-session.h.
Referenced by ~LDGM_session(), create_edges(), LDGM_session_gpu::decode_frame(), LDGM_session_cpu::encode(), LDGM_session_gpu::encode(), LDGM_session_cpu::encode_naive(), and set_pcMatrix().
|
protected |
Definition at line 109 of file ldgm-session.h.
|
protected |
Definition at line 118 of file ldgm-session.h.
|
protected |
Definition at line 114 of file ldgm-session.h.
Referenced by set_params().