huft_build() static private method

static private huft_build ( int b, int bindex, int n, int s, int d, int e, int t, int m, int hp, int hn, int v ) : int
b int
bindex int
n int
s int
d int
e int
t int
m int
hp int
hn int
v int
return int
Exemplo n.º 1
0
        internal static int inflate_trees_bits(int[] c, int[] bb, int[] tb, int[] hp, ZStream z)
        {
            int[] numArray  = new int[1];
            int[] numArray1 = new int[19];
            int   num       = InfTree.huft_build(c, 0, 19, 19, null, null, tb, bb, hp, numArray, numArray1);

            if (num == -3)
            {
                z.msg = "oversubscribed dynamic bit lengths tree";
            }
            else if (num == -5 || bb[0] == 0)
            {
                z.msg = "incomplete dynamic bit lengths tree";
                num   = -3;
            }
            return(num);
        }
Exemplo n.º 2
0
        internal static int inflate_trees_dynamic(int nl, int nd, int[] c, int[] bl, int[] bd, int[] tl, int[] td, int[] hp, ZStream z)
        {
            int[] numArray  = new int[1];
            int[] numArray1 = new int[288];
            int   num       = InfTree.huft_build(c, 0, nl, 257, InfTree.cplens, InfTree.cplext, tl, bl, hp, numArray, numArray1);

            if (num != 0 || bl[0] == 0)
            {
                if (num == -3)
                {
                    z.msg = "oversubscribed literal/length tree";
                }
                else if (num != -4)
                {
                    z.msg = "incomplete literal/length tree";
                    num   = -3;
                }
                return(num);
            }
            num = InfTree.huft_build(c, nl, nd, 0, InfTree.cpdist, InfTree.cpdext, td, bd, hp, numArray, numArray1);
            if (num == 0 && (bd[0] != 0 || nl <= 257))
            {
                return(0);
            }
            if (num == -3)
            {
                z.msg = "oversubscribed distance tree";
            }
            else if (num == -5)
            {
                z.msg = "incomplete distance tree";
                num   = -3;
            }
            else if (num != -4)
            {
                z.msg = "empty distance tree with lengths";
                num   = -3;
            }
            return(num);
        }