Skip to content

Draft: add support for audio (de)emphasis

Steve Lhomme requested to merge robUx4/vlc:cdda-emphasis/3 into master

Some CDs, DV, RTP, MPEG Audio files have an emphasis flag set to signify the audio should be "de-emphasis'ed" for proper playback.

This is similar to a transfer function for audio tracks. With different algorithms to use depending on the source type and the flag.

It's normally boosting the trebles and reducing the bass. So when played back, without the intended correction it sounds "bright".

This patchset carries the flag over and tries to add a filter to correct the audio before it's played back. On Windows the API doesn't provide any way to let the hardware do the conversion so we have to do it in software. There's an libavfilted-based converter added in this patchset. We do could our own local implementation with some biquad filters.

In many places the emphasis bits when reading/writing is disabled. Now we can read it properly. We could also write it as long as the output format knows about that flavor, otherwise a conversion should be done. Most of the time it's the same one as the one used in CDs. Soon Matroska will also provide this information.

Edited by Steve Lhomme

Merge request reports