mpeghdec
Fraunhofer IIS MPEG-H Decoder Library
Loading...
Searching...
No Matches
mpeghdecoder.h
Go to the documentation of this file.
1/*-----------------------------------------------------------------------------
2Software License for The Fraunhofer FDK MPEG-H Software
3
4Copyright (c) 2018 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten
5Forschung e.V. and Contributors
6All rights reserved.
7
81. INTRODUCTION
9
10The "Fraunhofer FDK MPEG-H Software" is software that implements the ISO/MPEG
11MPEG-H 3D Audio standard for digital audio or related system features. Patent
12licenses for necessary patent claims for the Fraunhofer FDK MPEG-H Software
13(including those of Fraunhofer), for the use in commercial products and
14services, may be obtained from the respective patent owners individually and/or
15from Via LA (www.via-la.com).
16
17Fraunhofer supports the development of MPEG-H products and services by offering
18additional software, documentation, and technical advice. In addition, it
19operates the MPEG-H Trademark Program to ease interoperability testing of end-
20products. Please visit www.mpegh.com for more information.
21
222. COPYRIGHT LICENSE
23
24Redistribution and use in source and binary forms, with or without modification,
25are permitted without payment of copyright license fees provided that you
26satisfy the following conditions:
27
28* You must retain the complete text of this software license in redistributions
29of the Fraunhofer FDK MPEG-H Software or your modifications thereto in source
30code form.
31
32* You must retain the complete text of this software license in the
33documentation and/or other materials provided with redistributions of
34the Fraunhofer FDK MPEG-H Software or your modifications thereto in binary form.
35You must make available free of charge copies of the complete source code of
36the Fraunhofer FDK MPEG-H Software and your modifications thereto to recipients
37of copies in binary form.
38
39* The name of Fraunhofer may not be used to endorse or promote products derived
40from the Fraunhofer FDK MPEG-H Software without prior written permission.
41
42* You may not charge copyright license fees for anyone to use, copy or
43distribute the Fraunhofer FDK MPEG-H Software or your modifications thereto.
44
45* Your modified versions of the Fraunhofer FDK MPEG-H Software must carry
46prominent notices stating that you changed the software and the date of any
47change. For modified versions of the Fraunhofer FDK MPEG-H Software, the term
48"Fraunhofer FDK MPEG-H Software" must be replaced by the term "Third-Party
49Modified Version of the Fraunhofer FDK MPEG-H Software".
50
513. No PATENT LICENSE
52
53NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
54limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
55Fraunhofer provides no warranty of patent non-infringement with respect to this
56software. You may use this Fraunhofer FDK MPEG-H Software or modifications
57thereto only for purposes that are authorized by appropriate patent licenses.
58
594. DISCLAIMER
60
61This Fraunhofer FDK MPEG-H Software is provided by Fraunhofer on behalf of the
62copyright holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED
63WARRANTIES, including but not limited to the implied warranties of
64merchantability and fitness for a particular purpose. IN NO EVENT SHALL THE
65COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE for any direct, indirect,
66incidental, special, exemplary, or consequential damages, including but not
67limited to procurement of substitute goods or services; loss of use, data, or
68profits, or business interruption, however caused and on any theory of
69liability, whether in contract, strict liability, or tort (including
70negligence), arising in any way out of the use of this software, even if
71advised of the possibility of such damage.
72
735. CONTACT INFORMATION
74
75Fraunhofer Institute for Integrated Circuits IIS
76Attention: Division Audio and Media Technologies - MPEG-H FDK
77Am Wolfsmantel 33
7891058 Erlangen, Germany
79www.iis.fraunhofer.de/amm
80amm-info@iis.fraunhofer.de
81-----------------------------------------------------------------------------*/
82
83#include <stdint.h>
84#include <stdbool.h>
85
86#ifndef MPEGH_DECODER_TIMING_HANDLING_WRAPPER
87#define MPEGH_DECODER_TIMING_HANDLING_WRAPPER
88
93
94#include "mpeghexport.h"
95
96#ifdef __cplusplus
97extern "C" {
98#endif
99
116
164
165typedef struct MPEGH_DECODER_CONTEXT*
167
189
196MPEGHDEC_EXPORT HANDLE_MPEGH_DECODER_CONTEXT mpeghdecoder_init(int32_t cicpSetup);
197
209 const uint8_t* config,
210 uint32_t configSize);
211
219
234 const uint8_t* inData, uint32_t inLength,
235 uint64_t timestamp);
236
253 const uint8_t* inData,
254 uint32_t inLength,
255 uint64_t timestamp,
256 uint32_t timescale);
257
273 int32_t* outData, uint32_t outLength,
275
286
295
305 MPEGH_DECODER_PARAMETER param, int value);
306
307#ifdef __cplusplus
308}
309#endif
310
311#endif
MPEGHDEC_EXPORT MPEGH_DECODER_ERROR mpeghdecoder_getSamples(HANDLE_MPEGH_DECODER_CONTEXT hCtx, int32_t *outData, uint32_t outLength, MPEGH_DECODER_OUTPUT_INFO *outInfo)
Get a decoded audio frame.
MPEGH_DECODER_PARAMETER
Options for handling of Dynamic Range Control (DRC) parameters.
@ MPEGH_DEC_PARAM_TARGET_REFERENCE_LEVEL
@ MPEGH_DEC_PARAM_ALBUM_MODE
@ MPEGH_DEC_PARAM_BOOST_FACTOR
@ MPEGH_DEC_PARAM_ATTENUATION_FACTOR
@ MPEGH_DEC_PARAM_EFFECT_TYPE
MPEGHDEC_EXPORT MPEGH_DECODER_ERROR mpeghdecoder_process(HANDLE_MPEGH_DECODER_CONTEXT hCtx, const uint8_t *inData, uint32_t inLength, uint64_t timestamp)
Fill MPEG-H decoder's internal input buffer with bitstream data from the external input buffer and ad...
struct MPEGH_DECODER_CONTEXT * HANDLE_MPEGH_DECODER_CONTEXT
MPEGHDEC_EXPORT MPEGH_DECODER_ERROR mpeghdecoder_flush(HANDLE_MPEGH_DECODER_CONTEXT hCtx)
Flush the decoder and discard all pending samples in the samples queue. This function should be used ...
MPEGHDEC_EXPORT MPEGH_DECODER_ERROR mpeghdecoder_setMhaConfig(HANDLE_MPEGH_DECODER_CONTEXT hCtx, const uint8_t *config, uint32_t configSize)
Explicitly configure the decoder by passing the MHA config contained in a binary buffer....
MPEGHDEC_EXPORT HANDLE_MPEGH_DECODER_CONTEXT mpeghdecoder_init(int32_t cicpSetup)
Open an MPEG-H decoder instance.
MPEGHDEC_EXPORT MPEGH_DECODER_ERROR mpeghdecoder_flushAndGet(HANDLE_MPEGH_DECODER_CONTEXT hCtx)
Flush the decoder and push the flushed PCM samples into a samples queue. The decoded PCM samples can ...
MPEGHDEC_EXPORT MPEGH_DECODER_ERROR mpeghdecoder_processTimescale(HANDLE_MPEGH_DECODER_CONTEXT hCtx, const uint8_t *inData, uint32_t inLength, uint64_t timestamp, uint32_t timescale)
Fill MPEG-H decoder's internal input buffer with bitstream data from the external input buffer and ad...
MPEGHDEC_EXPORT MPEGH_DECODER_ERROR mpeghdecoder_setParam(HANDLE_MPEGH_DECODER_CONTEXT hCtx, MPEGH_DECODER_PARAMETER param, int value)
Set decoder parameter.
MPEGH_DECODER_ERROR
MPEG-H decoder error codes.
@ MPEGH_DEC_FEED_DATA
@ MPEGH_DEC_UNSUPPORTED_PARAM
@ MPEGH_DEC_NEEDS_RESTART
@ MPEGH_DEC_OUT_OF_MEMORY
@ MPEGH_DEC_PROCESS_ERROR
@ MPEGH_DEC_BUFFER_ERROR
@ MPEGH_DEC_NULLPTR_ERROR
@ MPEGH_DEC_OK
MPEGHDEC_EXPORT void mpeghdecoder_destroy(HANDLE_MPEGH_DECODER_CONTEXT hCtx)
De-allocate all resources of an MPEG-H decoder instance.
This structure gives information about the currently decoded audio data. All fields are read-only.