From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 9EE774F5B8 for ; Wed, 18 Jun 2025 01:40:17 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id E9D6D68DCD9; Wed, 18 Jun 2025 04:39:35 +0300 (EEST) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 5350868DC99 for ; Wed, 18 Jun 2025 04:39:27 +0300 (EEST) Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-747c2cc3419so4964937b3a.2 for ; Tue, 17 Jun 2025 18:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750210765; x=1750815565; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=yEqWgEw0/oT9lh/ApFEsv+naAjJHPii1w6eQY8UgWI8=; b=Mf4W3Mi1+HNGVi2hZhDSamdCYw3LyL73CbVLFIWC6/QMfQWrtSVP/oOgA3n3TqzDoP 9MDWG08280khcBFbariZHLAylVmSK5qMqEzwpo4HFkl5gg2soiSQueD7XLo5JzWC+8T5 3GARTU4uTwh1YhhMwhy3xcYsUm2OU2YlfGwYp2CRf+b1s08dsTkIzPeRNQgnlzPn2alL oHjEvWVPmGGubfer23Q58dn9djoQH0l6vqX1Wp3/Xg807EpCWgAeZ5VFpIn50vItra9Z KaTSAtweS4N7f+J5i0t+0Rfpv9adUfYfoRQTqZ44EsnFatel3cqcSb0C3mgvAaxd6+6O zOrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750210765; x=1750815565; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yEqWgEw0/oT9lh/ApFEsv+naAjJHPii1w6eQY8UgWI8=; b=UzllyxFcWxiZjvsrv1E5Ccsfox2EIuErKQRWGq5G0eLilQvodWv9RkHWKvb5Mps8cN kaf0XGgzFjtwKKvwJznl/fmM5N8Pw+bhr8vQmGwv1bJ2WBm0qqq8+PQjdYAj8F5zEC1z +blPEDEBjMXkX4NfwniebPIjFj6Xl5yj05UpwGdIJAO/xa8QNv1O6hXj2RSdyAOZAs23 quuGITUubpwSrI3u1Zdi1iGgci6Wy041WIY5PMLS7X260xkhQIDjWEDFurUSk2vgxUgx Hv+tutKPArzkYzShkrcmp1ou+97UWTIbIPDlpMvYSEviCBNgIp4aKWAx6Z8CACVTJ79H fWzw== X-Gm-Message-State: AOJu0Yw5MMqHRdXo9jxwAQMFm5C0aJCBh31kk/45QX/9EMlZCskg3NxG SYZIRrURYdAw0JYU6Z+4Xq3eiN5TL99t8Jd+jq82TN33opcGmVeoisSVxMrKMQ== X-Gm-Gg: ASbGncsxzqCw56YFUeT4HikF1ntn+NWF1iF2qNcw5FfwVPUjk/vH15vNLVPiY51n1pN UvZt6nihvCLM75HlHphfZAbY4PHwUiSdDszluYIN+/NZJ8GCgevoaExpbhT9emOyZgLabE6oap5 Zv0aeE2Ujf3nxeGbhhT3Ym+LMouEA19XcbUwn5wfTdyN2kSWpLu6P4w7OCyyHLTWy6pW3FtE3CR fIGSKrzFBJgQeX9ibwfONKegEoLjQRXaONcnMQU/wwhHrJjhH2DvpYjaiaQTPT/ZT1cpvqT+CvM YjvikQc3x1XRp7p0ZOn71RxdsZB+oPCuzqnYdU53JyR6MKXgF9BouwZmniI= X-Google-Smtp-Source: AGHT+IE5oTbIgYLM6W+3kf+zHeP+lohrRd0WkwW7sbAZEcjZAzZLAhuv8q8/+zLAErLJEGUlThgw9Q== X-Received: by 2002:a05:6a00:21c1:b0:748:323f:ba21 with SMTP id d2e1a72fcca58-7489cf5c8c2mr21358237b3a.1.1750210764700; Tue, 17 Jun 2025 18:39:24 -0700 (PDT) Received: from Gryph ([2800:2121:b000:82e:746f:8b87:8ec9:3872]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-748e566bee6sm431865b3a.127.2025.06.17.18.39.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 18:39:24 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Tue, 17 Jun 2025 22:39:00 -0300 Message-ID: <20250618013904.15638-5-jamrial@gmail.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250618013904.15638-1-jamrial@gmail.com> References: <20250618013904.15638-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/9] avformat/iamf: fix setting channel layout for Scalable layers X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: The way streams are coded in an IAMF struct follows a scalable model where the channel layouts for each layer may not match the channel order our API can represent in a Native order layout. For example, an audio element may have six coded streams in the form of two stereo streams, followed by two mono streams, and then by another two stereo streams, for a total of 10 channels, and define for them four scalable layers with loudspeaker_layout values "Stereo", "5.1ch", "5.1.2ch", and "5.1.4ch". The first layer references the first stream, and each following layer will reference all previous streams plus extra ones. In this case, the "5.1ch" layer will reference four streams (the first two stereo and the two mono) to encompass six channels, which does not match out native layout 5.1(side) given that FC and LFE come after FL+FR but before SL+SR, and here, they are at the end. For this reason, we need to build Custom order layouts that properly represent what we're exporting. ---- Before: Stream group #0:0[0x12c]: IAMF Audio Element: Layer 0: stereo Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Layer 1: 5.1(side) Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Layer 2: 5.1.2 Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Layer 3: 5.1.4 Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:5[0x5]: Audio: opus, 48000 Hz, stereo, fltp (dependent) ---- AFter: Stream group #0:0[0x12c]: IAMF Audio Element: Layer 0: stereo Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Layer 1: 6 channels (FL+FR+SL+SR+FC+LFE) Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Layer 2: 8 channels (FL+FR+SL+SR+FC+LFE+TFL+TFR) Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Layer 3: 10 channels (FL+FR+SL+SR+FC+LFE+TFL+TFR+TBL+TBR) Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:5[0x5]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Signed-off-by: James Almer --- libavformat/iamf_parse.c | 77 +++++++++++++++++-- libavformat/iamf_writer.c | 28 +++++-- libavformat/iamfdec.c | 19 ----- tests/ref/fate/iamf-5_1-copy | 2 +- tests/ref/fate/iamf-5_1-demux | 2 +- tests/ref/fate/iamf-5_1_4 | 6 +- tests/ref/fate/iamf-7_1_4 | 54 ++++++------- tests/ref/fate/iamf-9_1_6 | 2 +- tests/ref/fate/mov-mp4-iamf-5_1_4 | 6 +- tests/ref/fate/mov-mp4-iamf-7_1_4-video-first | 6 +- tests/ref/fate/mov-mp4-iamf-7_1_4-video-last | 6 +- 11 files changed, 135 insertions(+), 73 deletions(-) diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c index f37edf5156..7c239ae946 100644 --- a/libavformat/iamf_parse.c +++ b/libavformat/iamf_parse.c @@ -357,7 +357,8 @@ static int scalable_channel_layout_config(void *s, AVIOContext *pb, return AVERROR(ENOMEM); audio_element->nb_layers = nb_layers; - for (int i = 0; i < nb_layers; i++) { + for (int i = 0, n = 0; i < nb_layers; i++) { + AVChannelLayout ch_layout = { 0 }; AVIAMFLayer *layer; int loudspeaker_layout, output_gain_is_present_flag; int substream_count, coupled_substream_count; @@ -387,12 +388,16 @@ static int scalable_channel_layout_config(void *s, AVIOContext *pb, if (!i && loudspeaker_layout == 15) expanded_loudspeaker_layout = avio_r8(pb); - if (expanded_loudspeaker_layout > 0 && expanded_loudspeaker_layout < 13) - av_channel_layout_copy(&layer->ch_layout, &ff_iamf_expanded_scalable_ch_layouts[expanded_loudspeaker_layout]); - else if (loudspeaker_layout < 10) - av_channel_layout_copy(&layer->ch_layout, &ff_iamf_scalable_ch_layouts[loudspeaker_layout]); - else - layer->ch_layout = (AVChannelLayout){ .order = AV_CHANNEL_ORDER_UNSPEC, + if (expanded_loudspeaker_layout > 0 && expanded_loudspeaker_layout < 13) { + av_channel_layout_copy(&ch_layout, &ff_iamf_expanded_scalable_ch_layouts[expanded_loudspeaker_layout]); + if (i) + ch_layout.u.mask &= ~av_channel_layout_subset(&audio_element->element->layers[i-1]->ch_layout, UINT64_MAX); + } else if (loudspeaker_layout < 10) { + av_channel_layout_copy(&ch_layout, &ff_iamf_scalable_ch_layouts[loudspeaker_layout]); + if (i) + ch_layout.u.mask &= ~av_channel_layout_subset(&audio_element->element->layers[i-1]->ch_layout, UINT64_MAX); + } else + ch_layout = (AVChannelLayout){ .order = AV_CHANNEL_ORDER_UNSPEC, .nb_channels = substream_count + coupled_substream_count }; @@ -407,6 +412,64 @@ static int scalable_channel_layout_config(void *s, AVIOContext *pb, return ret; } + if (ch_layout.order == AV_CHANNEL_ORDER_NATIVE) { + ret = av_channel_layout_custom_init(&layer->ch_layout, ch_layout.nb_channels); + if (ret < 0) + return ret; + + for (int j = 0; j < n; j++) + layer->ch_layout.u.map[j].id = av_channel_layout_channel_from_index(&audio_element->element->layers[i-1]->ch_layout, j); + + coupled_substream_count = audio_element->layers[i].coupled_substream_count; + while (coupled_substream_count--) { + if (ch_layout.u.mask & AV_CH_LAYOUT_STEREO) { + layer->ch_layout.u.map[n++].id = AV_CHAN_FRONT_LEFT; + layer->ch_layout.u.map[n++].id = AV_CHAN_FRONT_RIGHT; + ch_layout.u.mask &= ~AV_CH_LAYOUT_STEREO; + } else if (ch_layout.u.mask & (AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)) { + layer->ch_layout.u.map[n++].id = AV_CHAN_FRONT_LEFT_OF_CENTER; + layer->ch_layout.u.map[n++].id = AV_CHAN_FRONT_RIGHT_OF_CENTER; + ch_layout.u.mask &= ~(AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER); + } else if (ch_layout.u.mask & (AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)) { + layer->ch_layout.u.map[n++].id = AV_CHAN_SIDE_LEFT; + layer->ch_layout.u.map[n++].id = AV_CHAN_SIDE_RIGHT; + ch_layout.u.mask &= ~(AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT); + } else if (ch_layout.u.mask & (AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)) { + layer->ch_layout.u.map[n++].id = AV_CHAN_BACK_LEFT; + layer->ch_layout.u.map[n++].id = AV_CHAN_BACK_RIGHT; + ch_layout.u.mask &= ~(AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT); + } else if (ch_layout.u.mask & (AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)) { + layer->ch_layout.u.map[n++].id = AV_CHAN_TOP_FRONT_LEFT; + layer->ch_layout.u.map[n++].id = AV_CHAN_TOP_FRONT_RIGHT; + ch_layout.u.mask &= ~(AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT); + } else if (ch_layout.u.mask & (AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT)) { + layer->ch_layout.u.map[n++].id = AV_CHAN_TOP_SIDE_LEFT; + layer->ch_layout.u.map[n++].id = AV_CHAN_TOP_SIDE_RIGHT; + ch_layout.u.mask &= ~(AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT); + } else if (ch_layout.u.mask & (AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT)) { + layer->ch_layout.u.map[n++].id = AV_CHAN_TOP_BACK_LEFT; + layer->ch_layout.u.map[n++].id = AV_CHAN_TOP_BACK_RIGHT; + ch_layout.u.mask &= ~(AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT); + } + } + + substream_count -= audio_element->layers[i].coupled_substream_count; + while (substream_count--) { + if (ch_layout.u.mask & AV_CH_FRONT_CENTER) { + layer->ch_layout.u.map[n++].id = AV_CHAN_FRONT_CENTER; + ch_layout.u.mask &= ~AV_CH_FRONT_CENTER; + } + if (ch_layout.u.mask & AV_CH_LOW_FREQUENCY) { + layer->ch_layout.u.map[n++].id = AV_CHAN_LOW_FREQUENCY; + ch_layout.u.mask &= ~AV_CH_LOW_FREQUENCY; + } + } + + ret = av_channel_layout_retype(&layer->ch_layout, AV_CHANNEL_ORDER_NATIVE, 0); + if (ret < 0 && ret != AVERROR(ENOSYS)) + return ret; + } else // AV_CHANNEL_ORDER_UNSPEC + av_channel_layout_copy(&layer->ch_layout, &ch_layout); } return 0; diff --git a/libavformat/iamf_writer.c b/libavformat/iamf_writer.c index e34afb9a2c..86d09c3308 100644 --- a/libavformat/iamf_writer.c +++ b/libavformat/iamf_writer.c @@ -250,14 +250,18 @@ int ff_iamf_add_audio_element(IAMFContext *iamf, const AVStreamGroup *stg, void for (int j, i = 0; i < iamf_audio_element->nb_layers; i++) { const AVIAMFLayer *layer = iamf_audio_element->layers[i]; + for (j = 0; j < FF_ARRAY_ELEMS(ff_iamf_scalable_ch_layouts); j++) - if (!av_channel_layout_compare(&layer->ch_layout, &ff_iamf_scalable_ch_layouts[j])) + if (av_channel_layout_subset(&layer->ch_layout, UINT64_MAX) == + av_channel_layout_subset(&ff_iamf_scalable_ch_layouts[j], UINT64_MAX)) break; if (j >= FF_ARRAY_ELEMS(ff_iamf_scalable_ch_layouts)) { for (j = 0; j < FF_ARRAY_ELEMS(ff_iamf_expanded_scalable_ch_layouts); j++) - if (!av_channel_layout_compare(&layer->ch_layout, &ff_iamf_expanded_scalable_ch_layouts[j])) + if (av_channel_layout_subset(&layer->ch_layout, UINT64_MAX) == + av_channel_layout_subset(&ff_iamf_expanded_scalable_ch_layouts[j], UINT64_MAX)) break; + if (j >= FF_ARRAY_ELEMS(ff_iamf_expanded_scalable_ch_layouts)) { av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC); av_channel_layout_describe_bprint(&layer->ch_layout, &bp); @@ -592,12 +596,26 @@ static int scalable_channel_layout_config(const IAMFAudioElement *audio_element, if (!av_channel_layout_compare(&layer->ch_layout, &ff_iamf_scalable_ch_layouts[layout])) break; } - if (layout >= FF_ARRAY_ELEMS(ff_iamf_scalable_ch_layouts)) - for (expanded_layout = 0; expanded_layout < FF_ARRAY_ELEMS(ff_iamf_scalable_ch_layouts); expanded_layout++) { + if (layout >= FF_ARRAY_ELEMS(ff_iamf_scalable_ch_layouts)) { + for (layout = 0; layout < FF_ARRAY_ELEMS(ff_iamf_scalable_ch_layouts); layout++) + if (av_channel_layout_subset(&layer->ch_layout, UINT64_MAX) == + av_channel_layout_subset(&ff_iamf_scalable_ch_layouts[layout], UINT64_MAX)) + break; + } + if (layout >= FF_ARRAY_ELEMS(ff_iamf_scalable_ch_layouts)) { + for (expanded_layout = 0; expanded_layout < FF_ARRAY_ELEMS(ff_iamf_expanded_scalable_ch_layouts); expanded_layout++) { if (!av_channel_layout_compare(&layer->ch_layout, &ff_iamf_expanded_scalable_ch_layouts[expanded_layout])) break; } - av_assert0(expanded_layout > 0 || layout < FF_ARRAY_ELEMS(ff_iamf_scalable_ch_layouts)); + if (expanded_layout >= FF_ARRAY_ELEMS(ff_iamf_expanded_scalable_ch_layouts)) { + for (expanded_layout = 0; expanded_layout < FF_ARRAY_ELEMS(ff_iamf_expanded_scalable_ch_layouts); expanded_layout++) + if (av_channel_layout_subset(&layer->ch_layout, UINT64_MAX) == + av_channel_layout_subset(&ff_iamf_expanded_scalable_ch_layouts[expanded_layout], UINT64_MAX)) + break; + } + } + av_assert0((expanded_layout > 0 && expanded_layout < FF_ARRAY_ELEMS(ff_iamf_expanded_scalable_ch_layouts)) || + layout < FF_ARRAY_ELEMS(ff_iamf_scalable_ch_layouts)); init_put_bits(&pb, header, sizeof(header)); put_bits(&pb, 4, expanded_layout >= 0 ? 15 : layout); put_bits(&pb, 1, !!layer->output_gain_flags); diff --git a/libavformat/iamfdec.c b/libavformat/iamfdec.c index 3a6276dcde..e7b5bef907 100644 --- a/libavformat/iamfdec.c +++ b/libavformat/iamfdec.c @@ -81,10 +81,8 @@ static int iamf_read_header(AVFormatContext *s) for (int i = 0; i < iamf->nb_audio_elements; i++) { IAMFAudioElement *audio_element = iamf->audio_elements[i]; - const AVIAMFLayer *layer = audio_element->element->layers[audio_element->nb_layers - 1]; AVStreamGroup *stg = avformat_stream_group_create(s, AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT, NULL); int coupled_substream_count = audio_element->layers[audio_element->nb_layers - 1].coupled_substream_count; - int side_substream_id = -1, back_substream_id = -1; if (!stg) return AVERROR(ENOMEM); @@ -114,28 +112,11 @@ static int iamf_read_header(AVFormatContext *s) st->disposition |= AV_DISPOSITION_DEFAULT; else if (audio_element->nb_layers > 1 || audio_element->layers[0].substream_count > 1) st->disposition |= AV_DISPOSITION_DEPENDENT; - if (k == av_channel_layout_index_from_channel(&layer->ch_layout, AV_CHAN_BACK_LEFT)) - back_substream_id = j; - else if (k == av_channel_layout_index_from_channel(&layer->ch_layout, AV_CHAN_SIDE_LEFT)) - side_substream_id = j; st->id = substream->audio_substream_id; avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); k += 1 + (coupled_substream_count-- > 0); } - - // Swap back and side stream ids as our native channel layout ordering doen't match the - // order from ITU-R - BS.2051-3 for Systems I and J (where side channels come before back ones). - if (back_substream_id >= 0 && side_substream_id >= 0 && av_channel_layout_compare(&layer->ch_layout, - &(AVChannelLayout)AV_CHANNEL_LAYOUT_9POINT1POINT6)) { - const IAMFSubStream *back_substream = &audio_element->substreams[back_substream_id]; - const IAMFSubStream *side_substream = &audio_element->substreams[side_substream_id]; - AVStream *back_st = stg->streams[back_substream_id]; - AVStream *side_st = stg->streams[side_substream_id]; - - back_st->id = side_substream->audio_substream_id; - side_st->id = back_substream->audio_substream_id; - } } for (int i = 0; i < iamf->nb_mix_presentations; i++) { diff --git a/tests/ref/fate/iamf-5_1-copy b/tests/ref/fate/iamf-5_1-copy index 5f7d9f98c0..fe912d4ee7 100644 --- a/tests/ref/fate/iamf-5_1-copy +++ b/tests/ref/fate/iamf-5_1-copy @@ -37,7 +37,7 @@ output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=5.1(side) +channel_layout=6 channels (FL+FR+SL+SR+FC+LFE) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] diff --git a/tests/ref/fate/iamf-5_1-demux b/tests/ref/fate/iamf-5_1-demux index 5f7d9f98c0..fe912d4ee7 100644 --- a/tests/ref/fate/iamf-5_1-demux +++ b/tests/ref/fate/iamf-5_1-demux @@ -37,7 +37,7 @@ output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=5.1(side) +channel_layout=6 channels (FL+FR+SL+SR+FC+LFE) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] diff --git a/tests/ref/fate/iamf-5_1_4 b/tests/ref/fate/iamf-5_1_4 index 1d4c055906..4c765dc8e1 100644 --- a/tests/ref/fate/iamf-5_1_4 +++ b/tests/ref/fate/iamf-5_1_4 @@ -111,17 +111,17 @@ output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=5.1(side) +channel_layout=6 channels (FL+FR+SL+SR+FC+LFE) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=5.1.2 +channel_layout=8 channels (FL+FR+SL+SR+FC+LFE+TFL+TFR) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=5.1.4 +channel_layout=10 channels (FL+FR+SL+SR+FC+LFE+TFL+TFR+TBL+TBR) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] diff --git a/tests/ref/fate/iamf-7_1_4 b/tests/ref/fate/iamf-7_1_4 index 72b10f771a..4259e40135 100644 --- a/tests/ref/fate/iamf-7_1_4 +++ b/tests/ref/fate/iamf-7_1_4 @@ -45,72 +45,72 @@ 0, 0, 0, 4608, 1399, 0x6e89566e 1, 0, 0, 4608, 1399, 0x6e89566e 2, 0, 0, 4608, 1396, 0x0dcb5677 -3, 0, 0, 4608, 1399, 0x6e89566e +3, 0, 0, 4608, 1396, 0x0dcb5677 4, 0, 0, 4608, 1399, 0x6e89566e -5, 0, 0, 4608, 1396, 0x0dcb5677 +5, 0, 0, 4608, 1399, 0x6e89566e 6, 0, 0, 4608, 1399, 0x6e89566e 0, 4608, 4608, 4608, 1442, 0x6c3c5b13 1, 4608, 4608, 4608, 1442, 0x6c3c5b13 2, 4608, 4608, 4608, 1439, 0xc46b5ac5 -3, 4608, 4608, 4608, 1442, 0x6c3c5b13 +3, 4608, 4608, 4608, 1439, 0xc46b5ac5 4, 4608, 4608, 4608, 1442, 0x6c3c5b13 -5, 4608, 4608, 4608, 1439, 0xc46b5ac5 +5, 4608, 4608, 4608, 1442, 0x6c3c5b13 6, 4608, 4608, 4608, 1442, 0x6c3c5b13 0, 9216, 9216, 4608, 1380, 0xc497571b 1, 9216, 9216, 4608, 1380, 0xc497571b 2, 9216, 9216, 4608, 1377, 0x5b2a55fe -3, 9216, 9216, 4608, 1380, 0xc497571b +3, 9216, 9216, 4608, 1377, 0x5b2a55fe 4, 9216, 9216, 4608, 1380, 0xc497571b -5, 9216, 9216, 4608, 1377, 0x5b2a55fe +5, 9216, 9216, 4608, 1380, 0xc497571b 6, 9216, 9216, 4608, 1380, 0xc497571b 0, 13824, 13824, 4608, 1383, 0x48e9510f 1, 13824, 13824, 4608, 1383, 0x48e9510f 2, 13824, 13824, 4608, 1380, 0x045550d3 -3, 13824, 13824, 4608, 1383, 0x48e9510f +3, 13824, 13824, 4608, 1380, 0x045550d3 4, 13824, 13824, 4608, 1383, 0x48e9510f -5, 13824, 13824, 4608, 1380, 0x045550d3 +5, 13824, 13824, 4608, 1383, 0x48e9510f 6, 13824, 13824, 4608, 1383, 0x48e9510f 0, 18432, 18432, 4608, 1572, 0x9a514719 1, 18432, 18432, 4608, 1572, 0x9a514719 2, 18432, 18432, 4608, 1568, 0xa2bc45f4 -3, 18432, 18432, 4608, 1572, 0x9a514719 +3, 18432, 18432, 4608, 1568, 0xa2bc45f4 4, 18432, 18432, 4608, 1572, 0x9a514719 -5, 18432, 18432, 4608, 1568, 0xa2bc45f4 +5, 18432, 18432, 4608, 1572, 0x9a514719 6, 18432, 18432, 4608, 1572, 0x9a514719 0, 23040, 23040, 4608, 1391, 0x74ac5014 1, 23040, 23040, 4608, 1391, 0x74ac5014 2, 23040, 23040, 4608, 1388, 0x96c85007 -3, 23040, 23040, 4608, 1391, 0x74ac5014 +3, 23040, 23040, 4608, 1388, 0x96c85007 4, 23040, 23040, 4608, 1391, 0x74ac5014 -5, 23040, 23040, 4608, 1388, 0x96c85007 +5, 23040, 23040, 4608, 1391, 0x74ac5014 6, 23040, 23040, 4608, 1391, 0x74ac5014 0, 27648, 27648, 4608, 1422, 0x2f9d47c5 1, 27648, 27648, 4608, 1422, 0x2f9d47c5 2, 27648, 27648, 4608, 1419, 0x4d4d466a -3, 27648, 27648, 4608, 1422, 0x2f9d47c5 +3, 27648, 27648, 4608, 1419, 0x4d4d466a 4, 27648, 27648, 4608, 1422, 0x2f9d47c5 -5, 27648, 27648, 4608, 1419, 0x4d4d466a +5, 27648, 27648, 4608, 1422, 0x2f9d47c5 6, 27648, 27648, 4608, 1422, 0x2f9d47c5 0, 32256, 32256, 4608, 1768, 0x2a044b99 1, 32256, 32256, 4608, 1768, 0x2a044b99 2, 32256, 32256, 4608, 1765, 0xacb84b24 -3, 32256, 32256, 4608, 1768, 0x2a044b99 +3, 32256, 32256, 4608, 1765, 0xacb84b24 4, 32256, 32256, 4608, 1768, 0x2a044b99 -5, 32256, 32256, 4608, 1765, 0xacb84b24 +5, 32256, 32256, 4608, 1768, 0x2a044b99 6, 32256, 32256, 4608, 1768, 0x2a044b99 0, 36864, 36864, 4608, 1534, 0xb0b35a3f 1, 36864, 36864, 4608, 1534, 0xb0b35a3f 2, 36864, 36864, 4608, 1531, 0x996458aa -3, 36864, 36864, 4608, 1534, 0xb0b35a3f +3, 36864, 36864, 4608, 1531, 0x996458aa 4, 36864, 36864, 4608, 1534, 0xb0b35a3f -5, 36864, 36864, 4608, 1531, 0x996458aa +5, 36864, 36864, 4608, 1534, 0xb0b35a3f 6, 36864, 36864, 4608, 1534, 0xb0b35a3f 0, 41472, 41472, 4608, 926, 0xc26a5eae 1, 41472, 41472, 4608, 926, 0xc26a5eae 2, 41472, 41472, 4608, 923, 0xa7225edf -3, 41472, 41472, 4608, 926, 0xc26a5eae +3, 41472, 41472, 4608, 923, 0xa7225edf 4, 41472, 41472, 4608, 926, 0xc26a5eae -5, 41472, 41472, 4608, 923, 0xa7225edf +5, 41472, 41472, 4608, 926, 0xc26a5eae 6, 41472, 41472, 4608, 926, 0xc26a5eae [STREAM_GROUP] index=0 @@ -127,17 +127,17 @@ output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=3.1.2 +channel_layout=6 channels (FL+FR+TFL+TFR+FC+LFE) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=7.1.2 +channel_layout=10 channels (FL+FR+TFL+TFR+FC+LFE+SL+SR+BL+BR) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=7.1.4 +channel_layout=12 channels (FL+FR+TFL+TFR+FC+LFE+SL+SR+BL+BR+TBL+TBR) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] @@ -226,7 +226,7 @@ DISPOSITION:multilayer=0 [/STREAM] [STREAM] index=3 -id=0x5 +id=0x3 DISPOSITION:default=0 DISPOSITION:dub=0 DISPOSITION:original=0 @@ -272,7 +272,7 @@ DISPOSITION:multilayer=0 [/STREAM] [STREAM] index=5 -id=0x3 +id=0x5 DISPOSITION:default=0 DISPOSITION:dub=0 DISPOSITION:original=0 @@ -462,7 +462,7 @@ DISPOSITION:multilayer=0 [/STREAM] [STREAM] index=3 -id=0x5 +id=0x3 DISPOSITION:default=0 DISPOSITION:dub=0 DISPOSITION:original=0 @@ -508,7 +508,7 @@ DISPOSITION:multilayer=0 [/STREAM] [STREAM] index=5 -id=0x3 +id=0x5 DISPOSITION:default=0 DISPOSITION:dub=0 DISPOSITION:original=0 diff --git a/tests/ref/fate/iamf-9_1_6 b/tests/ref/fate/iamf-9_1_6 index 0c55a22774..4082d35729 100644 --- a/tests/ref/fate/iamf-9_1_6 +++ b/tests/ref/fate/iamf-9_1_6 @@ -170,7 +170,7 @@ nb_layers=1 audio_element_type=0 default_w=0 [SUBCOMPONENT] -channel_layout=9.1.6 +channel_layout=16 channels (FL+FR+FLC+FRC+SL+SR+BL+BR+TFL+TFR+TSL+TSR+TBL+TBR+FC+LFE) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] diff --git a/tests/ref/fate/mov-mp4-iamf-5_1_4 b/tests/ref/fate/mov-mp4-iamf-5_1_4 index 225bbba267..18a1f5337f 100644 --- a/tests/ref/fate/mov-mp4-iamf-5_1_4 +++ b/tests/ref/fate/mov-mp4-iamf-5_1_4 @@ -111,17 +111,17 @@ output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=5.1(side) +channel_layout=6 channels (FL+FR+SL+SR+FC+LFE) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=5.1.2 +channel_layout=8 channels (FL+FR+SL+SR+FC+LFE+TFL+TFR) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=5.1.4 +channel_layout=10 channels (FL+FR+SL+SR+FC+LFE+TFL+TFR+TBL+TBR) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] diff --git a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first index d3b37896b2..d5a1fe1cad 100644 --- a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first +++ b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first @@ -158,17 +158,17 @@ output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=3.1.2 +channel_layout=6 channels (FL+FR+TFL+TFR+FC+LFE) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=7.1.2 +channel_layout=10 channels (FL+FR+TFL+TFR+FC+LFE+SL+SR+BL+BR) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=7.1.4 +channel_layout=12 channels (FL+FR+TFL+TFR+FC+LFE+SL+SR+BL+BR+TBL+TBR) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] diff --git a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-last b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-last index ede4a40025..caf89d41f6 100644 --- a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-last +++ b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-last @@ -158,17 +158,17 @@ output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=3.1.2 +channel_layout=6 channels (FL+FR+TFL+TFR+FC+LFE) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=7.1.2 +channel_layout=10 channels (FL+FR+TFL+TFR+FC+LFE+SL+SR+BL+BR) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] [SUBCOMPONENT] -channel_layout=7.1.4 +channel_layout=12 channels (FL+FR+TFL+TFR+FC+LFE+SL+SR+BL+BR+TBL+TBR) output_gain_flags=0 output_gain=0/1 [/SUBCOMPONENT] -- 2.50.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".