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: HALAC (High Availability Lossless Audio Compression) (Read 20731 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

Re: HALAC (High Availability Lossless Audio Compression)

Reply #100
Very initial HALAC input component for foobar2000: https://foobar.hyv.fi/foo_input_halac.fb2k-component.

Couple of warnings:
The input library is very basic and only supports loading files by file path, and the path is given in ANSI codepage so characters needing unicode won't work.

As the library forces decoding the entire file to memory large files will need a lot of RAM. But the library won't be able to handle very big files as it addresses size with 32-bit integer.

The library doesn't seem to have any error checking. Feeding it a path that doesn't exist makes the host program (foobar2000) crash. Trying to load corrupted/invalid HALAC file makes the host program crash.

Edit: and based on the DLL name I believe AVX is required. And since there is only 64-bit DLL available this version of the component only works on 64-bit foobar2000.


Re: HALAC (High Availability Lossless Audio Compression)

Reply #102
The comment of everyone who comments is valuable to me. @mudlord , @Kraeved
As of now, HALAC is still in the development phase. The newest of other lossless codec except HALAC is close to 20 years of age. As I find time now, I try to establish the compression ratio/speed balance. I can see that there is a gap here.
When my improvements are over, it can be a codec that everyone can use. However, there is a lot of structural changes at the moment. And this is not very suitable for general use. However, 0.2.7 can now be encoded, decoded and listened to, albeit experimentally.

@Case
Thank you so much for foobar2000, Case. I have no desire to develop a new player. I just wanted to show that HALAC files can be listened to. So I prepared a very simple DLL.
  • I usually work as ANSI. Yes, Unicode support can also be added. I will have to make some change for this.
  • Decoded data in terms of convenience are returned as a single WAV. However, I can do this in the form of frames (up to 1 MB). However, in this case, the relevant Players should also use the data in pieces. I did not want to deal with it in the Player I have developed for now.
  • Since the maximum size of the WAV files was u32 bit, I didn't need more. This can be increased, no problem.
  • I need to add error controls, especially version control. It is true that I have ignored this stage a little.
  • I added the SSE2 version of DLL to Github. However, I have never needed 32 bit until now. If necessary, I can also compile 32 bit. But considering the whole structure, of course, there will be things I need to change. Therefore, the subject of 32 bit is less priority for me for now.

Re: HALAC (High Availability Lossless Audio Compression)

Reply #103
Best option for API would be not to rely on filenames at all. Most libraries allow setting callback functions - you just give pointer to simple functions for reading and seeking and other features API might need. Another option would be to use memory pointers for data exchange.

Not relying on filenames would for example mean that foobar component would automatically get support for playing HALACs over internet and from archives. And features like full file buffering or prebuffering parts of future tracks would work.

And partial decoding is of course very important for realtime playback. Decoding entire track in advance not only requires way too much memory, but it can also means a long delay for track changes potentially breaking gapless playback.

For playback use it would also make sense to have some way to report the audio data specs to the player and just give the audio data to it. My component now includes parser for WAV, RF64, BW64 and W64 formats just in case such things pop out of HALAC so that it can play them. It's not nice to outsource these things for the player.

Oh yeah, and you should specify what calling convention the functions use. Now they seem to depend on compiler defauls.

Re: HALAC (High Availability Lossless Audio Compression)

Reply #104
I added the SSE2 version of DLL to Github.

@Case, please, update your Foobar2000 component accordingly.
• Join our efforts to make Helix MP3 encoder great again
• Opus complexity & qAAC dependence on Apple is an aberration from Vorbis & Musepack breakthroughs
• Let's pray that D. Bryant improve WavPack hybrid, C. Helmrich update FSLAC, M. van Beurden teach FLAC to handle non-audio data

Re: HALAC (High Availability Lossless Audio Compression)

Reply #105
The foobar component now includes both SSE2 and AVX libraries and it will use the one supported by the CPU.

Re: HALAC (High Availability Lossless Audio Compression)

Reply #106
Foobar2000 2.1.4 with Case's component (442 550 bytes) crashed upon adding HALAC file to the playlist.

Source PCM WAV 44.1 kHz 16 bit stereo was compressed using HALAC 0.2.6 SSE2.

Code: [Select]
$ halac_encode_v.0.2.6_mt_sse2.exe sacrifice01.wav sacrifice.halac

$ halac_decode_v.0.2.6_mt_sse2.exe sacrifice.halac sacrifice02.wav

$ xxhsum.exe *.wav
0ebdb0d5ad93a94e  sacrifice01.wav
0ebdb0d5ad93a94e  sacrifice02.wav
• Join our efforts to make Helix MP3 encoder great again
• Opus complexity & qAAC dependence on Apple is an aberration from Vorbis & Musepack breakthroughs
• Let's pray that D. Bryant improve WavPack hybrid, C. Helmrich update FSLAC, M. van Beurden teach FLAC to handle non-audio data

Re: HALAC (High Availability Lossless Audio Compression)

Reply #107
That is what I warned about. The error handling leaves a lot to be desired and causes the host program to crash too. The demo HALAC Player crashes similarly. And the 0.2.7 decoder exe fails to decode the file too, creates a zero byte wav file.

If this was a final piece of decoder library with no hope of getting improvements, I could isolate it in a different process. But I hope things will improve so that such drastic measurements aren't necessary. The isolation layer adds more complexity and also introduces performance penalty.

Re: HALAC (High Availability Lossless Audio Compression)

Reply #108
@Kraeved; I have already mentioned that Player only works with Halac 0.2.7. Also, I did not specify this with an error message. For the next version, I will add this measure to both Decoder and DLL. OK.

Thank you very much for your great suggestions, Case. Such comments are really necessary.
Best option for API would be not to rely on filenames at all.
DLL/SO will not deal with file operations. OK.

And partial decoding is of course very important for realtime playback.
DLL/SE should only take memory address, frame number and data length. OK.

My component now includes parser for WAV, RF64, BW64 and W64 formats just in case such things pop out of HALAC so that it can play them.
DLL/SO should give us the necessary information such as header(channel count, bit rate...) and metadata. OK.

Oh yeah, and you should specify what calling convention the functions use.
This should be more important especially for Windows. OK.

I will add them in the next version. If I need to repeat, these are the usual problems in the software process and the solution can be produced quickly. However, I need to focus on what I need to focus on (speed, ratio, prediction, entropy ...).

Re: HALAC (High Availability Lossless Audio Compression)

Reply #109
When my improvements are over, it can be a codec that everyone can use.

Yep. I tried explaining to Kraevad that sometimes up until that point, a project is not for everyone *or anyone* at all, and that its purely a prototype. Like I have some personal projects which still have things cooking or I don't feel are up to any sort of standard that I feel comfortable to be public, so things like widespread vectorization/threading or even GPU support are not there yet, so I stick to SSE4/AVX2/NEON/GL4.6 until that time comes, because I am more focused on getting things working *at all* rather than any semblance of widespread appeal.

Re: HALAC (High Availability Lossless Audio Compression)

Reply #110
Since there is still no updated decoder DLL I sandboxed the process and added support for 32-bit foobar2000 while at it. Since the DLLs are only 64-bit the 32-bit component won't be able to decode anything unless the OS is also 64-bit.
And I listed the component on my component page: https://foobar.hyv.fi/?view=foo_input_halac

Re: HALAC (High Availability Lossless Audio Compression)

Reply #111
Since there is still no updated decoder DLL I sandboxed the process and added support for 32-bit foobar2000 while at it. Since the DLLs are only 64-bit the 32-bit component won't be able to decode anything unless the OS is also 64-bit.
And I listed the component on my component page: https://foobar.hyv.fi/?view=foo_input_halac
Thank you very much for your interest in the topic and for what you have done. You are great.
I have uploaded the 32-bit compiled versions of the Encoder and Decoder from version 0.2.7 to Github as SSE2 and AVX. The 32-bit version may experience slightly loss of speed during the Encode stage.

I'm trying to prepare the things I get notes for the 0.2.8 DLL version (Windows/Linux). And since the DLL will be independent of the file and the file path, Player will now have multiple language support.

X