MCPcopy Create free account
hub / github.com/OpenDriveLab/OpenLane / rleFrString

Function rleFrString

eval/CIPO_evaluation/common/maskApi.c:235–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235void rleFrString( RLE *R, char *s, siz h, siz w ) {
236 siz m=0, p=0, k; long x; int more; uint *cnts;
237 while( s[m] ) m++; cnts=malloc(sizeof(uint)*m); m=0;
238 while( s[p] ) {
239 x=0; k=0; more=1;
240 while( more ) {
241 char c=s[p]-48; x |= (c & 0x1f) << 5*k;
242 more = c & 0x20; p++; k++;
243 if(!more && (c & 0x10)) x |= -1 << 5*k;
244 }
245 if(m>2) x+=(long) cnts[m-2]; cnts[m++]=(uint) x;
246 }
247 rleInit(R,h,w,m,cnts); free(cnts);
248}

Calls 1

rleInitFunction · 0.85

Tested by

no test coverage detected