HydrogenAudio

Lossless Audio Compression => Lossless / Other Codecs => Topic started by: adamgibbo on 2011-10-28 00:47:32

Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: adamgibbo on 2011-10-28 00:47:32
Quote
The Apple Lossless Audio Codec (ALAC) is an audio codec developed by Apple and supported on iPhone, iPad, most iPods, Mac and iTunes.  ALAC is a data compression method which reduces the size of audio files with no loss of information.  A decoded ALAC stream is bit-for-bit identical to the original uncompressed audio file.



The Apple Lossless Audio Codec project contains the sources for the ALAC encoder and decoder.  Also included is an example command line utility, called alacconvert, to read and write audio data to/from Core Audio Format (CAF) and WAVE files.  A description of a 'magic cookie' for use with files based on the ISO base media file format (e.g. MP4 and M4A) is included as well.



The Apple Lossless Audio Codec sources are available under the Apache license.  Details can be found here http://www.apache.org/licenses/LICENSE-2.0 (http://www.apache.org/licenses/LICENSE-2.0).


http://alac.macosforge.org/ (http://alac.macosforge.org/)
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: slothropean on 2011-10-28 01:03:30
So does this mean Apple is finally going to start offering lossless for sale on the iTunes store?
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: kwanbis on 2011-10-28 03:26:25
Excellent news!
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Ron Jones on 2011-10-28 05:56:26
This won't greatly affect Mac users, but this should be extremely helpful for Windows users. Either way, it's good to have these technologies in the open.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: _m²_ on 2011-10-28 07:41:57
Is it Apple code or something independent?
This won't greatly affect Mac users, but this should be extremely helpful for Windows users. Either way, it's good to have these technologies in the open.

Why would Windows users bother?
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Larson on 2011-10-28 07:55:34
http://alac.macosforge.org/ (http://alac.macosforge.org/)

the news has also been reported by macrumors

http://www.macrumors.com/2011/10/27/apples...ow-open-source/ (http://www.macrumors.com/2011/10/27/apples-lossless-audio-codec-alac-now-open-source/)
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: soulsearchingsun on 2011-10-28 08:30:44
Is it Apple code or something independent?

"Apple is making the Apple Lossless Audio Codec (ALAC) available as an open source project."
From macosforge (http://www.macosforge.org/post/new-project-apple-lossless-audio-codec/)

Why would Windows users bother?

Because Windows users do have iPods/iOS devices, too?
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: spoon on 2011-10-28 09:34:57
Apple is trying to position ALAC as the dominant lossless audio codec, this will potentially be to the detriment of FLAC. WMAL was going no where.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Garf on 2011-10-28 10:37:10
This won't greatly affect Mac users, but this should be extremely helpful for Windows users. Either way, it's good to have these technologies in the open.


This doesn't help anyone but Apple.

ffmpeg and libavcodec have supported ALAC decoding for approximately three years. These technologies have been in the open for a while despite Apple.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Brand on 2011-10-28 10:47:41
This looks like nothing but a business move from Apple, to enforce their own format as a/the standard. (Now it will be easier for hardware/software manufacturers to implement ALAC.)

If Apple had any regard for open (source) standards they would've just used FLAC (added support for it in iDevices/iTunes), since ALAC offers no clear technical advantages.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Agent69 on 2011-10-28 11:19:19
Personally, I appreciate Apple doing this, regardless of their motives.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Justin Ruggles on 2011-10-28 13:12:47
This won't greatly affect Mac users, but this should be extremely helpful for Windows users. Either way, it's good to have these technologies in the open.


This doesn't help anyone but Apple.

ffmpeg and libavcodec have supported ALAC decoding for approximately three years. These technologies have been in the open for a while despite Apple.

Yes, but they're reverse-engineered codecs that are incomplete and not 100% compliant due to unknown or little-known syntax elements.  It is great just to have some official documentation (which seems to be pretty good from what I've glanced at so far).  Now other implementations can ensure they're compatible.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: bubbleguuum on 2011-10-28 13:43:12
This is good news but whatever the motive of Apple is, it is a few years too late.
At least now, Android can possibly get a native ALAC decoder in a future version.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: lameboy on 2011-10-28 14:26:27
http://alac.macosforge.org/ (http://alac.macosforge.org/)

the news has also been reported by macrumors

http://www.macrumors.com/2011/10/27/apples...ow-open-source/ (http://www.macrumors.com/2011/10/27/apples-lossless-audio-codec-alac-now-open-source/)


Some people are saying on the MacRumors-forum that one of the reasons Apple developed ALAC was that it is less power-hungry than FLAC and other lossless codecs, and therefore is better to use on battery-driven iPods etc.

Any truth to this?
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Brand on 2011-10-28 14:30:48
This is good news but whatever the motive of Apple is, it is a few years too late.


It's not too late. The lossless market is still open, also in terms of formats. FLAC might be the most popular, but overall not many people care about lossless right now anyway.
Also - and this is partly based on a rumor I read a few months ago - Apple might start selling [magical] lossless music through iTunes in 2012.

Given the popularity of iTunes that could easily make ALAC the most used format. Open sourcing it is a logical step towards domination, people like open source and it's easier for manufacturers. Well, I don't know what the licensing terms were until now for ALAC implementation, if and how much manufacturers had to pay.. even if they did and Apple now loses a few bucks there (due to competing hardware), at the end of the day the main source of profit are iTunes sales, which would increase.

Why do I not like this? Mostly because ALAC is technically a redundant format and also because it would give Apple an unfair advantage, in a way (very few non-Apple devices support it right now). I'm equally bothered by Microsoft and their WMAL, but MS doesn't have the reach Apple has with iTunes.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: tuffy on 2011-10-28 15:03:50
Some people are saying on the MacRumors-forum that one of the reasons Apple developed ALAC was that it is less power-hungry than FLAC and other lossless codecs, and therefore is better to use on battery-driven iPods etc.

Any truth to this?

Not really.  ALAC's frames are a lot like FLAC's LPC subframes, so the speed of decompression is similar.  But because ALAC decoding adjusts the coefficients and Rice parameter based on the residual, it may actually be a little more CPU intensive than FLAC - which does all of that work on the encoder side.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Kohlrabi on 2011-10-28 15:04:12
Some people are saying on the MacRumors-forum that one of the reasons Apple developed ALAC was that it is less power-hungry than FLAC and other lossless codecs, and therefore is better to use on battery-driven iPods etc.

Any truth to this?

Though the ALAC decoder in rockbox is based on reverse-engineered code, and is probably not as efficient as the FLAC decoder, the codec performance comparison (http://www.rockbox.org/wiki/CodecPerformanceComparison) shows that FLAC is more efficient than ALAC on rockbox by quite a margin.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Elbart on 2011-10-28 15:12:09
Next step: AirPlay.
Then we're talking. 
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: saratoga on 2011-10-28 18:51:22
Some people are saying on the MacRumors-forum that one of the reasons Apple developed ALAC was that it is less power-hungry than FLAC and other lossless codecs, and therefore is better to use on battery-driven iPods etc.

Any truth to this?


No that is nonsense. 

Quote
Yes, but they're reverse-engineered codecs that are incomplete and not 100% compliant due to unknown or little-known syntax elements.


Source?  I haven't heard of this.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: kwanbis on 2011-10-28 19:13:38
Come on guys, stop complaining. Whatever the reason, we get a 100% open source and compatible ALAC codec from Apple itself.

A LOT of us have ipods/ipads/iphones, and they only use ALAC, not FLAC.

This IS good news.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: tuffy on 2011-10-28 19:27:09
Quote
Yes, but they're reverse-engineered codecs that are incomplete and not 100% compliant due to unknown or little-known syntax elements.


Source?  I haven't heard of this.

I know ffmpeg's reverse-engineered codec doesn't handle multichannel quite right.  If you look at its source code (http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/alac.c;h=4e143270a552e522d81477c91b92736d85cadde5;hb=HEAD), there's a 3-bit channels field on line 373, and a 3-bit "end-of-frame" marker on line 488.  But that's actually the same 3-bit field.  A value of 0 or 1 means to read another 1 or 2 channels, and a value of 7 means to stop reading frames and assemble all the channels read - a bit like how WavPack handles multichannel streams with its "initial block in sequence" and "final block in sequence" flags in the block headers.

Stuff like the decoding algorithms is likely correct, but it's good to have a reference implementation to check this sort of stuff against.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Justin Ruggles on 2011-10-28 19:36:13
Quote
Yes, but they're reverse-engineered codecs that are incomplete and not 100% compliant due to unknown or little-known syntax elements.


Source?  I haven't heard of this.

You mean you want to see the source code? Or what is the source of this information?

If you mean the latter, the source is me.  I mentored the Google Summer of Code student who implemented the FFmpeg ALAC encoder a few years ago.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: saratoga on 2011-10-28 19:42:29
No I mean a source for files that the current decoder cannot handle due to unknown syntax elements?

Reason for edit: deleting unnecessary full quotation of above post
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: googlebot on 2011-10-28 20:07:03
Quote
The Apple Lossless Format
3   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4   
5   Apple Lossless supports the following features. Not all of these are implemented in alacconvert, though they are in the codec code provided.
6   
7   1. Bit depths 16, 20, 24 and 32 bits.
8   2. Any arbitrary integer sample rate from 1 to 384,000 Hz. In theory rates up to 4,294,967,295 (2^32 - 1) Hz could be supported.
9   3. From one to eight channels are supported. Channel orders for the supported formats are described as:
10           Num Chan        Order
11           1              mono
12           2              stereo (Left, Right)
13           3              MPEG 3.0 B (Center, Left, Right)
14           4              MPEG 4.0 B (Center, Left, Right, Center Surround)
15           5              MPEG 5.0 D (Center, Left, Right, Left Surround, Right Surround)
16           6              MPEG 5.1 D (Center, Left, Right, Left Surround, Right Surround, Low Frequency Effects)
17           7              Apple AAC 6.1 (Center, Left, Right, Left Surround, Right Surround, Center Surround, Low Frequency Effects)
18           8              MPEG 7.1 B (Center, Left Center, Right Center, Left, Right, Left Surround, Right Surround,  Low Frequency Effects)
19   4. Packet size defaults to 4096 sample frames of audio per packet. Other packet sizes are certainly possible. However, non-default packet sizes are not guaranteed to work properly on all hardware devices that support Apple Lossless. Packets above 16,384 sample frames are not supported.


Quote
Within the audio domain, there are many possible subdomains. For example: low bitrate speech, high-bitrate multi-channel music, etc. FLAC itself does not target a specific subdomain but many of the default parameters of the reference encoder are tuned to CD-quality music data (i.e. 44.1kHz, 2 channel, 16 bits per sample). The effect of the encoding parameters on different kinds of audio data will be examined later.  (Official FLAC FAQ)


Which one looks better?

Quote
The FLAC and Ogg FLAC formats themselves, and their specifications, are fully open to the public to be used for any purpose (the FLAC project reserves the right to set the FLAC specification and certify compliance).


FLAC is no industry standard. There is no committee, where interested parties could participate according to an open, defined protocol. It's just a bunch of guys who created a (good) format, gave it into the public domain, and now reserve the right to certify and shape the future of the standard.

Why should Apple accept the sovereignty of outside community developers to decide whether Apple products are FLAC compliant or not? Why should they let them decide how and when they want to support multichannel and additional bitrates and whether this breaks existing Apple compatibility. What about Apple users trying to use embedded cue-sheets with meta data, there is no unambiguous definition available.

Apple wants this to just work, without users having to think about the details. And I don't see them doing a bad job concerning ALAC.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: [JAZ] on 2011-10-28 20:17:58
Come on guys, stop complaining. Whatever the reason, we get a 100% open source and compatible ALAC codec from Apple itself.


Aside of WebKit (http://en.wikipedia.org/wiki/WebKit) (which wasn't really Apple's, to start with), I don't know of any successful Open source project comming from Apple. And as a counter argument, there is the example of Darwin (http://en.wikipedia.org/wiki/Darwin_OS) / OpenDarwin (Which is delusional )

And I mean open source projects that have beneffited other than Apple itself, of course.
(Most, if not all of the applications that Apple shows in open source that Mac OS includes is precisely open source projects *incorporated* into Mac OS).
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Justin Ruggles on 2011-10-28 20:21:59
Quote
Yes, but they're reverse-engineered codecs that are incomplete and not 100% compliant due to unknown or little-known syntax elements.


Source?  I haven't heard of this.

You mean you want to see the source code? Or what is the source of this information?

If you mean the latter, the source is me.  I mentored the Google Summer of Code student who implemented the FFmpeg ALAC encoder a few years ago.


No I mean a source for files that the current decoder cannot handle due to unknown syntax elements?

Any 5.1-channel or 32-bit file, for example.  I think someone did figure out correct 5.1 behavior, but it hasn't been implemented in FFmpeg/Libav at this point.  Also, there could be breakages that haven't been reported.  At any rate, the reverse-engineered decoder did do a pretty good job of handling the vast majority of files, but having a complete implementation will be nice.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: benski on 2011-10-28 20:42:13
No I mean a source for files that the current decoder cannot handle due to unknown syntax elements?

Reason for edit: deleting unnecessary full quotation of above post


I've worked with and made changes / submitted changes to the crazney.net decoder and can definitely confirm that there are things that it doesn't handle correctly.  I plan on updating it based on the newly released code.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: googlebot on 2011-10-28 21:25:13
Webkit was a BSD and LGPL project. So Apple did not have to contribute anything to be allowed to take from it. It was a great project with good modularization and performance to begin with, but Apple's high quality contributions were really a significant reason for its take-off.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: kwanbis on 2011-10-28 21:31:07
Ok, then, so, what harm does it makes?
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: kornchild2002 on 2011-10-29 01:37:59
So does this mean Apple is finally going to start offering lossless for sale on the iTunes store?


I highly doubt Apple is going to start offering ALAC content in the iTunes Store mainly because they are about to turn the switch on for iTunes Match and that deals with lossy (256kbps AAC) audio only.  I just don't see Apple starting one lossy service only to startup a lossless one in a short amount of time.  If anything, Apple is just pushing their format beyond the constraints of their own software.  Sure, third part encoders and decoders exist but now users can rely on code directly from Apple instead of using something that may not be completely solid (dBpowerAMP's early implementation of their own ALAC encoder is a prime example).  Leave it up to people on the internet to either blindly stamp on everything Apple does only to chock it up to them trying to take over the world or mindlessly praising it as if everything from them is a gift.  I think this walks somewhere in the middle.  Yes, Apple obviously has their reasoning which will never truly get out but the positive is that the most popular portable audio player line, the most popular slate tablet, and one of the most popular smartphones out there all work with this and now others can take advantage of Apple's ALAC implementation without reverse engineering.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: funkyblue on 2011-10-29 04:55:38
I'd presume if any hardware or software that has FLAC support would add Apple Lossless support now.
Can only be good.

I personally hope for lossless iTunes. Now that would be amazing!
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Garf on 2011-10-29 12:08:55
Webkit was a BSD and LGPL project. So Apple did not have to contribute anything to be allowed to take from it.


You have been reading too much Apple propaganda.

The core components (rendering, DOM, JavaScript) were LGPL only, forcing Apple to at the very least publish the changes they needed to make to those components. The things that were BSD were stuff like the debugger and the benchmarks, i.e. the stuff that nobody cares about.

Apple published their changes to WebKit because they legally had no other choice.

Having to publish the changes to Webkit hurt Apple a lot because it allowed Google an easier entry into the browser market. You really think Apple voluntary helped one of their biggest competitors?
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: galad on 2011-10-29 13:04:04
Yes, Apple needed to publish their changes, but they could have continued to send out some massive diff files every new Safari release (with no description of what changed, how or why), like they used to do, instead of creating a public website for webkit development, a public svn repository, a community around it and accepting contribution by third-parts.

So it's a bit hypocrite to criticize Apple and Webkit by saying that they were just obliged to do what they did.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: nu774 on 2011-10-29 16:43:06
It seems Apple's reference implementation gives incorrect magic cookie on little endian host.
In function ALACEncoder::GetMagicCookie():
Code: [Select]
theChannelLayout.mChannelLayoutTag = ALACChannelLayoutTags[theConfig.numChannels - 1];
--snip---
memcpy(theCookiePointer, &theChannelLayout, sizeof(ALACAudioChannelLayout));

In the upper line, mChannelLayoutTag is set without endian conversion, then it's just copied to the magic cookie buffer.
Probably this is not what they meant, since ALACSpecificConfig part is converted to big-endian.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Justin Ruggles on 2011-10-29 17:44:08
It seems Apple's reference implementation gives incorrect magic cookie on little endian host.
In function ALACEncoder::GetMagicCookie():
Code: [Select]
theChannelLayout.mChannelLayoutTag = ALACChannelLayoutTags[theConfig.numChannels - 1];
--snip---
memcpy(theCookiePointer, &theChannelLayout, sizeof(ALACAudioChannelLayout));

In the upper line, mChannelLayoutTag is set without endian conversion, then it's just copied to the magic cookie buffer.
Probably this is not what they meant, since ALACSpecificConfig part is converted to big-endian.

You should register at macosforge and send them a bug report.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: nu774 on 2011-10-29 17:51:53
Hi,
In fact, I registered and tried it, only to see the server error like this;
Quote
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/trac/web/api.py", line 376, in send_error
    'text/html')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/trac/web/chrome.py", line 733, in render_template
    message = req.session.pop('chrome.%s.%d' % (type_, i))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/trac/web/api.py", line 195, in __getattr__
    value = self.callbacks[name](self)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/trac/web/main.py", line 265, in _get_session
    return Session(self.env, req)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/trac/web/session.py", line 162, in __init__
    self.get_session(req.authname, authenticated=True)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/trac/web/session.py", line 178, in get_session
    super(Session, self).get_session(sid, authenticated)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/trac/web/session.py", line 59, in get_session
    (sid, int(authenticated)))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/trac/db/util.py", line 64, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/trac/db/util.py", line 64, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
InternalError: current transaction is aborted, commands ignored until end of transaction block
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Justin Ruggles on 2011-10-29 18:33:08
In fact, I registered and tried it, only to see the server error like this;
Quote
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/trac/web/api.py", line 376, in send_error
    'text/html')
(snip)
InternalError: current transaction is aborted, commands ignored until end of transaction block


That's unfortunate. Maybe someone should keep a mirror repo until Apple provides a non-broken way to communicate bugs.

edit: or email one of the people who made the initial git commits
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Aramys on 2011-11-01 09:00:48
Great news, I trully hope this move from Apple means they will now switch to HD-AAC, at last !
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: LosMintos on 2011-11-01 12:40:32
A LOT of us have ipods/ipads/iphones, and they only use ALAC, not FLAC.

This IS good news.
It would have been really good news, if they had added FLAC support to those devices.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Garf on 2011-11-01 14:29:26
Great news, I trully hope this move from Apple means they will now switch to HD-AAC, at last !


ALAC doesn't have anything to do with HD-AAC.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Garf on 2011-11-01 14:37:32
Yes, Apple needed to publish their changes, but they could have continued to send out some massive diff files every new Safari release (with no description of what changed, how or why), like they used to do, instead of creating a public website for webkit development, a public svn repository, a community around it and accepting contribution by third-parts.

So it's a bit hypocrite to criticize Apple and Webkit by saying that they were just obliged to do what they did.


I pointed out your claims regarding the LGPL were false, and that Apple is legally compelled to produce the modified sources. That makes me a hypocrite?

You *are* correct in saying that Apple provided their changes in the most unproductive way possible until they started getting massive community backlash against it, and the associated bad publicity.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Aramys on 2011-11-01 14:57:12
Great news, I trully hope this move from Apple means they will now switch to HD-AAC, at last !


ALAC doesn't have anything to do with HD-AAC.


Where do you read that ALAC as something to do with HD-AAC in my post? 

Apple making gifts to the community is just so strange. I hope it means they drop ALAC to use another (very promising) tech to sell lossless on iTunes.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: googlebot on 2011-11-01 17:36:53
I'm pretty sure that Apple has something coming for lossless mid- to long-term. They have no track record for releasing open source projects, that would else end up in the trash (or transition to pure maintenance mode), without ulterior motives.

I'd think that they wait a while until there is broader, ~100% compatible support and then launch a new offer, with a decreased risk that half of the blogosphere cries "nice, but why not FLAC FFS?".
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Aramys on 2011-11-01 18:47:21
All Apple devices or whatever other brand devices able to play AAC files are compatible with HD-AAC (they'll only play the "core" lossy AAC-LC part of the file). Maybe Apple sees that ALAC will never be adopted by other makers so now could be the time to use an ISO standard, licensed technology, which is also highly compatible with the current iTunes catalog. Time will tell.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: kwanbis on 2011-11-01 18:51:47
It would have been really good news, if they had added FLAC support to those devices.

Well, LOSSLESS is LOSSLESS, so the good thing is that you can now reencode from FLAC to ALAC at the time of transfer.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: saratoga on 2011-11-01 18:57:33
It would have been really good news, if they had added FLAC support to those devices.

Well, LOSSLESS is LOSSLESS, so the good thing is that you can now reencode from FLAC to ALAC at the time of transfer.



You've been able to do this for years now.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: kwanbis on 2011-11-01 19:07:58
You've been able to do this for years now.

Right. But now with an official encoder.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: saratoga on 2011-11-01 19:11:37
You've been able to do this for years now.

Right. But now with an official encoder.


Yes, but my point is that if you're transcoding from FLAC having an official encoder changes nothing.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: kwanbis on 2011-11-01 19:32:47
Yes, but my point is that if you're transcoding from FLAC having an official encoder changes nothing.

Au contraire! It makes me sure that the ALAC i get would be totally official an 100% compatible.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: saratoga on 2011-11-01 19:48:37
Yes, but my point is that if you're transcoding from FLAC having an official encoder changes nothing.

Au contraire! It makes me sure that the ALAC i get would be totally official an 100% compatible.


Well ok it changes nothing from an audio stand point.  The warm fuzzy feeling you get is up to you
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: kwanbis on 2011-11-01 19:57:36
Well ok it changes nothing from an audio stand point.  The warm fuzzy feeling you get is up to you

I don't actually use ALAC, but in fact it does. It gives you the peace of mind that the ALAC you get, is 100% accurate. Maybe the reverse engineered version is 100% accurate also, but you never know for sure, and somebody already mentioned there was a problem with the FFMPEG implementation IIRC.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: saratoga on 2011-11-01 20:28:17
Err, you never know for sure that any code is bug free.  As far as well know both encoders are lossless because everything they've encoded so far has been lossless, but that doesn't mean no bugs exist.  So no it doesn't give that peace of mind, or if it does you're mistaken.  If you want to know for sure, just verify that encoded file matches the input.  This is trivial for lossless files and if its important to you then you should be doing it.

But anyway, my point was that for the situation you described (transcoding flac for use on an ipod), nothing at all has changed.  Before you could trancode and be 100% sure the conversion was lossless (by checking) and afterwards you can continue to do the same (again, by checking). 

I don't understand why you're having some much trouble understanding this.  It seems pretty obvious to me
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: marc2003 on 2011-11-01 20:38:22
Au contraire! It makes me sure that the ALAC i get would be totally official an 100% compatible.


erm.... http://sites.google.com/site/qaacpage/ (http://sites.google.com/site/qaacpage/)

Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Elbart on 2011-11-01 21:38:04
I'm pretty sure that Apple has something coming for lossless mid- to long-term. They have no track record for releasing open source projects, that would else end up in the trash (or transition to pure maintenance mode), without ulterior motives.

AirPlay is using ALAC... 
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Phixion on 2011-11-01 21:55:21
Can anyone point me in the direction of the new open source encoder for Windows please?

I know the source is @ http://alac.macosforge.org/ (http://alac.macosforge.org/) but I have no idea how to compile it and every google search leads me to the old, reverse engineered ALAC codec.

Many thanks.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Gregory S. Chudov on 2011-11-01 22:49:14
Well, i did compile it, but the command line utility that comes with the library is not very useful - it only produces .caf format files, doesn't accept stdin for input and doesn't have any options. I have no idea if it works at all.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: kode54 on 2011-11-01 23:10:09
Well, i did compile it, but the command line utility that comes with the library is not very useful - it only produces .caf format files, doesn't accept stdin for input and doesn't have any options. I have no idea if it works at all.

I have verified that .caf files produced by the utility play in QuickTime X on OS X, but they don't play in iTunes.

Also, it would have been nice to know a way to check out the source with git or some other utility. I ended up downloading it file by file after I got the base download-in-original-format link from their Trac source browser.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Gregory S. Chudov on 2011-11-01 23:25:29
You can check it out with SVN from here: http://svn.macosforge.org/repository/alac/trunk (http://svn.macosforge.org/repository/alac/trunk)
For some reason this link doesn't appear anywhere on their site
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: jfb on 2011-11-03 23:13:45
It seems Apple's reference implementation gives incorrect magic cookie on little endian host.
In function ALACEncoder::GetMagicCookie():
Code: [Select]
theChannelLayout.mChannelLayoutTag = ALACChannelLayoutTags[theConfig.numChannels - 1];
--snip---
memcpy(theCookiePointer, &theChannelLayout, sizeof(ALACAudioChannelLayout));
In the upper line, mChannelLayoutTag is set without endian conversion, then it's just copied to the magic cookie buffer.
Probably this is not what they meant, since ALACSpecificConfig part is converted to big-endian.
I'm not seeing this; in the source, the mChannelLayoutTag is only set if the number of channels is > 2.  For a stereo bitstream, there's no layout tag.  But ffmpeg is still reading the header incorrectly, I think --

(from libavformat/cafdec.c:read_kuki_chunk()):

Code: [Select]
    } else if (st->codec->codec_id == CODEC_ID_ALAC) {
#define ALAC_PREAMBLE 12
#define ALAC_HEADER  36
        if (size < ALAC_PREAMBLE + ALAC_HEADER) {
            av_log(s, AV_LOG_ERROR, "invalid ALAC magic cookie\n");
            avio_skip(pb, size);
            return AVERROR_INVALIDDATA;
        }
I don't think those numbers are correct: the ALAC_PREAMBLE, (which I take to mean 'k' 'u' 'k' 'i' 00 00 00 00 00 00 00 18) is twelve bytes long; and ALAC_HEADER?  Is this supposed to be the contents of the kuki chunk?  Because that's a static size of sizeof(ALACSpecificConfig) for mono and stereo tracks, which is … 24 bytes.  I'm not seeing where this 48 byte minimum size requirement is coming from?  Regardless, this is a variable size -- if there are more than two channels, the size of the cookie payload is variable.  I think this ffmpeg code is just wrong.  Investigating further.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Ron Jones on 2011-11-04 03:28:13
This doesn't help anyone but Apple. ffmpeg and libavcodec have supported ALAC decoding for approximately three years. These technologies have been in the open for a while despite Apple.

When it comes to coded audio formats, decoding is approximately half the battle. The options available for ALAC encoding on Windows are quite limited, for obvious reasons.

Given the nature of this technology and the current climate of lossless audio codecs, I don't see this as genuinely benefitting Apple to any great extent. If there's some major win they get out of this open sourcing, I couldn't describe what that major win could be.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Xenion on 2011-11-04 12:26:26
Au contraire! It makes me sure that the ALAC i get would be totally official an 100% compatible.


erm.... http://sites.google.com/site/qaacpage/ (http://sites.google.com/site/qaacpage/)


which uses refalac now, exactly.
before apple opened the source of alac it relied on quicktime which gives you no guarantee of being a working solution in the future because of changes in quicktime making it incompatible with unsupported 3rd-party software.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Xenion on 2011-11-04 14:58:15
Since it's opensource now, someone might compile a binary that is useable with EAC or any other CD-ripper. For people who share lossless audiolibraries on heterogeneous networks alac might be a good choice since mac users often prefer itunes (and alac is the only lossless format itunes can deal with)
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: saratoga on 2011-11-04 15:41:07
Since it's opensource now, someone might compile a binary that is useable with EAC or any other CD-ripper. For people who share lossless audiolibraries on heterogeneous networks alac might be a good choice since mac users often prefer itunes (and alac is the only lossless format itunes can deal with)


To be clear, you are aware that its been open source for years, and that people already have compiled a binary usable with EAC or any other CD-ripper, right?
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: kwanbis on 2011-11-04 17:55:04
Since it's opensource now, someone might compile a binary that is useable with EAC or any other CD-ripper. For people who share lossless audiolibraries on heterogeneous networks alac might be a good choice since mac users often prefer itunes (and alac is the only lossless format itunes can deal with).

Spoon would be able to implement a official ALAC encoder now

To be clear, you are aware that its been open source for years, and that people already have compiled a binary usable with EAC or any other CD-ripper, right?

The apple alac encoder/decoder?
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: spoon on 2011-11-04 19:19:44
Cue Microsoft in 3..2..1?
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Elbart on 2011-11-04 21:21:47
Since it's opensource now, someone might compile a binary that is useable with EAC or any other CD-ripper. For people who share lossless audiolibraries on heterogeneous networks alac might be a good choice since mac users often prefer itunes (and alac is the only lossless format itunes can deal with)

Doesn't it need to be ported over first? Would be surprised if they made it multi-plat from the get-go.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: JunkieXL on 2011-11-04 23:38:49
You need to read this thread more closely.  We are talking about Apple releasing their source code.  Not some 3rd party that reverse engineered the ALAC codec.  I also stated that above if you had read it.
JXL
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: hellokeith on 2011-11-05 03:47:16
Cue Microsoft in 3..2..1?

The only folks left in Windows Media are the Expression Encoder group.  EE4 (free version) doesn't support AAC-LC output, so I doubt they'd be interested in this.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: spoon on 2011-11-05 07:54:33
Not MS supporting alac rather to release wmal as os
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: saratoga on 2011-11-05 18:44:06
We are talking about Apple releasing their source code.  Not some 3rd party that reverse engineered the ALAC codec.  I also stated that above if you had read it.


I know what you are talking about.  I didn't quote you because I was referring to Xenon's post rather then yours:

Quote
Since it's opensource now, someone might compile a binary that is useable with EAC or any other CD-ripper. For people who share lossless audiolibraries on heterogeneous networks alac might be a good choice since mac users often prefer itunes (and alac is the only lossless format itunes can deal with)


Theres already an open source encoder available that you can use with EAC.  Hence my point that theres already an open source encoder that you can use with EAC.  I realize that you made a different post above about a different thing, but since I was not referring to it, I did not quote it. 

Is that clear?
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Destroid on 2011-11-08 00:21:40
Well, of course everything Apple is lame and Steve was the icon of a-holiness and his best iFollowers kept his brain and his ding-dong alive in jar. (btw, this is a sarcastic joke)

Ok, seriously I'll bench the official ALAC encoder because I also was a little put-off by the unofficial encoder and its reputation of not being error-proof. I just don't think I'll see any dazzling scores from it, probably a bit better than FLAC compression wise with slower encode speeds. To what niche does ALAC have outside Apple products? I can't say and wouldn't predict it to catch on too quick, FLAC has quite a bit more notoriety at the present.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Wombat on 2011-11-08 01:06:42
Ok, seriously I'll bench the official ALAC encoder because I also was a little put-off by the unofficial encoder and its reputation of not being error-proof. I just don't think I'll see any dazzling scores from it, probably a bit better than FLAC compression wise with slower encode speeds. To what niche does ALAC have outside Apple products? I can't say and wouldn't predict it to catch on too quick, FLAC has quite a bit more notoriety at the present.

We won´t see much better compression. Gregory Chudov´s libalac already maxes out what ALAC can archieve at best. Its compression is better as the standard flac 1.21 but also worse as libflake/FlacCL from Gregory.
At least on my testcorpus. On some material ALAC is much worse like Lossywav or with empty bits in files.
I already asked Gregory if we can expect better compression from this source code and the answer wasn´t positive.
When i remember right there was some speculation about wasted bits ability of ALAC but now that the code is open there isn´t something to expect in that direction.
Besides that when you got used to GPU encoding with FlacCL most other codecs are slow. Wanting the tiny bit better high compression from libalac already needs much processing power and ALAC is not good for GPU.

Also i wonder why ALAC on the lossless wiki is said to decode "very fast". On my machine the foobar decoding test shows it at half the speed a flac -8 file decompresses at best.
Even alacConvert.exe decoding the *.caf file is much slower.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: jukkap on 2011-11-09 07:05:03
probably a bit better than FLAC compression wise with slower encode speeds.


I've found out that Apple's ALAC encoder is extremely fast encoder. I compiled Apple ALAC with Intel C++ max optimized. I'll do better ALAC vs. FLAC comparison later.

The Apple's reference ALAC encoder reads/writes the files in too short blocks and it slows down dramatically its performance.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: spoon on 2011-11-09 09:51:47
Quote
Either way you look at it, there is little reason for Apple to start selling ALAC files other than to appeal to a relatively small group of people.


When selling anything you need to keep ahead of the game, if Apple have the bandwidth + eco system to do so, it would not negatively impact them, rather it would put unexpected costs onto Amazon, etc to keep up with the game. Apple would put up a page explaining to Joe Public that the new offering (only costing 30c to upgrade your existing m4a purchases to) is the highest CD quality, where as the existing stuff purchased has less quality, people are not going to do listening tests, they would pay the 30c per track and Apple would have 12 months of healthy increased revenue (plus the lossless tracks would likely cost more also).
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Wombat on 2011-11-09 14:12:22
probably a bit better than FLAC compression wise with slower encode speeds.


I've found out that Apple's ALAC encoder is extremely fast encoder. I compiled Apple ALAC with Intel C++ max optimized. I'll do better ALAC vs. FLAC comparison later.

The Apple's reference ALAC encoder reads/writes the files in too short blocks and it slows down dramatically its performance.

Apple´s default compression must be pretty lousy likle between -3 and -4 for flac
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: tuffy on 2011-11-09 16:09:45

I've found out that Apple's ALAC encoder is extremely fast encoder. I compiled Apple ALAC with Intel C++ max optimized. I'll do better ALAC vs. FLAC comparison later.

The Apple's reference ALAC encoder reads/writes the files in too short blocks and it slows down dramatically its performance.

Apple´s default compression must be pretty lousy likle between -3 and -4 for flac

FLAC has a lot of tunable parameters in each frame.  At the higher compression presets, it tries every combination of parameters per frame and writes out the smallest frame it can find.  This is why it parallelizes really well.  An encoder can pass off all those searches to their own threads and run them all simultaneously.

ALAC, on the other hand, has very few tunable parameters.  Files compatible with iTunes support only a handful of channel correlation possibilities, and LPC parameter counts of 4 or 8.  Everything else is fixed, relying on its adaptiveness to take up the slack I suppose.  So because it's not trying out so many options, it compresses relatively quickly.  But that also means it can't compress as well as FLAC.  And that same adaptiveness means its can't decompress as quickly as FLAC.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Destroid on 2011-11-10 08:55:18
So now the capsule summary of ALAC appears to be faster but weaker compression and not as easily decoded compared to FLAC (I guess from a -5 perspective).

Maybe some more tests can show its how well ALAC deals with mono vs. stereo as well as the single instruments vs. CD albums and that I usually try, but the question is what kind of binaries are there to try?
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: lvqcl on 2011-11-10 15:57:52
Some time ago I tested several lossless encoders:

FLAC 1.2.1: 187x realtime at -4 compression option, 147x at -5.
iTunes x64 10.5: ~100x realtime
refalac 0.04: 77x realtime (and 130x in fast mode)
FFmpeg ALAC: 124x realtime

So current ALAC encoders are slower than FLAC.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Wombat on 2011-11-10 16:09:04
So now the capsule summary of ALAC appears to be faster but weaker compression and not as easily decoded compared to FLAC (I guess from a -5 perspective).

Maybe some more tests can show its how well ALAC deals with mono vs. stereo as well as the single instruments vs. CD albums and that I usually try, but the question is what kind of binaries are there to try?

ALAC isn´t faster as flac -4 here and compresses worse but i didn´t do exact tests and i won´t because i don´t have much interest in ALAC. Decoding of ALAC is always much slower.
On my system the foobar "Decoding Speed Test" plugin, decoding in RAM is ~150x for ALAC and ~600x for flac -8, maybe someone can check against.

Now Gregory Chudov´s compressors are completely different beasts. His libalac can compress to around the same size or slightly better as flac 1.21 but at an immense speed penalty. 15x on a C2@3400.
Since libalac has the ability to use a compression value from 1 to 10 someone may find a sweet spot.
Modern graphics cards and OS´s should all be capable of using OpenCL and here FlacCL from Gregory can encode ~500x speed with higher compression as flac 1.21. For non-OpenCL systems his libflake archieves the same compression at ~50x speed here.
I think with both compressors Mr. Chudov maxed pretty much out the possible.

Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: lvqcl on 2011-11-10 17:06:10
Results of my lossless encoding tests:
Encoding speed (x realtime) vs. compression ratio (encoded file size / original file size):

(http://img443.imageshack.us/img443/1888/clipboard01io.png)
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Wombat on 2011-11-10 18:31:52
Nice graph, thanks. To be really complete and fair it should contain Cuetools libflake or FlacCL imho since it has Cueetools ALAC.

Edit: with fair i mean this graph suggests ALAC can compress better as flac but in reality it only does because of the effort of the programmer. It should only be fair to use the corresponding flac encoder coming from the same synapses.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: googlebot on 2011-11-10 21:27:18
So about how much difference in storage costs are we talking here, for a 10000 track collection, with the presented encoding efficiencies? $0.50? The playback ecosystem is much more important.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Wombat on 2011-11-10 21:37:44
So about how much difference in storage costs are we talking here, for a 10000 track collection, with the presented encoding efficiencies? $0.50? The playback ecosystem is much more important.

Oh, sorry. i thought if we talk about ALAC we can go into detail. I wonder what hydrogenaudio stands for after all. It isn´t about storage cost i hope.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: bennie on 2011-11-16 17:20:48
Hi all,

First post after lurking for a while  Thanks for this lovely and very helpful community!

Does anyone know the correct value of the ALAC coefficients in order to produce bit-identical ALAC/CAF files with this official tool compared with the ones produced with iTunes? This seems to have a little  impact on filesize as well (i.e. "max coded framesize" is smaller with the official tool). I searched the internet but have not found any documentation about this. Hope someone who is more knowledgeable has some clues?
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Destroid on 2011-11-21 09:21:04
@lvqcl - I saw your post in the FB2K 1.1.10 beta thread (http://www.hydrogenaudio.org/forums/index.php?showtopic=91922&hl=#)
foo_input_alac 1.0.7: 121x realtime ALAC decoding speed
fb2k 1.1.10b1: 221x realtime.

and ffmpeg x64 (libavcodec 53.28.0): 167x realtime.

I am surprised at the native ALAC performance being better than originally expected. Any guess to why native ALAC did so well (other than the brilliant FB2K programmers' prowess  )?

edit: found answer to one of my own questions, my bad.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: lvqcl on 2011-11-21 14:56:46
BTW, refalac (http://sites.google.com/site/qaacpage) 0.12 decoding speed: 198x realtime.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Peter on 2011-11-22 08:19:51
Sadly this new decoder has multiple security issues:
- Missing input range checks lead to various out of range reads (no more harmful than just crashing the application), some of these might be triggerable on legit undamaged files, since functions such as dyn_get_32bit() will read more bytes from the input buffer than they really care about.
- "Partial frame" feature will happily cause arbitrary number of samples to be read from the file, possibly greater than the caller expects, writing past the buffer allocated by the caller. This one may be exploitable.

At least I see that iTunes itself cannot be too easily crashed with these, I guess they outsource decoding to external processes where these behaviors are acceptable-enough.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Justin Ruggles on 2011-11-22 12:54:59
Concerning what Apple had to gain from open sourcing their ALAC code... people finding bugs like this their software is ultimately a benefit to Apple. All software has bugs. Many pieces of software have some potential security vulnerabilities. Getting the public to find these for you for free saves money.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: neovibe on 2011-12-09 12:59:07
Hi all,

I am a big user of CUETools + libalac (to convert from FLAC to my apple ecosystem) and although I can't quite keep up to your technical knowledge, I'd like to know if it is foreseen that programs using libalac would move to the code made available by apple.

I am not aware of the differences (regarding the resulting file) but for the sake of future compatibility and general... harmonization, would you all agree that the apple code will be the only one used from here on?

Or is no one even looking into implementing this one instead of the reverse engineered options?

And again, no matter the future, thank you all that have taken the time to make something that makes the life of thousands of people easier without asking nothing in return.
(lame thanks I know, but it's due)

cheers everyone.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: tuffy on 2011-12-09 13:36:49
I am not aware of the differences (regarding the resulting file) but for the sake of future compatibility and general... harmonization, would you all agree that the apple code will be the only one used from here on?

Or is no one even looking into implementing this one instead of the reverse engineered options?

I doubt anyone would use this code as-is.  It's not like libflac or libwavpack, with lots of documentation and easy to hook into other programs.  Even Apple is probably using a slightly different implementation in iTunes.  But it is useful as a reference to ensure that other encoders and decoders are handling files in a compatible way.  And in lieu of any formal standard, that will have to do.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Wombat on 2011-12-09 13:58:10
Hi all,

I am a big user of CUETools + libalac (to convert from FLAC to my apple ecosystem) and although I can't quite keep up to your technical knowledge, I'd like to know if it is foreseen that programs using libalac would move to the code made available by apple.

I am not aware of the differences (regarding the resulting file) but for the sake of future compatibility and general... harmonization, would you all agree that the apple code will be the only one used from here on?

Or is no one even looking into implementing this one instead of the reverse engineered options?


If i was the coder of libalac and did it with better compression in mind as the apple default i wouldn´t change anything. I am not aware of any non-compliant files it creates.
I may even ask you, as user to find any file that doesn´t work like it should and correct the code. Since this didn´t happen afaik nothing needs to be changed imho.

Help with your usage to improve the existing code with finding problem samples but don´t ask the coder to throw away his code.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: neovibe on 2011-12-09 14:59:05
I may even ask you, as user to find any file that doesn´t work like it should and correct the code. Since this didn´t happen afaik nothing needs to be changed imho.

Help with your usage to improve the existing code with finding problem samples but don´t ask the coder to throw away his code.


I am not proposing anyone to throw away anything. Thats exactly what I'm asking: is there any real technical advantage in using the apple code at all?
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Wombat on 2011-12-09 15:34:52
I may even ask you, as user to find any file that doesn´t work like it should and correct the code. Since this didn´t happen afaik nothing needs to be changed imho.

Help with your usage to improve the existing code with finding problem samples but don´t ask the coder to throw away his code.


I am not proposing anyone to throw away anything. Thats exactly what I'm asking: is there any real technical advantage in using the apple code at all?

In another thread i already asked Gregory Chudov, the Cuetools developer if there are new insights from this apple code. There aren´t for compressing.
On the decoding side there seems to be a faster implementation used in foobar already.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Peter on 2011-12-10 14:36:03
I've published my bug-fixed version of Apple's library:
http://perkele.cc/software/ALAC (http://perkele.cc/software/ALAC)
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: nu774 on 2011-12-10 15:26:22
I've published my bug-fixed version of Apple's library:
http://perkele.cc/software/ALAC (http://perkele.cc/software/ALAC)

That's nice, thank you for opening it...
Quote
* MSVC/Windows compatibility fixes (MSVC does not like "static inline").

I was just using ugly -D inline=_inline to shut them up (C99 "inline" is not usable in MSVC, but it does support MSVC specific "_inline" keyword for C) .
It seems compiling as C++ (with -Tp) works, too.

By the way, mp4aac.[ch] (not in the original distribution) is included intentionally? Seems like spoontypes.h is missing.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: Peter on 2011-12-10 15:29:09
By the way, mp4aac.[ch] (not in the original distribution) is included intentionally? Seems like spoontypes.h is missing.

Oops, it wasn't meant to go in there. Thanks for pointing, fixed now.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: kode54 on 2011-12-10 20:21:33
To save 5 seconds of Googling, here's a reference article that may be useful for applying that compiler intrinsic change for GCC as well:

How to use MSVC intrinsics to get the equivalent of this gcc code (http://stackoverflow.com/questions/355967/how-to-use-msvc-intrinsics-to-get-the-equivalent-of-this-gcc-code), only in reverse. Handy bit mangling C version included as well, probably faster than doing a for loop over the entire number, especially considering all the branches that would involve.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: nu774 on 2011-12-21 05:34:10
Have found another bug in Apple implementation.
http://alac.macosforge.org/trac/ticket/8 (http://alac.macosforge.org/trac/ticket/8)

Apparently they are not using this implementation themselves, since encoder of CoreAudioToolbox doesn't suffer from these channel layout bugs, and returns proper magic cookies.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: jukkap on 2011-12-21 10:41:23
I've published my bug-fixed version of Apple's library:
http://perkele.cc/software/ALAC (http://perkele.cc/software/ALAC)


That's great work ! Thanks.

(I am now complete-testing the new fixed version)
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: k.eight.a on 2012-09-30 16:21:37
I've read the whole thread. I thought I'd be able to find a command line decoder that benefits from the officialy open-sourced Apple Lossless Audio Codec.
If I understand correctly, so far there is none.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: saratoga on 2012-09-30 18:06:46
I've read the whole thread. I thought I'd be able to find a command line decoder that benefits from the officialy open-sourced Apple Lossless Audio Codec.
If I understand correctly, so far there is none.


https://sites.google.com/site/qaacpage/cabi...rects=0&d=1 (https://sites.google.com/site/qaacpage/cabinet/qaac_1.41.zip?attredirects=0&d=1)
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: k.eight.a on 2012-09-30 19:13:40
@ saratoga: Thanks.  I've already found this page (https://sites.google.com/site/qaacpage/) but not read quite carefully to find it out (https://sites.google.com/site/qaacpage/news/qaacrelease094).
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: lameboy on 2012-09-30 20:37:32
I've read the whole thread. I thought I'd be able to find a command line decoder that benefits from the officialy open-sourced Apple Lossless Audio Codec.
If I understand correctly, so far there is none.


https://github.com/nu774/qaac/wiki/refalac-usage (https://github.com/nu774/qaac/wiki/refalac-usage)
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: lameboy on 2013-03-30 11:45:35
Hi!

Does anyone know if FFMPEG and/or AVLIB's ALAC encoder is the reference implementation released by Apple in october 2011, or do they still use a reverse engineered one from pre-2011?

(yes, I know about the "refalac"-encoder, but that one is Windows only.)



Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: skamp on 2013-03-30 11:54:25
refalac works with Wine.
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: marc2003 on 2013-03-30 12:00:15
a quick google found this: https://ffmpeg.org/trac/ffmpeg/ticket/858 (https://ffmpeg.org/trac/ffmpeg/ticket/858)
Title: Apple Lossless Audio Codec is now open source (Apache license)
Post by: saratoga on 2013-03-30 16:54:13
Does anyone know if FFMPEG and/or AVLIB's ALAC encoder is the reference implementation released by Apple in october 2011,


ffmpeg does not use reference implementations in general, so I doubt they would ever do this.