[FFmpeg-devel] wmv3: poor decoding of some files

Kostya kostya.shishkov
Thu Jun 28 10:53:09 CEST 2007

On Thu, Jun 28, 2007 at 08:58:24AM +0200, Reimar D?ffinger wrote:
> Hello,
> On Wed, Jun 27, 2007 at 05:51:52PM +0300, Kostya wrote:
> [...]
> > Maybe after RV40 I'll have time to look at it and I'm not sure somebody else will
> > improve it (Reimar, you showed not sufficiently strong refusal to work on X8 so you are
> > an ideal candidate *g* ).
> "Someone" is supposed to already have it working for WMV2. So I am

Very good indeed. Maybe this autumn I will have some time for other WMV3
specific features.

> basically waiting for some code to arrive. Same for the Huffman stuff,
> Mans is supposed to already have quite a bit of zlib decompression code
> which I'd really like to see before wasting my time with reimplementing
> something that was already done...

Here is a scheme I've met in some places:
if we have specified bit lengths (like in X8)

 1. count how many times every bit length is seen (-> bitcounts[])
 2. calculate prefixes: 
   sum[0] = 0;
   for(i = 0; i < 16;i++) sum[i+1] = (sum[i] + bitcounts[i]) << 1;
 3. output codes:
   for(i = 0; i < num_codes; i++) code[i] = sum[code_length[i]]++;

You can find ZIP technical documentation (with samples) here:

And maybe it was implemented in my unfinished zlib code I sent to this list.
> Greetings,
> Reimar D?ffinger

More information about the ffmpeg-devel mailing list