1 /*****************************************************************************
2 * dts_header.c: parse DTS audio headers info
3 *****************************************************************************
4 * Copyright (C) 2004-2016 VLC authors and VideoLAN
6 * Authors: Gildas Bazin <gbazin@netcourrier.com>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #define VLC_DTS_HEADER_SIZE 14
26 #define PROFILE_DTS_INVALID -1
28 #define PROFILE_DTS_HD 1
29 #define PROFILE_DTS_EXPRESS 2
31 enum vlc_dts_syncword_e
36 DTS_SYNC_CORE_14BITS_BE
,
37 DTS_SYNC_CORE_14BITS_LE
,
39 /* Substreams internal syncs */
40 DTS_SYNC_SUBSTREAM_LBR
,
45 enum vlc_dts_syncword_e syncword
;
47 unsigned int i_bitrate
;
48 unsigned int i_frame_size
;
49 unsigned int i_frame_length
;
50 uint32_t i_substream_header_size
;
51 uint16_t i_physical_channels
;
55 int vlc_dts_header_Parse( vlc_dts_header_t
*p_header
,
56 const void *p_buffer
, size_t i_buffer
);
58 bool vlc_dts_header_IsSync( const void *p_buffer
, size_t i_buffer
);
60 ssize_t
vlc_dts_header_Convert14b16b( void *p_dst
, size_t i_dst
,
61 const void *p_src
, size_t i_src
,