From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id 7331D4C0EA
	for <ffmpegdev@gitmailbox.com>; Tue,  1 Apr 2025 17:19:38 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3EE06687DCF;
	Tue,  1 Apr 2025 20:16:59 +0300 (EEST)
Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com
 [209.85.214.177])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 99653687DB6
 for <ffmpeg-devel@ffmpeg.org>; Tue,  1 Apr 2025 20:16:55 +0300 (EEST)
Received: by mail-pl1-f177.google.com with SMTP id
 d9443c01a7336-227d6b530d8so106734805ad.3
 for <ffmpeg-devel@ffmpeg.org>; Tue, 01 Apr 2025 10:16:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743527814; x=1744132614; darn=ffmpeg.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=2oc4eSl5hnylXmM9LRgeP/uSxSpHKG7xijs1Fa3fRXY=;
 b=lpTeZ3TcKYgCTMPRFkwq8j3IWn9j+b4kx2xba8PVK07UMz7q/J3o+qwoVmKYdeP9e4
 dUD/liEJ3I3C189pJthn7APdEDJWMKtixB5yJ4vWYerPhDdO9PZVN1nRhm6ESurya8Od
 5srn9bC36flPHHyUS9b/tFVbH+x+RgXpHyywCkskiyFLjB4wtPMuEF6+6YsIVSyCww42
 BS7DlFJxtehfevuUryBsToEJvFhf3hjDP3ifBSHgC2bN3KEX9dDRkhbSdbnESO/L106k
 wwHep63bE7KywEWjZfhH5SW3poOAuMq4NKcwIxU315LVZjcBCkD8yMR4pblW63ha/+Z+
 Uq3A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743527814; x=1744132614;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=2oc4eSl5hnylXmM9LRgeP/uSxSpHKG7xijs1Fa3fRXY=;
 b=hzeIX592WCs7bEyQ4/W1Hq8indnZrJqdRTrXggf+hlq38JkQJw5/jRSXzuPMuyQx3N
 vCQ1t8NSu9UWowww4k8uAxS7xrNkFufZyff6vhPvEngNLaxcVCp0cFLYMoan+l3Oet1l
 hgR9MN4OKoA/HUq9qO4cmSu3FenkQurfDjRX/O7iLRqRRb7rze5y/J3OjqzxY/t4tkQI
 9Nz56twfyPBKE+W9eflqkzMqKyWdKYwGM/osfLLOOAocpHAod7+7ZjuaZH9K9xJivJC/
 mt4+kcQ65qlT3AFpUpT9wy27kaKm9WROBVd7SiJgO9H3LFaS09Z8MhIBw0Sg68NV/6ls
 Jtpw==
X-Gm-Message-State: AOJu0YxmoxblJ3ymKS8tye2LdSX7aWueAwZ87sOLnJE6XzVa5623LQpT
 /y4oicw6e637yjezTOe2OPkArD3mtVh2WbPWrn8zEsd4iVYA0uigBm60zWbSXak=
X-Gm-Gg: ASbGncsro+ab6Z3VB90OubxYtON65DzaUSe4RORvyJEBFOmjucnArAf5fSbXmoMM5UL
 Y38QLjTSAPQ/enui/2SdAFwOzmiLkSEb5QDsovjYK2aMl43HhWJbfAeGrc9aaU8521xzz8NaN+l
 h7nYmgVGyR9qExZvzG9rtarmod48h6mgqWDEATSKVp9C7R99Rw6sToRc+X8VAZRejp3tE45fUkK
 /1GyRFCdQvyFA7AS4Em5uBHD2XgVhK9qF+X+3Rs+vsboxWqX1BG0xP2T1ULlwYvOpQnuTJGiy1W
 itZW3BeQhBv0Gw8gqaQrRaKbR0eg2+vJm2IhSVJZgG4dbG2AJcOyNaIriqqMnUEKOg==
X-Google-Smtp-Source: AGHT+IHn12Orp84MhblsP3bRFnTOGv05AIRngJLIwOnly+FlGkW91zipgyB8aRXTYdUg1EE4kZvomw==
X-Received: by 2002:a17:902:c411:b0:220:f7bb:842 with SMTP id
 d9443c01a7336-2295c0ed243mr58678485ad.42.1743527813670; 
 Tue, 01 Apr 2025 10:16:53 -0700 (PDT)
Received: from localhost.localdomain ([124.79.129.75])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2291eee0bafsm90902495ad.90.2025.04.01.10.16.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 01 Apr 2025 10:16:53 -0700 (PDT)
From: toqsxw@gmail.com
X-Google-Original-From: toqsxw@outlook.com
To: ffmpeg-devel@ffmpeg.org
Date: Wed,  2 Apr 2025 01:16:11 +0800
Message-ID: <20250401171616.1378-14-toqsxw@outlook.com>
X-Mailer: git-send-email 2.44.0.windows.1
In-Reply-To: <20250401171616.1378-1-toqsxw@outlook.com>
References: <20250401171616.1378-1-toqsxw@outlook.com>
MIME-Version: 1.0
Subject: [FFmpeg-devel] [PATCH v1 14/19] avcodec/cbs_sei_syntax_template:
 add sei message frame_field_information
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Wu Jianhua <toqsxw@outlook.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250401171616.1378-14-toqsxw@outlook.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

From: Wu Jianhua <toqsxw@outlook.com>

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
---
 libavcodec/cbs_h2645.c               |  6 ++++++
 libavcodec/cbs_sei.h                 | 12 ++++++++++++
 libavcodec/cbs_sei_syntax_template.c | 26 ++++++++++++++++++++++++++
 3 files changed, 44 insertions(+)

diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
index c868770209..6677134d77 100644
--- a/libavcodec/cbs_h2645.c
+++ b/libavcodec/cbs_h2645.c
@@ -2199,6 +2199,12 @@ static const SEIMessageTypeDescriptor cbs_sei_common_types[] = {
         sizeof(SEIRawDisplayOrientation),
         SEI_MESSAGE_RW(sei, display_orientation)
     },
+    {
+        SEI_TYPE_FRAME_FIELD_INFO,
+        1, 0,
+        sizeof(SEIRawFrameFieldInformation),
+        SEI_MESSAGE_RW(sei, frame_field_information)
+    },
     SEI_MESSAGE_TYPE_END,
 };
 
diff --git a/libavcodec/cbs_sei.h b/libavcodec/cbs_sei.h
index 7be12e33e0..81867b79a7 100644
--- a/libavcodec/cbs_sei.h
+++ b/libavcodec/cbs_sei.h
@@ -125,6 +125,18 @@ typedef struct SEIRawDisplayOrientation {
     uint8_t      display_orientation_reserved_zero_3bits;
 } SEIRawDisplayOrientation;
 
+typedef struct SEIRawFrameFieldInformation {
+    uint8_t      ffi_field_pic_flag;
+    uint8_t      ffi_bottom_field_flag;
+    uint8_t      ffi_pairing_indicated_flag;
+    uint8_t      ffi_paired_with_next_field_flag;
+    uint8_t      ffi_display_fields_from_frame_flag;
+    uint8_t      ffi_top_field_first_flag;
+    uint8_t      ffi_display_elemental_periods_minus1;
+    uint8_t      ffi_source_scan_type;
+    uint8_t      ffi_duplicate_flag;
+} SEIRawFrameFieldInformation;
+
 typedef struct SEIRawMessage {
     uint32_t     payload_type;
     uint32_t     payload_size;
diff --git a/libavcodec/cbs_sei_syntax_template.c b/libavcodec/cbs_sei_syntax_template.c
index fb19f6ee42..e6863a0fd7 100644
--- a/libavcodec/cbs_sei_syntax_template.c
+++ b/libavcodec/cbs_sei_syntax_template.c
@@ -295,6 +295,32 @@ SEI_FUNC(display_orientation, (CodedBitstreamContext *ctx, RWContext *rw,
     return 0;
 }
 
+SEI_FUNC(frame_field_information, (CodedBitstreamContext *ctx, RWContext *rw,
+                                       SEIRawFrameFieldInformation *current,
+                                       SEIMessageState *state))
+{
+    int err;
+
+    HEADER("Frame-field information");
+
+    flag(ffi_field_pic_flag);
+    if (current->ffi_field_pic_flag) {
+        flag(ffi_bottom_field_flag);
+        flag(ffi_pairing_indicated_flag);
+        if (current->ffi_pairing_indicated_flag)
+            flag(ffi_paired_with_next_field_flag);
+    } else {
+        flag(ffi_display_fields_from_frame_flag);
+        if (current->ffi_display_fields_from_frame_flag)
+            flag(ffi_top_field_first_flag);
+        u(8, ffi_display_elemental_periods_minus1, 0, 0xff);
+    }
+    u(2, ffi_source_scan_type, 0, 3);
+    flag(ffi_duplicate_flag);
+
+    return 0;
+}
+
 static int FUNC(message)(CodedBitstreamContext *ctx, RWContext *rw,
                          SEIRawMessage *current)
 {
-- 
2.44.0.windows.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".