Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: toqsxw@gmail.com
To: ffmpeg-devel@ffmpeg.org
Cc: nuomi2021@gmail.com, Wu Jianhua <toqsxw@outlook.com>
Subject: [FFmpeg-devel] [PATCH v2 17/20] avcodec/vvc/sei: add decode_frame_field_info
Date: Sun, 27 Apr 2025 19:44:47 +0800
Message-ID: <20250427114451.1236-17-toqsxw@outlook.com> (raw)
In-Reply-To: <20250427114451.1236-1-toqsxw@outlook.com>

From: Wu Jianhua <toqsxw@outlook.com>

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
---
 libavcodec/vvc/sei.c | 26 ++++++++++++++++++++++++++
 libavcodec/vvc/sei.h |  1 +
 2 files changed, 27 insertions(+)

diff --git a/libavcodec/vvc/sei.c b/libavcodec/vvc/sei.c
index 49a7961c63..47edd94fb2 100644
--- a/libavcodec/vvc/sei.c
+++ b/libavcodec/vvc/sei.c
@@ -127,6 +127,27 @@ static int decode_content_light_level_info(H2645SEIContentLight *h, const SEIRaw
     return 0;
 }
 
+static int decode_frame_field_info(H274SEIFrameFieldInfo *h, const SEIRawFrameFieldInformation *s)
+{
+    if (s->ffi_source_scan_type > 3)
+        return AVERROR_INVALIDDATA;
+
+    h->present = 1;
+    if (s->ffi_field_pic_flag) {
+        if (s->ffi_bottom_field_flag)
+            h->picture_struct = AV_PICTURE_STRUCTURE_BOTTOM_FIELD;
+        else
+            h->picture_struct = AV_PICTURE_STRUCTURE_TOP_FIELD;
+    } else {
+        h->display_elemental_periods = s->ffi_display_elemental_periods_minus1 + 1;
+    }
+
+    h->source_scan_type = s->ffi_source_scan_type;
+    h->duplicate_flag   = s->ffi_duplicate_flag;
+
+    return 0;
+}
+
 int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameContext *fc)
 {
     H2645SEI *c  = &s->common;
@@ -155,6 +176,9 @@ int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameCon
         case SEI_TYPE_CONTENT_LIGHT_LEVEL_INFO:
             return decode_content_light_level_info(&s->common.content_light, payload);
 
+        case SEI_TYPE_FRAME_FIELD_INFO:
+            return decode_frame_field_info(&s->frame_field_info, payload);
+
         default:
             av_log(fc->log_ctx, AV_LOG_DEBUG, "Skipped %s SEI %d\n",
                 sei->nal_unit_header.nal_unit_type == VVC_PREFIX_SEI_NUT ?
@@ -169,6 +193,7 @@ int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameCon
 int ff_vvc_sei_replace(VVCSEI *dst, const VVCSEI *src)
 {
     dst->picture_hash.present = 0;        // drop hash
+    dst->frame_field_info.present = 0;    // drop field info
     return ff_h2645_sei_ctx_replace(&dst->common, &src->common);
 }
 
@@ -176,4 +201,5 @@ void ff_vvc_sei_reset(VVCSEI *s)
 {
     ff_h2645_sei_reset(&s->common);
     s->picture_hash.present = 0;
+    s->frame_field_info.present = 0;
 }
diff --git a/libavcodec/vvc/sei.h b/libavcodec/vvc/sei.h
index 6e4855bf60..578b48a0e4 100644
--- a/libavcodec/vvc/sei.h
+++ b/libavcodec/vvc/sei.h
@@ -36,6 +36,7 @@
 typedef struct VVCSEI {
     H2645SEI common;
     H274SEIPictureHash picture_hash;
+    H274SEIFrameFieldInfo frame_field_info;
 } VVCSEI;
 
 struct VVCFrameContext;
-- 
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".

  parent reply	other threads:[~2025-04-27 11:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-27 11:44 [FFmpeg-devel] [PATCH v2 01/20] avcodec/cbs_h2645: add cbs_sei_h274_types toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 02/20] avcodec/cbs_sei_syntax_template: add sei message film_grain_characteristics toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 03/20] avcodec/vvc: support decoding prefix and suffix nal units toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 04/20] avcodec/vvc/sei: add decode_film_grain_characteristics toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 05/20] avcodec/vvc/dec: export sei to the frame when the frame starts toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 06/20] avcodec/vvc/dec: support applying film grain by the decoder toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 07/20] avcodec/vvc/dec: support removing film grain params from side data toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 08/20] avcodec/h274: add H274SEIPictureHash struct toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 09/20] avcodec/vvc/sei: add decode_decoded_picture_hash toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 10/20] avcodec/h274: add ff_h274_hash functions toqsxw
2025-05-31 20:34   ` Andreas Rheinhardt
2025-05-31 21:46     ` [FFmpeg-devel] 回复: " Wu Jianhua
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 11/20] avcodec/vvcdec: verify picture hash toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 12/20] avcodec/cbs_sei_syntax_template: add sei message sei_display_orientation toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 13/20] avcodec/vvc/sei: add decode_display_orientation toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 14/20] avcodec/vvc/sei: add decode_content_light_level_info toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 15/20] avcodec/cbs_sei_syntax_template: add sei message frame_field_information toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 16/20] avcodec/h274: add H274SEIFrameFieldInfo struct toqsxw
2025-04-27 11:44 ` toqsxw [this message]
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 18/20] avcodec/vvc: support fields toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 19/20] avcodec/vvc/sei: add decode_ambient_viewing_environment toqsxw
2025-04-27 11:44 ` [FFmpeg-devel] [PATCH v2 20/20] avcodec/vvc/sei: add decode_mastering_display_colour_volume toqsxw

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=20250427114451.1236-17-toqsxw@outlook.com \
    --to=toqsxw@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=nuomi2021@gmail.com \
    --cc=toqsxw@outlook.com \
    /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