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 2ECA24C4CD for ; Thu, 23 Jan 2025 14:12:32 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 99E6968B8D7; Thu, 23 Jan 2025 16:12:28 +0200 (EET) Received: from out203-205-221-236.mail.qq.com (out203-205-221-236.mail.qq.com [203.205.221.236]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AEE67680B20 for ; Thu, 23 Jan 2025 16:12:20 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1737641531; bh=E+yZOwpJv95dfweEzE4BjutMybgMEBROZsf3tD0nbss=; h=From:To:Cc:Subject:Date; b=PI0qNXAHtvVMaz/P36O8xCHTNQPYJcFEYqQ8d/boLt6qRbxmJPgvjuPB0As7KQ419 CBnZEIN5Gdg1If4gq7O/yfD57V7KUfE108ROE2ej8GoV3BNdgwYbtri16RI1+OEZyI IpPoifsVqourupnAzfXOl49A/mr8Xiqki5I7M3BI= Received: from localhost.localdomain ([119.147.10.242]) by newxmesmtplogicsvrszgpua8-1.qq.com (NewEsmtp) with SMTP id 30A97459; Thu, 23 Jan 2025 22:12:10 +0800 X-QQ-mid: xmsmtpt1737641530tk74wke8f Message-ID: X-QQ-XMAILINFO: NMMG1eKt9nPGrNmFs/x42IT+P83gMDu/aDnWUl29/AD07fAYQbWgpeKf08yoYl wEUDK3TEgstvJu+Xf+lhWLlfU1Z1WHF/cAsU2SmTFKmVAd9gw9flq1FB5toP0loulGkQZZ7t734y QRFYAbkrVF2YfGHEJN1AQhNVngoML/vnph3NTm2XXjYpcZeny2g5zV5qC6VKg55dD56GLAExUZ0C BCn+IyzjpNCDDxHlPj36CzOjRFjVyPY9zscaJah6RPexi3ztNdc3sHQdRoK+/H2MDG1RrHg+1fSt aTUkK3t+CCZQAmGZWZSm4ifVxM5xzSjvlvCUd3E3eihzwP7BQsM3zPk5b1lWTDXQSsV0zt1pxK9N /wPD+SKKu21poxcAFnto36UZhZ+Q3qpZg4WMK0bjP3oSkrnTlAlSnmiBwIVIXUIoV4S3GMoT655f FvA9EDa7EEcwPINgLkO6a6YCPRq6rWT3UZwZA3LpenGSrPldjTmfRm5Pzi3YsF0JbYQaSByOFFCI lst1xuAb7ujxoQI/O955HVeguri9oud8M9rX6W5JHpycxCMAdYmUgtEYzpdRxr3H9ouDiHbaRE1M UpnlzeYFDHGRcIFAm+1j+39CRW9fzz4pS7eGp8zMF2fD9z2Iw2goJ4PJxZjN69L6X3ZwOynb5bZW NCRKqdpAaCXbIWraMC631F5R5mRG5+iwdZNFc7D8G5c51r40UZNwbdvZpYZf2IRHHWzStSxvxO1T EN6kkJ/MyFmKTq7l5KkQapBLcw8mYSJ9hvoosgYVjYPXe4eRuxPWS3eoOY+Z2+1cCk3p2yR9PZdh h3MeQyrpmENhXYO4Aq2JoGkV3/jp6zyLGn/wonRvzpIryZuT4diwghIAkHKHAEAAZ4atKsKlPljW 3Inr218WPnBKKnCCMsFJWWKsFO/vnVQpX5h9vvkLAVi+3TFFcnII8lPT3X8yGDDxYvHsCBXoYrWy KVxtQLw7OpWJoVDSUa1sJVorgM3veJ1CRtr7S79dh7E+GH57iunw== X-QQ-XMRINFO: NS+P29fieYNw95Bth2bWPxk= From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Thu, 23 Jan 2025 22:12:09 +0800 X-OQ-MSGID: <20250123141209.55818-1-quinkblack@foxmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 2/3] avcodec/hevc: Parse recovery point SEI 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: Zhao Zhili 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: Zhao Zhili --- libavcodec/hevc/hevcdec.c | 1 + libavcodec/hevc/sei.c | 16 ++++++++++++++++ libavcodec/hevc/sei.h | 7 +++++++ 3 files changed, 24 insertions(+) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 3655ed0039..79dd63092c 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -4009,6 +4009,7 @@ static int hevc_update_thread_context(AVCodecContext *dst, s->sei.common.display_orientation = s0->sei.common.display_orientation; s->sei.common.alternative_transfer = s0->sei.common.alternative_transfer; s->sei.tdrdi = s0->sei.tdrdi; + s->sei.recovery_point = s0->sei.recovery_point; return 0; } diff --git a/libavcodec/hevc/sei.c b/libavcodec/hevc/sei.c index e11a33773c..9c3594ac2f 100644 --- a/libavcodec/hevc/sei.c +++ b/libavcodec/hevc/sei.c @@ -79,6 +79,20 @@ static int decode_nal_sei_pic_timing(HEVCSEI *s, GetBitContext *gb, return 0; } +static int decode_nal_sei_recovery_point(HEVCSEI *s, GetBitContext *gb) +{ + HEVCSEIRecoveryPoint *rec = &s->recovery_point; + int recovery_poc_cnt = get_se_golomb(gb); + + if (recovery_poc_cnt > INT16_MAX || recovery_poc_cnt < INT16_MIN) + return AVERROR_INVALIDDATA; + rec->recovery_poc_cnt = recovery_poc_cnt; + rec->exact_match_flag = get_bits1(gb); + rec->broken_link_flag = get_bits1(gb); + + return 0; +} + static int decode_nal_sei_active_parameter_sets(HEVCSEI *s, GetBitContext *gb, void *logctx) { int num_sps_ids_minus1; @@ -212,6 +226,8 @@ static int decode_nal_sei_prefix(GetBitContext *gb, GetByteContext *gbyte, return decode_nal_sei_decoded_picture_hash(&s->picture_hash, gbyte); case SEI_TYPE_PIC_TIMING: return decode_nal_sei_pic_timing(s, gb, ps, logctx); + case SEI_TYPE_RECOVERY_POINT: + return decode_nal_sei_recovery_point(s, gb); case SEI_TYPE_ACTIVE_PARAMETER_SETS: return decode_nal_sei_active_parameter_sets(s, gb, logctx); case SEI_TYPE_TIME_CODE: diff --git a/libavcodec/hevc/sei.h b/libavcodec/hevc/sei.h index ee640003bc..7e1a2b0756 100644 --- a/libavcodec/hevc/sei.h +++ b/libavcodec/hevc/sei.h @@ -95,6 +95,12 @@ typedef struct HEVCSEITDRDI { uint8_t three_dimensional_reference_displays_extension_flag; } HEVCSEITDRDI; +typedef struct HEVCSEIRecoveryPoint { + int16_t recovery_poc_cnt; + uint8_t exact_match_flag; + uint8_t broken_link_flag; +} HEVCSEIRecoveryPoint; + typedef struct HEVCSEI { H2645SEI common; HEVCSEIPictureHash picture_hash; @@ -102,6 +108,7 @@ typedef struct HEVCSEI { int active_seq_parameter_set_id; HEVCSEITimeCode timecode; HEVCSEITDRDI tdrdi; + HEVCSEIRecoveryPoint recovery_point; } HEVCSEI; struct HEVCParamSets; -- 2.46.0 _______________________________________________ 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".