UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
ldgm-session.h
Go to the documentation of this file.
1/*
2 * =====================================================================================
3 *
4 * Filename: ldgm-session.h
5 *
6 * Description: LDGM coding session
7 *
8 * Version: 1.0
9 * Created: 04/12/2012 11:05:35 AM
10 * Revision: none
11 * Compiler: gcc
12 *
13 * Author: Milan Kabat (), kabat@ics.muni.cz
14 * Organization:
15 *
16 * =====================================================================================
17 */
18
19
20#include <stdint.h>
21
22#include "coding-session.h"
23#include "tanner.h"
24
25
26#ifndef LDGM_SESSION_INC
27#define LDGM_SESSION_INC
28
37{
38 public:
39 /* ==================== LIFECYCLE ======================================= */
40 LDGM_session () : /* constructor **/
41 pcMatrix(NULL), pcm(NULL), param_k(0), param_m(0), row_weight(0),
43 lost_ptr(NULL), elapsed_sum2(0.0), no_frames2(0)
44 {
45 }
46 virtual ~LDGM_session (); /* destructor **/
47
48 /* ==================== ACCESSORS ======================================= */
55 bool
56 needs_decoding ( Tanner_graph *tanner_graph );
57
58 unsigned int
60 {
61 return packet_size;
62 }
63
64 void
65 set_pcMatrix ( char * matrix );
66
67 /* ==================== OPERATORS ======================================= */
68
69 void
71
72 char*
73 encode_frame ( char* frame, int frame_size, int* out_buf_size );
74
75 char*
76 encode_hdr_frame( char *hdr, int hdr_size, char* frame, int frame_size, int* out_buf_size );
77
78 virtual void
79 encode ( char* data, char* parity ) = 0;
80
81 virtual void
82 encode_naive ( char* data, char* parity ) = 0;
83
84 virtual void *
85 alloc_buf(int size) = 0;
86
87 virtual char*
88 decode_frame ( char* received_data, int buf_size, int* frame_size,
89 std::map<int, int> valid_data ) = 0;
90
91 void
92 set_params ( unsigned short k,
93 unsigned short m,
94 unsigned short rw
95 )
96 {
97 param_k = k;
98 param_m = m;
99 row_weight = rw;
100 }
101
102 virtual void
103 free_out_buf (char *buf) = 0;
104
105
106 protected:
107 /* ==================== DATA MEMBERS ======================================= */
108
109 char* pcMatrix;
110 int *pcm; //compact
111
112 unsigned short param_k;
113 unsigned short param_m;
114 unsigned short row_weight;
115 unsigned short packet_size;
116 unsigned short max_row_weight;
117
119 char *lost_ptr;
120
123
124 static const int HEADER_SIZE = 4;
125
126 private:
127
128
129
130 /* ==================== DATA MEMBERS ======================================= */
131
132}; /* ----- end of class LDGM_session ----- */
133
134#endif /* ----- #ifndef LDGM_SESSION_INC ----- */
135
struct video_frame * frame
Abstract class Coding_session.
Parent class for CPU and GPU implementations of LDGM coding.
static const int HEADER_SIZE
unsigned short param_m
virtual void * alloc_buf(int size)=0
double elapsed_sum2
void set_pcMatrix(char *matrix)
virtual void encode(char *data, char *parity)=0
bool needs_decoding(Tanner_graph *tanner_graph)
virtual char * decode_frame(char *received_data, int buf_size, int *frame_size, std::map< int, int > valid_data)=0
unsigned short row_weight
unsigned short max_row_weight
char * encode_frame(char *frame, int frame_size, int *out_buf_size)
unsigned short param_k
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
unsigned short packet_size
unsigned int get_packet_size() const
void set_params(unsigned short k, unsigned short m, unsigned short rw)
virtual ~LDGM_session()
virtual void free_out_buf(char *buf)=0
void create_edges(Tanner_graph *g)
char * received_ptr