I need to implement the BSPatch algorithm on the Renesas (RH850F1KMS4) controller. Input: a difference file or delta file of two software versions compressed with the BZIP2 compression method.
When I googled the BSpatch algorithm,
- I was unable to understand the following function:
static int64_t offtin(const uint8_t* buf) {
int64_t y;
y = buf[7] & 0x7F;
y = y * 256;
y += buf[6];
y = y * 256;
y += buf[5];
y = y * 256;
y += buf[4];
y = y * 256;
y += buf[3];
y = y * 256;
y += buf[2];
y = y * 256;
y += buf[1];
y = y * 256;
y += buf[0];
if(buf[7] & 0x80) y = -y;
return y;
}
2.I also need to test the LZMA compression method after BZIP2 in my project.
- I tried understanding the offtin function, but still I could not get the logic beyond it. It would be great if I got some explanation about this function.
- Is there any link where I can get LZMA-related .c source files for integration in my project?
- Which compression method is best for controller-related architecture in terms of faster execution and memory consumption?