From e503535ec29eb7720ba2d1f23b1845522047bedb Mon Sep 17 00:00:00 2001 From: ybai001 Date: Tue, 3 Dec 2024 13:29:57 +0800 Subject: [PATCH 1/2] LFE channel should always be counted for AC-4 A-JOC content on MPEG-4 layer --- .../main/java/androidx/media3/extractor/Ac4Util.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libraries/extractor/src/main/java/androidx/media3/extractor/Ac4Util.java b/libraries/extractor/src/main/java/androidx/media3/extractor/Ac4Util.java index d895cae984..4990f0890b 100644 --- a/libraries/extractor/src/main/java/androidx/media3/extractor/Ac4Util.java +++ b/libraries/extractor/src/main/java/androidx/media3/extractor/Ac4Util.java @@ -410,13 +410,21 @@ public final class Ac4Util { ac4Presentation.hasBackChannels, ac4Presentation.topChannelPairs); } else { - channelCount = ac4Presentation.numOfUmxObjects; + // The ETSI TS 103 190-2 V1.2.1 (2018-02) specification defines the parameter + // n_umx_objects_minus1 in Annex E (E.11.11) to specify the number of fullband objects. While + // the elementary stream specification (section 6.3.2.8.1) provides information about the + // presence of an LFE channel within the set of dynamic objects, this detail is not explicitly + // stated in the ISO Base Media File Format (Annex E). However, current implementation + // practices consistently include the LFE channel when creating an A-JOC substream. As a + // result, it has been decided that when interpreting the ISO Base Media File Format, the LFE + // channel should always be counted as part of the total channel count. + channelCount = ac4Presentation.numOfUmxObjects + 1; // Here "1" stands for LFE channel // TODO: There is a bug in ETSI TS 103 190-2 V1.2.1 (2018-02), E.11.11 // For AC-4 level 4 stream, the intention is to set 19 to n_umx_objects_minus1 but it is // equal to 15 based on current specification. Dolby has filed a bug report to ETSI. // The following sentence should be deleted after ETSI specification error is fixed. if (ac4Presentation.level == 4) { - channelCount = channelCount == 16 ? 21 : channelCount; + channelCount = channelCount == 17 ? 21 : channelCount; } } From 1df0ee2052d43af5480f5f5c8827c9460b80c6bf Mon Sep 17 00:00:00 2001 From: ybai001 Date: Tue, 3 Dec 2024 15:29:57 +0800 Subject: [PATCH 2/2] Minor change to comment --- .../main/java/androidx/media3/extractor/Ac4Util.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/extractor/src/main/java/androidx/media3/extractor/Ac4Util.java b/libraries/extractor/src/main/java/androidx/media3/extractor/Ac4Util.java index 4990f0890b..777e8fe258 100644 --- a/libraries/extractor/src/main/java/androidx/media3/extractor/Ac4Util.java +++ b/libraries/extractor/src/main/java/androidx/media3/extractor/Ac4Util.java @@ -412,12 +412,12 @@ public final class Ac4Util { } else { // The ETSI TS 103 190-2 V1.2.1 (2018-02) specification defines the parameter // n_umx_objects_minus1 in Annex E (E.11.11) to specify the number of fullband objects. While - // the elementary stream specification (section 6.3.2.8.1) provides information about the - // presence of an LFE channel within the set of dynamic objects, this detail is not explicitly - // stated in the ISO Base Media File Format (Annex E). However, current implementation - // practices consistently include the LFE channel when creating an A-JOC substream. As a - // result, it has been decided that when interpreting the ISO Base Media File Format, the LFE - // channel should always be counted as part of the total channel count. + // the elementary stream specification (section 6.3.2.8.1 and 6.3.2.10.4) provides information + // about the presence of an LFE channel within the set of dynamic objects, this detail is not + // explicitly stated in the ISO Base Media File Format (Annex E). However, current + // implementation practices consistently include the LFE channel when creating an object-based + // substream. As a result, it has been decided that when interpreting the ISO Base Media File + // Format, the LFE channel should always be counted as part of the total channel count. channelCount = ac4Presentation.numOfUmxObjects + 1; // Here "1" stands for LFE channel // TODO: There is a bug in ETSI TS 103 190-2 V1.2.1 (2018-02), E.11.11 // For AC-4 level 4 stream, the intention is to set 19 to n_umx_objects_minus1 but it is