/* * Opus decoder using libopus * Copyright (c) 2012 Nicolas George * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
if (channels > 2 && channels <= 8) { const uint8_t *vorbis_offset = ff_vorbis_channel_layout_offsets[channels - 1]; int ch;
/* Remap channels from Vorbis order to ffmpeg order */ for (ch = 0; ch < channels; ch++)
mapping_arr[ch] = mapping[vorbis_offset[ch]];
mapping = mapping_arr;
}
#ifdef OPUS_SET_GAIN
ret = opus_multistream_decoder_ctl(opus->dec, OPUS_SET_GAIN(gain_db)); if (ret != OPUS_OK)
av_log(avc, AV_LOG_WARNING, "Failed to set gain: %s\n",
opus_strerror(ret)); #else
{ double gain_lin = ff_exp10(gain_db / (20.0 * 256)); if (avc->sample_fmt == AV_SAMPLE_FMT_FLT)
opus->gain.d = gain_lin; else
opus->gain.i = FFMIN(gain_lin * 65536, INT_MAX);
} #endif
#ifdef OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST
ret = opus_multistream_decoder_ctl(opus->dec,
OPUS_SET_PHASE_INVERSION_DISABLED(!opus->apply_phase_inv)); if (ret != OPUS_OK)
av_log(avc, AV_LOG_WARNING, "Unable to set phase inversion: %s\n",
opus_strerror(ret)); #endif
/* Decoder delay (in samples) at 48kHz */
avc->delay = avc->internal->skip_samples = opus->pre_skip;
opus_multistream_decoder_ctl(opus->dec, OPUS_RESET_STATE); /* The stream can have been extracted by a tool that is not Opus-aware.
Therefore, any packet can become the first of the stream. */
avc->internal->skip_samples = opus->pre_skip;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.