corrade-vassal – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 vero 1 /*
2 * CVS identifier:
3 *
4 * $Id: EntropyDecoder.java,v 1.38 2001/09/20 12:48:01 grosbois Exp $
5 *
6 * Class: EntropyDecoder
7 *
8 * Description: The abstract class for all entropy decoders.
9 *
10 *
11 *
12 * COPYRIGHT:
13 *
14 * This software module was originally developed by Raphaël Grosbois and
15 * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel
16 * Askelöf (Ericsson Radio Systems AB); and Bertrand Berthelot, David
17 * Bouchard, Félix Henry, Gerard Mozelle and Patrice Onno (Canon Research
18 * Centre France S.A) in the course of development of the JPEG2000
19 * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This
20 * software module is an implementation of a part of the JPEG 2000
21 * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio
22 * Systems AB and Canon Research Centre France S.A (collectively JJ2000
23 * Partners) agree not to assert against ISO/IEC and users of the JPEG
24 * 2000 Standard (Users) any of their rights under the copyright, not
25 * including other intellectual property rights, for this software module
26 * with respect to the usage by ISO/IEC and Users of this software module
27 * or modifications thereof for use in hardware or software products
28 * claiming conformance to the JPEG 2000 Standard. Those intending to use
29 * this software module in hardware or software products are advised that
30 * their use may infringe existing patents. The original developers of
31 * this software module, JJ2000 Partners and ISO/IEC assume no liability
32 * for use of this software module or modifications thereof. No license
33 * or right to this software module is granted for non JPEG 2000 Standard
34 * conforming products. JJ2000 Partners have full right to use this
35 * software module for his/her own purpose, assign or donate this
36 * software module to any third party and to inhibit third parties from
37 * using this software module for non JPEG 2000 Standard conforming
38 * products. This copyright notice must be included in all copies or
39 * derivative works of this software module.
40 *
41 * Copyright (c) 1999/2000 JJ2000 Partners.
42 * */
43 using System;
44 using CSJ2K.j2k.quantization.dequantizer;
45 using CSJ2K.j2k.codestream.reader;
46 using CSJ2K.j2k.wavelet.synthesis;
47 using CSJ2K.j2k.codestream;
48 using CSJ2K.j2k.entropy;
49 using CSJ2K.j2k.image;
50 using CSJ2K.j2k.io;
51 using CSJ2K.j2k;
52 namespace CSJ2K.j2k.entropy.decoder
53 {
54  
55 /// <summary> This is the abstract class from which all entropy decoders must
56 /// inherit. This class implements the 'MultiResImgData', therefore it has the
57 /// concept of a current tile and all operations are performed on the current
58 /// tile.
59 ///
60 /// <p>Default implementations of the methods in 'MultiResImgData' are provided
61 /// through the 'MultiResImgDataAdapter' abstract class.</p>
62 ///
63 /// <p>Sign magnitude representation is used (instead of two's complement) for
64 /// the output data. The most significant bit is used for the sign (0 if
65 /// positive, 1 if negative). Then the magnitude of the quantized coefficient
66 /// is stored in the next most significat bits. The most significant magnitude
67 /// bit corresponds to the most significant bit-plane and so on.</p
68 ///
69 /// </summary>
70 /// <seealso cref="MultiResImgData">
71 /// </seealso>
72 /// <seealso cref="MultiResImgDataAdapter">
73 ///
74 /// </seealso>
75 public abstract class EntropyDecoder:MultiResImgDataAdapter, CBlkQuantDataSrcDec
76 {
77 /// <summary> Returns the horizontal code-block partition origin. Allowable values
78 /// are 0 and 1, nothing else.
79 ///
80 /// </summary>
81 virtual public int CbULX
82 {
83 get
84 {
85 return src.CbULX;
86 }
87  
88 }
89 /// <summary> Returns the vertical code-block partition origin. Allowable values are
90 /// 0 and 1, nothing else.
91 ///
92 /// </summary>
93 virtual public int CbULY
94 {
95 get
96 {
97 return src.CbULY;
98 }
99  
100 }
101 /// <summary> Returns the parameters that are used in this class and
102 /// implementing classes. It returns a 2D String array. Each of the
103 /// 1D arrays is for a different option, and they have 3
104 /// elements. The first element is the option name, the second one
105 /// is the synopsis and the third one is a long description of what
106 /// the parameter is. The synopsis or description may be 'null', in
107 /// which case it is assumed that there is no synopsis or
108 /// description of the option, respectively. Null may be returned
109 /// if no options are supported.
110 ///
111 /// </summary>
112 /// <returns> the options name, their synopsis and their explanation,
113 /// or null if no options are supported.
114 ///
115 /// </returns>
116 public static System.String[][] ParameterInfo
117 {
118 get
119 {
120 return pinfo;
121 }
122  
123 }
124  
125 /// <summary>The prefix for entropy decoder optiojns: 'C' </summary>
126 public const char OPT_PREFIX = 'C';
127  
128 /// <summary>The list of parameters that is accepted by the entropy
129 /// decoders. They start with 'C'.
130 /// </summary>
131 //UPGRADE_NOTE: Final was removed from the declaration of 'pinfo'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
132 private static readonly System.String[][] pinfo = new System.String[][]{new System.String[]{"Cverber", "[on|off]", "Specifies if the entropy decoder should be verbose about detected " + "errors. If 'on' a message is printed whenever an error is detected.", "on"}, new System.String[]{"Cer", "[on|off]", "Specifies if error detection should be performed by the entropy " + "decoder engine. If errors are detected they will be concealed and " + "the resulting distortion will be less important. Note that errors " + "can only be detected if the encoder that generated the data " + "included error resilience information.", "on"}};
133  
134 /// <summary>The bit stream transport from where to get the compressed data
135 /// (the source)
136 /// </summary>
137 protected internal CodedCBlkDataSrcDec src;
138  
139 /// <summary> Initializes the source of compressed data.
140 ///
141 /// </summary>
142 /// <param name="src">From where to obtain the compressed data.
143 ///
144 /// </param>
145 public EntropyDecoder(CodedCBlkDataSrcDec src):base(src)
146 {
147 this.src = src;
148 }
149  
150 /// <summary> Returns the subband tree, for the specified tile-component. This method
151 /// returns the root element of the subband tree structure, see Subband and
152 /// SubbandSyn. The tree comprises all the available resolution levels.
153 ///
154 /// <P>The number of magnitude bits ('magBits' member variable) for
155 /// each subband is not initialized.
156 ///
157 /// </summary>
158 /// <param name="t">The index of the tile, from 0 to T-1.
159 ///
160 /// </param>
161 /// <param name="c">The index of the component, from 0 to C-1.
162 ///
163 /// </param>
164 /// <returns> The root of the tree structure.
165 ///
166 /// </returns>
167 public override SubbandSyn getSynSubbandTree(int t, int c)
168 {
169 return src.getSynSubbandTree(t, c);
170 }
171 public abstract CSJ2K.j2k.image.DataBlk getCodeBlock(int param1, int param2, int param3, CSJ2K.j2k.wavelet.synthesis.SubbandSyn param4, CSJ2K.j2k.image.DataBlk param5);
172 public abstract CSJ2K.j2k.image.DataBlk getInternCodeBlock(int param1, int param2, int param3, CSJ2K.j2k.wavelet.synthesis.SubbandSyn param4, CSJ2K.j2k.image.DataBlk param5);
173 }
174 }