This game that I'm recompressing has a bunch of .ogg files, and when I use QuickBMS to try and compress it again after successfully decompressing it, some of the .ogg files end the compression process and give me the error:
Error: there is an error with the decompression the returned output size is negative (-1)
This seems to be happening because the compressed file's size is larger than the original, decompressed filesize. Is there a way I can bypass this error and have QuickBMS compress the .ogg files regardless of their size?
you can set any desired output size in the following way: xmath NEW_SIZE "SIZE * 2" clog NAME OFFSET SIZE NEW_SIZE
What compression algorithm are you using? All the *_compress algorithms in quickbms automatically set a slightly bigger output size but it's possible that it's not enough with some algorithms in some conditions.
aluigi wrote:you can set any desired output size in the following way: xmath NEW_SIZE "SIZE * 2" clog NAME OFFSET SIZE NEW_SIZE
What compression algorithm are you using? All the *_compress algorithms in quickbms automatically set a slightly bigger output size but it's possible that it's not enough with some algorithms in some conditions.
I'm using the lz77wii_compress 0x10 algorithm. It usually compresses things just fine, and it only seems to have these issues when compressing .ogg files. Also, if possible, I would prefer to have QuickBMS automatically determine the compressed filesize as usual and just ignore whether it's larger or smaller than the original file, rather than setting a specific size for the compressed files to be. Sorry if I'm asking for too much ;P
Almost all the algorithms in quickbms directly decompress the data into the output buffer, lz77wii is one of the very few in which the output buffer is dynamically enlarged to fit the decompressed data.
Usually the algorithms for recompressing data have enough space for the newly compressed data but sometimes, like in your case, that may not be enough.
aluigi wrote:Almost all the algorithms in quickbms directly decompress the data into the output buffer, lz77wii is one of the very few in which the output buffer is dynamically enlarged to fit the decompressed data.
Usually the algorithms for recompressing data have enough space for the newly compressed data but sometimes, like in your case, that may not be enough.
I see... is there a way to edit the algorithm/script so that there's enough space in that case?
aluigi wrote:I already gave you the code in my first answer.
Oh, my bad
Anyways, I plugged the code into my script, but the output file was 0 KB. I had my go at figuring out the problem, but whatever it is is beyond me. The script i used is: