diff mbox series

[FFmpeg-devel,1/3] avutil/channel_layout: rename 7.1(top) channel layout to 5.1.2

Message ID 20231023232346.8813-1-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/3] avutil/channel_layout: rename 7.1(top) channel layout to 5.1.2 | expand

Checks

Context Check Description
yinshiyou/commit_msg_loongarch64 warning Please wrap lines in the body of the commit message between 60 and 72 characters.
andriy/commit_msg_x86 warning Please wrap lines in the body of the commit message between 60 and 72 characters.
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer Oct. 23, 2023, 11:23 p.m. UTC
This layout maps to ITU-R BS.2051-3 "Sound System C" and ITU-R BS.1196-8 "Channel
Configuration 14", and it being the first layout with top layer channels, it's
best to use a different scheme to properly convey the presence and amount of said
channels.
The new name will also be a better fit for the additions in the following commits.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 doc/utils.texi                | 2 +-
 libavutil/channel_layout.c    | 2 +-
 libavutil/channel_layout.h    | 8 ++++++--
 tests/ref/fate/channel_layout | 2 +-
 4 files changed, 9 insertions(+), 5 deletions(-)

Comments

Hendrik Leppkes Oct. 23, 2023, 11:46 p.m. UTC | #1
On Tue, Oct 24, 2023 at 1:24 AM James Almer <jamrial@gmail.com> wrote:
>
> This layout maps to ITU-R BS.2051-3 "Sound System C" and ITU-R BS.1196-8 "Channel
> Configuration 14", and it being the first layout with top layer channels, it's
> best to use a different scheme to properly convey the presence and amount of said
> channels.
> The new name will also be a better fit for the additions in the following commits.
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h
> index ac2ddfa022..8c40c81b44 100644
> --- a/libavutil/channel_layout.h
> +++ b/libavutil/channel_layout.h
> @@ -232,13 +232,15 @@ enum AVChannelOrder {
>  #define AV_CH_LAYOUT_7POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
>  #define AV_CH_LAYOUT_7POINT1_WIDE      (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
>  #define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
> -#define AV_CH_LAYOUT_7POINT1_TOP_BACK  (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
> +#define AV_CH_LAYOUT_5POINT1POINT2     (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)

Looking at the specs and the naming of the thing, I don't think it
should be using AV_CH_LAYOUT_5POINT1_BACK as the base layer, but
rather AV_CH_LAYOUT_5POINT1. "5.1" is that, and 5.1.2 should extend
that, and not swap the base layer speakers.
Looking at the specifications, they don't map properly to our speaker
definitions, as they assign it a generic "surround" title (at 100-120
degrees azimuth), while a rear/back speaker should be at 135 degrees,
and a side speaker at 90 (as is the standard for 7.1 setups).

Yes, this doesn't match the one you are renaming, but I think
consistency within our own defined formats is important here. 5.1 ->
5.1.2 should just add two.

The renamed one could be 5.1.2(back) or whatever we want to name those.

Or we do it properly and actually include a proper "surround" speaker
definition and get rid of the confusion between side and back. But
that breaks compat with WAVEFORMATEXTENSIBLE that our channel
definitions are mostly sourced from, so might not be worth it.

- Hendrik


- Hendrik
Hendrik Leppkes Oct. 23, 2023, 11:49 p.m. UTC | #2
On Tue, Oct 24, 2023 at 1:46 AM Hendrik Leppkes <h.leppkes@gmail.com> wrote:
>
> On Tue, Oct 24, 2023 at 1:24 AM James Almer <jamrial@gmail.com> wrote:
> >
> > This layout maps to ITU-R BS.2051-3 "Sound System C" and ITU-R BS.1196-8 "Channel
> > Configuration 14", and it being the first layout with top layer channels, it's
> > best to use a different scheme to properly convey the presence and amount of said
> > channels.
> > The new name will also be a better fit for the additions in the following commits.
> >
> > Signed-off-by: James Almer <jamrial@gmail.com>
> > ---
> > diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h
> > index ac2ddfa022..8c40c81b44 100644
> > --- a/libavutil/channel_layout.h
> > +++ b/libavutil/channel_layout.h
> > @@ -232,13 +232,15 @@ enum AVChannelOrder {
> >  #define AV_CH_LAYOUT_7POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
> >  #define AV_CH_LAYOUT_7POINT1_WIDE      (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
> >  #define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
> > -#define AV_CH_LAYOUT_7POINT1_TOP_BACK  (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
> > +#define AV_CH_LAYOUT_5POINT1POINT2     (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
>
> Looking at the specs and the naming of the thing, I don't think it
> should be using AV_CH_LAYOUT_5POINT1_BACK as the base layer, but
> rather AV_CH_LAYOUT_5POINT1. "5.1" is that, and 5.1.2 should extend
> that, and not swap the base layer speakers.
> Looking at the specifications, they don't map properly to our speaker
> definitions, as they assign it a generic "surround" title (at 100-120
> degrees azimuth), while a rear/back speaker should be at 135 degrees,
> and a side speaker at 90 (as is the standard for 7.1 setups).
>
> Yes, this doesn't match the one you are renaming, but I think
> consistency within our own defined formats is important here. 5.1 ->
> 5.1.2 should just add two.
>
> The renamed one could be 5.1.2(back) or whatever we want to name those.
>
> Or we do it properly and actually include a proper "surround" speaker
> definition and get rid of the confusion between side and back. But
> that breaks compat with WAVEFORMATEXTENSIBLE that our channel
> definitions are mostly sourced from, so might not be worth it.

Actually I got confused by our terrible naming. The define
AV_CHANNEL_LAYOUT_5POINT1 maps to "5.1(side)", but the define
AV_CHANNEL_LAYOUT_5POINT1_BACK maps to "5.1"? What is up with that?
Regardless, rather see consistency within those as well, so while the
name of the format is fine, rename the define to include the _BACK
maybe?

- Hendrik
James Almer Oct. 23, 2023, 11:56 p.m. UTC | #3
On 10/23/2023 8:49 PM, Hendrik Leppkes wrote:
> On Tue, Oct 24, 2023 at 1:46 AM Hendrik Leppkes <h.leppkes@gmail.com> wrote:
>>
>> On Tue, Oct 24, 2023 at 1:24 AM James Almer <jamrial@gmail.com> wrote:
>>>
>>> This layout maps to ITU-R BS.2051-3 "Sound System C" and ITU-R BS.1196-8 "Channel
>>> Configuration 14", and it being the first layout with top layer channels, it's
>>> best to use a different scheme to properly convey the presence and amount of said
>>> channels.
>>> The new name will also be a better fit for the additions in the following commits.
>>>
>>> Signed-off-by: James Almer <jamrial@gmail.com>
>>> ---
>>> diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h
>>> index ac2ddfa022..8c40c81b44 100644
>>> --- a/libavutil/channel_layout.h
>>> +++ b/libavutil/channel_layout.h
>>> @@ -232,13 +232,15 @@ enum AVChannelOrder {
>>>   #define AV_CH_LAYOUT_7POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
>>>   #define AV_CH_LAYOUT_7POINT1_WIDE      (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
>>>   #define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
>>> -#define AV_CH_LAYOUT_7POINT1_TOP_BACK  (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
>>> +#define AV_CH_LAYOUT_5POINT1POINT2     (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
>>
>> Looking at the specs and the naming of the thing, I don't think it
>> should be using AV_CH_LAYOUT_5POINT1_BACK as the base layer, but
>> rather AV_CH_LAYOUT_5POINT1. "5.1" is that, and 5.1.2 should extend
>> that, and not swap the base layer speakers.
>> Looking at the specifications, they don't map properly to our speaker
>> definitions, as they assign it a generic "surround" title (at 100-120
>> degrees azimuth), while a rear/back speaker should be at 135 degrees,
>> and a side speaker at 90 (as is the standard for 7.1 setups).
>>
>> Yes, this doesn't match the one you are renaming, but I think
>> consistency within our own defined formats is important here. 5.1 ->
>> 5.1.2 should just add two.
>>
>> The renamed one could be 5.1.2(back) or whatever we want to name those.
>>
>> Or we do it properly and actually include a proper "surround" speaker
>> definition and get rid of the confusion between side and back. But
>> that breaks compat with WAVEFORMATEXTENSIBLE that our channel
>> definitions are mostly sourced from, so might not be worth it.
> 
> Actually I got confused by our terrible naming. The define
> AV_CHANNEL_LAYOUT_5POINT1 maps to "5.1(side)", but the define
> AV_CHANNEL_LAYOUT_5POINT1_BACK maps to "5.1"? What is up with that?
> Regardless, rather see consistency within those as well, so while the
> name of the format is fine, rename the define to include the _BACK
> maybe?

Yes, it's a mess.

Do i use "5.1.2" alongside AV_CH_LAYOUT_5POINT1POINT2_BACK, then?

> - Hendrik
Hendrik Leppkes Oct. 24, 2023, 12:04 a.m. UTC | #4
On Tue, Oct 24, 2023 at 1:57 AM James Almer <jamrial@gmail.com> wrote:
>
> On 10/23/2023 8:49 PM, Hendrik Leppkes wrote:
> > On Tue, Oct 24, 2023 at 1:46 AM Hendrik Leppkes <h.leppkes@gmail.com> wrote:
> >>
> >> On Tue, Oct 24, 2023 at 1:24 AM James Almer <jamrial@gmail.com> wrote:
> >>>
> >>> This layout maps to ITU-R BS.2051-3 "Sound System C" and ITU-R BS.1196-8 "Channel
> >>> Configuration 14", and it being the first layout with top layer channels, it's
> >>> best to use a different scheme to properly convey the presence and amount of said
> >>> channels.
> >>> The new name will also be a better fit for the additions in the following commits.
> >>>
> >>> Signed-off-by: James Almer <jamrial@gmail.com>
> >>> ---
> >>> diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h
> >>> index ac2ddfa022..8c40c81b44 100644
> >>> --- a/libavutil/channel_layout.h
> >>> +++ b/libavutil/channel_layout.h
> >>> @@ -232,13 +232,15 @@ enum AVChannelOrder {
> >>>   #define AV_CH_LAYOUT_7POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
> >>>   #define AV_CH_LAYOUT_7POINT1_WIDE      (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
> >>>   #define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
> >>> -#define AV_CH_LAYOUT_7POINT1_TOP_BACK  (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
> >>> +#define AV_CH_LAYOUT_5POINT1POINT2     (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
> >>
> >> Looking at the specs and the naming of the thing, I don't think it
> >> should be using AV_CH_LAYOUT_5POINT1_BACK as the base layer, but
> >> rather AV_CH_LAYOUT_5POINT1. "5.1" is that, and 5.1.2 should extend
> >> that, and not swap the base layer speakers.
> >> Looking at the specifications, they don't map properly to our speaker
> >> definitions, as they assign it a generic "surround" title (at 100-120
> >> degrees azimuth), while a rear/back speaker should be at 135 degrees,
> >> and a side speaker at 90 (as is the standard for 7.1 setups).
> >>
> >> Yes, this doesn't match the one you are renaming, but I think
> >> consistency within our own defined formats is important here. 5.1 ->
> >> 5.1.2 should just add two.
> >>
> >> The renamed one could be 5.1.2(back) or whatever we want to name those.
> >>
> >> Or we do it properly and actually include a proper "surround" speaker
> >> definition and get rid of the confusion between side and back. But
> >> that breaks compat with WAVEFORMATEXTENSIBLE that our channel
> >> definitions are mostly sourced from, so might not be worth it.
> >
> > Actually I got confused by our terrible naming. The define
> > AV_CHANNEL_LAYOUT_5POINT1 maps to "5.1(side)", but the define
> > AV_CHANNEL_LAYOUT_5POINT1_BACK maps to "5.1"? What is up with that?
> > Regardless, rather see consistency within those as well, so while the
> > name of the format is fine, rename the define to include the _BACK
> > maybe?
>
> Yes, it's a mess.
>
> Do i use "5.1.2" alongside AV_CH_LAYOUT_5POINT1POINT2_BACK, then?

That works for me.

- Hendrik
Anton Khirnov Oct. 29, 2023, 9:13 a.m. UTC | #5
Quoting James Almer (2023-10-24 01:23:44)
> This layout maps to ITU-R BS.2051-3 "Sound System C" and ITU-R BS.1196-8 "Channel
> Configuration 14", and it being the first layout with top layer channels, it's
> best to use a different scheme to properly convey the presence and amount of said
> channels.
> The new name will also be a better fit for the additions in the following commits.
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  doc/utils.texi                | 2 +-
>  libavutil/channel_layout.c    | 2 +-
>  libavutil/channel_layout.h    | 8 ++++++--
>  tests/ref/fate/channel_layout | 2 +-
>  4 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/doc/utils.texi b/doc/utils.texi
> index 8e8bfa76d4..1388e5dabe 100644
> --- a/doc/utils.texi
> +++ b/doc/utils.texi
> @@ -713,7 +713,7 @@ FL+FR+FC+LFE+BL+BR+SL+SR
>  FL+FR+FC+LFE+BL+BR+FLC+FRC
>  @item 7.1(wide-side)
>  FL+FR+FC+LFE+FLC+FRC+SL+SR
> -@item 7.1(top)
> +@item 5.1.2
>  FL+FR+FC+LFE+BL+BR+TFL+TFR
>  @item octagonal
>  FL+FR+FC+BL+BR+BC+SL+SR
> diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
> index 9b581ae6b3..b259e75d37 100644
> --- a/libavutil/channel_layout.c
> +++ b/libavutil/channel_layout.c
> @@ -200,7 +200,7 @@ static const struct channel_layout_name channel_layout_map[] = {
>      { "7.1",            AV_CHANNEL_LAYOUT_7POINT1             },
>      { "7.1(wide)",      AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK   },
>      { "7.1(wide-side)", AV_CHANNEL_LAYOUT_7POINT1_WIDE        },
> -    { "7.1(top)",       AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK    },

Doesn't this need deprecation?
diff mbox series

Patch

diff --git a/doc/utils.texi b/doc/utils.texi
index 8e8bfa76d4..1388e5dabe 100644
--- a/doc/utils.texi
+++ b/doc/utils.texi
@@ -713,7 +713,7 @@  FL+FR+FC+LFE+BL+BR+SL+SR
 FL+FR+FC+LFE+BL+BR+FLC+FRC
 @item 7.1(wide-side)
 FL+FR+FC+LFE+FLC+FRC+SL+SR
-@item 7.1(top)
+@item 5.1.2
 FL+FR+FC+LFE+BL+BR+TFL+TFR
 @item octagonal
 FL+FR+FC+BL+BR+BC+SL+SR
diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
index 9b581ae6b3..b259e75d37 100644
--- a/libavutil/channel_layout.c
+++ b/libavutil/channel_layout.c
@@ -200,7 +200,7 @@  static const struct channel_layout_name channel_layout_map[] = {
     { "7.1",            AV_CHANNEL_LAYOUT_7POINT1             },
     { "7.1(wide)",      AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK   },
     { "7.1(wide-side)", AV_CHANNEL_LAYOUT_7POINT1_WIDE        },
-    { "7.1(top)",       AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK    },
+    { "5.1.2",          AV_CHANNEL_LAYOUT_5POINT1POINT2       },
     { "octagonal",      AV_CHANNEL_LAYOUT_OCTAGONAL           },
     { "cube",           AV_CHANNEL_LAYOUT_CUBE                },
     { "hexadecagonal",  AV_CHANNEL_LAYOUT_HEXADECAGONAL       },
diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h
index ac2ddfa022..8c40c81b44 100644
--- a/libavutil/channel_layout.h
+++ b/libavutil/channel_layout.h
@@ -232,13 +232,15 @@  enum AVChannelOrder {
 #define AV_CH_LAYOUT_7POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
 #define AV_CH_LAYOUT_7POINT1_WIDE      (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
 #define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
-#define AV_CH_LAYOUT_7POINT1_TOP_BACK  (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
+#define AV_CH_LAYOUT_5POINT1POINT2     (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
 #define AV_CH_LAYOUT_OCTAGONAL         (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
 #define AV_CH_LAYOUT_CUBE              (AV_CH_LAYOUT_QUAD|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT)
 #define AV_CH_LAYOUT_HEXADECAGONAL     (AV_CH_LAYOUT_OCTAGONAL|AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
 #define AV_CH_LAYOUT_STEREO_DOWNMIX    (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
 #define AV_CH_LAYOUT_22POINT2          (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT)
 
+#define AV_CH_LAYOUT_7POINT1_TOP_BACK AV_CH_LAYOUT_5POINT1POINT2
+
 enum AVMatrixEncoding {
     AV_MATRIX_ENCODING_NONE,
     AV_MATRIX_ENCODING_DOLBY,
@@ -398,13 +400,15 @@  typedef struct AVChannelLayout {
 #define AV_CHANNEL_LAYOUT_7POINT1           AV_CHANNEL_LAYOUT_MASK(8,  AV_CH_LAYOUT_7POINT1)
 #define AV_CHANNEL_LAYOUT_7POINT1_WIDE      AV_CHANNEL_LAYOUT_MASK(8,  AV_CH_LAYOUT_7POINT1_WIDE)
 #define AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK AV_CHANNEL_LAYOUT_MASK(8,  AV_CH_LAYOUT_7POINT1_WIDE_BACK)
-#define AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK  AV_CHANNEL_LAYOUT_MASK(8,  AV_CH_LAYOUT_7POINT1_TOP_BACK)
+#define AV_CHANNEL_LAYOUT_5POINT1POINT2     AV_CHANNEL_LAYOUT_MASK(8,  AV_CH_LAYOUT_5POINT1POINT2)
 #define AV_CHANNEL_LAYOUT_OCTAGONAL         AV_CHANNEL_LAYOUT_MASK(8,  AV_CH_LAYOUT_OCTAGONAL)
 #define AV_CHANNEL_LAYOUT_CUBE              AV_CHANNEL_LAYOUT_MASK(8,  AV_CH_LAYOUT_CUBE)
 #define AV_CHANNEL_LAYOUT_HEXADECAGONAL     AV_CHANNEL_LAYOUT_MASK(16, AV_CH_LAYOUT_HEXADECAGONAL)
 #define AV_CHANNEL_LAYOUT_STEREO_DOWNMIX    AV_CHANNEL_LAYOUT_MASK(2,  AV_CH_LAYOUT_STEREO_DOWNMIX)
 #define AV_CHANNEL_LAYOUT_22POINT2          AV_CHANNEL_LAYOUT_MASK(24, AV_CH_LAYOUT_22POINT2)
 
+#define AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK  AV_CHANNEL_LAYOUT_5POINT1POINT2
+
 #define AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER \
     { /* .order */ AV_CHANNEL_ORDER_AMBISONIC, \
       /* .nb_channels */ 4, \
diff --git a/tests/ref/fate/channel_layout b/tests/ref/fate/channel_layout
index b93f96dbb3..eece8293ad 100644
--- a/tests/ref/fate/channel_layout
+++ b/tests/ref/fate/channel_layout
@@ -24,7 +24,7 @@  hexagonal      FL+FR+FC+BL+BR+BC
 7.1            FL+FR+FC+LFE+BL+BR+SL+SR
 7.1(wide)      FL+FR+FC+LFE+BL+BR+FLC+FRC
 7.1(wide-side) FL+FR+FC+LFE+FLC+FRC+SL+SR
-7.1(top)       FL+FR+FC+LFE+BL+BR+TFL+TFR
+5.1.2          FL+FR+FC+LFE+BL+BR+TFL+TFR
 octagonal      FL+FR+FC+BL+BR+BC+SL+SR
 cube           FL+FR+BL+BR+TFL+TFR+TBL+TBR
 hexadecagonal  FL+FR+FC+BL+BR+BC+SL+SR+TFL+TFC+TFR+TBL+TBC+TBR+WL+WR