[]
This class builds packets and keeps the state information of packet interdependencies. It also supports saving the state and reverting (restoring) to the last saved state, with the save() and restore() methods.
<p>Each time the encodePacket() method is called a new packet is encoded,
the packet header is returned by the method, and the packet body can be
obtained with the getLastBodyBuf() and getLastBodyLen() methods.</p>
public class PktEncoder
Name | Description |
---|---|
PktEncoder(CodedCBlkDataSrcEnc, EncoderSpecs, Coord[][][], ParameterList) | Creates a new packet encoder object, using the information from the 'infoSrc' object. |
Name | Description |
---|---|
OPT_PREFIX | The prefix for packet encoding options: 'P' |
Name | Description |
---|---|
LastBodyBuf | Returns the buffer of the body of the last encoded packet. The length of the body can be retrieved with the getLastBodyLen() method. The length of the array returned by this method may be larger than the actual body length. |
LastBodyLen | Returns the length of the body of the last encoded packet, in bytes. The body itself can be retrieved with the getLastBodyBuf() method. |
PacketWritable | Returns true if the current packet is writable i.e. should be written. Returns false otherwise. |
ParameterInfo | Returns the parameters that are used in this class and implementing classes. It returns a 2D String array. Each of the 1D arrays is for a different option, and they have 3 elements. The first element is the option name, the second one is the synopsis, the third one is a long description of what the parameter is and the fourth is its default value. The synopsis or description may be 'null', in which case it is assumed that there is no synopsis or description of the option, respectively. Null may be returned if no options are supported. |
ROILen | Gives the length to read in current packet body to get all ROI information |
ROIinPkt | Tells if there was ROI information in the last written packet |
Name | Description |
---|---|
encodePacket(int, int, int, int, CBlkRateDistStats[][], int[][], BitOutputBuffer, byte[], int) | Encodes a packet and returns the buffer containing the encoded packet header. The code-blocks appear in a 3D array of CBlkRateDistStats, 'cbs'. The first index is the tile index in lexicographical order, the second index is the subband index (as defined in the Subband class), and the third index is the code-block index (whithin the subband tile) in lexicographical order as well. The indexes of the new truncation points for each code-block are specified by the 3D array of int 'tIndx'. The indices of this array are the same as for cbs. The truncation point indices in 'tIndx' are the indices of the elements of the 'truncIdxs' array, of the CBlkRateDistStats class, that give the real truncation points. If a truncation point index is negative it means that the code-block has not been included in any layer yet. If the truncation point is less than or equal to the highest truncation point used in previous layers then the code-block is not included in the packet. Otherwise, if larger, the code-block is included in the packet. The body of the packet can be obtained with the getLastBodyBuf() and getLastBodyLen() methods.
|
getPrecInfo(int, int, int, int) | Returns information about a given precinct |
reset() | Resets the state of the object to the initial state, as if the object was just created. |
restore() | Restores the last saved state of this object. An IllegalArgumentException is thrown if no state has been saved. |
save() | Saves the current state of this object. The last saved state can be restored with the restore() method. |