[FFmpeg-devel] [PATCH 2/4 v2] avutil/channel_layout: add a 7.1(top) channel layout

James Almer jamrial at gmail.com
Fri Oct 28 15:21:38 EEST 2022


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

diff --git a/doc/APIchanges b/doc/APIchanges
index 5807bf8069..75bbcaddff 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -14,6 +14,9 @@ libavutil:     2021-04-27
 
 API changes, most recent first:
 
+2022-10-xx - xxxxxxxxxx - lavu 57.xx.xxx - channel_layout.h
+  Add AV_CH_LAYOUT_7POINT1_TOP and AV_CHANNEL_LAYOUT_7POINT1_TOP.
+
 2022-10-11 - xxxxxxxxxx - lavu 57.39.101 - pixfmt.h
   Add AV_PIX_FMT_RGBF32 and AV_PIX_FMT_RGBAF32.
 
diff --git a/doc/utils.texi b/doc/utils.texi
index 627b55d154..d19523a5f4 100644
--- a/doc/utils.texi
+++ b/doc/utils.texi
@@ -713,6 +713,8 @@ 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
+ at item 7.1(top)
+FL+FR+FC+LFE+SL+SR+TFL+TFR
 @item octagonal
 FL+FR+FC+BL+BR+BC+SL+SR
 @item hexadecagonal
diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
index 21b70173b7..bc0016d346 100644
--- a/libavutil/channel_layout.c
+++ b/libavutil/channel_layout.c
@@ -196,6 +196,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         },
     { "octagonal",      AV_CHANNEL_LAYOUT_OCTAGONAL           },
     { "hexadecagonal",  AV_CHANNEL_LAYOUT_HEXADECAGONAL       },
     { "downmix",        AV_CHANNEL_LAYOUT_STEREO_DOWNMIX,     },
diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h
index 059ff70841..9246562807 100644
--- a/libavutil/channel_layout.h
+++ b/libavutil/channel_layout.h
@@ -232,6 +232,7 @@ 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       (AV_CH_LAYOUT_5POINT1|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_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)
@@ -388,6 +389,7 @@ 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       AV_CHANNEL_LAYOUT_MASK(8,  AV_CH_LAYOUT_7POINT1_TOP)
 #define AV_CHANNEL_LAYOUT_OCTAGONAL         AV_CHANNEL_LAYOUT_MASK(8,  AV_CH_LAYOUT_OCTAGONAL)
 #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)
diff --git a/tests/ref/fate/channel_layout b/tests/ref/fate/channel_layout
index 19bcbce7d8..918b01584d 100644
--- a/tests/ref/fate/channel_layout
+++ b/tests/ref/fate/channel_layout
@@ -24,6 +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+SL+SR+TFL+TFR
 octagonal      FL+FR+FC+BL+BR+BC+SL+SR
 hexadecagonal  FL+FR+FC+BL+BR+BC+SL+SR+TFL+TFC+TFR+TBL+TBC+TBR+WL+WR
 downmix        DL+DR
-- 
2.38.1



More information about the ffmpeg-devel mailing list