DDraceNetwork Docs
huffman.cpp File Reference
#include "huffman.h"
#include <algorithm>
#include <base/system.h>
Include dependency graph for huffman.cpp:

Classes

struct  CHuffmanConstructNode
 

Macros

#define HUFFMAN_MACRO_LOADSYMBOL(Sym)
 
#define HUFFMAN_MACRO_WRITE()
 

Functions

bool CompareNodesByFrequencyDesc (const CHuffmanConstructNode *pNode1, const CHuffmanConstructNode *pNode2)
 

Macro Definition Documentation

◆ HUFFMAN_MACRO_LOADSYMBOL

#define HUFFMAN_MACRO_LOADSYMBOL (   Sym)
Value:
do \
{ \
Bits |= m_aNodes[Sym].m_Bits << Bitcount; \
Bitcount += m_aNodes[Sym].m_NumBits; \
} while(0)

◆ HUFFMAN_MACRO_WRITE

#define HUFFMAN_MACRO_WRITE ( )
Value:
do \
{ \
while(Bitcount >= 8) \
{ \
*pDst++ = (unsigned char)(Bits & 0xff); \
if(pDst == pDstEnd) \
return -1; \
Bits >>= 8; \
Bitcount -= 8; \
} \
} while(0)

Function Documentation

◆ CompareNodesByFrequencyDesc()

bool CompareNodesByFrequencyDesc ( const CHuffmanConstructNode pNode1,
const CHuffmanConstructNode pNode2 
)