summaryrefslogtreecommitdiffstats
path: root/Master/Modellbildung_und_Simulation/Aufgabenblatt1/Quantization/src/Quantization.h
blob: 59395912dcc33b4a54e3fd0ee90e8adaa2004b1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * Quantization.h
 *
 *  Created on: 02.04.2011
 *      Author: sven
 */

#ifndef QUANTIZATION_H_
#define QUANTIZATION_H_

#ifndef QUANTIZATIONPARAMETERS_H_
	#include "QuantizationParameters.h"
#endif

#ifndef _GLIBCXX_VECTOR
	#include <vector>
#endif

struct QuantizationRange {
	unsigned short mMinValue;
	unsigned short mMaxValue;
	unsigned short mRangeWidth;
	unsigned short mRangeValue;
	bool IsInRange(unsigned short val)
	{
		return ((val >= mMinValue) && (val <= mMaxValue));
	}
};

typedef std::vector<QuantizationRange*> QuantizationRanges;
typedef std::vector<QuantizationRange*>::iterator QuantizationRangesIter;

class Quantization {
public:
	Quantization(QuantizationParameters& params);
	virtual ~Quantization();
private:
	QuantizationParameters& mParams;
	unsigned mNumQuantizationValues;
	QuantizationRanges mQuantizationRanges;
	short getQuantizationValue(short);
	void calcQuantizationValues();
};

#endif /* QUANTIZATION_H_ */