diff mbox series

[FFmpeg-devel,v5,01/10] channel_layout: add new channel positions supported by xHE-AAC

Message ID 20240530023927.1205442-2-dev@lynne.ee
State Accepted
Commit caeb27509245e87dd0dc6a0677fdeedab3406a97
Headers show
Series aacdec: add a native xHE-AAC decoder | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Lynne May 30, 2024, 2:37 a.m. UTC
apichanges will be updated upon merging, as well as a version bump.
---
 libavutil/channel_layout.c | 4 ++++
 libavutil/channel_layout.h | 8 ++++++++
 2 files changed, 12 insertions(+)

Comments

Jan Ekström May 31, 2024, 1:39 p.m. UTC | #1
On Thu, May 30, 2024 at 5:39 AM Lynne via ffmpeg-devel
<ffmpeg-devel@ffmpeg.org> wrote:
>
> apichanges will be updated upon merging, as well as a version bump.
> ---
>  libavutil/channel_layout.c | 4 ++++
>  libavutil/channel_layout.h | 8 ++++++++
>  2 files changed, 12 insertions(+)
>
> diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
> index 98839b7250..2d6963b6df 100644
> --- a/libavutil/channel_layout.c
> +++ b/libavutil/channel_layout.c
> @@ -75,6 +75,10 @@ static const struct channel_name channel_names[] = {
>      [AV_CHAN_BOTTOM_FRONT_CENTER  ] = { "BFC",       "bottom front center"   },
>      [AV_CHAN_BOTTOM_FRONT_LEFT    ] = { "BFL",       "bottom front left"     },
>      [AV_CHAN_BOTTOM_FRONT_RIGHT   ] = { "BFR",       "bottom front right"    },
> +    [AV_CHAN_SIDE_SURROUND_LEFT   ] = { "SSL",       "side surround left"    },
> +    [AV_CHAN_SIDE_SURROUND_RIGHT  ] = { "SSR",       "side surround right"   },
> +    [AV_CHAN_TOP_SURROUND_LEFT    ] = { "TTL",       "top surround left"     },
> +    [AV_CHAN_TOP_SURROUND_RIGHT   ] = { "TTR",       "top surround right"    },

Just noticed for these two top ones, is there a connection being "TTL"
and "top surround left" that I somehow missed, or is this a typo of
"TSL"?

Jan
Lynne May 31, 2024, 1:48 p.m. UTC | #2
On 31/05/2024 15:39, Jan Ekström wrote:
> On Thu, May 30, 2024 at 5:39 AM Lynne via ffmpeg-devel
> <ffmpeg-devel@ffmpeg.org> wrote:
>>
>> apichanges will be updated upon merging, as well as a version bump.
>> ---
>>   libavutil/channel_layout.c | 4 ++++
>>   libavutil/channel_layout.h | 8 ++++++++
>>   2 files changed, 12 insertions(+)
>>
>> diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
>> index 98839b7250..2d6963b6df 100644
>> --- a/libavutil/channel_layout.c
>> +++ b/libavutil/channel_layout.c
>> @@ -75,6 +75,10 @@ static const struct channel_name channel_names[] = {
>>       [AV_CHAN_BOTTOM_FRONT_CENTER  ] = { "BFC",       "bottom front center"   },
>>       [AV_CHAN_BOTTOM_FRONT_LEFT    ] = { "BFL",       "bottom front left"     },
>>       [AV_CHAN_BOTTOM_FRONT_RIGHT   ] = { "BFR",       "bottom front right"    },
>> +    [AV_CHAN_SIDE_SURROUND_LEFT   ] = { "SSL",       "side surround left"    },
>> +    [AV_CHAN_SIDE_SURROUND_RIGHT  ] = { "SSR",       "side surround right"   },
>> +    [AV_CHAN_TOP_SURROUND_LEFT    ] = { "TTL",       "top surround left"     },
>> +    [AV_CHAN_TOP_SURROUND_RIGHT   ] = { "TTR",       "top surround right"    },
> 
> Just noticed for these two top ones, is there a connection being "TTL"
> and "top surround left" that I somehow missed, or is this a typo of
> "TSL"?

TSL and TSR are already taken:

 > [AV_CHAN_TOP_SIDE_LEFT        ] = { "TSL",       "top side left" },
 > [AV_CHAN_TOP_SIDE_RIGHT       ] = { "TSR",       "top side right" },

I tried using "Beside" instead of side, which would have resulted in 
"TBR" and "TBL", but those are taken by Top Back Left/Right.

So I went with the short form of "Top Top Left" and "Top Top Right" 
without putting too much thought.
diff mbox series

Patch

diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
index 98839b7250..2d6963b6df 100644
--- a/libavutil/channel_layout.c
+++ b/libavutil/channel_layout.c
@@ -75,6 +75,10 @@  static const struct channel_name channel_names[] = {
     [AV_CHAN_BOTTOM_FRONT_CENTER  ] = { "BFC",       "bottom front center"   },
     [AV_CHAN_BOTTOM_FRONT_LEFT    ] = { "BFL",       "bottom front left"     },
     [AV_CHAN_BOTTOM_FRONT_RIGHT   ] = { "BFR",       "bottom front right"    },
+    [AV_CHAN_SIDE_SURROUND_LEFT   ] = { "SSL",       "side surround left"    },
+    [AV_CHAN_SIDE_SURROUND_RIGHT  ] = { "SSR",       "side surround right"   },
+    [AV_CHAN_TOP_SURROUND_LEFT    ] = { "TTL",       "top surround left"     },
+    [AV_CHAN_TOP_SURROUND_RIGHT   ] = { "TTR",       "top surround right"    },
 };
 
 void av_channel_name_bprint(AVBPrint *bp, enum AVChannel channel_id)
diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h
index b26b601065..3a96c2d9b8 100644
--- a/libavutil/channel_layout.h
+++ b/libavutil/channel_layout.h
@@ -79,6 +79,10 @@  enum AVChannel {
     AV_CHAN_BOTTOM_FRONT_CENTER,
     AV_CHAN_BOTTOM_FRONT_LEFT,
     AV_CHAN_BOTTOM_FRONT_RIGHT,
+    AV_CHAN_SIDE_SURROUND_LEFT,     ///<  +90 degrees, Lss, SiL
+    AV_CHAN_SIDE_SURROUND_RIGHT,    ///<  -90 degrees, Rss, SiR
+    AV_CHAN_TOP_SURROUND_LEFT,      ///< +110 degrees, Lvs, TpLS
+    AV_CHAN_TOP_SURROUND_RIGHT,     ///< -110 degrees, Rvs, TpRS
 
     /** Channel is empty can be safely skipped. */
     AV_CHAN_UNUSED = 0x200,
@@ -195,6 +199,10 @@  enum AVChannelOrder {
 #define AV_CH_BOTTOM_FRONT_CENTER    (1ULL << AV_CHAN_BOTTOM_FRONT_CENTER  )
 #define AV_CH_BOTTOM_FRONT_LEFT      (1ULL << AV_CHAN_BOTTOM_FRONT_LEFT    )
 #define AV_CH_BOTTOM_FRONT_RIGHT     (1ULL << AV_CHAN_BOTTOM_FRONT_RIGHT   )
+#define AV_CH_SIDE_SURROUND_LEFT     (1ULL << AV_CHAN_SIDE_SURROUND_LEFT   )
+#define AV_CH_SIDE_SURROUND_RIGHT    (1ULL << AV_CHAN_SIDE_SURROUND_RIGHT  )
+#define AV_CH_TOP_SURROUND_LEFT      (1ULL << AV_CHAN_TOP_SURROUND_LEFT    )
+#define AV_CH_TOP_SURROUND_RIGHT     (1ULL << AV_CHAN_TOP_SURROUND_RIGHT   )
 
 /**
  * @}