Huffman to trash
git-svn-id: svn://db.shs.com.ru/pip@107 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -33,23 +33,6 @@
|
||||
class PIString;
|
||||
class PIByteArray;
|
||||
|
||||
class PIHuffman {
|
||||
public:
|
||||
PIDeque<uchar> compress(const PIDeque<uchar> & src);
|
||||
|
||||
private:
|
||||
struct node {
|
||||
int freq;
|
||||
PIDeque<uchar> word;
|
||||
PIBitArray path;
|
||||
node * parent;
|
||||
node * right;
|
||||
node * left;
|
||||
};
|
||||
static int nodeCompare(const void * f, const void * s);
|
||||
void calcFrequencies(const PIDeque<uchar> & src);
|
||||
PIVector<node> nodes;
|
||||
};
|
||||
|
||||
class PIP_EXPORT PIByteArray: public PIDeque<uchar>
|
||||
{
|
||||
@@ -100,8 +83,6 @@ public:
|
||||
PIByteArray compressedRLE(uchar threshold = 192) {PIByteArray ba(*this); ba.compressRLE(threshold); return ba;}
|
||||
PIByteArray decompressedRLE(uchar threshold = 192) {PIByteArray ba(*this); ba.decompressRLE(threshold); return ba;}
|
||||
|
||||
PIByteArray & compressHuffman() {*this = huffman.compress(*this); return *this;}
|
||||
|
||||
PIString toString(int base = 16) const;
|
||||
|
||||
//! Add to the end data "data" with size "size"
|
||||
@@ -145,7 +126,6 @@ private:
|
||||
|
||||
static const char base64Table[64];
|
||||
static const char base64InvTable[256];
|
||||
static PIHuffman huffman;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user