Type:
ScalarQuantiser provides an interface for all scalar quantisers. The number of reconstruction levels are specified on construction by a parameter of type QLevels. Rate and Levels return the bit rate and number of reconstruction levels respectively. Index returns the index of the closest reconstruction level, while Reconstruction returns the reconstruction value for a specified index. Q returns the quantised value of its parameter. IndexD is the same as Index except that a record of quantisation distortion is maintained. Distortion returns the current average value of this distortion, while reset_distortion resets the record. |
ScalarQuantiser | (const QLevels& ql) ; |
virtual ~ScalarQuantiser | () ; |
void reset_distortion | () ; |
Reset the average distortion count maintained by IndexD |
float Rate | (void) const ; |
Return the bit rate of the quantiser |
unsigned int Levels | (void) const ; |
Return the number of reconstruction levels of the quantiser |
virtual int Index | (float x) const ; |
Return the index of the nearest reconstruction level to x |
virtual int IndexD | (float x) ; |
Same as Index, but maintains a record of average distortion |
virtual float Q | (float x) ; |
Return quantised value of x |
virtual float Reconstruction | (unsigned int idx) const ; |
Return reconstruction level corresponding to index idx |
float Distortion | () const ; |
Return average distortion in calls to IndexD |