[FFmpeg-devel] [PATCH] AAC Encoder: clipping avoidance

Claudio Freire klaussfreire at gmail.com
Tue Jul 21 04:39:22 CEST 2015

On Fri, Jul 17, 2015 at 8:42 PM, Michael Niedermayer
<michael at niedermayer.cc> wrote:
>> If you mean a transition in time, I don't think it makes any
>> difference. 0.95 is a ~0.5db change in intensity, which ought to be
>> inaudible, and windowing will already take care to make the transition
>> smooth. And the logic wouldn't be completely free either to ramp
>> gradually, as it would have to ramp fully to 0.95 by the time it
>> reaches the first window marked as clipping hazard, and it could very
>> well be the frist window.
> what i meant was that whatever condition is used to hard switch
> between 1.0 and 0.95 could be rather a soft transition that is
> for example
> insteda of
> if (x > 0.0) f = 0.95
> something like
> if (x > 0.0 && x<1.0) f = 1.0 + (0.95 - 1.0)*x
> so theres no discontinuity in the transition

Attached is a patch with something like that.

1. It measures per-window minimum clip avoidance factor
2. Computes a whole-frame factor (minimum of all)
3. Applies the clip avoidance factor to the whole frame (to make it
smooth and almost linear, and avoid adding harmonic distortion).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-AAC-Encoder-clipping-avoidance.patch
Type: text/x-patch
Size: 26973 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150720/fb0e32c4/attachment.bin>

More information about the ffmpeg-devel mailing list