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;
86 pl_mask=(
INTU4 *)pc_input;
87 pl_end=pl_mask+l_inlen/4;
88 while(pl_mask!=pl_end)
90 if(*pl_mask&0x000000ff) l_bytes++;
91 if(*pl_mask&0x0000ff00) l_bytes++;
92 if(*pl_mask&0x00ff0000) l_bytes++;
93 if(*pl_mask&0xff000000) l_bytes++;
96 if(l_bytes%4 != 0) l_bytes=l_bytes+4-l_bytes%4;
97 l_masks=(l_inlen >> 5);
98 if(l_inlen%32 != 0) l_masks++;
141 for(I=1;I<=l_inlen;I++)
if(*pc_in++ == 0) l_bytes++;
142 return (l_bytes*100/l_inlen);
225 INTU4 l_mask,l_masks;
227 INTU1 *pc_out,*pc_in,*pc_1;
231 l_masks=(l_inlen >> 5);
232 if(l_inlen%32 != 0) l_masks++;
234 if(l_outlen < (
INTS4) (4*l_masks+
sizeof(
s_compress)+l_inlen))
return -1;
238 pl_mask=(
INTU4 *)(ps_compress+1);
239 pc_out = (
INTU1 *)(pl_mask+l_masks);
245 for(I=1;I<l_masks;I++)
282 l_bytes=pc_out-pc_1 ;
285 for(I=0;I<(l_inlen-l_masks*32+32);I++)
287 if(*pc_in != 0){*pl_mask += l_mask; *pc_out++ = *pc_in; l_bytes++; } l_mask = l_mask << 1; pc_in++;
293 ps_compress->
l_masks = l_masks;
297 return (l_bytes+4*l_masks+
sizeof(
s_compress));
349 INTU1 *pc_out,*pc_in;
357 pl_out=(
INTU4 *) pc_output;
359 while(pl_out != pl_tmp) *pl_out++ = 0;
362 pl_out=(
INTU4 *) pc_output;
364 while(pl_out != pl_tmp) *pl_out++ = 0;
370 pl_mask=(
INTU4 *)(ps_compress+1);
374 for(L=1;L<ps_compress->
l_masks;L++)
415 if(l_mask%2 != 0) *pc_out++ = *pc_in++;
else *pc_out++=0;
416 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)