mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-02 02:30:58 +00:00
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>
This commit is contained in:
parent
1a71df9bac
commit
fcf3e06fe4
@ -373,10 +373,12 @@ av_cold int ff_opus_parse_extradata(AVCodecContext *avctx,
|
|||||||
channel_reorder = channel_reorder_vorbis;
|
channel_reorder = channel_reorder_vorbis;
|
||||||
} else if (map_type == 2) {
|
} else if (map_type == 2) {
|
||||||
int ambisonic_order = ff_sqrt(channels) - 1;
|
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,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"Channel mapping 2 is only specified for channel counts"
|
"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;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
layout = 0;
|
layout = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user