Hello, I want to use IMA ADPCM for unofficial bit depths like 2bps, 3bps, 5bps, or 6bps. I have index tables for them. I got them from https://open-flash.github.io/mirrors/swf-spec-19.pdf for 2bps, 3bps, and 5bps (Flash ADPCM). I had to make the index table myself for 6bps. As 5bps index table is logarithmic, i thinked 6bps must also be logarithmic at first. And, i made [1, 2, 3, 4, 5, 6, 8, 10, 12, 14, 16, 19, 22, 25, 28, 32] for a half of the index table (the other half is just -1's). But, later i thinked: why logarithmic? Can [2, 4, 6, ..., 28, 30, 32] for 6bps and [2, 4, 6, ..., 12, 14, 16] for 5bps be better? Why 5bps SWF ADPCM has a logarithmic index table, and can a linear index table be better for 5bps and 6bps?
Why nobody answered this?
ADPCM stopped being relevant long before Adobe Flash was a thing. Only place where it would make some sense is in some ancient software that supported nothing else. In that setting unofficial variations make no sense at all.
Replacing a lookup table with a linear variant would mean worse quality per bitrate. Storing an index number for something that could be directly computed simply by multiplying with a constant is a waste of space.
@Case Codec's are not only required for high-performance computers, they are also required for tiny microcontroller's and etc.. Using a modern codec like MP3 can be very hard or impossible with these tiny MCU's and etc.. So, ADPCM is still required for some low processing power tasks. I'm asking this because i want to use ADPCM with Arduino. Anyway, thanks for recommendation.
This is codec experts forum, your question was put on the queue.
Write PCM. Is there a reason not to?
@itisljar ADPCM is more efficient than PCM.
If it is for your own "canned" audio, then there was a fun thing discussed here recently, the new Quite OK Audio format: https://hydrogenaud.io/index.php/topic,123838.0.html . It has even made its way into ffmpeg.
The idea behind it: https://phoboslab.org/log/2023/02/qoa-time-domain-audio-compression
Why nobody answered this?
Because there are very few people on this planet reading this forum
and knowing how a certain 40-year-old codec works.
Short answer: in audio and speech coding, logarithmic quantizers usually fit the (residual) audio data better than linear quantizers - many small values, few large values. You simply get better perofrmance.
Chris
@Porcus Thank you, i can use it for some stuff but it can be too big for some stuff as it is 3.2 bits per sample (sometimes 2 bits per sample is needed for me) and i'll be happy if a 2 bits per sample version comes.
@C.R.Helmrich Thank you, the reason i was thinking linear can be better was the fact that difference values are linear.
ADPCM is still required for some low processing power tasks. I'm asking this because i want to use ADPCM with Arduino.
Have you taken a look at
LC3? That coding standard is longer (in terms of specification and code lines) but was specifically designed for operation on low-power devices, allows for much finer variation of bit-rate, and should perform much better than ADPCM in terms of audio quality.
https://github.com/marzzzello/LC3plus
https://github.com/google/liblc3
More details: https://www.iis.fraunhofer.de/en/ff/amm/communication/lc3.html
Chris
@C.R.Helmrich Looks like this codec works in frequency domain and i'm not sure Arduino can handle it, but thank you anyway.
@Case Codec's are not only required for high-performance computers, they are also required for tiny microcontroller's and etc.. Using a modern codec like MP3 can be very hard or impossible with these tiny MCU's and etc.. So, ADPCM is still required for some low processing power tasks. I'm asking this because i want to use ADPCM with Arduino. Anyway, thanks for recommendation.
Are you going to use "tiny MCU" to decode or to encode?
@Bogozo Probably decode, but maybe encode. I think most frequency based codecs will be too hard even for decode.
If to decode, you can consider LossyFLAC in "extraportable" mode. It has high quality, high effeciency. It can be decoded faster than mp3 and even faster than ADPCM (https://www.rockbox.org/wiki/CodecPerformanceComparison#NXP_i.MX233_w_47_454MHz_PCLK_40ARM926EJ_45S_41).
@Bogozo What's it's supported minimum bit depth?
I don't know if Klymins is familiar with this, but this Arduino Audio Tools (https://github.com/pschatzmann/arduino-audio-tools/wiki/Encoding-and-Decoding-of-Audio) collection makes it look like there are ready made libraries to get pretty much everything working on Arduino.
@Case This looks very good, thanks!