From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 480254E01B for ; Sun, 27 Apr 2025 11:46:24 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C536968B522; Sun, 27 Apr 2025 14:45:54 +0300 (EEST) Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 18286687B1C for ; Sun, 27 Apr 2025 14:45:22 +0300 (EEST) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-736c062b1f5so3166535b3a.0 for ; Sun, 27 Apr 2025 04:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745754320; x=1746359120; 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=oRItoM7LVfY3YfPUiV0LgimOkUBNQYOAfBtqnMjET8U=; b=ReNf7CXTeH4aqPrKi+6BSsIEP7oSq14DhNuZ4+qNqMVgnV/C6xEcFVDaiqxq151aFM KKilfEXr1HmT90RhAjWUKhE5Nd7MxyPg0+rAA8ViFxHGyGSrQtaAk3R2b6Inwr6BXZ2J XbjAU4jXJcjvhmEskyzFdxMzg1dEuVADO4jvlUx3ToCqhEWE6uJEI2MP6qcuGuPivPpR sZ9pu6SaJw8O4bi8hT+f+i3XEPvCkUHlepXCoo5d3c7ZWEpAc1ROJV6NoPNfp0EOaYwA 4XfMTs66fG/FuajdeVUGfBrqXWOK49IMvKbEbMF6T+bqKv1+cfsfZwBLrQJOHdWHookR hxHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745754320; x=1746359120; 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=oRItoM7LVfY3YfPUiV0LgimOkUBNQYOAfBtqnMjET8U=; b=ka7DerfxAsScbGWxTMBU7GeXAt/nzzRdjDWiw/kcgkXYFTScH4NYQFNEBC8GcC05NN UMnhnrhKlAVM1QAv7XPd5yhlFqeFK4GQ+0x+XATkgVpb0G/DwAWSvApelynF4JZKEk24 Py6Fw4dcNTdGKrz0u8fR8J4dQhZHv/SCt+ZCil5NyuirrBSn6iIxuRqUc8cCT/3y+eZV QAKsfx76YphOZn6Nop/6X4NlBH8Q56BT1O3+ZTO9X9xy1E6Lw41ia9KZNtlkuf3JkuIy 9i/IpdXFF6GB06ChXYt52FjHbg5U4irZWBFGDl7dj1tOMLcMCmgWAgWPXcVhBBtNUiHF lBSA== X-Gm-Message-State: AOJu0Yz1QOsEsIPEKGP9ZaK3f1UvuS+iyVV/kCDgwY2h8I+wS7DaBz8c 1cxBJV77gVfNz36IEjcjwaiwn4XDVFI3eKuEUITZ4PGkLXla0yQsoRdsPBGa X-Gm-Gg: ASbGncth5PMA7BDFA8BFM//IGNAGNip9Ysv16jwVEMWnAWrd+MxfGWvH85LgG1ncTAi JZilbhULJlh0TWAgjytr2fIOdgNNXDi9j0SujJ1c1PHbG6bQWnv2i9gJU/gDPPkdQc3hF0EBLJQ VtWL1XUwUFkA9dFuLyNp/jWcteQyOlyFF96kTGzMtw1ZRR4hAKXkMXinHpzIZXLoZNrDucL+phH cJEQ4roL/U8/IdnRkDy77351+cvjpkGx1JB57vn4MzWJ0VtISYM+nEgNVeJGq9m8Figwu4k+l1+ Uu0+e/W7IfLd0s42nFYdwKZaW8jTgcZXkhHp77usGhlbBEE+fSE7b8OaSlQzjQ== X-Google-Smtp-Source: AGHT+IGRAzuOGSdfdzqLZ/emmDPsUPtMwlpSlrtH6F242ltRZYmbyqSNrSc5bhWofT+Rh3MKtSDqcA== X-Received: by 2002:a05:6a00:2402:b0:736:2a73:675b with SMTP id d2e1a72fcca58-73fd876d982mr12513803b3a.19.1745754320065; Sun, 27 Apr 2025 04:45:20 -0700 (PDT) Received: from localhost.localdomain ([124.79.129.75]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e259134ebsm6064452b3a.27.2025.04.27.04.45.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Apr 2025 04:45:19 -0700 (PDT) From: toqsxw@gmail.com X-Google-Original-From: toqsxw@outlook.com To: ffmpeg-devel@ffmpeg.org Date: Sun, 27 Apr 2025 19:44:35 +0800 Message-ID: <20250427114451.1236-5-toqsxw@outlook.com> X-Mailer: git-send-email 2.44.0.windows.1 In-Reply-To: <20250427114451.1236-1-toqsxw@outlook.com> References: <20250427114451.1236-1-toqsxw@outlook.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 05/20] avcodec/vvc/dec: export sei to the frame when the frame starts X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: nuomi2021@gmail.com, Wu Jianhua Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Wu Jianhua Signed-off-by: Wu Jianhua --- libavcodec/h2645_sei.c | 9 +++++---- libavcodec/h2645_sei.h | 2 +- libavcodec/vvc/dec.c | 12 ++++++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/libavcodec/h2645_sei.c b/libavcodec/h2645_sei.c index 2494daaf3c..78d9db20fd 100644 --- a/libavcodec/h2645_sei.c +++ b/libavcodec/h2645_sei.c @@ -44,8 +44,9 @@ #include "h2645_sei.h" #include "itut35.h" -#define IS_H264(codec_id) (CONFIG_H264_SEI && CONFIG_HEVC_SEI ? codec_id == AV_CODEC_ID_H264 : CONFIG_H264_SEI) -#define IS_HEVC(codec_id) (CONFIG_H264_SEI && CONFIG_HEVC_SEI ? codec_id == AV_CODEC_ID_HEVC : CONFIG_HEVC_SEI) +#define IS_H264(codec_id) (CONFIG_H264_SEI && (CONFIG_HEVC_SEI || CONFIG_VVC_SEI ) ? codec_id == AV_CODEC_ID_H264 : CONFIG_H264_SEI) +#define IS_HEVC(codec_id) (CONFIG_HEVC_SEI && (CONFIG_H264_SEI || CONFIG_VVC_SEI ) ? codec_id == AV_CODEC_ID_HEVC : CONFIG_HEVC_SEI) +#define IS_VVC(codec_id) (CONFIG_VVC_SEI && (CONFIG_H264_SEI || CONFIG_HEVC_SEI) ? codec_id == AV_CODEC_ID_VVC : CONFIG_VVC_SEI ) #if CONFIG_HEVC_SEI static int decode_registered_user_data_dynamic_hdr_plus(HEVCSEIDynamicHDRPlus *s, @@ -427,7 +428,7 @@ static int decode_film_grain_characteristics(H2645SEIFilmGrainCharacteristics *h } } } - if (IS_HEVC(codec_id)) + if (!IS_H264(codec_id)) h->persistence_flag = get_bits1(gb); else h->repetition_period = get_ue_golomb_long(gb); @@ -854,7 +855,7 @@ FF_ENABLE_DEPRECATION_WARNINGS fgp->subsampling_x = fgp->subsampling_y = 0; h274->model_id = fgc->model_id; - if (fgc->separate_colour_description_present_flag) { + if (IS_VVC(codec_id) || fgc->separate_colour_description_present_flag) { fgp->bit_depth_luma = fgc->bit_depth_luma; fgp->bit_depth_chroma = fgc->bit_depth_chroma; fgp->color_range = fgc->full_range + 1; diff --git a/libavcodec/h2645_sei.h b/libavcodec/h2645_sei.h index abc49760d9..f2ad7147c6 100644 --- a/libavcodec/h2645_sei.h +++ b/libavcodec/h2645_sei.h @@ -108,7 +108,7 @@ typedef struct H2645SEIFilmGrainCharacteristics { uint8_t intensity_interval_upper_bound[3][256]; int16_t comp_model_value[3][256][6]; int repetition_period; //< H.264 only - int persistence_flag; //< HEVC only + int persistence_flag; //< HEVC/VVC } H2645SEIFilmGrainCharacteristics; typedef struct H2645SEIMasteringDisplay { diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c index 206be3cc33..8b1c2c751b 100644 --- a/libavcodec/vvc/dec.c +++ b/libavcodec/vvc/dec.c @@ -718,6 +718,14 @@ static void decode_prefix_sei(VVCFrameContext *fc, VVCContext *s) } } +static int set_side_data(VVCContext *s, VVCFrameContext *fc) +{ + AVFrame *out = fc->ref->frame; + + return ff_h2645_sei_to_frame(out, &fc->sei.common, AV_CODEC_ID_VVC, s->avctx, + NULL, fc->ps.sps->bit_depth, fc->ps.sps->bit_depth, fc->ref->poc); +} + static int frame_start(VVCContext *s, VVCFrameContext *fc, SliceContext *sc) { const VVCPH *ph = &fc->ps.ph; @@ -733,6 +741,10 @@ static int frame_start(VVCContext *s, VVCFrameContext *fc, SliceContext *sc) decode_prefix_sei(fc, s); + ret = set_side_data(s, fc); + if (ret < 0) + goto fail; + if (!IS_IDR(s)) ff_vvc_bump_frame(s, fc); -- 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".