diff options
author | Felicia <flim@google.com> | 2017-02-06 15:49:36 -0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-02-17 11:05:15 +0100 |
commit | fcf3e06fe406823214e95993e210ac2cc2bfa6b4 (patch) | |
tree | 1de2282c9b03bc1725ce2f2a417c1004f0534280 /libavcodec/opus.c | |
parent | 1a71df9bac4bb5840b394e76f98aa34ce0c3eebc (diff) | |
download | ffmpeg-fcf3e06fe406823214e95993e210ac2cc2bfa6b4.tar.gz |
libopus: decode ambisonics with non-diegetic sources
Channel mapping 2 additionally supports a non-diegetic stereo track
appended to the end of a full-order ambisonics signal, such that the
total channel count is either
(n + 1) ^ 2, or
(n + 1) ^ 2 + 2
where n is the ambisonics order
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/opus.c')
-rw-r--r-- | libavcodec/opus.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/opus.c b/libavcodec/opus.c index 1eeb92c5bd..07e70fd7a4 100644 --- a/libavcodec/opus.c +++ b/libavcodec/opus.c @@ -373,10 +373,12 @@ av_cold int ff_opus_parse_extradata(AVCodecContext *avctx, channel_reorder = channel_reorder_vorbis; } else if (map_type == 2) { int ambisonic_order = ff_sqrt(channels) - 1; - if (channels != (ambisonic_order + 1) * (ambisonic_order + 1)) { + if (channels != ((ambisonic_order + 1) * (ambisonic_order + 1)) && + channels != ((ambisonic_order + 1) * (ambisonic_order + 1) + 2)) { av_log(avctx, AV_LOG_ERROR, "Channel mapping 2 is only specified for channel counts" - " which can be written as (n + 1)^2 for nonnegative integer n\n"); + " which can be written as (n + 1)^2 or (n + 1)^2 + 2" + " for nonnegative integer n\n"); return AVERROR_INVALIDDATA; } layout = 0; |