qpl
qpl copied to clipboard
QPL decompress function
Hi, I have a question about how to use the decompress function in a specific situation. I want to decompress .zlib file and my .zlib file size is 50MB. I split 50MB to 500 100KB data chunks and made jobs. I set it to 100KB data chunk because the output size should not exceed 2MB after decompressing. However, I got error code, 217, from qpl_wait_job(). I didn't what this error code means, "Decoded Distance is 0 or greater than History Buffer." Can I get help on how to decompress .zlib file with QPL? Below is my job interface.
job[i]->op = qpl_op_decompress;
job[i]->level = qpl_default_level;
job[i]->next_in_ptr = src_vector[i].data();
job[i]->next_out_ptr = dest_vector[i].data();
job[i]->available_in = assume_size; // assume_size = 100 * 1024
job[i]->available_out = chunk_size; // chunk_size = 2 * 1024 * 1024
job[i]->flags = QPL_FLAG_ZLIB_MODE
if (file_id == num_chunk - 1) {job[i]->flags |= QPL_FLAG_LAST;}
else if (file_id == 0) {job[i]->flags |= QPL_FLAG_FIRST;} // num_chunk = 500