Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
1db533c8
Commit
1db533c8
authored
Oct 16, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/opus: move formula to EbuR128ToReplayGain()
parent
78ee6636
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
OpusDecoderPlugin.cxx
src/decoder/plugins/OpusDecoderPlugin.cxx
+12
-7
No files found.
src/decoder/plugins/OpusDecoderPlugin.cxx
View file @
1db533c8
...
...
@@ -63,6 +63,17 @@ IsOpusTags(const ogg_packet &packet) noexcept
return
packet
.
bytes
>=
8
&&
memcmp
(
packet
.
packet
,
"OpusTags"
,
8
)
==
0
;
}
/**
* Convert an EBU R128 value to ReplayGain.
*/
constexpr
float
EbuR128ToReplayGain
(
float
ebu_r128
)
noexcept
{
/* add 5dB to compensate for the different reference levels
between ReplayGain (89dB) and EBU R128 (-23 LUFS) */
return
ebu_r128
+
5
;
}
bool
mpd_opus_init
([[
maybe_unused
]]
const
ConfigBlock
&
block
)
{
...
...
@@ -249,13 +260,7 @@ MPDOpusDecoder::HandleTags(const ogg_packet &packet)
{
ReplayGainInfo
rgi
;
rgi
.
Clear
();
/**
* Add 5dB to compensate for the different
* reference levels between ReplayGain (89dB) and EBU R128 (-23 LUFS).
*/
rgi
.
track
.
gain
=
output_gain
+
5
;
rgi
.
album
.
gain
=
output_gain
+
5
;
rgi
.
track
.
gain
=
rgi
.
album
.
gain
=
EbuR128ToReplayGain
(
output_gain
);
TagBuilder
tag_builder
;
AddTagHandler
h
(
tag_builder
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment