2020-01-21 21:50:13 +01:00
|
|
|
#ifndef HUFFMANTABLE_H
|
|
|
|
#define HUFFMANTABLE_H
|
|
|
|
|
2020-11-10 00:58:19 +01:00
|
|
|
#include "huffmanbuffer.h"
|
|
|
|
|
|
|
|
class RGNFile;
|
2020-01-21 21:50:13 +01:00
|
|
|
|
|
|
|
class HuffmanTable {
|
|
|
|
public:
|
2020-11-10 00:58:19 +01:00
|
|
|
HuffmanTable(quint8 id) : _buffer(id) {}
|
2020-01-21 21:50:13 +01:00
|
|
|
|
2020-11-10 00:58:19 +01:00
|
|
|
bool load(const RGNFile *rgn, SubFile::Handle &rgnHdl);
|
2020-01-21 21:50:13 +01:00
|
|
|
quint8 maxSymbolSize() const {return _s2;}
|
|
|
|
quint32 symbol(quint32 data, quint8 &size) const;
|
|
|
|
|
2020-11-10 00:58:19 +01:00
|
|
|
quint8 id() const {return _buffer.id();}
|
2020-06-27 22:46:26 +02:00
|
|
|
|
2020-01-21 21:50:13 +01:00
|
|
|
private:
|
2020-11-10 00:58:19 +01:00
|
|
|
HuffmanBuffer _buffer;
|
2020-01-21 21:50:13 +01:00
|
|
|
quint8 _s0, _s1, _s2, _s3;
|
|
|
|
quint8 *_s10, *_s14, *_s18;
|
|
|
|
quint8 _s1c, _s1d, _s1e, _s1f, _s20;
|
|
|
|
quint16 _s22;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // HUFFMANTABLE_H
|