Recognizes if input is ogg or not.
[xiph/unicode.git] / w3d / WHAT_THE_HECK_IS_THIS_CODE_DOING
blob4660260582ed0493b7e7cce68eb80832377c820e
2 This is deprecated. Take a look in the w3d/docs directory.
4 The command line semantics are changed. You have to call the test program
5 now like this:
7 ./tarkin_enc ../clips/venuscubes-ppm/AnimSpace00%03d.ppm 5000 4 4
8 ./tarkin_dec
10 ------------------------------------------------------------------------------
12 Hi,
14 this is a experimental 3d-integer-wavelet-video compression codec. Since the
15 integer wavelet transform is reversible and a reversible rgb-yuv conversion
16 is used (you can understand it as (1,2) integer wavelet transform, too), this
17 codec should be lossless if you transmit the whole bitstream.
18 The Y/U/V-bitstreams are embedded, thus you can simply get lossy compression 
19 and shape the used bandwith by cutting bitstreams, when a user defined limit 
20 is reached.
23 Here is how the current code works:
25 First we grab a block of N_FRAMES frames (defined in main.c) of .ppm files.
26 Then each pixel becomes transformed into a YUV-alike colorspace. Take a look in
27 yuv.c to see how it is done. Each component is then transformed into frequency
28 space by applying the wavelet transform in x, y and frame direction. 
29 The frame-direction transform is our high-order 'motion compensation'.
30 At boundaries we use (1,1)-Wavelets (== HAAR transform), inside the image 
31 (2,2)-Wavelets. (4,4)-Wavelets should be easy to add. See wavelet.c for details.
33 The resulting coefficients are scanned bitplane by bitplane and 
34 runlength-encoded. Runlengths are Huffman-compressed and written into the 
35 bitstreams. The bitplanes of higher-frequency scales are offset'ed to ensure a
36 fast transmission of high-energy-low-frequency coefficients. (coder.c)
37 The huffman coder is quite simple and uses a hardcoded table, this can be done
38 much better, but I wanted to get it working fast.
40 Decompression works exactly like compression but in reversed direction.
42 The test program writes for each frame the grabbed original image, the y/u/v
43 component (may look strange, since u/v can be negative and are not clamped to
44 the [0:255] range), the coefficients (look much more like usual wavelet 
45 coefficients if you add 128 to each pixel), the coefficients after they are 
46 runlength/huffman encoded and decoded, the y/u/v components when inverse wavelet
47 transform is done and the output image in .ppm format.
49 You can call the test program like this:
51   $ ./main 20000 5000 5000 ../clips/%i.ppm
53 which means: images are grabbed from directory ../clips/0.ppm, ../clips/1.ppm,
54 etc. The Y component bitstream is limited to 20000 Bytes, the U and V bitstreams
55 to 5000 Bytes. If the last argument is omitted, frames are taken from current
56 directory.
58 Good Luck,
60 - Holger  <hwaechtler@users.sourceforge.net>