blob: 06ab421ba9472c1a6acd4ac7d89dc3c67381c1ea [file] [log] [blame]
Ian Caulfield6b493b22007-11-28 14:27:531/*
2 * MLP parser prototypes
3 * Copyright (c) 2007 Ian Caulfield
4 *
Mans Rullgard2912e872011-03-18 17:35:105 * This file is part of Libav.
Ian Caulfield6b493b22007-11-28 14:27:536 *
Mans Rullgard2912e872011-03-18 17:35:107 * Libav is free software; you can redistribute it and/or
Ian Caulfield6b493b22007-11-28 14:27:538 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
Mans Rullgard2912e872011-03-18 17:35:1012 * Libav is distributed in the hope that it will be useful,
Ian Caulfield6b493b22007-11-28 14:27:5313 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
Mans Rullgard2912e872011-03-18 17:35:1018 * License along with Libav; if not, write to the Free Software
Ian Caulfield6b493b22007-11-28 14:27:5319 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22/**
Diego Biurrunba87f082010-04-20 14:45:3423 * @file
Ian Caulfield6b493b22007-11-28 14:27:5324 * MLP parser prototypes
25 */
26
Stefano Sabatini98790382008-08-31 07:39:4727#ifndef AVCODEC_MLP_PARSER_H
28#define AVCODEC_MLP_PARSER_H
Ian Caulfield6b493b22007-11-28 14:27:5329
Stefano Sabatini9106a692009-04-13 16:20:2630#include "get_bits.h"
Diego Biurrun2d4e0c12007-11-30 14:08:0031
Ian Caulfield6b493b22007-11-28 14:27:5332typedef struct MLPHeaderInfo
33{
Tim Walker40cf1ad2012-12-31 14:33:2834 int stream_type; ///< 0xBB for MLP, 0xBA for TrueHD
Hendrik Leppkesf36f6a62014-09-26 11:49:2035 int header_size; ///< Size of the major sync header, in bytes
Ian Caulfield6b493b22007-11-28 14:27:5336
Tim Walker40cf1ad2012-12-31 14:33:2837 int group1_bits; ///< The bit depth of the first substream
38 int group2_bits; ///< Bit depth of the second substream (MLP only)
Ian Caulfield6b493b22007-11-28 14:27:5339
Tim Walker40cf1ad2012-12-31 14:33:2840 int group1_samplerate; ///< Sample rate of first substream
41 int group2_samplerate; ///< Sample rate of second substream (MLP only)
Ian Caulfield6b493b22007-11-28 14:27:5342
Tim Walker4b7f1a72013-12-11 02:03:3243 int channel_modifier_thd_stream0; ///< Channel modifier for substream 0 of TrueHD sreams ("2-channel presentation")
44 int channel_modifier_thd_stream1; ///< Channel modifier for substream 1 of TrueHD sreams ("6-channel presentation")
45 int channel_modifier_thd_stream2; ///< Channel modifier for substream 2 of TrueHD sreams ("8-channel presentation")
46
Tim Walker99ccd2b2012-12-31 14:33:2347 int channels_mlp; ///< Channel count for MLP streams
48 int channels_thd_stream1; ///< Channel count for substream 1 of TrueHD streams ("6-channel presentation")
49 int channels_thd_stream2; ///< Channel count for substream 2 of TrueHD streams ("8-channel presentation")
50 uint64_t channel_layout_mlp; ///< Channel layout for MLP streams
51 uint64_t channel_layout_thd_stream1; ///< Channel layout for substream 1 of TrueHD streams ("6-channel presentation")
52 uint64_t channel_layout_thd_stream2; ///< Channel layout for substream 2 of TrueHD streams ("8-channel presentation")
Ian Caulfield6b493b22007-11-28 14:27:5353
Tim Walker40cf1ad2012-12-31 14:33:2854 int access_unit_size; ///< Number of samples per coded frame
55 int access_unit_size_pow2; ///< Next power of two above number of samples per frame
Ian Caulfield6b493b22007-11-28 14:27:5356
Tim Walker40cf1ad2012-12-31 14:33:2857 int is_vbr; ///< Stream is VBR instead of CBR
58 int peak_bitrate; ///< Peak bitrate for VBR, actual bitrate (==peak) for CBR
Ian Caulfield6b493b22007-11-28 14:27:5359
Tim Walker40cf1ad2012-12-31 14:33:2860 int num_substreams; ///< Number of substreams within stream
Ian Caulfield6b493b22007-11-28 14:27:5361} MLPHeaderInfo;
62
63
Ramiro Polla49de8d12008-07-01 01:36:1664int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb);
Ian Caulfield6b493b22007-11-28 14:27:5365
Stefano Sabatini98790382008-08-31 07:39:4766#endif /* AVCODEC_MLP_PARSER_H */