1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2012-2017 L-SMASH project
6 * Authors: Yusuke Nakamura <muken.the.vfrmaniac@gmail.com>
8 * Permission to use, copy, modify, and/or distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies.
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 *****************************************************************************/
21 /* This file is available under an ISC license. */
23 #define DTS_MAX_CORE_SIZE 16384
24 #define DTS_MAX_EXSS_SIZE 32768
25 #define DTS_MAX_NUM_EXSS 4 /* the maximum number of extension substreams */
29 DTS_SUBSTREAM_TYPE_NONE
= 0,
30 DTS_SUBSTREAM_TYPE_CORE
= 1,
31 DTS_SUBSTREAM_TYPE_EXTENSION
= 2,
37 uint16_t channel_layout
;
38 uint8_t lower_planes
; /* CL, LL and RL */
43 uint32_t sampling_frequency
;
44 uint32_t frame_duration
;
46 uint16_t channel_layout
;
47 uint8_t channel_arrangement
;
48 uint8_t extension_audio_descriptor
;
49 uint8_t pcm_resolution
;
56 uint16_t channel_layout
;
57 uint32_t sampling_frequency
;
58 uint32_t frame_duration
;
59 uint8_t pcm_resolution
;
60 uint8_t stereo_downmix
;
61 uint8_t lower_planes
; /* CL, LL and RL */
62 uint8_t dtsx_extension_present
;
68 uint16_t channel_layout
;
69 uint32_t sampling_frequency
;
70 uint32_t frame_duration
;
71 uint8_t stereo_downmix
;
73 uint8_t duration_modifier
;
80 uint16_t channel_layout
;
81 uint8_t bOne2OneMapChannels2Speakers
;
82 uint8_t nuRepresentationType
;
84 lsmash_dts_construction_flag nuCoreExtensionMask
;
95 uint32_t sampling_frequency
;
96 uint32_t frame_duration
;
97 uint8_t nuBits4ExSSFsize
;
98 uint8_t bStaticFieldsPresent
;
99 uint8_t bMixMetadataEnbl
;
100 uint8_t nuNumMixOutConfigs
;
101 uint8_t nNumMixOutCh
[4];
102 uint8_t nuNumAudioPresnt
;
104 uint8_t nuActiveExSSMask
[8];
105 uint8_t nuActiveAssetMask
[8][4];
106 uint8_t bBcCorePresent
[8];
107 uint8_t nuBcCoreExtSSIndex
[8];
108 uint8_t nuBcCoreAssetIndex
[8];
109 uint8_t stereo_downmix
;
110 uint8_t bit_resolution
;
111 dts_audio_asset_t asset
[8];
112 } dts_extension_info_t
;
116 dts_substream_type substream_type
;
117 lsmash_dts_construction_flag flags
;
118 lsmash_dts_specific_parameters_t ddts_param
;
119 dts_core_info_t core
; /* core component and its extensions in core substream */
120 dts_extension_info_t exss
[4]; /* extension substreams */
121 uint8_t ddts_param_initialized
;
124 uint32_t frame_duration
;
125 uint32_t frame_size
; /* size of substream */
129 void dts_setup_parser( dts_info_t
*info
);
130 int dts_parse_core_substream( dts_info_t
*info
);
131 int dts_parse_extension_substream( dts_info_t
*info
);
132 int dts_get_max_channel_count( dts_info_t
*info
);
133 dts_substream_type
dts_get_substream_type( dts_info_t
*info
);
134 int dts_get_exss_index( dts_info_t
*info
, uint8_t *exss_index
);
135 void dts_update_specific_param( dts_info_t
*info
);