-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This diff incorporates support for the OPUS multichannel API by introducing a new variable, stereoPair, within the data layout. Based on the total number of channels and stereo pair count, the total monochannels within an OPUS compression frame can be calculated. The implementation requires that all stereo pairs are positioned at the start of the frame followed by mono channels, with no streams or channels lacking audio information included in the frame. Due to these restrictions, channel mapping is limited to stereo pair values less than two times the stereo pair count and mono channel mappings greater than two times the stereo pair count but below the total channel count. # Mapping 1. for stereo channel => mapping < 2*stereoPairCount 2. for mono channel => 2*stereoPairCount < mapping < total channel # Background and logic behind Channel mapping needed for the OPUS multichannel API 1. **Mapping Table**: This table associates each input/output (I/O) channel with a decoded channel. It's usually represented as an unsigned char array. 2. **Mapping Logic**: If i < 2*coupled_streams, then the I/O channel j is encoded as either the left or right channel of a stereo stream, depending on whether i is even or odd respectively. The stereo stream index is i/2. If i >= 2*coupled_streams, the I/O channel j is encoded as mono in a stream. If i equals 255, it's omitted from encoding (treated as silence). Each i must be either 255 or less than streams + coupled_streams. 3. **Output Channels**: The encoder should use the Vorbis channel ordering. A decoder might reorder the channels if needed. 4. **Multistream Packet Structure**: Each multistream packet contains an Opus packet for each stream. All Opus packets within a single multistream packet must have the same duration. 5. **TOC Sequence**: The duration of a multistream packet can be determined from the Type of Content (TOC) sequence of the first stream, located at the packet's beginning, similar to an elementary Opus stream. Reviewed By: georges-berenger Differential Revision: D56542097 fbshipit-source-id: 1f93d6848952cca8d0f6bac21b9cc07df38d3ebb
- Loading branch information
1 parent
917dfec
commit 7a137c2
Showing
7 changed files
with
130 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters