|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--LDPCFecSession_JNI
This is the FEC session class, where all the context information is kept for encoding/decoding this block. There must be one such FEC session instance per FEC block.
WARNING: the following class contains a lot of checking code that
is only available in DEBUG mode (set -DDEBUG on the compiling line
of native implementation code).
Whenever used with a new application, first validate your code in
DEBUG mode, and switch to production code only in a second step...
Field Summary | |
static int |
FLAG_BOTH
Flag for a coding and decoding session |
static int |
FLAG_CODER
Flag for a coding session |
static int |
FLAG_DECODER
Flag for a decoding session |
static int |
LDPC_ERROR
Ok statut retruned bu functions |
static int |
LDPC_OK
Error statut retruned bu functions |
int |
ptr_obj
Pointer to an instance of native type LDPCFecSession Public for JNI. |
static int |
TypeLDGM
Codec of type Low Density-Generator Matrix |
static int |
TypeLDPC
Codec of type Low-Density Parity Check |
static int |
TypeSTAIRS
Codec of type Stairs |
Constructor Summary | |
LDPCFecSession_JNI()
LDPCFecSession_JNI Contructor. |
Method Summary | |
(package private) static void |
|
void |
BuildFecPacket(byte[][] pkt_canvas,
int fec_index,
byte[] fec_pkt)
BuildFecPacket: Build a new FEC packet. |
int |
DecodeFecStep(byte[][] pkt_canvas,
byte[] new_packet,
int pkt_seqno,
boolean store_packet,
int context_4_callback)
DecodeFecStep: Perform a new decoding step with a new (given) packet. |
void |
EndSession()
EndSession : Ends the LDPC session, and cleans up everything. |
int |
InitSession(int nbDataPkt,
int nbFecPkt,
int pktSize,
int flags,
int leftDegree,
int seed,
int codecType)
InitSession: Initializes the LDPC session. |
boolean |
IsDecodingComplete(byte[][] pkt_canvas)
IsDecodingComplete: Checks if all DATA packets have been received/rebuilt. |
boolean |
IsInitialized()
IsInitialized: Check if the LDPC session has been initialized. |
private int |
LDPCFecSession()
|
void |
SetVerbosity(int verb)
Set the verbosity level. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
Field Detail |
public static final int LDPC_OK
public static final int LDPC_ERROR
public static final int FLAG_CODER
public static final int FLAG_DECODER
public static final int FLAG_BOTH
public static final int TypeLDPC
public static final int TypeLDGM
public static final int TypeSTAIRS
public int ptr_obj
Constructor Detail |
public LDPCFecSession_JNI()
=> Call native LDPCFecSession Constructor and affect an int pointeur to the member ptr_obj;
Method Detail |
static void()
private int LDPCFecSession()
public int InitSession(int nbDataPkt, int nbFecPkt, int pktSize, int flags, int leftDegree, int seed, int codecType)
nbDataPkt
- (IN) number of DATA packets (i.e. k).nbFecPkt
- (IN) number of FEC packets (i.e. n-k).pktSize
- (IN) packet size in bytes. MUST BE multiple of 4.flags
- (IN) session flags (FLAG_CODER, FLAG_DECODER, ...).leftDegree
- (IN) number of check edges per packet (FEC constraints).seed
- (IN) seed used to build the parity check matrix (H).codecType
- (IN) Type of codec algorithm and matrix to use.
Can be on of TypeLDGM, TypeSTAIRS, TypeLDPCpublic void EndSession()
public boolean IsInitialized()
public void SetVerbosity(int verb)
verb
- (IN) new verbosity level (0: no trace, 1: few traces, 2: all traces)public void BuildFecPacket(byte[][] pkt_canvas, int fec_index, byte[] fec_pkt)
pkt_canvas
- (IN) Array of source DATA packets.
This is a table of n references to objects
containing the source packets.fec_index
- (IN) Index of FEC packet to build in {0.. n-k-1}
(!) range.fec_pkt
- (IN-OUT)Reference to the FEC packet buffer that will
be built. This buffer MUST BE allocated
before, but NOT cleared since
this function will do it.public int DecodeFecStep(byte[][] pkt_canvas, byte[] new_packet, int pkt_seqno, boolean store_packet, int context_4_callback)
This function relies on the following simple algorithm:
Given a set of linear equations, if one of them has only one
remaining unknown variable, then the value of this variable is
that of the constant term.
Replace this variable by its value in all remaining linear
equations, and reiterate. The value of several variables can
therefore be find by this recursive algorithm.
In practice, an incoming packet contains the value of the associated variable, so replace its value in all linear equations in which it is implicated. Then apply the above algorithm and see if decoding can progress by one or more steps.
For instance, if {s1, s2} are source symbols, and {f1} a FEC symbol:
{ s1 + s2 + f1 = 0 (eq. 1)
{ s2 + f1 = 0 (eq. 2)
Now if the node receives symbol s2, he replaces its value in the two equations, he then finds f1, he replaces its value in the first equation and finds s1.
pkt_canvas
- (IN-OUT) Global array of received/rebuilt packets.
This is a table of n references to objects.
This array must be cleared upon
the first call to this function. It will be
automatically updated, with pointers to
packets received or decoded, by this function.new_packet
- (IN) References to the buffer containing the new packet.pkt_seqno
- (IN) Packet's sequence number in {0.. n-1} range.store_packet
- (IN) true if the function needs to allocate memory,
copy the packet content in it, and call
any required callback.
This is typically done when this function is
called recursively, for newly decoded packets.context_4_callback
- (IN) Pointer to context that will be passed
to the callback function (if any). This
context is not interpreted by this function.public boolean IsDecodingComplete(byte[][] pkt_canvas)
pkt_canvas
- (IN) Array of received/rebuilt packets.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |