[PR #12354] [MERGED] Add AC-4 downmix algorithm #12981

Closed
opened 2025-12-22 09:36:08 +01:00 by backuprepo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/12354
Author: @gnattu
Created: 7/29/2024
Status: Merged
Merged: 8/1/2024
Merged by: @Bond-009

Base: masterHead: ac-4-downmix


📝 Commits (5)

📊 Changes

2 files changed (+19 additions, -3 deletions)

View changed files

📝 MediaBrowser.Controller/MediaEncoding/DownMixAlgorithmsHelper.cs (+9 -0)
📝 MediaBrowser.Model/Entities/DownMixStereoAlgorithms.cs (+10 -3)

📄 Description

This adds the AC-4 spec-defined downmix algorithm, which supports 3.0, 5.0, 5.1, 7.0 and 7.1 inputs. The downmix method is defined in ETSI TS 103 190-1, Section 6.2.17.

This implementation uses the LoRo downmix mode (preferred_dmx_method == 1) as we do not need LtRt to support Dolby Pro Logic systems.

The channel mode for 7.1 inputs is always 3/4/0.x because the channel layout of this mode matches the ffmpeg definition of 7.1.

All AC-4 stream-specific fields used in the downmixing formula are initialized with the spec-defined default values, which means:

  • -3dB gain for loro_cmg and loro_smg, as defined in Table 148.
  • -∞dB gain for lfe_mg (discard LFE), as defined in Section 4.3.12.2.18.

This PR also extends Dave750 and NightmodeDialogue to use the same cascaded downmix operations as AC-4 to support 7.1 inputs. These algorithms will now first downmix 7.1 inputs to 5.1 using the AC-4 downmix method, and then perform their own operations to downmix to stereo.

Changes

  • Adds AC-4 downmix algorithm
  • Extends Dave750 and NightmodeDialogue to support 7.1 inputs.

Issues

Requires #12300, mark as draft until that one is merged


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/12354 **Author:** [@gnattu](https://github.com/gnattu) **Created:** 7/29/2024 **Status:** ✅ Merged **Merged:** 8/1/2024 **Merged by:** [@Bond-009](https://github.com/Bond-009) **Base:** `master` ← **Head:** `ac-4-downmix` --- ### 📝 Commits (5) - [`daf8d64`](https://github.com/jellyfin/jellyfin/commit/daf8d649f2bcadddabb2293fdadee9df436e7bf1) Add AC4 downmix - [`31dccac`](https://github.com/jellyfin/jellyfin/commit/31dccaca0f8d3d924756286af54c70101155cffb) Add 5.0 and 7.0 support to ac4 downmix - [`8f28c3a`](https://github.com/jellyfin/jellyfin/commit/8f28c3a0fbdd285288de76b5213b1462005eb7dc) fix doc - [`c171b6d`](https://github.com/jellyfin/jellyfin/commit/c171b6def22b32740654d7830f4ef6440854c404) fix space - [`3788ccd`](https://github.com/jellyfin/jellyfin/commit/3788ccd447ffaa4638f3fe5d235c5bb92b809692) Add comments for Dave750/NightmodeDialogue 7.1 downmix ### 📊 Changes **2 files changed** (+19 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `MediaBrowser.Controller/MediaEncoding/DownMixAlgorithmsHelper.cs` (+9 -0) 📝 `MediaBrowser.Model/Entities/DownMixStereoAlgorithms.cs` (+10 -3) </details> ### 📄 Description <!-- Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y). For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our documentation. --> This adds the AC-4 spec-defined downmix algorithm, which supports 3.0, 5.0, 5.1, 7.0 and 7.1 inputs. The downmix method is defined in [ETSI TS 103 190-1](https://www.etsi.org/deliver/etsi_ts/103100_103199/10319001/01.03.01_60/ts_10319001v010301p.pdf), Section 6.2.17. This implementation uses the LoRo downmix mode (`preferred_dmx_method == 1`) as we do not need LtRt to support Dolby Pro Logic systems. The channel mode for 7.1 inputs is always `3/4/0.x` because the channel layout of this mode matches the ffmpeg definition of 7.1. All AC-4 stream-specific fields used in the downmixing formula are initialized with the spec-defined default values, which means: - -3dB gain for `loro_cmg` and `loro_smg`, as defined in Table 148. - -∞dB gain for `lfe_mg` (discard LFE), as defined in Section 4.3.12.2.18. This PR also extends Dave750 and NightmodeDialogue to use the same cascaded downmix operations as AC-4 to support 7.1 inputs. These algorithms will now first downmix 7.1 inputs to 5.1 using the AC-4 downmix method, and then perform their own operations to downmix to stereo. **Changes** <!-- Describe your changes here in 1-5 sentences. --> - Adds AC-4 downmix algorithm - Extends Dave750 and NightmodeDialogue to support 7.1 inputs. **Issues** <!-- Tag any issues that this PR solves here. ex. Fixes # --> ~~Requires #12300, mark as draft until that one is merged~~ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
backuprepo 2025-12-22 09:36:08 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: starred/jellyfin#12981
No description provided.