2 * Copyright (c) 2014 Tim Walker <tdskywalker@gmail.com>
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef AVUTIL_DOWNMIX_INFO_H
22 #define AVUTIL_DOWNMIX_INFO_H
28 * audio downmix medatata
32 * @addtogroup lavu_audio
37 * @defgroup downmix_info Audio downmix metadata
42 * Possible downmix types.
45 AV_DOWNMIX_TYPE_UNKNOWN, /**< Not indicated. */
46 AV_DOWNMIX_TYPE_LORO, /**< Lo/Ro 2-channel downmix (Stereo). */
47 AV_DOWNMIX_TYPE_LTRT, /**< Lt/Rt 2-channel downmix, Dolby Surround compatible. */
48 AV_DOWNMIX_TYPE_DPLII, /**< Lt/Rt 2-channel downmix, Dolby Pro Logic II compatible. */
49 AV_DOWNMIX_TYPE_NB /**< Number of downmix types. Not part of ABI. */
53 * This structure describes optional metadata relevant to a downmix procedure.
55 * All fields are set by the decoder to the value indicated in the audio
56 * bitstream (if present), or to a "sane" default otherwise.
58 typedef struct AVDownmixInfo {
60 * Type of downmix preferred by the mastering engineer.
62 enum AVDownmixType preferred_downmix_type;
65 * Absolute scale factor representing the nominal level of the center
66 * channel during a regular downmix.
68 double center_mix_level;
71 * Absolute scale factor representing the nominal level of the center
72 * channel during an Lt/Rt compatible downmix.
74 double center_mix_level_ltrt;
77 * Absolute scale factor representing the nominal level of the surround
78 * channels during a regular downmix.
80 double surround_mix_level;
83 * Absolute scale factor representing the nominal level of the surround
84 * channels during an Lt/Rt compatible downmix.
86 double surround_mix_level_ltrt;
89 * Absolute scale factor representing the level at which the LFE data is
90 * mixed into L/R channels during downmixing.
96 * Get a frame's AV_FRAME_DATA_DOWNMIX_INFO side data for editing.
98 * If the side data is absent, it is created and added to the frame.
100 * @param frame the frame for which the side data is to be obtained or created
102 * @return the AVDownmixInfo structure to be edited by the caller, or NULL if
103 * the structure cannot be allocated.
105 AVDownmixInfo *av_downmix_info_update_side_data(AVFrame *frame);
115 #endif /* AVUTIL_DOWNMIX_INFO_H */