-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replaygain 2.0 #520
Replaygain 2.0 #520
Conversation
On a second thought this approach sound good to me: Since we do not know the ReplaGain version from the file meta data, there is not much sense to track the ReplaGain version in the Mixxx library. Any thoughts? |
License: |
Hold on there, cowboy. According to the RG 2.0 spec document, the spec is still under construction, which means it may change, so we definitely do not want to merge this unless and until the specification is finalized and the code is updated to match. |
The RG 2.0 spec is currently not an issue for Mixxx, since it covers how to store loudness informations in the file metadata, which Mixxx does not do yet. The interesting part of RG 2.0 is the proposed algorithm. It is the ITU BS.1770-3[3] standard, already published August 2012. And this is the base for the LUFS unit published as EBU R 128. A nice addition will be an option to switch the vu-metres to a Loudness meter. |
I'm starting to test this stuff. It would be great if we could improve the replay gain algorithm. I only found some minor issues in the code so far, but first I want to compare the results. |
Branch is now rebased on the replaygain column changes in master. |
@daschuer Could you please align (or rebase) this branch on master? I would recommend rebasing for a clean start, since we haven't written any code review comments yet. It would be nice to have the EBU R 128 variant avialable in 2.1. What about the licensing issues? |
How about using this implementation? |
66fc506
to
a251dd1
Compare
Rebased! libebur128 is included in Ubuntu from Vivid |
This was a bad deal, the libebur128 (MIT) version takes 8 x more CPU, compared to the ebu_r128 (GPL) version.
|
libebur128 supports different modes with varying performance On 02/21/2016 01:35 AM, Daniel Schürmann wrote:
|
libebur128 uses double for calculations while ebu_r128 uses float. If the resampler is enabled for libebur128 the performance penalty becomes #ifdef USE_SPEEX_RESAMPLER if (st->samplerate < 96000) { On 02/21/2016 01:35 AM, Daniel Schürmann wrote:
|
I would recommend to use a widespread, thoroughly tested library instead of any special implementation that we need to maintain in the future. Hopefully the performance penalties can be reduced by an appropriate configuration of the libebur128 analyzer. |
7784a78
to
919c7c1
Compare
Now I have added both implementations parallel. The Vivid's libebur128 (MIT) seams to suffer some issues:
|
The same happens with Xenials version 1.1.0-1 |
Of cause the -INF error was my fault ;-)
The oversampling is only required for the true peak calculation. It is not used for loudness calculation. The float vs double issue should make a big difference on a 64 bit build.
Both implementations do not result in the same values, but they are close, probably due to the halve precision of the GPL version. Since the Analysis is not too time critical but the values are stored in the file, the exactness matters more then the performance. If we decide to introduce a live loudness meter, which I like to have, the performance matters more. |
Notes addressed. The isDisabledOrLoadStoredSuccess API change, just changes the name of a current function to |
Conflicts: src/engine/sidechain/engineshoutcast.cpp
This merges again cleanly. |
@@ -246,6 +221,43 @@ | |||
</widget> | |||
</item> | |||
<item> | |||
<widget class="QGroupBox" name="groupBoxAnalyzis"> | |||
<property name="title"> | |||
<string>Analyzis</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo. Should be "Analysis"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be American English:
http://grammarist.com/spelling/analyse-analyze/
Just to verify: Is it "to analyze" but analysis? Strange.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"To analyze" is the correct spelling of the verb in American English, but "analysis" is the correct spelling of that noun in all English dialects. Yes, English is strange.
I also confirm that this works well with the -18 LUFS default target loudness. Before I had to set target loudness to -12 LUFS to have loud tracks not be brought way down. |
Typo fixed. Any objections to merge this? |
I'm using this branch since quite some time now. Very satisfied with the results. Should be included in 2.1 and is also a nice entry for both the change log and the feature list ;) |
@daschuer doesn't seem like it. I'd like to see this merged. |
* Author: daniel | ||
*/ | ||
|
||
#include "replaygainsettings.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use an absolute include path
Conflicts: src/engine/sidechain/engineshoutcast.cpp
Done. |
Thanks for the changes! -- LGTM |
This is a evaluation branch of ReplaGain 2.0
Warning: using this branch replaces your current ReplayGain value by a new calculated ReplayGain 2.0 value in any case.
I have used a light weight EBU R 128 implementation based on http://kokkinizita.linuxaudio.org/linuxaudio/ebumeter-doc/quickguide.html
it is much faster than our current ReplayGain analysis:
Currently RG1 and RG2 are processed and printed by qDebug()
RG2 is applied.
Whats next:
I am in favor to adopt it to Mixxx.
We may either switch silently to ReplayGain 2.0 or do all the work to switch between RG1 and RG2 this means that RG1 is used for all ReplayGain values calculated by Mixxx 1.11. and RG2 for new tracks.
Mixxx prefers to use RG from the file. But we cannot find out which version is it.
We may also store in a DB coloumn which RG version was used.
We may also offer an option to clear all RG values to analyze it with the new RG2 algorithm.
What do you think?
http://wiki.hydrogenaud.io/index.php?title=ReplayGain_1.0_specification
http://wiki.hydrogenaud.io/index.php?title=ReplayGain_2.0_specification