Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 11/20] avcodec/h264_sei, sei: Make H264_SEI_FpaType generic
Date: Sun,  3 Jul 2022 00:21:51 +0200
Message-ID: <DB6PR0101MB22143216494044CDEF82847B8FBC9@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com> (raw)
In-Reply-To: <DB6PR0101MB2214F50F230E6F64A2428AED8FBC9@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com>

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/h2645_sei.h  |  2 +-
 libavcodec/h264_sei.c   | 14 +++++++-------
 libavcodec/h264_sei.h   | 13 -------------
 libavcodec/h264_slice.c | 16 ++++++++--------
 libavcodec/sei.h        | 17 +++++++++++++++++
 5 files changed, 33 insertions(+), 29 deletions(-)

diff --git a/libavcodec/h2645_sei.h b/libavcodec/h2645_sei.h
index 4600caab29..4713b89e1f 100644
--- a/libavcodec/h2645_sei.h
+++ b/libavcodec/h2645_sei.h
@@ -57,7 +57,7 @@ typedef struct H2645SEIFramePacking {
     int present;
     int arrangement_id;
     int arrangement_cancel_flag;  ///< is previous arrangement canceled, -1 if never received (currently H.264 only)
-    int arrangement_type;
+    SEIFpaType arrangement_type;
     int arrangement_repetition_period;
     int content_interpretation_type;
     int quincunx_sampling_flag;
diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
index f11f8371f6..668204959f 100644
--- a/libavcodec/h264_sei.c
+++ b/libavcodec/h264_sei.c
@@ -307,37 +307,37 @@ const char *ff_h264_sei_stereo_mode(const H2645SEIFramePacking *h)
 {
     if (h->arrangement_cancel_flag == 0) {
         switch (h->arrangement_type) {
-            case H264_SEI_FPA_TYPE_CHECKERBOARD:
+            case SEI_FPA_H264_TYPE_CHECKERBOARD:
                 if (h->content_interpretation_type == 2)
                     return "checkerboard_rl";
                 else
                     return "checkerboard_lr";
-            case H264_SEI_FPA_TYPE_INTERLEAVE_COLUMN:
+            case SEI_FPA_H264_TYPE_INTERLEAVE_COLUMN:
                 if (h->content_interpretation_type == 2)
                     return "col_interleaved_rl";
                 else
                     return "col_interleaved_lr";
-            case H264_SEI_FPA_TYPE_INTERLEAVE_ROW:
+            case SEI_FPA_H264_TYPE_INTERLEAVE_ROW:
                 if (h->content_interpretation_type == 2)
                     return "row_interleaved_rl";
                 else
                     return "row_interleaved_lr";
-            case H264_SEI_FPA_TYPE_SIDE_BY_SIDE:
+            case SEI_FPA_TYPE_SIDE_BY_SIDE:
                 if (h->content_interpretation_type == 2)
                     return "right_left";
                 else
                     return "left_right";
-            case H264_SEI_FPA_TYPE_TOP_BOTTOM:
+            case SEI_FPA_TYPE_TOP_BOTTOM:
                 if (h->content_interpretation_type == 2)
                     return "bottom_top";
                 else
                     return "top_bottom";
-            case H264_SEI_FPA_TYPE_INTERLEAVE_TEMPORAL:
+            case SEI_FPA_TYPE_INTERLEAVE_TEMPORAL:
                 if (h->content_interpretation_type == 2)
                     return "block_rl";
                 else
                     return "block_lr";
-            case H264_SEI_FPA_TYPE_2D:
+            case SEI_FPA_H264_TYPE_2D:
             default:
                 return "mono";
         }
diff --git a/libavcodec/h264_sei.h b/libavcodec/h264_sei.h
index 003f427ac3..bb9275e569 100644
--- a/libavcodec/h264_sei.h
+++ b/libavcodec/h264_sei.h
@@ -40,19 +40,6 @@ typedef enum {
     H264_SEI_PIC_STRUCT_FRAME_TRIPLING    = 8  ///<  8: %frame tripling
 } H264_SEI_PicStructType;
 
-/**
- * frame_packing_arrangement types
- */
-typedef enum {
-    H264_SEI_FPA_TYPE_CHECKERBOARD        = 0,
-    H264_SEI_FPA_TYPE_INTERLEAVE_COLUMN   = 1,
-    H264_SEI_FPA_TYPE_INTERLEAVE_ROW      = 2,
-    H264_SEI_FPA_TYPE_SIDE_BY_SIDE        = 3,
-    H264_SEI_FPA_TYPE_TOP_BOTTOM          = 4,
-    H264_SEI_FPA_TYPE_INTERLEAVE_TEMPORAL = 5,
-    H264_SEI_FPA_TYPE_2D                  = 6,
-} H264_SEI_FpaType;
-
 typedef struct H264SEITimeCode {
     /* When not continuously receiving full timecodes, we have to reference
        the previous timecode received */
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 18b9ae5b09..cd9f9bfa27 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1234,28 +1234,28 @@ static int h264_export_frame_props(H264Context *h)
         AVStereo3D *stereo = av_stereo3d_create_side_data(out);
         if (stereo) {
         switch (fp->arrangement_type) {
-        case H264_SEI_FPA_TYPE_CHECKERBOARD:
+        case SEI_FPA_H264_TYPE_CHECKERBOARD:
             stereo->type = AV_STEREO3D_CHECKERBOARD;
             break;
-        case H264_SEI_FPA_TYPE_INTERLEAVE_COLUMN:
+        case SEI_FPA_H264_TYPE_INTERLEAVE_COLUMN:
             stereo->type = AV_STEREO3D_COLUMNS;
             break;
-        case H264_SEI_FPA_TYPE_INTERLEAVE_ROW:
+        case SEI_FPA_H264_TYPE_INTERLEAVE_ROW:
             stereo->type = AV_STEREO3D_LINES;
             break;
-        case H264_SEI_FPA_TYPE_SIDE_BY_SIDE:
+        case SEI_FPA_TYPE_SIDE_BY_SIDE:
             if (fp->quincunx_sampling_flag)
                 stereo->type = AV_STEREO3D_SIDEBYSIDE_QUINCUNX;
             else
                 stereo->type = AV_STEREO3D_SIDEBYSIDE;
             break;
-        case H264_SEI_FPA_TYPE_TOP_BOTTOM:
+        case SEI_FPA_TYPE_TOP_BOTTOM:
             stereo->type = AV_STEREO3D_TOPBOTTOM;
             break;
-        case H264_SEI_FPA_TYPE_INTERLEAVE_TEMPORAL:
+        case SEI_FPA_TYPE_INTERLEAVE_TEMPORAL:
             stereo->type = AV_STEREO3D_FRAMESEQUENCE;
             break;
-        case H264_SEI_FPA_TYPE_2D:
+        case SEI_FPA_H264_TYPE_2D:
             stereo->type = AV_STEREO3D_2D;
             break;
         }
@@ -1263,7 +1263,7 @@ static int h264_export_frame_props(H264Context *h)
         if (fp->content_interpretation_type == 2)
             stereo->flags = AV_STEREO3D_FLAG_INVERT;
 
-        if (fp->arrangement_type == H264_SEI_FPA_TYPE_INTERLEAVE_TEMPORAL) {
+        if (fp->arrangement_type == SEI_FPA_TYPE_INTERLEAVE_TEMPORAL) {
             if (fp->current_frame_is_frame0_flag)
                 stereo->view = AV_STEREO3D_VIEW_LEFT;
             else
diff --git a/libavcodec/sei.h b/libavcodec/sei.h
index f13c37c308..f96b7b647b 100644
--- a/libavcodec/sei.h
+++ b/libavcodec/sei.h
@@ -137,4 +137,21 @@ enum SEIType {
     SEI_TYPE_SAMPLE_ASPECT_RATIO_INFO                    = 204,
 };
 
+/**
+ * frame_packing_arrangement types. H.265 and H.274 use only 3..5
+ * with all the other values being reserved. H.264 uses a few more values
+ * that are prefixed with SEI_FPA_H264 in the enum below.
+ *
+ * The semantics of the common values are the same for all standards.
+ */
+typedef enum {
+    SEI_FPA_H264_TYPE_CHECKERBOARD        = 0,
+    SEI_FPA_H264_TYPE_INTERLEAVE_COLUMN   = 1,
+    SEI_FPA_H264_TYPE_INTERLEAVE_ROW      = 2,
+    SEI_FPA_TYPE_SIDE_BY_SIDE             = 3,
+    SEI_FPA_TYPE_TOP_BOTTOM               = 4,
+    SEI_FPA_TYPE_INTERLEAVE_TEMPORAL      = 5,
+    SEI_FPA_H264_TYPE_2D                  = 6,
+} SEIFpaType;
+
 #endif /* AVCODEC_SEI_H */
-- 
2.34.1

_______________________________________________
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".

  parent reply	other threads:[~2022-07-02 22:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-02 22:20 [FFmpeg-devel] [PATCH 01/20] avcodec/hevc_sei: Use proper type for NALU type Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 02/20] avcodec/h264_sei: Don't use GetBit-API for byte-aligned reads Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 03/20] configure: Add (h264|hevc)_sei subsystems Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 04/20] avcodec/sei: Add tag to SEI enumeration Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 05/20] fftools/ffprobe: Improve description of AFD side data Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 06/20] fate/h264: Add Active Format Descriptor test Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 07/20] avcodec/h2645_sei: Factor parsing common SEI messages out Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 08/20] avcodec/h2645_sei: Factor updating H.2645 SEIs out Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 09/20] avcodec/h2645_sei: Factor out freeing common SEI parts Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 10/20] avcodec/h2645_sei: Factor out applying SEIs to frames Andreas Rheinhardt
2022-07-02 22:21 ` Andreas Rheinhardt [this message]
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 12/20] avcodec/h2645_sei: Attach AVStereo3D side data generically Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 13/20] avcodec/h2645_sei: Also support Active Format Descriptor for HEVC Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 14/20] avcodec/h264_ps: Don't error out on unknown aspect ratio Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 15/20] avcodec/h264data: Deduplicate H.26[45] aspect ratio table Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 16/20] avcodec/hevc_ps: Fix wrong copyright years Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 17/20] avcodec/h264_ps: Don't output invalid chroma location Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 18/20] avcodec/h26[45]_metadata_bsf: Fix range of chroma_sample_loc_type Andreas Rheinhardt
2022-07-02 22:21 ` [FFmpeg-devel] [PATCH 19/20] avcodec/(h264|hevc)_ps: Factor common VUI code out Andreas Rheinhardt
2022-07-02 22:22 ` [FFmpeg-devel] [PATCH 20/20] avcodec/h2645_sei: Factor attaching film grain side-data to frame out Andreas Rheinhardt
2022-07-02 23:28 ` [FFmpeg-devel] [PATCH 01/20] avcodec/hevc_sei: Use proper type for NALU type Soft Works
2022-11-23  3:19   ` Andreas Rheinhardt
2022-11-23  4:15     ` Soft Works
2022-11-23  5:05     ` Soft Works

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=DB6PR0101MB22143216494044CDEF82847B8FBC9@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com \
    --to=andreas.rheinhardt@outlook.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