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 D59AA4E00D for ; Sun, 27 Apr 2025 11:47:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0B40268B78B; Sun, 27 Apr 2025 14:46:49 +0300 (EEST) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1249568AE09 for ; Sun, 27 Apr 2025 14:45:31 +0300 (EEST) Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-736b98acaadso3623478b3a.1 for ; Sun, 27 Apr 2025 04:45:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745754330; x=1746359130; 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=6NmrAtkt2pSt858Kzy0tDOys8JryGzUcWkjINrqTO54=; b=GEI9a8krlyopczr882T3QsAbz+9yB+lVQEq+WYMFtMwucpMw+ozk8mY2RwLOOpdqlP sgpRCSyNG+Ci78A8O81GI/qh7cQoRvinz7wX1da0qZ9EF37II7HTITYdMoJEA15LCKNO sZ50Ol8Ek8H1exXO9v1OxxgdewOfyzOL4t2q18Q6ckSOjcy5Nb58VLJ23CWPA4bUgIwx g2ct3XaB//dNAMrx49p+5b1+SNYLdKdqLqqG03AQC0F91UaR6Kno9207DlUUmSY9sARn 7ByoNVt4aAXpir+Rs3QBmpAeuTbcgaQdmpe3SiIoh5vwNNXbeid9Vjv9C5lAyTW2TNIx 1kRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745754330; x=1746359130; 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=6NmrAtkt2pSt858Kzy0tDOys8JryGzUcWkjINrqTO54=; b=cc98uZPa0r6HoxtOa4JzYL/6y2fneqDKaOOCfACOlA2CaQzhRxcgMoHTTAph+u6olb Wk9ou4Zc1zt2e6B3SbmK8CoU4XycEGkGzXghI1ivGZytr/0U8VrHVjlRw2bmzmmqkAHH ggPAaEibWKKCYaOk1WEK4upXeraMOiqWHfpfEh1LUYJhy4c00pTVu4YTP7OegpRZyf0F pCqVxccTNd5WrLYLWJSLnuT3JpTi5SEWHD3s1ha6XRyyMn2U658HZUgySqzgH2c/Hl+s GeRy6ItKhsf8GEjEd3K7QFyUwuq/JC2193PdthwSXnxLpiWcmt0Is+Q252CqRu8i80qF E4Pw== X-Gm-Message-State: AOJu0Yy15qDsIa/W/JGhclro1uWUE86Bwp8a9fCg86cISsrHsunP8tc8 DxwYxllBLzHiM0qi3VTZmEZMAzgmTtdWDNBH+x2wi894XMXQYiE130hEYGnK X-Gm-Gg: ASbGncvj1ao3UfoOhNo8mU29q07L4qRRHr9+Ab2+QFhdM/C+3ldqPFylkw3IMz7Bsjy COuwW/4h42o1vGmfWHMbWkOTkfKenEm8eCkgjOHXppkTRohA1AEwTAEyVgCHelsEqWbcP0QcFTA LawYvBN02C3lvk89J2FmhhZZZYZlf85gAYfQ4lUYEnR2VNt9FKGzIlrKnhKMEyXB9tcaaIPEMWb J8eR+/l0loKWD6RCqR78/tJerDH3tb5h8R401BFfbi2Hazp31REPZ6zWlpPR+1xGZifLRoANWqA 8JL+yN+giwqkZne4IDVkoFbZOYphkysgHKyuYjnwW/eTiwb7YUWxPWuQN7L8xw== X-Google-Smtp-Source: AGHT+IHTBdkW7K/FHgnsHGDoVB4oGPREm2cUg4sTdCyVuUFKa8r8QSwz/p+P/NTBGr1JdYLmL/TgaA== X-Received: by 2002:a05:6a00:a8e:b0:730:7600:aeab with SMTP id d2e1a72fcca58-73fd75c4cd0mr10298782b3a.13.1745754329987; Sun, 27 Apr 2025 04:45:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Apr 2025 04:45:29 -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:41 +0800 Message-ID: <20250427114451.1236-11-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 11/20] avcodec/vvcdec: verify picture hash 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/vvc/dec.c | 21 ++++++++++++++++++++- libavcodec/vvc/dec.h | 2 ++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c index 4c0d08440a..11d653e684 100644 --- a/libavcodec/vvc/dec.c +++ b/libavcodec/vvc/dec.c @@ -1079,7 +1079,25 @@ static int frame_end(VVCContext *s, VVCFrameContext *fc) } } - return ret; + if (!s->avctx->hwaccel && s->avctx->err_recognition & AV_EF_CRCCHECK) { + VVCSEI *sei = &fc->sei; + if (sei->picture_hash.present) { + int ret = ff_h274_hash_init(&s->hash_ctx, sei->picture_hash.hash_type); + if (ret < 0) + return ret; + + ret = ff_h274_hash_verify(s->hash_ctx, &sei->picture_hash, fc->ref->frame, fc->ps.pps->width, fc->ps.pps->height); + if (ret < 0) { + av_log(s->avctx, AV_LOG_ERROR, + "Verifying checksum for frame with decoder_order %d: failed\n", + (int)fc->decode_order); + if (s->avctx->err_recognition & AV_EF_EXPLODE) + return ret; + } + } + } + + return 0; } static int wait_delayed_frame(VVCContext *s, AVFrame *output, int *got_output) @@ -1207,6 +1225,7 @@ static av_cold int vvc_decode_free(AVCodecContext *avctx) frame_context_free(s->fcs + i); av_free(s->fcs); } + ff_h274_hash_freep(&s->hash_ctx); ff_vvc_ps_uninit(&s->ps); ff_cbs_close(&s->cbc); diff --git a/libavcodec/vvc/dec.h b/libavcodec/vvc/dec.h index b159863b31..5f8065b38b 100644 --- a/libavcodec/vvc/dec.h +++ b/libavcodec/vvc/dec.h @@ -249,6 +249,8 @@ typedef struct VVCContext { uint64_t nb_frames; ///< processed frames int nb_delayed; ///< delayed frames + + H274HashContext *hash_ctx; } VVCContext ; #endif /* AVCODEC_VVC_DEC_H */ -- 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".