Skip to content

A correction of decodeArray(..) in every one algorithm class #20

Description

@floodfill

Take Simple16 as an example, the decodeArray is rendered as following:

decodeArray(uint32_t _in, uint32_t len, uint32_t *out, uint32_t nvalue){
uint32_t *end = out + nvalue;
while (end > out) {
(__simple16_unpack[_in >>
(32 - SIMPLE16_LOGDESC)])(&out, &in);
}
}

According to my understanding of this function, the len indicates the count of numbers to be decompressed, and nvalue should be returned as the count of numbers decompressed to be. So I suggest correct this part of file to be following:

decodeArray(uint32_t _in, uint32_t len, uint32_t *out, uint32_t &nvalue){
uint32_t *end = in + len;
uint32_t *last;
uint32_t count = 0;
while (end > in) {
(__simple16_unpack[_in >>
(32 - SIMPLE16_LOGDESC)])(&out, &in);
count += in - last;
last = in;
}
nvalue = count;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions