[vlc-devel] [PATCH] opus: apply soft clipping when decoding

Tristan Matthews tmatth at videolan.org
Wed Jun 28 03:15:53 CEST 2017


On Tue, Jun 27, 2017 at 2:23 PM, Tristan Matthews <tmatth at videolan.org> wrote:
> On Tue, Jun 27, 2017 at 1:58 PM, Tristan Matthews <tmatth at videolan.org> wrote:
>> On Tue, Jun 27, 2017 at 1:52 PM, Francois Cartegnie <fcvlcdev at free.fr> wrote:
>>> Le 27/06/2017 à 19:37, Tristan Matthews a écrit :
>>>> This patch uses Opus' soft clipping API to avoid clipping when decoding.
>>>> This is preferable to hard clipping which will introduce undesired
>>>> harmonics.

It might actually make more sense to have a dedicated audio filter for
just this purpose, as:
- this can be used to softclip any float PCM audio (it is not
dependent on the actual decoder state)
- this should probably be applied post resampling/pre conversion to
int, as resampling may introduce clipping

>>>
>>> Chained Opus glitches ?
>
> But more to your point, this does not resolve the weird distortions
> I'm hearing on https://trac.videolan.org/vlc/ticket/18401
>
>>
>> I was able to have the decoder output samples > 1.0 and < -1.0 on
>> every test case I tried, including the chained samples.
>> (Paraphrasing Jean-Marc Valin) "Basically any music mastered in the
>> last 15 years will be at the rails and clip when decoded".


More information about the vlc-devel mailing list