Hi Vladimir,
On 2/10/2012 9:34 AM, Vladimir Vassilevsky wrote:
> Don Y wrote:
>> I'm looking some pointers concerning the design of lossless
>> audio (plus "silence") codecs.
> The design is trivial: backwards adaptive predictor followed by
> conventional Huffman coder.
If it was "trivial", one-size-fits-all, someone would have
designed, patented, and commercialized it -- and retired
to some sunny beach to drink "tuna" coladas and watch
cute young things frolick in the surf.
The fact that there are so many different CODECs testifies to
the non-triviality of the task.
>> I want to deploy these on either end of a packet switched
>> network (coder at server, decoder at client). I.e., they
>> are intended primarily for communication bandwidth reduction.
> Loseless audio compressor is hardly useful in this scenario, as it does
> not guarantee a fixed bandwidth.
It doesn't *have* to guarantee a fixed bandwidth. It just has to
nominally afford some reduction in required bandwidth to offset
the implementation cost.
>> The decoder needs to be *fast*.
> Then omit backward adaptation. Transmit forward prediction coefficients
> over the channel.
>> [[[Note: I am targeting general purpose MCU's, not DSP's!]]]
> Like what, for example?
Like whatever the implementor decides is appropriate! If
you can't design hardware, you might port it to a PC platform.
If you've got a DSP in an existing product, port it there.
Etc.
Tying an implementation to a particular hardware platform is
"premature optimization". Figure out what needs to be done
(with your best effort) and use that to determine the minimum
requirements for any hosting platform.
>> Smaller frame sizes are better than larger ones (requires
>> less resources to hold in the client WHILE CONSUMING). And,
>> bigger frames mean bigger packets mean supporting fragmentation
>> and reassembly in the protocol stack, etc. Alternatively,
>> makes the data stream more sensitive to dropped fragments.
> That's irrelevant.
> Large buffers will be needed to cope with the variable data rate.
No. The model that you chose for the coder (and thus, decoder)
determines the resources that will be needed.
Silly example:
You're going to be passing (pure) sine waves down the wire.
I can encode that as 4 values: amplitude, frequency, phase
and duration.
The decoder can take those four values and reconstruct an
equivalent sine wave with almost *0* resources at its
disposal.
This is why the knowledge of folks with first-hand experience
is worthwhile. What models work best in which circumstances, etc.
An encoder for speech is not going to be as effective encoding
"music". (speech has lots of silence). OTOH, it might work
well encoding a (single) *singer*.
>> The type of source material shouldn't have a dramatic effect on
>> the efficiency or cost of either coder or decoder (speech, music,
>> etc. -- don't worry about "white/pink/chartreuse/etc noise")
> The compression ratio is going to be only about 50% or so.
> Then why bother about compression at all?
Because compressing is cheaper than running another wire or
upgrading the communications fabric to handle higher bandwidths.
Save a dollar on the processor and spend thousands on more cable?
>> From some observations of existing CODECS (open and proprietary):
>> All try to encapsulate a variety of different source formats:
>> bits per sample, samples per second, seek points, tags, etc.
>> All try to apply different compression strategies which are
>> then encoded in the data stream.
> The codecs are LOSELESS. Once the session is started, you can't drop any
> data.
That doesn't directly depend on the strategy used in doing the
compression. Rather, that depends on how the protocol handles
errors/dropouts.
OTOH, a CODEC that has to handle music *and* speech might chose
to use different strategies to represent that data based on its
knowledge/examination of the data stream.
>> Most seem to treat the source material as discrete "sessions"
>> (song 1, song 2, etc.) instead of an endless *stream* of content.
> So you will have to parse the uninterruptible stream from very beginning
> in the last year. If you loose a packet, you are lost.
No. Only if the coder stores no "absolute state" in the data stream.
This doesn't seem to be the case for the codecs that I've examined.
It would be a burden to implementors for that reason as well as
making the stream "unseekable" (or, only seekable at elevated
expense) -- your decoder would have to process all of the "skipped
over" content in order to accurately track state.
>> So...
> [...]
> So.
> I am tired of your bleat. Stop here and do anything useful other then
> spewing internet with nonsense.
Add me to your kill file. Or, discipline yourself not to open
any posts with my name on them. I don't try to "elude" filters.
I always post from the same IP, use the same news service, etc.
I'm sure someone like you should be able to figure out how to
rid yourself of these "unpleasant distractions".
If not, ask one of the kids in the neighborhood to show you how...