19 #define PACK(bit) if(*pc_in != 0){*pl_mask += bit ; *pc_out++ = *pc_in; } pc_in++;
22 #define UNPACK(bit) if(l_mask & bit ) *pc_out++ = *pc_in++; else *pc_out++ = 0;
25 #define UNPACK(bit) if(l_mask & bit ) *pc_out++ = *pc_in++; else *pc_out++ = 0;
28 #define UNPACK(bit) if(l_mask & bit ) *pc_out++ = *pc_in++; else *pc_out++ = 0;
31 #define UNPACK(bit) if(l_mask & bit ) *pc_out = *pc_in++; pc_out++;
34 #define UNPACK(bit) if(l_mask & bit ) *pc_out = *pc_in++; pc_out++;
37 #define UNPACK(bit) if(l_mask & bit ) *pc_out = *pc_in++; pc_out++;
40 #define UNPACK(bit) if(l_mask & bit ) *pc_out = *pc_in++; pc_out++;
84 INTU4 *pl_mask,*pl_end;
90 pl_mask=(
INTU4 *)pc_input;
91 pl_end=pl_mask+l_inlen/4;
92 while(pl_mask!=pl_end)
94 if(*pl_mask&0x000000ff) l_bytes++;
95 if(*pl_mask&0x0000ff00) l_bytes++;
96 if(*pl_mask&0x00ff0000) l_bytes++;
97 if(*pl_mask&0xff000000) l_bytes++;
100 if(l_bytes%4 != 0) l_bytes=l_bytes+4-l_bytes%4;
101 l_masks=(l_inlen >> 5);
102 if(l_inlen%32 != 0) l_masks++;
143 INTU1 *pc_out,*pc_in;
148 for(I=1;I<=l_inlen;I++)
if(*pc_in++ == 0) l_bytes++;
149 return (l_bytes*100/l_inlen);
232 INTU4 l_mask,l_masks;
234 INTU1 *pc_out,*pc_in,*pc_1;
238 l_masks=(l_inlen >> 5);
239 if(l_inlen%32 != 0) l_masks++;
241 if(l_outlen < 4*l_masks+
sizeof(
s_compress)+l_inlen)
return -1;
245 pl_mask=(
INTU4 *)(ps_compress+1);
246 pc_out = (
INTU1 *)(pl_mask+l_masks);
252 for(I=1;I<l_masks;I++)
289 l_bytes=pc_out-pc_1 ;
292 for(I=0;I<(l_inlen-l_masks*32+32);I++)
294 if(*pc_in != 0){*pl_mask += l_mask; *pc_out++ = *pc_in; l_bytes++; } l_mask = l_mask << 1; pc_in++;
300 ps_compress->
l_masks = l_masks;
304 return (l_bytes+4*l_masks+
sizeof(
s_compress));
355 INTU4 *pl_mask,*pl_tmp,*pl_out;
356 INTU1 *pc_out,*pc_in;
364 pl_out=(
INTU4 *) pc_output;
366 while(pl_out != pl_tmp) *pl_out++ = 0;
369 pl_out=(
INTU4 *) pc_output;
371 while(pl_out != pl_tmp) *pl_out++ = 0;
377 pl_mask=(
INTU4 *)(ps_compress+1);
381 for(L=1;L<ps_compress->
l_masks;L++)
422 if(l_mask%2 != 0) *pc_out++ = *pc_in++;
else *pc_out++=0;
423 l_mask = l_mask >> 1;
INTS4 f_ut_compr_size(INTU1 *pc_input, INTS4 l_inlen)
INTS4 f_ut_compr_unpack(INTU1 *pc_input, INTU1 *pc_output, INTS4 l_outlen)
INTS4 f_ut_compr_pack(INTU1 *pc_input, INTS4 l_inlen, INTU1 *pc_output, INTS4 l_outlen)
INTS4 f_ut_compr_zeros(INTU1 *pc_input, INTS4 l_inlen)