Re: question about converting to lossless
Re: question about converting to lossless
- Subject: Re: question about converting to lossless
- From: William Stewart <email@hidden>
- Date: Mon, 19 Dec 2005 15:06:51 -0800
On 19/12/2005, at 2:33 PM, Dan Morgan wrote:
Sorry to bother the list again, but I am still having trouble with
apple lossless compression. (Our client definitely ruled out any
lossy compression algorithms due to their perception that any
lossy compression other than chopping off bits or downsampling
might not stand as evidence in a court of law.)
I ran the following test. I generated a sine wave sampled at
16kHz-16bits. I created two quicktime movie files, one straight
LPCM data and the second compressed using apple lossless via
an audio unit format converter (and AudioUnitRender). I then
used the apple quicktime player to export the uncompressed movie
as apple lossless, hence producing a second lossless compressed
movie of the same data.
It turned out that both compressed movies reproduced the
sine wave perfectly. However, the one using the audio unit got
less than 20% compression, while the one using quicktime player
export got over 60% compression.
Why would these two ways of compressing using presumably
the same algorithm get such different amounts of compression?
Its the way you set up the lossless compressor.
When you are doing it from an AU your input to the AudioConverter to
do the conversion to lossless is starting off as float 32 data.
Therefore, the audio converter thinks it has to preserve as much of
the original signal's dynamic range as possible, so is probably
configuring the Apple Lossless codec with source material at 24 or
even 32 bits (ALAC takes integer source).
When you are doing the QT movie, it is probably configuring the ALAC
encoder from 16 bit source material.
There is a property on the audio converter:
@constant kAudioConverterPropertyBitDepthHint
A UInt32 of the source bit depth to preserve. This is a hint to
some
encoders like lossless about how many bits to preserve in the
input. The
converter usually tries to preserve as many as possible, but a
lossless
encoder will do poorly if more bits are supplied than are
desired in the
output.
Set this to 16 in the AU case and you should see a similar ratio as
you see in the QT export case.
Bill
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden