|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jj2000.j2k.encoder.Encoder
This class is the main class of JJ2000's encoder. It instantiates all objects of the chain and launchs the encoding process. It then writes the header and the compressed bit stream to the output file. Finally, packed packet headers (through codestream post-manipulation) and file-format may be created if needed.
First the encoder should be initialized with a ParameterList object provided through the constructor. Then, the run() method is invoked and the encoder executes. The exit code of the class can be obtained with the getExitCode() method, after the constructor and after the run method. A non-zero value indicates that an error has occurred.
The modules are inserted in the encoding chain with the following order:
The encoder uses a pull model. This means that the last module (PostCompRateAllocator) requests data from its source (EntropyCoder), ...
Writing of the codestream writing (header+bit stream) is realized by HeaderEncoder and CodestreamWriter modules.
Packed packet headers and file-format creation are carried out by CodestreamManipulator and FileFormatWriter modules respectively.
Many modules of the encoder may behave differently depending on the tile-component. The specifications of their behaviour are kept in specialized modules extending ModuleSpec class. All these modules are accessible through an instance of EncoderSpecs class.
ImgReader
,
ImgDataJoiner
,
ForwCompTransf
,
Tiler
,
ImgDataConverter
,
ForwardWT
,
Quantizer
,
ROIScaler
,
EntropyCoder
,
PostCompRateAllocator
,
HeaderEncoder
,
CodestreamWriter
,
CodestreamManipulator
,
FileFormatWriter
,
ModuleSpec
,
EncoderSpecs
Field Summary | |
private ParameterList |
defpl
The default parameter list (arguments) |
private int |
exitCode
The exit code of the run method |
private static java.lang.String[][] |
pinfo
The parameter information for this class |
private ParameterList |
pl
The parameter list (arguments) |
static char[] |
vprfxs
The valid list of options prefixes |
Constructor Summary | |
Encoder(ParameterList pl)
Instantiates an encoder object, width the ParameterList object given as argument. |
Method Summary | |
private void |
error(java.lang.String msg,
int code)
Prints the error message 'msg' to standard err, prepending "ERROR" to it, and sets the exitCode to 'code'. |
static java.lang.String[][] |
getAllParameters()
Returns all the parameters used in the encoding chain. |
int |
getExitCode()
Returns the exit code of the class. |
static java.lang.String[][] |
getParameterInfo()
Returns the parameters that are used in this class and implementing classes. |
private void |
printParamInfo(MsgLogger out,
java.lang.String[][] pinfo)
Prints the parameters in 'pinfo' to the provided output, 'out', showing the existing defaults. |
private void |
printUsage()
Prints the usage information to stdout. |
private void |
printVersionAndCopyright()
Prints version and copyright information to stdout, using the MsgPrinter. |
void |
run()
Runs the encoder. |
private void |
warning(java.lang.String msg)
Prints the warning message 'msg' to standard err, prepending "WARNING" to it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private int exitCode
private ParameterList pl
private ParameterList defpl
public static final char[] vprfxs
private static final java.lang.String[][] pinfo
Constructor Detail |
public Encoder(ParameterList pl)
pl
- The ParameterList for this decoder (contains also defaults
values);Method Detail |
public int getExitCode()
public void run()
run
in interface java.lang.Runnable
getExitCode()
public static java.lang.String[][] getParameterInfo()
public static java.lang.String[][] getAllParameters()
getParameterInfo()
private void error(java.lang.String msg, int code)
msg
- The error messagecode
- The exit code to setprivate void warning(java.lang.String msg)
msg
- The error messageprivate void printVersionAndCopyright()
private void printUsage()
private void printParamInfo(MsgLogger out, java.lang.String[][] pinfo)
out
- Where to print.pinfo
- The parameter information to write.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |