[codec] draft-ietf-codec-oggopus and "album" gain

Gregory Maxwell <greg@xiph.org> Mon, 04 August 2014 18:06 UTC

Return-Path: <gmaxwell@gmail.com>
X-Original-To: codec@ietfa.amsl.com
Delivered-To: codec@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9D9AB1A00A8 for <codec@ietfa.amsl.com>; Mon, 4 Aug 2014 11:06:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.278
X-Spam-Level:
X-Spam-Status: No, score=-1.278 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2k3Ln0Aykm04 for <codec@ietfa.amsl.com>; Mon, 4 Aug 2014 11:06:38 -0700 (PDT)
Received: from mail-vc0-x230.google.com (mail-vc0-x230.google.com [IPv6:2607:f8b0:400c:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AE9B11A005C for <codec@ietf.org>; Mon, 4 Aug 2014 11:06:38 -0700 (PDT)
Received: by mail-vc0-f176.google.com with SMTP id id10so11756849vcb.35 for <codec@ietf.org>; Mon, 04 Aug 2014 11:06:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=UZhuw2XKM59UrxEItzYczWvLUOfUipgC4WHqcT7eAvM=; b=pG9upjKVM0/bd0JzP4yxy4ikSKEb3jZ4jzX+TWCg1TuOOim7z30cpdwnAHIx3iKbq4 gj+4xZcRSGqwVXunRc/uMLRrTdLNcurOZpE7XXmF7nFU3mcA+AOZiYvnKh4Jh3YtZg02 dDpk/xYmXkejO1rNkyQL4MacZ1ZsEmOxMAlh/9wjxWzNXS4dT6HEl1LTYrDH+SisuPfk Ow176XSWWmTqNjhyIFbPm6T19qw1NMi0qpwizMH8JCW+m35DF9B0rJKQr7i/oTzeB5bZ +PDYaBSggmF9VJeDRie0a371gYwv09ZwSo+fFvdps3Kt/r/gHvok1ZtjexgVm/Tvi3Zc roJg==
MIME-Version: 1.0
X-Received: by 10.221.44.69 with SMTP id uf5mr25559427vcb.4.1407175595162; Mon, 04 Aug 2014 11:06:35 -0700 (PDT)
Sender: gmaxwell@gmail.com
Received: by 10.52.187.132 with HTTP; Mon, 4 Aug 2014 11:06:35 -0700 (PDT)
Date: Mon, 4 Aug 2014 11:06:35 -0700
X-Google-Sender-Auth: L4N8cWdsDTDwuwPMMr5Gc80Msy8
Message-ID: <CAAS2fgSL+LGVSUDN=hJ9Jxeu1u7_jrfs1E_b7U5b9Y2bF67CaA@mail.gmail.com>
From: Gregory Maxwell <greg@xiph.org>
To: codec@ietf.org
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Archived-At: http://mailarchive.ietf.org/arch/msg/codec/uTvxjFaYCPS0mbU4LybTAC92tzE
Subject: [codec] draft-ietf-codec-oggopus and "album" gain
X-BeenThere: codec@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Codec WG <codec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/codec>, <mailto:codec-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/codec/>
List-Post: <mailto:codec@ietf.org>
List-Help: <mailto:codec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/codec>, <mailto:codec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 04 Aug 2014 18:06:41 -0000

There have been a comments from a number of implementers that their
applications would like to know if "album" gain adjustment had been
performed on a track. An album gain is a feature the replaygain
tagging has which allowed the dynamics within a collection of tracks
to be preserved while still normalizing the collection overall.

Right now, the draft just recommends the encoder store it in the
header gain field— which works okay but doesn't allow a player to know
for sure which gain is being applied.

To clear this up I'm proposing we add a R128_ALBUM_GAIN which works
just like R128_TRACK_GAIN and which can be set to zero when the header
gain matches the album gain.

Here is a diff against the current draft:

diff --git a/doc/draft-ietf-codec-oggopus.xml b/doc/draft-ietf-codec-oggopus.xml
index cb1f739..9364361 100644
--- a/doc/draft-ietf-codec-oggopus.xml
+++ b/doc/draft-ietf-codec-oggopus.xml
@@ -1155,7 +1155,7 @@ The user comment strings follow the NAME=value
format described by
  <xref target="vorbis-comment"/> with the same recommended tag names.
 </t>
 <figure align="center">
-  <preamble>One new comment tag is introduced for Ogg Opus:</preamble>
+  <preamble>Two new comment tags are introduced for Ogg Opus:</preamble>
 <artwork align="left"><![CDATA[
 R128_TRACK_GAIN=-573
 ]]></artwork>
@@ -1170,32 +1170,38 @@ This tag is similar to the REPLAYGAIN_TRACK_GAIN tag in
  Vorbis&nbsp;<xref target="replay-gain"/>, except that the normal volume
  reference is the <xref target="EBU-R128"/> standard.
 </t>
+<artwork align="left"><![CDATA[
+R128_ALBUM_GAIN=111
+]]></artwork>
+<postamble>
+representing the volume shift needed to normalize the volume of a collection
+ of tracks.
+The gain is a Q7.8 fixed point number in dB, as in the ID header's 'output
+ gain' field.
+</postamble>
+</figure>
 <t>
-An Ogg Opus file MUST NOT have more than one such tag, and if present its
- value MUST be an integer from -32768 to 32767, inclusive, represented in
+An Ogg Opus file MUST NOT have more than one of each tags, and if present
+ their values MUST be an integer from -32768 to 32767, inclusive,
represented in
  ASCII with no whitespace.
-If present, it MUST correctly represent the R128 normalization gain relative
- to the 'output gain' field specified in the ID header.
-If a player chooses to make use of the R128_TRACK_GAIN tag, it MUST be
- applied <spanx style="emph">in addition</spanx> to the 'output gain' value.
+If present, REPLAYGAIN_TRACK_GAIN MUST correctly represent the R128
+ normalization gain relative to the 'output gain' field specified in
the ID header.
+If a player chooses to make use of the R128_TRACK_GAIN tag or the
+ R128_ALBUM_GAIN, it MUST be applied <spanx style="emph">in addition</spanx> to
[gmaxwell@helmholtz doc]$ git diff | cat
diff --git a/doc/draft-ietf-codec-oggopus.xml b/doc/draft-ietf-codec-oggopus.xml
index cb1f739..9364361 100644
--- a/doc/draft-ietf-codec-oggopus.xml
+++ b/doc/draft-ietf-codec-oggopus.xml
@@ -1155,7 +1155,7 @@ The user comment strings follow the NAME=value
format described by
  <xref target="vorbis-comment"/> with the same recommended tag names.
 </t>
 <figure align="center">
-  <preamble>One new comment tag is introduced for Ogg Opus:</preamble>
+  <preamble>Two new comment tags are introduced for Ogg Opus:</preamble>
 <artwork align="left"><![CDATA[
 R128_TRACK_GAIN=-573
 ]]></artwork>
@@ -1170,32 +1170,38 @@ This tag is similar to the REPLAYGAIN_TRACK_GAIN tag in
  Vorbis&nbsp;<xref target="replay-gain"/>, except that the normal volume
  reference is the <xref target="EBU-R128"/> standard.
 </t>
+<artwork align="left"><![CDATA[
+R128_ALBUM_GAIN=111
+]]></artwork>
+<postamble>
+representing the volume shift needed to normalize the volume of a collection
+ of tracks.
+The gain is a Q7.8 fixed point number in dB, as in the ID header's 'output
+ gain' field.
+</postamble>
+</figure>
 <t>
-An Ogg Opus file MUST NOT have more than one such tag, and if present its
- value MUST be an integer from -32768 to 32767, inclusive, represented in
+An Ogg Opus file MUST NOT have more than one of each tags, and if present
+ their values MUST be an integer from -32768 to 32767, inclusive,
represented in
  ASCII with no whitespace.
-If present, it MUST correctly represent the R128 normalization gain relative
- to the 'output gain' field specified in the ID header.
-If a player chooses to make use of the R128_TRACK_GAIN tag, it MUST be
- applied <spanx style="emph">in addition</spanx> to the 'output gain' value.
+If present, REPLAYGAIN_TRACK_GAIN MUST correctly represent the R128
+ normalization gain relative to the 'output gain' field specified in
the ID header.
+If a player chooses to make use of the R128_TRACK_GAIN tag or the
+ R128_ALBUM_GAIN, it MUST be applied <spanx style="emph">in addition</spanx> to
+ the 'output gain' value.
 If an encoder wishes to use R128 normalization, and the output gain is not
  otherwise constrained or specified, the encoder SHOULD write the R128 gain
  into the 'output gain' field and store a tag containing "R128_TRACK_GAIN=0".
 That is, it should assume that by default tools will respect the 'output gain'
  field, and not the comment tag.
 If a tool modifies the ID header's 'output gain' field, it MUST also update or
- remove the R128_TRACK_GAIN comment tag.
+ remove the R128_TRACK_GAIN and R128_ALBUM_GAIN comment tags.
 </t>
 <t>
 To avoid confusion with multiple normalization schemes, an Opus comment header
  SHOULD NOT contain any of the REPLAYGAIN_TRACK_GAIN, REPLAYGAIN_TRACK_PEAK,
  REPLAYGAIN_ALBUM_GAIN, or REPLAYGAIN_ALBUM_PEAK tags.
 </t>
-<t>
-There is no Opus comment tag corresponding to REPLAYGAIN_ALBUM_GAIN.
-That information should instead be stored in the ID header's 'output gain'
- field.
-</t>
 </section>

 </section>