1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2012-2014 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 */
67 uint16_t channel_layout
;
68 uint32_t sampling_frequency
;
69 uint32_t frame_duration
;
70 uint8_t stereo_downmix
;
72 uint8_t duration_modifier
;
79 uint16_t channel_layout
;
80 uint8_t bOne2OneMapChannels2Speakers
;
81 uint8_t nuRepresentationType
;
83 lsmash_dts_construction_flag nuCoreExtensionMask
;
94 uint32_t sampling_frequency
;
95 uint32_t frame_duration
;
96 uint8_t nuBits4ExSSFsize
;
97 uint8_t bStaticFieldsPresent
;
98 uint8_t bMixMetadataEnbl
;
99 uint8_t nuNumMixOutConfigs
;
100 uint8_t nNumMixOutCh
[4];
101 uint8_t nuNumAudioPresnt
;
103 uint8_t nuActiveExSSMask
[8];
104 uint8_t nuActiveAssetMask
[8][4];
105 uint8_t bBcCorePresent
[8];
106 uint8_t nuBcCoreExtSSIndex
[8];
107 uint8_t nuBcCoreAssetIndex
[8];
108 uint8_t stereo_downmix
;
109 uint8_t bit_resolution
;
110 dts_audio_asset_t asset
[8];
111 } dts_extension_info_t
;
115 dts_substream_type substream_type
;
116 lsmash_dts_construction_flag flags
;
117 lsmash_dts_specific_parameters_t ddts_param
;
118 dts_core_info_t core
; /* core component and its extensions in core substream */
119 dts_extension_info_t exss
[4]; /* extension substreams */
120 uint8_t ddts_param_initialized
;
123 uint32_t frame_duration
;
124 uint32_t frame_size
; /* size of substream */
128 void dts_setup_parser( dts_info_t
*info
);
129 int dts_parse_core_substream( dts_info_t
*info
);
130 int dts_parse_extension_substream( dts_info_t
*info
);
131 int dts_get_max_channel_count( dts_info_t
*info
);
132 dts_substream_type
dts_get_substream_type( dts_info_t
*info
);
133 int dts_get_exss_index( dts_info_t
*info
, uint8_t *exss_index
);
134 void dts_update_specific_param( dts_info_t
*info
);