/// <summary> Keep a reference to the header encoder.
///
/// </summary>
/// <param name="headEnc">The header encoder
///
/// </param>
virtualpublicHeaderEncoderHeaderEncoder
{
set
{
this.headEnc=value;
}
}
/// <summary> Returns the number of layers that are actually generated.
///
/// </summary>
/// <returns> The number of layers generated.
///
/// </returns>
virtualpublicintNumLayers
{
get
{
returnnum_Layers;
}
}
/// <summary> 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.
///
/// </summary>
/// <returns> the options name, their synopsis and their explanation,
/// or null if no options are supported.
///
/// </returns>
publicstaticSystem.String[][]ParameterInfo
{
get
{
returnpinfo;
}
}
/// <summary>The prefix for rate allocation options: 'A' </summary>
publicconstcharOPT_PREFIX='A';
/// <summary>The list of parameters that is accepted for entropy coding. Options
/// for entropy coding start with 'R'.
/// </summary>
//UPGRADE_NOTE: Final was removed from the declaration of 'pinfo'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
privatestaticreadonlySystem.String[][]pinfo=newSystem.String[][]{newSystem.String[]{"Aptype","[<tile idx>] res|layer|res-pos|"+"pos-comp|comp-pos [res_start comp_start layer_end res_end "+"comp_end "+"prog] [[res_start comp_start ly_end res_end comp_end prog] ...] ["+"[<tile-component idx>] ...]","Specifies which type of progression should be used when "+"generating "+"the codestream. The 'res' value generates a resolution "+"progressive codestream with the number of layers specified by "+"'Alayers' option. The 'layer' value generates a layer progressive "+"codestream with multiple layers. In any case the rate-allocation "+"algorithm optimizes for best quality in each layer. The quality "+"measure is mean squared error (MSE) or a weighted version of it "+"(WMSE). If no progression type is specified or imposed by other "+"modules, the default value is 'layer'.\n"+"It is also possible to describe progression order changes. In "+"this case, 'res_start' is the index (from 0) of the first "+"resolution "+"level, 'comp_start' is the index (from 0) of the first component, "+"'ly_end' is the index (from 0) of the first layer not included, "+"'res_end' is the index (from 0) of the first resolution level not "+"included, 'comp_end' is index (from 0) of the first component not "+"included and 'prog' is the progression type to be used "+"for the rest of the tile/image. Several progression order changes "+"can be specified, one after the other.",null},newSystem.String[]{"Alayers","[<rate> [+<layers>] [<rate [+<layers>] [...]] | sl]","Explicitly specifies the codestream layer formation parameters. "+"The <rate> parameter specifies the bitrate to which the first "+"layer should be optimized. The <layers> parameter, if present, "+"specifies the number of extra layers that should be added for "+"scalability. These extra layers are not optimized. "+"Any extra <rate> and <layers> parameters add more layers, in the "+
"same way. An additional layer is always added at the end, which"+" is "+"optimized to the overall target bitrate of the bit stream. Any "+"layers (optimized or not) whose target bitrate is higher that the "+"overall target bitrate are silently ignored. The bitrates of the "+"extra layers that are added through the <layers> parameter are "+"approximately log-spaced between the other target bitrates. If "+"several <rate> [+<layers>] constructs appear the <rate>"+" parameters "+"must appear in increasing order. The rate allocation algorithm "+"ensures that all coded layers have a minimal reasonable size, if "+"not these layers are silently ignored.\n"+"If the 'sl' (i.e. 'single layer') argument is specified, the "+"generated codestream will"+" only contain one layer (with a bit rate specified thanks to the"+" '-rate' or 'nbytes' options).","0.015 +20 2.0 +10"}};
/// <summary>The source of entropy coded data </summary>
protectedinternalCodedCBlkDataSrcEncsrc;
/// <summary>The source of entropy coded data </summary>
protectedinternalEncoderSpecsencSpec;
/// <summary>The number of layers. </summary>
protectedinternalintnum_Layers;
/// <summary>The bit-stream writer </summary>
internalCodestreamWriterbsWriter;
/// <summary>The header encoder </summary>
internalHeaderEncoderheadEnc;
/// <summary> Initializes the source of entropy coded data.
///
/// </summary>
/// <param name="src">The source of entropy coded data.
///
/// </param>
/// <param name="ln">The number of layers to create
///
/// </param>
/// <param name="pt">The progressive type, as defined in 'ProgressionType'.
///
/// </param>
/// <param name="bw">The packet bit stream writer.
//UPGRADE_WARNING: Data types in Visual C# might be different. Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
lyrs.addOptPoint(r,(int)stok.nval);
}
catch(System.ArgumentExceptione)
{
//UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.getMessage' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
thrownewSystem.ArgumentException("Error in 'Alayers' "+"option: "+e.Message);
}
ratepending=false;
islayer=false;
}
else
{
// rate parameter
if(ratepending)
{
// Add pending rate parameter
try
{
lyrs.addOptPoint(r,0);
}
catch(System.ArgumentExceptione)
{
//UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.getMessage' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
thrownewSystem.ArgumentException("Error in 'Alayers' "+"option: "+e.Message);
}
}
// Now store new rate parameter
//UPGRADE_WARNING: Data types in Visual C# might be different. Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
r=(float)stok.nval;
ratepending=true;
}
break;
case'+':
if(!ratepending||islayer)
{
thrownewSystem.ArgumentException("Layer parameter without "+"previous rate parameter "+"in 'Alayers' option");
//UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.getMessage' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
thrownewSystem.ArgumentException("Error in 'Alayers' "+"option: "+e.Message);