dequantize
Functions
-
int main(int argc, char *argv[])
dequantize [ option ] [ infile ]
-v double
absolute maximum value \((0 < V)\)
-b int
number of bits \((1 \le B)\)
-t int
quantization type
0
mid-rise1
mid-tread
-q int
input format
0
non-negative integer1
integer
infile str
int-type quantized data sequence
stdout
double-type data sequence
echo -2 -1 0 1 2 | x2x +ad | quantize -b 2 -v 2 -t 0 | dequantize -b 2 -v 2 -t 0 | x2x +da # -1.5, -0.5, 0.5, 1.5, 1.5 echo -2 -1 0 1 2 | x2x +ad | quantize -b 2 -v 2 -t 1 | dequantize -b 2 -v 2 -t 1 | x2x +da # -1.33333, -1.33333, 0, 1.33333, 1.33333
- Parameters:
argc – [in] Number of arguments.
argv – [in] Argument vector.
- Returns:
0 on success, 1 on failure.
See also
-
class InverseUniformQuantization
Perform inverse uniform quantization.
The input is an index and the output is the corresponding value. There are two types of quantization, i.e., mid-rise and mid-tread.
Public Functions
-
InverseUniformQuantization(double absolute_maximum_value, int num_bit, UniformQuantization::QuantizationType quantization_type)
- Parameters:
absolute_maximum_value – [in] Absolute maximum value.
num_bit – [in] Number of quantization bits.
quantization_type – [in] Quantization type.
-
inline double GetAbsoluteMaximumValue() const
- Returns:
Absolute maximum value.
-
inline int GetNumBit() const
- Returns:
Number of quantization bits.
-
inline UniformQuantization::QuantizationType GetQuantizationType() const
- Returns:
Quantization type.
-
inline bool IsValid() const
- Returns:
True if this object is valid.
-
inline int GetQuantizationLevels() const
- Returns:
Quantization levels.
-
bool Run(int input, double *output) const
- Parameters:
input – [in] Input index.
output – [out] Output value.
- Returns:
True on success, false on failure.
-
InverseUniformQuantization(double absolute_maximum_value, int num_bit, UniformQuantization::QuantizationType quantization_type)