Evita  0.16
evCodecSARL.h
Go to the documentation of this file.
1 /*
2  *
3  * EVITA: Efficient Visualization of Terascale Datasets
4  * Copyright (C) 2000-2016 Team Evita
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
19  * MA 02139, USA.
20  *
21  */
22 
23 
24 #ifndef __evCodecSARL_h
25 #define __evCodecSARL_h
26 
27 
28 #include "evCodecEmbedded.h"
30 #include "evDataset.h"
31 
32 class evPrioritySchedule;
33 class evSegmentationMap;
34 
35 
36 #define EVMAX_VECTOR_DIMENSION (sizeof(int)*8 - 2)
37 
39 {
40 public:
41  evCodecSARL(void);
42  virtual ~evCodecSARL(void);
43 
44  virtual const evString GetClassName(void) const
45  {
46  return(evString("evCodecSARL"));
47  }
48 
49  virtual int Encode(evBitBuffer &output_buffer,
50  evDataset &dataset,
51  evProgressReporter *progress_reporter = NULL);
52  virtual int EncodeHeader(evFile &outfile,
53  evDataset &dataset) const;
54  virtual int Decode(evBitBuffer &input_buffer, evDataset &dataset,
55  evProgressReporter *progress_reporter = NULL);
56  virtual int DecodeHeader(evFile &infile, evDataset &dataset);
57 
58 protected:
59 
60 private:
62 
63  QccENTArithmeticModel *ArithmeticModel;
64  std::vector<std::vector<std::vector<evCodecSARLComponentInfo> > >
66 
70 
71  void Initialize(void);
72 
73  void SetupModel(void);
74 
75  int EncodeStart(evBitBuffer &output_buffer,
76  evDataset &dataset,
77  evProgressReporter *progress_reporter = NULL);
78  int EncodeStartROI(evBitBuffer &output_buffer,
79  evROI &roi,
80  evProgressReporter *progress_reporter = NULL);
81  int EncodeStartROIComponent(evBitBuffer &output_buffer,
82  evROI &coefficients,
83  const unsigned int current_component,
84  evProgressReporter *progress_reporter = NULL);
85  int EncodeMask(const evAlphaField &mask,
86  const unsigned int current_scale_start,
87  const unsigned int current_scale_length,
88  evBitBuffer &output_buffer);
89  int EncodeNext(evBitBuffer &output_buffer,
90  const evDataset &dataset,
91  evProgressReporter *progress_reporter = NULL);
92  int EncodeEnd(evBitBuffer &output_buffer,
93  const evDataset &dataset,
94  evProgressReporter *progress_reporter = NULL);
95  int ExtractSigns(evROI &magnitudes);
96  unsigned int SetSign(unsigned int current_sign,
97  const unsigned int vector_component) const;
98  unsigned int ClearSign(unsigned int current_sign,
99  const unsigned int vector_component) const;
100  unsigned int GetSign(const unsigned int current_sign,
101  const unsigned int vector_component) const;
102  unsigned int SetSignificance(const unsigned int map_value) const;
103  unsigned int ClearSignificance(const unsigned int map_value) const;
104  unsigned int GetSignificance(const unsigned int map_value) const;
105  unsigned int SetDifference(const unsigned int map_value) const;
106  unsigned int ClearDifference(const unsigned int map_value) const;
107  unsigned int GetDifference(const unsigned int map_value) const;
108  int EncodeEnhancementLayer(evBitBuffer &output_buffer,
109  evROI *current_magnitudes,
110  const unsigned int current_component,
111  const unsigned int current_scale,
112  const unsigned int current_scale_start,
113  const unsigned int current_scale_length,
114  evProgressReporter *progress_reporter = NULL);
115  int EncodeFinishEnhancementLayer(evBitBuffer &output_buffer,
116  const unsigned int current_roi,
117  const unsigned int current_tile,
118  const unsigned int current_component,
119  const unsigned int current_bitplane,
120  const unsigned int current_scale,
121  const double current_priority);
122  int EncodeSignificancePass(const double threshold,
123  evROI *current_magnitudes,
124  const unsigned int current_component,
125  const unsigned int current_scale_start,
126  const unsigned int current_scale_length,
127  evBitBuffer &output_buffer);
128  int EncodeRefinementPass(const double threshold,
129  evROI *current_magnitudes,
130  const unsigned int current_component,
131  const unsigned int current_scale_start,
132  const unsigned int current_scale_length,
133  evBitBuffer &output_buffer);
134  int OutputRun(const unsigned int runlength,
135  const unsigned int signs,
136  const unsigned int vector_dimension,
137  evBitBuffer &output_buffer) const;
138  int OutputSymbol(int symbol,
139  evBitBuffer &output_buffer) const;
140 
141  int DecodeStart(evBitBuffer &input_buffer,
142  evDataset &dataset);
143  int DecodeNext(evBitBuffer &input_buffer,
144  evDataset &dataset);
145  int DecodeStartROIComponent(evBitBuffer &input_buffer,
146  const evDataset &dataset,
147  const unsigned int current_roi,
148  const unsigned int current_tile,
149  const unsigned int current_component,
150  const evBoundingBox &current_bounding_box);
151  int DecodeMask(evAlphaField &mask,
152  const unsigned int current_scale_start,
153  const unsigned int current_scale_length,
154  evBitBuffer &input_buffer);
155  int DecodeEnhancementLayer(evBitBuffer &input_buffer,
156  const unsigned int current_roi,
157  const unsigned int current_tile,
158  const unsigned int current_component,
159  const unsigned int current_bitplane,
160  const unsigned int current_scale);
161  int DecodeSignificancePass(const double threshold,
162  evROI *current_magnitudes,
163  const unsigned int current_component,
164  const unsigned int current_scale_start,
165  const unsigned int current_scale_length,
166  evBitBuffer &input_buffer);
167  int DecodeRefinementPass(const double threshold,
168  evROI *current_magnitudes,
169  const unsigned int current_component,
170  const unsigned int current_scale_start,
171  const unsigned int current_scale_length,
172  evBitBuffer &input_buffer);
173  int InputRun(int &runlength,
174  unsigned int &signs,
175  const unsigned int vector_dimension,
176  evBitBuffer &input_buffer) const;
177  int InputSymbol(int &symbol,
178  evBitBuffer &input_buffer) const;
179  int ApplySigns(const evROI &magnitudes,
180  evROI &coefficients,
181  const unsigned int current_roi,
182  const unsigned int current_tile,
183  const unsigned int current_component);
184  int CopyMask(const evROI &magnitudes,
185  evROI &coefficients,
186  const unsigned int current_component);
187  int DecodeReconstruct(evDataset &dataset);
188  int DecodeReconstructROI(const unsigned int current_roi,
189  const unsigned int current_tile,
190  const unsigned int current_component);
191 
192  int DeactivateROI(const evPriorityScheduleEntry &entry);
193 
194  int DecodeAuxiliaryFiles(const evDataset &dataset);
195 
196  int ProcessLevelOfDetail(void);
197 
198 };
199 
200 
201 inline unsigned int evCodecSARL::SetSign(const unsigned int map_value,
202  const unsigned int vector_component)
203  const
204 {
205  return(map_value | (1 << vector_component));
206 }
207 
208 
209 inline unsigned int evCodecSARL::ClearSign(const unsigned int map_value,
210  const unsigned int vector_component)
211  const
212 {
213  return(map_value & (~(1 << vector_component)));
214 }
215 
216 
217 inline unsigned int evCodecSARL::GetSign(const unsigned int map_value,
218  const unsigned int vector_component)
219  const
220 {
221  return((map_value >> vector_component) & 1);
222 }
223 
224 
225 inline unsigned int evCodecSARL::SetSignificance(const unsigned int map_value)
226  const
227 {
228  return(map_value | (1 << EVMAX_VECTOR_DIMENSION));
229 }
230 
231 
232 inline unsigned int evCodecSARL::ClearSignificance(const unsigned int
233  map_value) const
234 {
235  return(map_value & (~(1 << EVMAX_VECTOR_DIMENSION)));
236 }
237 
238 
239 inline unsigned int evCodecSARL::GetSignificance(const unsigned int map_value)
240  const
241 {
242  return((map_value >> EVMAX_VECTOR_DIMENSION) & 1);
243 }
244 
245 
246 inline unsigned int evCodecSARL::SetDifference(const unsigned int map_value)
247  const
248 {
249  return(map_value | (1 << (EVMAX_VECTOR_DIMENSION + 1)));
250 }
251 
252 
253 inline unsigned int evCodecSARL::ClearDifference(const unsigned int map_value)
254  const
255 {
256  return(map_value & (~(1 << (EVMAX_VECTOR_DIMENSION + 1))));
257 }
258 
259 
260 inline unsigned int evCodecSARL::GetDifference(const unsigned int map_value)
261  const
262 {
263  return((map_value >> (EVMAX_VECTOR_DIMENSION + 1)) & 1);
264 }
265 
266 
267 #endif
Definition: evFile.h:44
Definition: evCodecEmbedded.h:36
unsigned int ClearSignificance(const unsigned int map_value) const
Definition: evCodecSARL.h:232
unsigned int ClearSign(unsigned int current_sign, const unsigned int vector_component) const
Definition: evCodecSARL.h:209
virtual ~evCodecSARL(void)
int ProcessLevelOfDetail(void)
unsigned int GetDifference(const unsigned int map_value) const
Definition: evCodecSARL.h:260
int DecodeRefinementPass(const double threshold, evROI *current_magnitudes, const unsigned int current_component, const unsigned int current_scale_start, const unsigned int current_scale_length, evBitBuffer &input_buffer)
int OutputRun(const unsigned int runlength, const unsigned int signs, const unsigned int vector_dimension, evBitBuffer &output_buffer) const
int DecodeEnhancementLayer(evBitBuffer &input_buffer, const unsigned int current_roi, const unsigned int current_tile, const unsigned int current_component, const unsigned int current_bitplane, const unsigned int current_scale)
evROIList * Magnitudes
Definition: evCodecSARL.h:61
Definition: evPrioritySchedule.h:36
Definition: evProgressReporter.h:32
unsigned int SetSign(unsigned int current_sign, const unsigned int vector_component) const
Definition: evCodecSARL.h:201
unsigned int GetSign(const unsigned int current_sign, const unsigned int vector_component) const
Definition: evCodecSARL.h:217
Definition: evAlphaField.h:31
int InputSymbol(int &symbol, evBitBuffer &input_buffer) const
Definition: evPriorityScheduleEntry.h:39
int ApplySigns(const evROI &magnitudes, evROI &coefficients, const unsigned int current_roi, const unsigned int current_tile, const unsigned int current_component)
#define EVMAX_VECTOR_DIMENSION
Definition: evCodecSARL.h:36
int DecodeStart(evBitBuffer &input_buffer, evDataset &dataset)
int EncodeMask(const evAlphaField &mask, const unsigned int current_scale_start, const unsigned int current_scale_length, evBitBuffer &output_buffer)
int EncodeSignificancePass(const double threshold, evROI *current_magnitudes, const unsigned int current_component, const unsigned int current_scale_start, const unsigned int current_scale_length, evBitBuffer &output_buffer)
unsigned int GetSignificance(const unsigned int map_value) const
Definition: evCodecSARL.h:239
int DecodeNext(evBitBuffer &input_buffer, evDataset &dataset)
Definition: evDataset.h:34
int EncodeStartROIComponent(evBitBuffer &output_buffer, evROI &coefficients, const unsigned int current_component, evProgressReporter *progress_reporter=NULL)
double CurrentPriority
Definition: evCodecSARL.h:68
int EncodeStart(evBitBuffer &output_buffer, evDataset &dataset, evProgressReporter *progress_reporter=NULL)
QccENTArithmeticModel * ArithmeticModel
Definition: evCodecSARL.h:63
unsigned int SetSignificance(const unsigned int map_value) const
Definition: evCodecSARL.h:225
int EncodeNext(evBitBuffer &output_buffer, const evDataset &dataset, evProgressReporter *progress_reporter=NULL)
Definition: evBoundingBox.h:32
unsigned int ClearDifference(const unsigned int map_value) const
Definition: evCodecSARL.h:253
int DecodeMask(evAlphaField &mask, const unsigned int current_scale_start, const unsigned int current_scale_length, evBitBuffer &input_buffer)
int DecodeAuxiliaryFiles(const evDataset &dataset)
int CopyMask(const evROI &magnitudes, evROI &coefficients, const unsigned int current_component)
evCodecSARL(void)
int InputRun(int &runlength, unsigned int &signs, const unsigned int vector_dimension, evBitBuffer &input_buffer) const
int EncodeFinishEnhancementLayer(evBitBuffer &output_buffer, const unsigned int current_roi, const unsigned int current_tile, const unsigned int current_component, const unsigned int current_bitplane, const unsigned int current_scale, const double current_priority)
int EncodeEnd(evBitBuffer &output_buffer, const evDataset &dataset, evProgressReporter *progress_reporter=NULL)
int EncodeEnhancementLayer(evBitBuffer &output_buffer, evROI *current_magnitudes, const unsigned int current_component, const unsigned int current_scale, const unsigned int current_scale_start, const unsigned int current_scale_length, evProgressReporter *progress_reporter=NULL)
std::vector< std::vector< std::vector< evCodecSARLComponentInfo > > > ComponentInfo
Definition: evCodecSARL.h:65
evROIList * Coefficients
Definition: evCodecSARL.h:67
Definition: evBitBuffer.h:34
int EncodeStartROI(evBitBuffer &output_buffer, evROI &roi, evProgressReporter *progress_reporter=NULL)
virtual int DecodeHeader(evFile &infile, evDataset &dataset)
Definition: evCodecSARL.h:38
int OutputSymbol(int symbol, evBitBuffer &output_buffer) const
unsigned int SetDifference(const unsigned int map_value) const
Definition: evCodecSARL.h:246
void SetupModel(void)
virtual int Decode(evBitBuffer &input_buffer, evDataset &dataset, evProgressReporter *progress_reporter=NULL)
int DecodeReconstruct(evDataset &dataset)
virtual const evString GetClassName(void) const
Definition: evCodecSARL.h:44
int ExtractSigns(evROI &magnitudes)
void Initialize(void)
int EncodeRefinementPass(const double threshold, evROI *current_magnitudes, const unsigned int current_component, const unsigned int current_scale_start, const unsigned int current_scale_length, evBitBuffer &output_buffer)
int DeactivateROI(const evPriorityScheduleEntry &entry)
Definition: evSegmentationMap.h:35
int DecodeStartROIComponent(evBitBuffer &input_buffer, const evDataset &dataset, const unsigned int current_roi, const unsigned int current_tile, const unsigned int current_component, const evBoundingBox &current_bounding_box)
Definition: evROI.h:40
Definition: evString.h:30
virtual int Encode(evBitBuffer &output_buffer, evDataset &dataset, evProgressReporter *progress_reporter=NULL)
int DecodeSignificancePass(const double threshold, evROI *current_magnitudes, const unsigned int current_component, const unsigned int current_scale_start, const unsigned int current_scale_length, evBitBuffer &input_buffer)
virtual int EncodeHeader(evFile &outfile, evDataset &dataset) const
evROI * CurrentReconstructed
Definition: evCodecSARL.h:69
int DecodeReconstructROI(const unsigned int current_roi, const unsigned int current_tile, const unsigned int current_component)
Definition: evROIList.h:32