New Ultra Fast Lossless Audio Codec (HALAC)

Author Avatar

Staff Writer

Joined: Nov 2016

1

Print

lazka and 310 Guests are viewing this topic.

HALAC (High Availability Lossless Audio Compression)

2023-12-31 21:12:23

I’m new in this forum. I am glad it was such a special forum on Audio. I am the writer of the lossless image codec called HALIC(High Availability Lossless Image Compression). It is a work that can offer a good compression ratio quite quickly. This time I would like to introduce my work called HALAC(High Availability Lossless Audio Compression).In the past(2018-2019), I had been working on the lossless audio compression. However, I could not bring together the work I did. Now I have a little time and I think I developed a fast codec. I worked on 16 bit, 2 channel audio data (.wav). Higher bit and channel options can be added if necessary. As a result, the approach is the same.

HALAC, like the HALIC, focuses on a reasonable compression ratio and high processing speed. The compression rate for audio data is usually limited. So I wanted a solution that can work faster with a few percent concessions.

I used a quick estimation with ANS(FSE). I don’t know if there are other codecs using ANS, but the majority uses “Rice Coding”. However, in my tests, Rice Coding(my own implementation) is a bit behind in terms of speed(0.6x – 0.7x), but it gives better results as compression rate(1% – 2%). The loss of speed in the Rice Coding is due to the calculation of adaptive parameter. I am really happy with ANS right now because speed is more important to me. In addition, I do not think that I use ANS fully efficiently.

GPU or SIMD was not used. Also now in the single-thread version. In the next version, I can add the Multithread option. I couldn’t compile the Linux version because my Linux machine collapsed. I tried to find the middle way by working with different music genres.
Below are the comparisons (from original wav, 16 bit, 2 channel, 44100 bps) with FLAC, ALAC and WAVPACK (Pazera_Free_Audio_Extractor ver. 2.11).

Test Machine (2012): i7 3770k, 3.9 ghz, 16 gb ram, 256 gb ssd
Encode Usage: halac_encode.exe input.wav out.halac
Decode Usage: halac_decode.exe out.halac original.wav

Last Edit: 2023-12-31 21:17:50 by Hakan Abbas

Re: HALAC (High Availability Lossless Audio Compression)

Reply #1 – 2024-01-01 08:18:09

Speed wise your codec is quite impressive. I ran some simple tests here and it seems to compress a tiny bit worse than FLAC 1.4.3 in mode -4 but clearly better than FLAC in mode -3.
But in compression speed it beats even FLAC mode -0 and TAK -p0. And seems to beat them all in decoding speed too.

Re: HALAC (High Availability Lossless Audio Compression)

Reply #2 – 2024-01-01 11:31:35

Very nice. tl;dr is it essentially LPC with ANS for the residual? If you could release source or compile for Linux that would be great, I have trouble running .NET mono crap through wine.

Re: HALAC (High Availability Lossless Audio Compression)

Reply #3 – 2024-01-01 11:39:52

I wonder how much of the speed benefit comes from the codec seemingly lacking any safety checks.I compressed a WAV with metadata and the decoded file seems to have copied the header from the original file but is missing the metadata chunks, so it’s a bit invalid length wise.

And I randomly altered bits in the encoded binary data as a test, decoder didn’t notice any issues but of course the decoded file is no longer bit-identical to the original.

Re: HALAC (High Availability Lossless Audio Compression)

Reply #4 – 2024-01-01 12:14:17

Very nice. tl;dr is it essentially LPC with ANS for the residual? If you could release source or compile for Linux that would be great, I have trouble running .NET mono crap through wine.
Yes, a linear prediction and then 2 pieces FSE are used to encode residues. After the installation of my Linux machine is completed, I add execuable files. It is not open source at the moment, but can be evaluated according to the situation in the future. Right now, it’s very new and I have things to improve.There are also different predictors I don’t use. Some are good in high entropy and some low entropy. As I said, we are at the beginning yet.

Re: HALAC (High Availability Lossless Audio Compression)

Reply #5 – 2024-01-01 12:22:04

I wonder how much of the speed benefit comes from the codec seemingly lacking any safety checks.I compressed a WAV with metadata and the decoded file seems to have copied the header from the original file but is missing the metadata chunks, so it’s a bit invalid length wise.

And I randomly altered bits in the encoded binary data as a test, decoder didn’t notice any issues but of course the decoded file is no longer bit-identical to the original.

What you are talking about, ie data integrity control, can be achieved with a rapid Hash functions(wyhash, xxhash…). This will not have much effect on speed. Because they work extremely fast. However, no one had made such a request in my previous studies. If this is necessary, I will add it in the next version, no problem. Thanks a lot…In addition, dealing with Metadata is the next simple details. We usually do not compress them (a few kilobytes).

Last Edit: 2024-01-01 12:25:08 by Hakan Abbas

Re: HALAC (High Availability Lossless Audio Compression)

Reply #6 – 2024-01-01 12:34:48

The numbers posted suggest 3x to 5x faster than FLAC, and I get nothing of that kind. Though it is fast indeed! The decoding speeds are outright impressive given how FLAC is the fastest thing we ever saw … yet. (Only recently did the -0 encoding speeds improve.)I ran it on the corpus in my signature, and it is on par with fastest FLAC –no-md5. On a RAM disk (I use Passmark OSFmount because it is mounting software too) I had to restrict myself down to 4 albums (all classical music, this is just a brief test). After a few runs, I can report figures like these:

Encoding:
10.1 sec for flac -0r0 –no-md5 –totally-silent
10.4 sec for HALAC
11.0 sec for flac -1 –no-md5
14.4 sec for flac -0
16.1 sec for TAK -p0

Decoding:
13.8 for HALAC
16.6 for flac on the “-0r0 –no-md5” files
18.5 for TAK -p0

Sizes are impressive at the speed! File sizes for the full “signature” corpus, all FLAC and ALAC figures have had tags and padding removed
13 360 205 283 for FLAC -0r0
12 772 828 991 for FLAC -1
12 393 304 500 for HALAC

Reviews

0 %

User Score

0 ratings
Rate This

Leave your comment

Your email address will not be published. Required fields are marked *