From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] avfilter: add ambisonic decoder filter
Date: Sun, 30 Oct 2022 15:24:36 -0300
Message-ID: <3a38e8dc-0c3a-eec2-9278-75f2bc6118aa@gmail.com> (raw)
In-Reply-To: <CAPYw7P7TxTaEDR3_8Vdm4CpMPstcAmt_cZP_hmA6+rrUkULv3g@mail.gmail.com>
On 10/30/2022 3:19 PM, Paul B Mahol wrote:
> On 10/30/22, James Almer <jamrial@gmail.com> wrote:
>> On 10/30/2022 12:34 PM, Paul B Mahol wrote:
>>> +static const struct {
>>> + const int order;
>>> + const int inputs;
>>> + const int speakers;
>>> + const int near_field;
>>> + const int type;
>>> + const double xover;
>>> + const AVChannelLayout outlayout;
>>> + const double *speakers_azimuth;
>>> + const double *speakers_elevation;
>>> + const double *speakers_distance;
>>> +} ambisonic_tab[] = {
>>> + [MONO] = {
>>> + .order = 0,
>>> + .inputs = 1,
>>> + .speakers = 1,
>>> + .near_field = NF_NONE,
>>> + .xover = 0.,
>>> + .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO,
>>> + .speakers_azimuth = (const double[1]){ 0. },
>>> + .speakers_distance = (const double[1]){ 1. },
>>> + },
>>> + [STEREO] = {
>>> + .order = 1,
>>> + .inputs = 4,
>>> + .speakers = 2,
>>> + .near_field = NF_NONE,
>>> + .xover = 0.,
>>> + .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO,
>>> + .speakers_azimuth = (const double[2]){ -30, 30},
>>> + .speakers_distance = same_distance,
>>> + },
>>> + [STEREO_DOWNMIX] = {
>>> + .order = 1,
>>> + .inputs = 4,
>>> + .speakers = 2,
>>> + .near_field = NF_NONE,
>>> + .xover = 0.,
>>> + .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO_DOWNMIX,
>>> + .speakers_azimuth = (const double[2]){ -90, 90 },
>>> + .speakers_distance = same_distance,
>>> + },
>>> + [SURROUND] = {
>>> + .order = 1,
>>> + .inputs = 4,
>>> + .speakers = 3,
>>> + .near_field = NF_NONE,
>>> + .xover = 0.,
>>> + .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_SURROUND,
>>> + .speakers_azimuth = (const double[3]){ -45, 45, 0 },
>>> + .speakers_distance = same_distance,
>>> + },
>>> + [L2_1] = {
>>> + .order = 1,
>>> + .inputs = 4,
>>> + .speakers = 3,
>>> + .near_field = NF_NONE,
>>> + .xover = 0.,
>>> + .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_2_1,
>>> + .speakers_azimuth = (const double[3]){ -45, 45, 180 },
>>> + .speakers_distance = same_distance,
>>> + },
>>> + [TRIANGLE] = {
>>> + .order = 1,
>>> + .inputs = 4,
>>> + .speakers = 3,
>>> + .type = 1,
>>> + .near_field = NF_NONE,
>>> + .xover = 0.,
>>> + .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_SURROUND,
>>> + .speakers_azimuth = (const double[3]){ -120, 120, 0 },
>>> + .speakers_distance = same_distance,
>>> + },
>>> + [QUAD] = {
>>> + .order = 1,
>>> + .inputs = 4,
>>> + .speakers = 4,
>>> + .near_field = NF_NONE,
>>> + .xover = 0.,
>>> + .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_QUAD,
>>> + .speakers_azimuth = (const double[4]){ -45, 45, -135, 135 },
>>> + .speakers_distance = same_distance,
>>> + },
>>> + [SQUARE] = {
>>> + .order = 1,
>>> + .inputs = 4,
>>> + .speakers = 4,
>>> + .type = 1,
>>> + .near_field = NF_NONE,
>>> + .xover = 0.,
>>> + .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_4POINT0,
>>> + .speakers_azimuth = (const double[4]){ 0, -90, 180, 90 },
>>> + .speakers_distance = same_distance,
>>> + },
>>> + [L4_0] = {
>>> + .order = 1,
>>> + .inputs = 4,
>>> + .speakers = 4,
>>> + .near_field = NF_NONE,
>>> + .xover = 0.,
>>> + .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_4POINT0,
>>> + .speakers_azimuth = (const double[4]){ -30, 30, 0, 180 },
>>> + .speakers_distance = same_distance,
>>> + },
>>> + [L5_0] = {
>>> + .order = 1,
>>> + .inputs = 4,
>>> + .speakers = 5,
>>> + .near_field = NF_NONE,
>>> + .xover = 0.,
>>> + .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT0_BACK,
>>> + .speakers_azimuth = (const double[5]){ -30, 30, 0, -145, 145 },
>>> + .speakers_distance = same_distance,
>>> + },
>>> + [L5_0_SIDE] = {
>>> + .order = 1,
>>> + .inputs = 4,
>>> + .speakers = 5,
>>> + .near_field = NF_NONE,
>>> + .xover = 0.,
>>> + .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT0,
>>> + .speakers_azimuth = (const double[5]){ -30, 30, 0, -110, 110 },
>>> + .speakers_distance = same_distance,
>>> + },
>>> + [L6_0] = {
>>> + .order = 1,
>>> + .inputs = 4,
>>> + .speakers = 6,
>>> + .near_field = NF_NONE,
>>> + .xover = 0.,
>>> + .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT0,
>>> + .speakers_azimuth = (const double[6]){ -30, 30, 0, 180, -110, 110
>>> },
>>> + .speakers_distance = same_distance,
>>> + },
>>> + [L7_0] = {
>>> + .order = 1,
>>> + .inputs = 4,
>>> + .speakers = 7,
>>> + .near_field = NF_NONE,
>>> + .xover = 0.,
>>> + .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT0,
>>> + .speakers_azimuth = (const double[7]){ -30, 30, 0, -145, 145,
>>> -110, 110 },
>>> + .speakers_distance = same_distance,
>>> + },
>>> + [TETRA] = {
>>> + .order = 1,
>>> + .inputs = 4,
>>> + .speakers = 4,
>>> + .type = 2,
>>> + .near_field = NF_NONE,
>>> + .xover = 0.,
>>> + .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_QUAD,
>>> + .speakers_azimuth = (const double[4]){ -90, 90, 0, 180 },
>>> + .speakers_elevation = (const double[4]){ -35.3, -35.3, 35.3, 35.3
>>> },
>>> + .speakers_distance = same_distance,
>>> + },
>>> + [CUBE] = {
>>> + .order = 1,
>>> + .inputs = 4,
>>> + .speakers = 8,
>>> + .type = 2,
>>> + .near_field = NF_NONE,
>>> + .xover = 0.,
>>> + .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1,
>>
>> 7.1 defines an LFE channel, which is clearly not intended here, so it
>> should be either:
>>
>> .outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MASK(8,
>> AV_CH_LAYOUT_QUAD |
>> AV_CH_TOP_FRONT_LEFT |
>> AV_CH_TOP_FRONT_RIGHT |
>> AV_CH_TOP_BACK_LEFT |
>> AV_CH_TOP_BACK_RIGHT),
>>
>> Or the AV_CHANNEL_LAYOUT_CUBE layout (using the exact same bitmask as
>> above) after the patch i sent just now is committed.
>
> CUBE is as real cube in 3d space. No current layout in API can be
> described correctly.
the TOP_* channels are in a different height layer than the other
channels, namely above them. The result for this bitmask is a 3D cube
layout (Left and right speakers both front and back, in two different
height layers).
>
>>
>>> + .speakers_azimuth = cube_azimuth,
>>> + .speakers_elevation = cube_elevation,
>>> + .speakers_distance = same_distance,
>>> + },
>>
>> _______________________________________________
>> 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".
>>
> _______________________________________________
> 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".
_______________________________________________
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".
next prev parent reply other threads:[~2022-10-30 18:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-30 15:34 Paul B Mahol
2022-10-30 16:15 ` James Almer
2022-10-30 18:19 ` Paul B Mahol
2022-10-30 18:24 ` James Almer [this message]
2022-10-30 18:29 ` Paul B Mahol
2022-10-30 18:55 ` James Almer
2022-10-30 18:58 ` Paul B Mahol
2022-10-30 19:14 ` James Almer
2022-10-30 19:19 ` Paul B Mahol
2022-10-30 19:41 ` James Almer
2022-10-30 19:59 ` James Almer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3a38e8dc-0c3a-eec2-9278-75f2bc6118aa@gmail.com \
--to=jamrial@gmail.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git