SkillAgentSearch skills...

Libmpeghe

MPEG-H 3D Audio Low Complexity Profile Encoder. Decoder: https://github.com/ittiam-systems/libmpegh Contact: mob-audio@ittiam.com

Install / Use

/learn @ittiam-systems/Libmpeghe
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Introduction of the MPEG-H 3D Audio Low Complexity Profile Encoder

The advent of object-based audio and scene-based audio has revolutionized the 3D sound experience. Traditional channel-based coding expects the capture and playback geometric locations to be exactly the same for best reconstruction of the audio scene. On the other hand, object-based audio coding represents discrete sound sources in the audio scene. The positional information of each of the objects in the audio scene is conveyed in the form of metadata. Scene-based audio coding attempts to reconstruct the sound field at the playback end using the coded higher order ambisonics (HOA) information. In case of both object-based and scene-based audio, the rendering algorithm can adapt based on the configuration of the playback end loudspeaker arrangement, thus making the sound experience agnostic to the configuration of speakers at the playback end.

MPEG-H 3D Audio is a coding standard that supports traditional channel-based, object-based and scene-based audio coding. The immersive 3D sound experience created by MPEG-H 3D Audio is significantly enhanced in comparison with the traditional channel-based multichannel programs and playback systems.

The MPEG-H 3D Audio Low Complexity Profile encoder supports all specified formats, including channel-based audio, object-based audio and scene-based audio via higher order ambisonics (HOA). State-of-the-art MPEG-H 3D Audio Low Complexity Profile encoders according to ISO/IEC 23008-3:2019/AMD 2:2020 also support the MPEG-H 3D Audio Baseline Profile, which is a subset of the MPEG-H 3D Audio Low Complexity Profile. The MPEG-H 3D Audio Baseline Profile does not support scene-based audio/HOA.

The initial version supports sampling frequencies of 14.7kHz, 16kHz, 22.05kHz, 24kHz, 29.4kHz, 32kHz, 44.1kHz and 48kHz and requires a minimal bit-rate of 32kbps per channel. Further fine-tuning will be available in later version.

Introduction to MPEG-H 3D Audio Low Complexity Profile Encoder APIs

Files to be included are

Encoder APIs

| API Call | Description | |------|------| |impeghe_get_lib_id_strings | Gets the encoder library name and version number details | |impeghe_create | Sets the encoder configuration parameters, gets the memory requirements and allocate required memory | |impeghe_init | Initializes the encoder as per set configurations | |impeghe_execute | Encodes the input frame data | |impeghe_delete | Frees the allocated memories for the encoder |

Flowchart of calling sequence

API Flowchart

Building the MPEG-H 3D Audio Low Complexity Profile Encoder

Building for Unix/MacOS

  • Makefiles for building the MPEG-H 3D Audio Low Complexity Profile encoder library and application are provided in build/makefile folder.
  • These makefiles are common for Unix/MacOS builds.
  • If compiling for non-native platforms, ensure that the compiler and sysroot are updated.
  • Supported arch values are x86, x86_64, armv7 and armv8.
  • Build the library followed by the application using the below commands:
$ make -f Makefile_lib clean all ARCH=<arch>
$ make -f Makefile clean all	ARCH=<arch>

Building for Windows

  • MSVS projects files required for building the MPEG-H 3D Audio Low Complexity Profile encoder library and application are provided in build/msvs folder.
  • These MSVS project files correspond to "MSVS 2017". If the MSVS version is different, then the SDK and toolset will have to be updated accordingly.

Using CMake

Users can also use cmake to build for x86, x86_64, armv7, armv8 and Windows (MSVS project) platforms. The binaries get generated in libmpeghe/build/bin folder.

Building for native platforms

Run the following commands to build the MPEG-H 3D Audio Low Complexity Profile Encoder for native platform:

Go to the root directory(libmpeghe/) of the MPEG-H 3D Audio Low Complexity Profile Encoder.
Create a new folder in the project root directory and move to the newly created folder.

$ cd <path to libmpeghe>
$ mkdir cmake_build
$ cd cmake_build
$ cmake ..
$ make

Cross-compiling

Run the following commands to cross compile for x86, ARMv7 or ARMv8:

Go to the root directory(libmpeghe/) of the MPEG-H 3D Audio Low Complexity Profile Encoder.
Create a new folder in the project root directory and move to the newly created folder.

$ cd <path to libmpeghe>
$ mkdir cmake_build
$ cd cmake_build
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../toolchain_<arch>.cmake
$ make

Creating MSVS project files

To create MSVS project files for the MPEG-H 3D Audio Low Complexity Profile encoder from cmake, run the following commands:

Go to the root directory(libmpeghe/) of the MPEG-H 3D Audio Low Complexity Profile Encoder.
Create a new folder in the project root directory and move to the newly created folder.

$ cd <path to libmpeghe>
$ mkdir cmake_build
$ cd cmake_build
$ cmake -G "Visual Studio 15 2017" ..

The above command creates MSVS 2017 project files. If the version is different, modify the generator name accordingly. The MPEG-H 3D Audio Low Complexity Profile encoder can be built using these project files.

Running the MPEG-H 3D Audio Low Complexity Profile Encoder

The MPEG-H 3D Audio Low Complexity Profile Encoder can be run by providing command-line parameters(CLI options) directly or by providing a parameter file as a command line argument. The MPEG-H 3D Audio Low Complexity Profile Encoder supports Channel-based, Object-based and HOA-based inputs. Channel based input are wave files which consist of set of monophonic channel signals represented as single wave file. Object based input comprises of metadata and a set of monophonic signals and each signal is in the form of monophonic wav file. The audio data can include object signals alone or both channel signals and object signals. HOA based input is provided as set of monophonic channel data where each channel signal is represented as mono wave file of 32-bit float with a sampling rate of 48kHz. HOA content of the format ACN/SN3D is supported.

Command line usage :

<executable> -ifile:<inputfile> -ofile:<outputfile> [options]

[options] can be,
[-br:<bitrate>]
[-op_fmt:<output_format>]
[-cicp:<cicp_layout_index>]
[-oam_file:<oam_file>]
[-hoa_file:<first_hoa_file_name>]

where,
  <inputfile> is the input wav file name
  <outputfile> is the output MP4/MHAS file name
  <bitrate> is the bit-rate in bits per second.
        Range: 32000 to (6 * Sample rate * Number of channels)
        Default value is
        32000 for mono,
        64000 for stereo,
        192000 for 6-channel,
        256000 for 8-channel,
        320000 for 10-channel.
  <output_format> is the output format. (Supported values: 1 - MHAS, 2 - MHA1, 3 - MHM1).
        Default is 1 (MHAS).
  <cicp_layout_index> is the channel configuration index. Range: 1 to 20 except 8
        Description in format Front/Surr.LFE
        1: 1/0.0    - C
        2: 2/0.0    - L, R
        3: 3/0.0    - C, L, R
        4: 3/1.0    - C, L, R, Cs
        5: 3/2.0    - C, L, R, Ls, Rs
        6: 3/2.1    - C, L, R, Ls, Rs, LFE
        7: 5/2.1    - C, Lc, Rc, L, R, Ls, Rs, LFE
        8: NA
        9: 2/1.0    - L, R, Cs
        10: 2/2.0   - L, R, Ls, Rs
        11: 3/3.1   - C, L, R, Ls, Rs, Cs, LFE
        12: 3/4.1   - C, L, R, Ls, Rs, Lsr, Rsr, LFE
        13: 11/11.2 - C, Lc, Rc, L, R, Lss, Rss, Lsr, Rsr, Cs, LFE, LFE2, Cv, Lv, Rv, Lvss, Rvss, 
                      Ts, Lvr, Rvr, Cvr, Cb, Lb, Rb
        14: 5/2.1   - C, L, R, Ls, Rs, LFE, Lv, Rv
        15: 5/5.2   - C, L, R, Lss, Rss, Ls, Rs, Lv, Rv, Cvr, LFE, LFE2
        16: 5/4.1   - C, L, R, Ls, Rs, LFE, Lv, Rv, Lvs, Rvs
        17: 6/5.1   - C, L, R, Ls, Rs, LFE, Lv, Rv, Cv, Lvs, Rvs, Ts
        18: 6/7.1   - C, L, R, Ls, Rs, Lbs, Rbs, LFE, Lv, Rv, Cv, Lvs, Rvs, Ts
        19: 5/6.1   - C, L, R, Lss, Rss, Lsr, Rsr, LFE, Lv, Rv, Lvr, Rvr
        20: 7/6.1   - C, Leos, Reos, L, R, Lss, Rss, Lsr, Rsr, LFE, Lv, Rv, Lvs, Rvs
        If the parameter is not set or set to 0, default value is assigned based on number of input channels.
  <oam_file> file containing object metadata.
  <first_hoa_file_name> first hoa file name that ends with 00+.wav

Sample CLI for Channel-based input:

<impeghe_testbench.exe> -ifile:inp.wav -ofile:out.mhas -br:64000 -op_fmt:1

Sample CLI for Object-based input:

Channel files should be named in the format item_name_A<azimuth_angle>

View on GitHub
GitHub Stars47
CategoryDevelopment
Updated5mo ago
Forks5

Languages

C

Security Score

92/100

Audited on Oct 25, 2025

No findings