|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectCADI.Server.LogicalTarget.JPEG2000.RateDistortion.CoRDBasedDelivery
public class CoRDBasedDelivery
This class implements a Characterization of Rate Distortion (CoRD) -based algorithm to deliver the precincts belonging to the client requested Window of Interest.
The CoRD algorithm achieves a rate-distortion performance which is very close to the PCPRD. However, sometimes the scanning order followed by CoRD forces a change in the natural scanning order of subbands from a precinct. Therefore, the only way to keep the CoRD's scanning order is to build one packet for each subband of the precinct and setting the other subbands of this packet to null. Moreover, this scanning order has to be kept the packets are delivered to clients, so that a JPIP message has to be built for each packet. This issue generates an overhead, and it makes that CoRD may not be as competitive as it is when images are decompressed and not transmitted.
This degradation of the CoRD algorith when it is used for image transmission
can be improved with a minor modification of the algorithm. This
modification consists in each packet always include one block of each
subband. The rate-distortion performance of this CoRD-based algorithm is a
bit worse than CoRD's one, but it reduces the packet and JPIP headers
considerably. Therefore, its rate-distortion performance taken into account
the packet header, packet body, and JPIP message headers achieves
competitive results.
Usage example:
constructor
runResponseParameters
getResponseViewWindow
getQuality
runResponseData
getJPIPMessageData
getEORReasonCode
| Field Summary | |
|---|---|
private CODParameters |
codParameters
Definition in CODParameters |
private int[][] |
comps
|
private int |
EORReasonCode
Definition in ServerLogicalTargetManager.EORReasonCode. |
private int[] |
fsiz
Some internal attributes for passing values between diferents methods. |
private HTTPResponseSender |
httpResponseSender
Definition in Worker.httpResponseSender |
private long[][][] |
inClassIdentifierCorrespondence
Is a multiple-dimensional array which will be a mapping between the component-resolutionlevel-precinct and the unique in-class identifier. |
private JPCParameters |
jpcParameters
Definition in JPCParameters |
private JPIPMessageEncoder |
jpipMessageEncoder
Definition in JP2LogicalTargetManager. |
private java.util.ArrayList<JPIPMessageHeader> |
jpipMessageHeaders
Definition in ServerLogicalTargetManager.jpipMessageHeaders. |
private int |
layers
|
private JP2LogicalTarget |
logicalTarget
Definition in ServerLogicalTargetManager.EORReasonCode. |
private byte[] |
mainHeader
Contains the encoded main header. |
private long |
maximumResponseLength
Definition in DataLimitField.len |
private int |
maxNumLayers
Definition in CODParameters.numLayers |
private int |
MSBPlane
Definition in CADI.Server.LogicalTarget.JPEG2000.JP2LogicalTarget#MSBPlanes. |
private PacketHeadersEncoder |
packetHeading
This object is used to build the packet headers. |
private int[][][] |
precinctsPerRLevel
Is a mutiple-dimensional array which will contain the precincts belonging to the WOI. |
private int |
quality
Definition in ServerLogicalTargetManager.quality. |
private long |
responseLength
It is a temporal attribute to accumulate the response length which is sending to the client. |
private ViewWindowField |
responseViewWindow
Definition in ServerLogicalTargetManager.responseViewWindow. |
private int[] |
roff
|
private int[] |
rsiz
|
private JPCServerCache |
serverCache
This attribute contains the cache data for the client. |
private SIZParameters |
sizParameters
Definition in SIZParameters |
| Constructor Summary | |
|---|---|
CoRDBasedDelivery(JP2LogicalTarget logicalTarget,
JPCServerCache serverCache,
long maximumResponseLength)
Constructor. |
|
| Method Summary | |
|---|---|
private java.util.ArrayList<CodingPassID> |
adjustScanningOrder(java.util.ArrayList<BlockOrder> blockOrders)
|
void |
calculateMaxMinBitPlanes(int[][][] precinctsPerRLevel,
int[][][] maxsBP,
int[][][] minsBP,
long[][][] inClassIdentifierCorrespondence,
int[] components)
Construction of two structures which contain the max and min number of bit-planes of the code-blocks, by subbands Indexes mean: [component][rLevel][subbandBP] |
private void |
calculateSlopeStimations(float[][][][][] slopes,
int[][][] minsBP)
SLOPE ESTIMATIONS |
private void |
deliverPrecincts(java.util.ArrayList<CodingPassID> scanningOrder)
This method is used to deliver the requested window of interest when the maximum response length parameter has been set. |
private void |
encodeMainHeader()
Gets the main header as a byte array. |
private java.util.ArrayList<BlockOrder> |
findSubbandScanningOrder(float[][][][][] slopes,
int[][][][] currSLs,
int[][][] minsBP,
int[] components)
|
private java.util.ArrayList<BlockOrder> |
getDeliveryOrder(java.util.ArrayList relevantPrecincts)
Performs the block building and reads the needed bytestreams using the number of bytes. |
int |
getEORReasonCode()
Returns the EORReasonCode attribute. |
java.util.ArrayList<JPIPMessageHeader> |
getJPIPMessageHeaders()
Returns the jpipMessageHeaders attribute. |
byte[] |
getMainHeader()
Returns the main header. |
private int |
getMaxSubbandWeight()
Calculate which is the maximum subband weight for the whole image. |
void |
getPrecinctsPerRLevel(java.util.ArrayList relevantPrecincts)
Gets the relevant precincts for each subband. |
int |
getQuality()
Returns the quality attribute. |
ViewWindowField |
getResponseViewWindow()
Returns the responseViewWindow attribute. |
private int |
getSubbandWeight(int z,
int rLevel,
int subband)
Returns a rate-distortion adjustment for a component, resolution level, and subband. |
private java.util.ArrayList<CodingPassID> |
includeCP(java.util.ArrayList<CodingPassID> orderOfCodingPasses,
long inClassIdentifier,
int component,
int rLevel,
int precinct,
int subband,
int yBlock,
int xBlock,
int codingLevelGlobal)
|
void |
list(java.io.PrintStream out)
Prints this CoRD delivery out to the specified output stream. |
void |
runResponseData(HTTPResponseSender httpResponseSender,
JPIPMessageEncoder jpipMessageEncoder,
java.util.ArrayList<JPIPMessageHeader> jpipMessageHeaders)
Gets the data of the response window of interest. |
void |
runResponseParameters(ViewWindowField viewWindow)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private HTTPResponseSender httpResponseSender
Worker.httpResponseSender
private JPIPMessageEncoder jpipMessageEncoder
JP2LogicalTargetManager.
private java.util.ArrayList<JPIPMessageHeader> jpipMessageHeaders
ServerLogicalTargetManager.jpipMessageHeaders.
private byte[] mainHeader
private ViewWindowField responseViewWindow
ServerLogicalTargetManager.responseViewWindow.
private int quality
ServerLogicalTargetManager.quality.
private int EORReasonCode
ServerLogicalTargetManager.EORReasonCode.
private JP2LogicalTarget logicalTarget
ServerLogicalTargetManager.EORReasonCode.
private JPCServerCache serverCache
This reference is passed from the
private long maximumResponseLength
DataLimitField.len
private JPCParameters jpcParameters
JPCParameters
private SIZParameters sizParameters
SIZParameters
private CODParameters codParameters
CODParameters
private int MSBPlane
CADI.Server.LogicalTarget.JPEG2000.JP2LogicalTarget#MSBPlanes.
private long responseLength
private int[] fsiz
ViewWindowField
private int[] roff
private int[] rsiz
private int[][] comps
private int layers
private int maxNumLayers
CODParameters.numLayers
private int[][][] precinctsPerRLevel
private long[][][] inClassIdentifierCorrespondence
private PacketHeadersEncoder packetHeading
| Constructor Detail |
|---|
public CoRDBasedDelivery(JP2LogicalTarget logicalTarget,
JPCServerCache serverCache,
long maximumResponseLength)
logicalTarget - definition in logicalTargetserverCache - definition in serverCachemaximumResponseLength - definition in maximumResponseLength| Method Detail |
|---|
public void runResponseParameters(ViewWindowField viewWindow)
viewWindow - the requested Window Of Interest
public void runResponseData(HTTPResponseSender httpResponseSender,
JPIPMessageEncoder jpipMessageEncoder,
java.util.ArrayList<JPIPMessageHeader> jpipMessageHeaders)
throws ErrorException,
java.io.IOException
httpResponseSender - definition in httpResponseSenderjpipMessageEncoder - definition in jpipMessageEncoderjpipMessageHeaders - definition in jpipMessageHeaders
ErrorException
java.io.IOExceptionpublic byte[] getMainHeader()
mainHeader.public int getEORReasonCode()
EORReasonCode attribute.
EORReasonCode attribute.public ViewWindowField getResponseViewWindow()
responseViewWindow attribute.
responseViewWindow attribute.public java.util.ArrayList<JPIPMessageHeader> getJPIPMessageHeaders()
jpipMessageHeaders attribute.
jpipMessageHeaders attribute.public int getQuality()
quality attribute.
quality attribute.public java.lang.String toString()
toString in class java.lang.Objectpublic void list(java.io.PrintStream out)
out - an output stream.private void encodeMainHeader()
private int getSubbandWeight(int z,
int rLevel,
int subband)
z - image componentrLevel - 0 is the LL subband, and 1, 2, ... represents
next starting with the little onesubband - 0 - HL, 1 - LH, 2 - HH (if resolutionLevel == 0 --> 0 -
LL)
private int getMaxSubbandWeight()
method.
private java.util.ArrayList<BlockOrder> getDeliveryOrder(java.util.ArrayList relevantPrecincts)
throws ErrorException
ErrorException - when some problem reading file occurs
private void calculateSlopeStimations(float[][][][][] slopes,
int[][][] minsBP)
slopes - minsBP -
private java.util.ArrayList<BlockOrder> findSubbandScanningOrder(float[][][][][] slopes,
int[][][][] currSLs,
int[][][] minsBP,
int[] components)
slopes - currSLs - minsBP -
private java.util.ArrayList<CodingPassID> adjustScanningOrder(java.util.ArrayList<BlockOrder> blockOrders)
order -
private java.util.ArrayList<CodingPassID> includeCP(java.util.ArrayList<CodingPassID> orderOfCodingPasses,
long inClassIdentifier,
int component,
int rLevel,
int precinct,
int subband,
int yBlock,
int xBlock,
int codingLevelGlobal)
blockOrder - inClassIdentifier - component - rLevel - precinct - yBlock - xBlock - codingLevel -
private void deliverPrecincts(java.util.ArrayList<CodingPassID> scanningOrder)
throws ErrorException,
java.io.IOException
scanningOrder - is an ArrayList with the order of precincts
including the subband, yBlock, xBlock and coding passes to be sent.
ErrorException
java.io.IOExceptionpublic void getPrecinctsPerRLevel(java.util.ArrayList relevantPrecincts)
relevantPrecincts - an array list with the unique precinct identifier of the
relevant precincts.
public void calculateMaxMinBitPlanes(int[][][] precinctsPerRLevel,
int[][][] maxsBP,
int[][][] minsBP,
long[][][] inClassIdentifierCorrespondence,
int[] components)
precinctsPerRLevel - maxsBP - minsBP -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||