[Flac-dev] Re: nice idea

Brady Patterson brady at spaceship.com
Thu Oct 17 07:52:02 PDT 2002

Okay, I deleted most of this thread, so I was waiting for another message to
respond to, so unfortunately this will be out of place in the thread.

This is in response to Miroslav's idea about variable block sizes.  I may be a
bit out of my league here as I'm just starting to look at how the actual
encoding gets done.  But it seems to me that you could make a decent guess
about when something "new" happens based on the second derivative of the signal
(where the first derivative is the difference between a given sample and the
previous, and the second is you-get-the-idea).

Here's my rationale: high-amplitude, high-frequency sections are the hard ones
to encode, or at least will work best in their own frame.  Those
characteristics imply a high first derivative.  You want to put such sections
in their own block, and boundaries of such blocks will be where the second
derivative is relatively high.

Okay, that's not quite right, since the first derivative will be negative about
half the time, and large negative has the same effect as lange positive.  So I
think what you really want is the first derivative of the absolute value of the
first derivative.

Then there's the question of where to put the boundaries.  Some trial-and-error
is probably the best approach here.  For files on which the above formula is
consistently high, it will probably be desirable to set the limit high to avoid
too much frame overhead.

Hope this was interesting and/or useful :) .

Brady Patterson (brady at spaceship.com)

More information about the Flac-dev mailing list