private SeqAccessRank1 ( int acc, long pos, int max, int &found_pos, |
||
acc | int | |
pos | long | |
max | int | |
found_pos | int | |
ctx | ||
return | int |
int SeqAccessRank1(int acc, long pos, int max, out int found_pos, BitStreamCtx ctx)
{
int i = 0;
while (i < max && acc < pos) {
int u = this.ReadNext (ctx);
if (acc + u > pos) {
found_pos = acc;
return i;
}
acc += u;
i++;
}
found_pos = acc;
return i;
}