Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: WavPack library: Hybrid compression requierments (Read 6740 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

WavPack library: Hybrid compression requierments

Hi.
I am trying to use hybrid compression. I am not using a correction file. I want to read from memory so I am using WavpackOpenFileInputEx. What is the minimum set of access functions that I need to implement in order for the extraction to work? Is seeking capability required for lossy decompression?

Thanks,
Doron

 

WavPack library: Hybrid compression requierments

Reply #1
I am trying to use hybrid compression. I am not using a correction file. I want to read from memory so I am using WavpackOpenFileInputEx. What is the minimum set of access functions that I need to implement in order for the extraction to work? Is seeking capability required for lossy decompression?

The only function that must work correctly is read_bytes. There is no seeking for any WavPack file unless you attempt to seek in the audio data (or try to read tags or md5sum or something else out at the end of the file).

However, you should define stubs for the other functions and return some non-error value. For example, get_length should return -1.

You might want to try the "tiny decoder" because it's simpler to use (there's only a read function passed because it can't seek). It's available on the WavPack downloads page.

Please let me know of you have any trouble.

WavPack library: Hybrid compression requierments

Reply #2

I am trying to use hybrid compression. I am not using a correction file. I want to read from memory so I am using WavpackOpenFileInputEx. What is the minimum set of access functions that I need to implement in order for the extraction to work? Is seeking capability required for lossy decompression?

The only function that must work correctly is read_bytes. There is no seeking for any WavPack file unless you attempt to seek in the audio data (or try to read tags or md5sum or something else out at the end of the file).

However, you should define stubs for the other functions and return some non-error value. For example, get_length should return -1.

You might want to try the "tiny decoder" because it's simpler to use (there's only a read function passed because it can't seek). It's available on the WavPack downloads page.

Please let me know of you have any trouble.


I've activated the hybrid mode.
I am really pleased with wavpack's performances especially since I abused it a little (I am compressing 16KB buffers, each one as a single file) and still got good compression and good quality, so thanks!
btw, I've implemented the put_char function because it seems the decoder needs it (in the beginning of each buffer the decoder reads one byte and puts it back).
One more question - currently i am using the following flags when compressing: CONFIG_HYBRID_FLAG | CONFIG_BITRATE_KBPS. (and setting config->bitrate=32;)
I tried adding the CONFIG_HIGH_FLAG and got only silence when decrypting the files. Do I have to do anything else to make this flag work?

thanks,

Doron

WavPack library: Hybrid compression requierments

Reply #3
btw, I've implemented the put_char function because it seems the decoder needs it (in the beginning of each buffer the decoder reads one byte and puts it back).
Oops, sorry I forgot about that! You can rebuild the library with the VER4_ONLY macro defined and that will eliminate the push_back_byte function requirement (and make the code smaller too).

Quote
One more question - currently i am using the following flags when compressing: CONFIG_HYBRID_FLAG | CONFIG_BITRATE_KBPS. (and setting config->bitrate=32;)
I tried adding the CONFIG_HIGH_FLAG and got only silence when decrypting the files. Do I have to do anything else to make this flag work?
Hmm, no, there shouldn't be anything else required to do for that case. Usually silence in decoding means that errors were found and the output was muted. If you are decoding the whole file in one call to WavpackUnpackSamples() then maybe it has something to do with that. It might be interesting to try smaller chunks and see what you get (in fact, you can unpack one sample at a time although it will be slow).

Let me know if you can't figure that one out.

David