1 // Copyright 2015 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "media/formats/common/opus_constants.h" 6 7 namespace media { 8 9 // Ensure offset values are properly ordered. 10 static_assert(OPUS_EXTRADATA_VERSION_OFFSET < OPUS_EXTRADATA_SIZE, 11 "Invalid opus version constant."); 12 static_assert(OPUS_EXTRADATA_CHANNELS_OFFSET < OPUS_EXTRADATA_SIZE, 13 "Invalid opus channels constant."); 14 static_assert(OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET < OPUS_EXTRADATA_SIZE, 15 "Invalid opus skip samples constant."); 16 static_assert(OPUS_EXTRADATA_SAMPLE_RATE_OFFSET < OPUS_EXTRADATA_SIZE, 17 "Invalid opus sample rate constant."); 18 static_assert(OPUS_EXTRADATA_GAIN_OFFSET < OPUS_EXTRADATA_SIZE, 19 "Invalid opus gain constant."); 20 static_assert(OPUS_EXTRADATA_CHANNEL_MAPPING_OFFSET < OPUS_EXTRADATA_SIZE, 21 "Invalid opus channel mapping offset"); 22 23 const uint8_t kOpusVorbisChannelMap[OPUS_MAX_VORBIS_CHANNELS] 24 [OPUS_MAX_VORBIS_CHANNELS] = { 25 {0}, 26 {0, 1}, 27 {0, 2, 1}, 28 {0, 1, 2, 3}, 29 {0, 4, 1, 2, 3}, 30 {0, 4, 1, 2, 3, 5}, 31 {0, 4, 1, 2, 3, 5, 6}, 32 {0, 6, 1, 2, 3, 4, 5, 7}, 33 }; 34 35 } // namespace media 36