1cabdff1aSopenharmony_ci/* 2cabdff1aSopenharmony_ci * ALAC encoder and decoder common data 3cabdff1aSopenharmony_ci * 4cabdff1aSopenharmony_ci * This file is part of FFmpeg. 5cabdff1aSopenharmony_ci * 6cabdff1aSopenharmony_ci * FFmpeg is free software; you can redistribute it and/or 7cabdff1aSopenharmony_ci * modify it under the terms of the GNU Lesser General Public 8cabdff1aSopenharmony_ci * License as published by the Free Software Foundation; either 9cabdff1aSopenharmony_ci * version 2.1 of the License, or (at your option) any later version. 10cabdff1aSopenharmony_ci * 11cabdff1aSopenharmony_ci * FFmpeg is distributed in the hope that it will be useful, 12cabdff1aSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of 13cabdff1aSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14cabdff1aSopenharmony_ci * Lesser General Public License for more details. 15cabdff1aSopenharmony_ci * 16cabdff1aSopenharmony_ci * You should have received a copy of the GNU Lesser General Public 17cabdff1aSopenharmony_ci * License along with FFmpeg; if not, write to the Free Software 18cabdff1aSopenharmony_ci * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19cabdff1aSopenharmony_ci */ 20cabdff1aSopenharmony_ci 21cabdff1aSopenharmony_ci#include "libavutil/channel_layout.h" 22cabdff1aSopenharmony_ci#include "alac_data.h" 23cabdff1aSopenharmony_ci 24cabdff1aSopenharmony_ciconst uint8_t ff_alac_channel_layout_offsets[ALAC_MAX_CHANNELS][ALAC_MAX_CHANNELS] = { 25cabdff1aSopenharmony_ci { 0 }, 26cabdff1aSopenharmony_ci { 0, 1 }, 27cabdff1aSopenharmony_ci { 2, 0, 1 }, 28cabdff1aSopenharmony_ci { 2, 0, 1, 3 }, 29cabdff1aSopenharmony_ci { 2, 0, 1, 3, 4 }, 30cabdff1aSopenharmony_ci { 2, 0, 1, 4, 5, 3 }, 31cabdff1aSopenharmony_ci { 2, 0, 1, 4, 5, 6, 3 }, 32cabdff1aSopenharmony_ci { 2, 6, 7, 0, 1, 4, 5, 3 } 33cabdff1aSopenharmony_ci}; 34cabdff1aSopenharmony_ci 35cabdff1aSopenharmony_ciconst AVChannelLayout ff_alac_ch_layouts[ALAC_MAX_CHANNELS + 1] = { 36cabdff1aSopenharmony_ci AV_CHANNEL_LAYOUT_MONO, 37cabdff1aSopenharmony_ci AV_CHANNEL_LAYOUT_STEREO, 38cabdff1aSopenharmony_ci AV_CHANNEL_LAYOUT_SURROUND, 39cabdff1aSopenharmony_ci AV_CHANNEL_LAYOUT_4POINT0, 40cabdff1aSopenharmony_ci AV_CHANNEL_LAYOUT_5POINT0_BACK, 41cabdff1aSopenharmony_ci AV_CHANNEL_LAYOUT_5POINT1_BACK, 42cabdff1aSopenharmony_ci AV_CHANNEL_LAYOUT_6POINT1_BACK, 43cabdff1aSopenharmony_ci AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK, 44cabdff1aSopenharmony_ci { 0 } 45cabdff1aSopenharmony_ci}; 46cabdff1aSopenharmony_ci 47cabdff1aSopenharmony_ciconst enum AlacRawDataBlockType ff_alac_channel_elements[ALAC_MAX_CHANNELS][5] = { 48cabdff1aSopenharmony_ci { TYPE_SCE, }, 49cabdff1aSopenharmony_ci { TYPE_CPE, }, 50cabdff1aSopenharmony_ci { TYPE_SCE, TYPE_CPE, }, 51cabdff1aSopenharmony_ci { TYPE_SCE, TYPE_CPE, TYPE_SCE }, 52cabdff1aSopenharmony_ci { TYPE_SCE, TYPE_CPE, TYPE_CPE, }, 53cabdff1aSopenharmony_ci { TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_SCE, }, 54cabdff1aSopenharmony_ci { TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_SCE, TYPE_SCE, }, 55cabdff1aSopenharmony_ci { TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_SCE, }, 56cabdff1aSopenharmony_ci}; 57