[xiph-cvs] cvs commit: w3d/docs entropycoder.tex

Holger Waechtler holger at xiph.org
Tue Nov 20 05:06:38 PST 2001



holger      01/11/20 05:06:38

  Modified:    .        golomb.h wavelet_coeff.c
               docs     entropycoder.tex
  Log:
  cosmetical changes, fixed a typo in the documentation

Revision  Changes    Path
1.3       +13 -12    w3d/golomb.h

Index: golomb.h
===================================================================
RCS file: /usr/local/cvsroot/w3d/golomb.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- golomb.h	2001/11/20 11:33:05	1.2
+++ golomb.h	2001/11/20 13:06:37	1.3
@@ -6,12 +6,25 @@
 
 
 static inline
+unsigned int required_bits (unsigned int x)
+{
+   int bits = 31;
+
+   while ((x & (1 << bits)) == 0 && bits)
+      bits--;
+
+   return bits;
+}
+
+
+static inline
 void write_number_binary (BitCoderState *b, unsigned int x, int bits)
 {
    while (bits) {
       bits--;
       bitcoder_write_bit (b, (x >> bits) & 1);
    }
+printf ("wrote %i with %i bits\n", x, bits);
 }
 
 
@@ -26,18 +39,6 @@
    }
 
    return x;
-}
-
-
-static inline
-unsigned int required_bits (unsigned int x)
-{
-   int bits = 31;
-
-   while ((x & (1 << bits)) == 0 && bits)
-      bits--;
-
-   return bits;
 }
 
 

1.7       +2 -2      w3d/wavelet_coeff.c

Index: wavelet_coeff.c
===================================================================
RCS file: /usr/local/cvsroot/w3d/wavelet_coeff.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- wavelet_coeff.c	2001/11/20 11:15:00	1.6
+++ wavelet_coeff.c	2001/11/20 13:06:37	1.7
@@ -9,7 +9,7 @@
                    ENTROPY_CODER insignificand_bitstream [],
                    TYPE coeff)
 {
-   TYPE mask [2] = { 0, ~0 };
+   static TYPE mask [2] = { 0, ~0 };
    int sign = (coeff >> (8*sizeof(TYPE)-1)) & 1;
    TYPE significance = coeff ^ mask[sign];
    int i = TYPE_BITS;
@@ -31,7 +31,7 @@
 TYPE decode_coeff (ENTROPY_CODER significand_bitstream [],
                    ENTROPY_CODER insignificand_bitstream [])
 {
-   TYPE mask [2] = { 0, ~0 };
+   static TYPE mask [2] = { 0, ~0 };
    TYPE significance = 0;
    int sign;
    int i = TYPE_BITS;

1.4       +1 -1      w3d/docs/entropycoder.tex

Index: entropycoder.tex
===================================================================
RCS file: /usr/local/cvsroot/w3d/docs/entropycoder.tex,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- entropycoder.tex	2001/11/20 11:15:02	1.3
+++ entropycoder.tex	2001/11/20 13:06:38	1.4
@@ -25,7 +25,7 @@
 combination of near optimal huffman codes without going through the huffman
 algorithm. This was the base for some arithmetic entropy coders, namely the 
 Z- and ZP-Coder which generalize and extend the Golomb coder to improve adaption.
-Because of patent issues of Mitsubishi and AT&T we can't use those derivates.
+Because of patent issues of Mitsubishi and AT\&T we can't use those derivates.
 
 Instead we use a slightly modified version of the original algorithm. If we 
 have a good guess of the range of a number $x$ given by the number of required bits

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list