Re: Building Huffman three




"LiloLilo" <danilo.brambilla@xxxxxxxx> wrote in message
news:460d1d06$0$20813$5fc30a8@xxxxxxxxxxxxxxxxxx
Hi all!

suppose I have a small set of data, and I want to compress them using
huffman encoding. Grouping this data by value and counting them, I got the
following counters:

Value 1: 0 (Value 1 present 0 times in data set)
Value 2: 1 (Value 2 present 1 times in data set)
Value 3: 5 ...
Value 4: 11
Value 5: 13
Value 6: 12
Value 7: 5
Value 8: 1
Value 9: 0

My question is: I have to use also Values 1 and 9 that are never present
in data set when building huffman three? It is correct If I suppose that
using them I would get longest words in huffman three, so I'll get a worst
compression?


whether or not to include them is up to the implementor. many typical
implementations will simply omit them from the tree being built.

however, it may make sense to include them as well (for example, if the tree
is not absolute but merely a speculative guess).

in this case, they would get the longest codes, but this doesn't really
matter if they are never (or almost never) actually encoded.


Thank you all!


.



Relevant Pages

  • Re: Best existing binary compressor method?
    ... get closer than huffman to the entropy on average. ... but only due to the limitation of huffman not ... the probabilities of the source alphabet are inverse powers of two, ... compress smaller than the entropy and some longer. ...
    (comp.compression)
  • Re: Huffmans use in various compressions
    ... Static huffman produces better entropy than adaptive huffman ... But its still a function of what files you compress. ... Static Huffman is difficult in practice because the encoding tree ...
    (comp.compression)
  • The core of the method examined
    ... The average file will have this layup: ... We will assume that 10 and 01 outcomes are 'exactly equal' for the ... Huffman we have these too high, we will fail to compress. ...
    (comp.compression)
  • Re: QI and MQ Coder: First real-life experiences
    ... is way off base and doesn't seem to compress to ... radix codes from Radix.c as the original test, ... Of course, Huffman can do it. ... If you have just one component in the whole package that you have to ...
    (comp.compression)
  • Re: question about using huffman algorithm
    ... >> I am told to compress a file using the huffman algorithm...the file may ... compressed data could be significantly smaller than the preimage, ... letters, with a fixed table based on English letter frequency, would ...
    (comp.programming)