replaygain: correctly parse peak values

According to the ReplayGain spec, the peak amplitude may overflow and may result
in peak amplitude values greater than 1.0 with psychoacoustically coded audio,
such as MP3. Fully compliant decoders must allow peak overflows.

Additionally, having peak values in the 0<->UINT32_MAX scale makes it more
difficult for applications to actually use the peak values (e.g. when
implementing clipping prevention) since values have to be rescaled down.

This patch corrects the peak parsing by removing the rescaling of the decoded
values between 0 and UINT32_MAX and the 1.0 upper limit.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Alessandro Ghedini
2014-04-04 11:50:44 +02:00
committed by Anton Khirnov
parent 25b6837f7c
commit 8542f9c4f1
4 changed files with 18 additions and 46 deletions

View File

@@ -13,6 +13,10 @@ libavutil: 2013-12-xx
API changes, most recent first:
2014-04-xx - xxxxxxx - lavu 53.10.0 - replaygain.h
Full scale for peak values is now 100000 (instead of UINT32_MAX) and values
may overflow.
2014-04-xx - xxxxxxx - lavu 53.09.0 - log.h
Add AV_LOG(c) macro to have 256 color debug messages.