-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
We noticed a problem with the range coder for very short sequences. For example, encoding the data below yields a file with 2 bytes instead of the expected 1 byte.
unsigned int data[6] = {0, 2, 2, 2, 1, 2};
SearchType::freq_type cumFreq[3] = {0, 2, 4, 8};
This line seems to cause the extra bit:
Line 95 in 4376cea
| *iter++ = buffer; |
And this should fix it:
if (!start) {
*iter++ = buffer;
for (; carryN != 0; carryN--) {
*iter++ = 0xFF;
}
}
Metadata
Metadata
Assignees
Labels
No labels