Re: Good 1bit-ADPCM codecs?

I've said, it is not HiFi quality.But in most cases, it performs similar to IMA and MS ADPCM if used in 2-bit mode.

It is old, but yesterday, I improved it a bit (just for fun).

But it can't keep on the same level as modern frequency transformation based codecs. It would loose in compare to Opus and Vorbis.

I originally made it many years ago to transform audio to pictures. These pictures were intended to be print on paper so you can save audio on paper^^. This was somewhere in the time of Windows 98. These papers worked similar to QR codes and you can scan them to get the audio files back. That technique needed heavy compression to get the paper sheets scannable. That isn't useful anymore since hard drives became bigger and bigger so I butchered this ancient project yesterday (but resqued this codec from it).

Today, it might be still useful for microprocessors, where resources are limited, because only integer addition and subtraction is needed to decode it. IMA and MS need more processing power to decode.

I find the technique behind ADPCM codecs interesting so I made my own.

It seems, no one ever wants to use any kind of ADPCM anymore, so I keep it for myself.

Re: Good 1bit-ADPCM codecs?

OK so now things make more sense. So you want to make something like a QR code that each dot actually represents a bit of an ADPCM file. That would be extremely hard since there is pretty like zero room for improving 1bit. On the other hand, if you used a lossy/speech codec with extremely good resilience in errors or dropped packages you might achieve the same or better results. It also kinda matches with the idea I had a long time now of somehow modulating a lossy audio stream into a normal cassette tape, more like a DIY DCC tape that uses regular tapes. The key is the modulation method/technic that I haven't found yet, though I bet there is one out there.

Annotations:- Left channel only, because the source file is not mono compatible. - I converted it to WAV using Audacity before doing the conversion. It is resampled to 48000Hz because there is no support for the original 44100Hz. It is in fact an 1.08-bit encoding.

Re: Good 1bit-ADPCM codecs?

I tinkered around with my little codec baby once more... I was bored^^.

I made somewhat two-stream container from it. The first one is the ADPCM I already explained here. The other track contains the difference between the original and the encoded file compressed losslessly. Both together comes up to approx 640-800kbps. It is pretty high bit-rate but almost lossless, if both are mixed together during playback.

It is not true lossless, because it does not support 44100Hz, because the algorithm operates at 24000Hz or a multiple of that (48000, 96000, 144000, 192000). So you have to live with a (high quality SoX-)resampling to 48000Hz in case of 44100Hz. If the source is already one of the supported sample rates, it is exactly lossless.

Killer samples raising the bit-rate are everything that has to do with loudness-war (clipping, hypercompression, intersample-overs). Such rectangular-shaped sounds are hard to trace for the ADPCM part.

High dynamic ranges and uncompressed classical music (especially church organs, trumpets, flutes and violins) are resulting in lowest bit rates and a good sounding lossy part. The other extreme, heavy-metal, results in lower bitrates too.

The lossy stream that can be played alone. Then it is lossy and has a fixed bit rate. The lowest bit-rate for an acceptable lossy part is 192kbps for a stereo file. If 288kps or higher is used, the artifacts are inaudible to me using hifi headphones. There is no VBR for the lossy part yet. Supported bitrates for the lossy part are: 48kbps (poor), 96kbps, 144kbps, 192kbps, 240kbps, 288kbps, 336kbps, 384kbps, 432kbps, 480kbps... no upper limit. The safe choice for quality would be 336 or 384 I think. The residue that does not fit into the lossy stream with a given bit-rate goes into the difference-stream. As higher the bit-rate for the lossy part is chosen, the lower the bit-rate of the difference-part is.

If both streams are played together, it is lossless (compared to the 48000Hz-resampled input file).

Because the difference-stream that makes it lossless is optional, the same codec can be used as lossy and lossless codec. You can turn a lossless file into a lossy one by dropping the difference-stream.

The compression artifact of lossy playback is little crackle and rumble that sounds like a vinyl disc (so I'm already using it for myself for compressing digitalized vinyl records). The rumble is caused by the internal usage of some basic pre-emphasis that reduces the crackle in the mid-frequency-range - just like a record player^^.

The encoder is currently hard to use because a few encoding parameters aren't chosen automatically yet. Still not ready for average users^^.

As I understood, FLAC works similar like this but uses completely different algorithm for the lossy part^^.

It was just a fun-codec because I wanted to build my own one. But is that useful in some way? Does it worth to develop it to something that is easy to use and then to share that as a serious audio codec? The lossy part is still more inefficient than psychoacoustic codecs but doesn't sound ugly "bity" if set to low....

Re: Good 1bit-ADPCM codecs?

In the days of extreme storage and computing power limitations such codec would be a killer (Say NES, SNES and Gameboy PCM support) but now I don't see how it would be useful. But even then I have my doubts because all companies decided to go for 2-bits and up for their PCM based audio on their games so even if you pitched the codec to Nintendo in that case back in that time I doubt they would consider it. There has to be a reason they didn't bother with 1-bit ADPCM and went straight for 2 or 4 bit. Even Gameboy's rare case of PCM samples of games were using at least 2-bit ADPCM which was really well tuned but still sounded like crap.

Re: Good 1bit-ADPCM codecs?

I don't know what, if any, codecs are used for Game Boy, since those are likely as close to PCM as possible, since they're bit banging the PSG to output a pure 2 or 4 bit PCM stream over the volume register.

NES has 1 bit DPCM for many things, which as you can imagine, is not that great, but still sounded okay for the most part.

You may have some luck if you try to examine the old TrueVoice codec, which was pretty crap for its time. It was a 1 bit codec, but it probably didn't use ADPCM. It was also limited to 8000 Hz.

Re: Good 1bit-ADPCM codecs?

Sounds all terrible. These are made for limited CPU power and limited sound processors with limited PCM support so these aren't comparable at all because of different use case.

I encountered a codec named "WavPack" during my further research. I heard about that name a few times but I thought it is an old MP3-fork or something like this from the 90's so I never touched it. On a quick test, it produced similar quality on in 192kbps-384kbps range but doesn't support lower bit rates. And I'm not 100% sure if this is an ADPCM variant, even it produces ADPCM-like artifacts.

I won't publish my codec.

Another candidate for keeping in fun-developing and using for myself xD.