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++;
83 INTU4 *pl_mask,*pl_end;
88 pl_mask=(
INTU4 *)pc_input;
89 pl_end=pl_mask+l_inlen/4;
90 while(pl_mask!=pl_end)
92 if(*pl_mask&0x000000ff) l_bytes++;
93 if(*pl_mask&0x0000ff00) l_bytes++;
94 if(*pl_mask&0x00ff0000) l_bytes++;
95 if(*pl_mask&0xff000000) l_bytes++;
98 if(l_bytes%4 != 0) l_bytes=l_bytes+4-l_bytes%4;
99 l_masks=(l_inlen >> 5);
100 if(l_inlen%32 != 0) l_masks++;
143 for(I=1;I<=l_inlen;I++)
if(*pc_in++ == 0) l_bytes++;
144 return (l_bytes*100/l_inlen);
227 INTU4 l_mask,l_masks;
229 INTU1 *pc_out,*pc_in,*pc_1;
233 l_masks=(l_inlen >> 5);
234 if(l_inlen%32 != 0) l_masks++;
236 if(l_outlen < 4*l_masks+
sizeof(
s_compress)+l_inlen)
return -1;
240 pl_mask=(
INTU4 *)(ps_compress+1);
241 pc_out = (
INTU1 *)(pl_mask+l_masks);
247 for(I=1;I<l_masks;I++)
284 l_bytes=pc_out-pc_1 ;
287 for(I=0;I<(l_inlen-l_masks*32+32);I++)
289 if(*pc_in != 0){*pl_mask += l_mask; *pc_out++ = *pc_in; l_bytes++; } l_mask = l_mask << 1; pc_in++;
295 ps_compress->
l_masks = l_masks;
299 return (l_bytes+4*l_masks+
sizeof(
s_compress));
351 INTU1 *pc_out,*pc_in;
359 pl_out=(
INTU4 *) pc_output;
361 while(pl_out != pl_tmp) *pl_out++ = 0;
364 pl_out=(
INTU4 *) pc_output;
366 while(pl_out != pl_tmp) *pl_out++ = 0;
372 pl_mask=(
INTU4 *)(ps_compress+1);
376 for(L=1;L<ps_compress->
l_masks;L++)
417 if(l_mask%2 != 0) *pc_out++ = *pc_in++;
else *pc_out++=0;
418 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)