From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 620194BB28 for ; Tue, 28 Oct 2025 12:53:26 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'dprNeesmLTO1xVbgzp+kt46GZsurFkC2XVkE7mMyRjY=', expected b'Me6vY+mOG/TQ4k2emZXhBwGGAXPP8748EiDFNDaRHU0=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1761655999; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=dprNeesmLTO1xVbgzp+kt46GZsurFkC2XVkE7mMyRjY=; b=HXbTfJ660360gIey0YZq0vPgBhMp4nphxg6iPTqa3n0Z9Ryn1Ic2GnQn325vTTtUAyF4l mVSkgq3uZhme5QSe7MiT+p6ElVns/5eTTsb/GCAnCgD6HEmS8+gkdyA9soEUulU/VGItRE6 ufYnNjD90lKRu6yU06EiGCoEZ3B+RozuO0nVLyexTeojIZ5xCnlxjdBOIYC7FZ6aj5+vWqG DebcqwwtE0sJsXYyG0f8CvmI5kHVzuzdhXZbEMu+OScU4kHxxq3WOA7RgA7r7JRbaCy51hU pRPRYcvUO0eSGiX7prvoGM0DZi0vnCpJuLlZjaltoBM53Sf7GC8xOul8sEHg== Received: from [172.19.0.2] (unknown [172.19.0.2]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id AE66968F6E0; Tue, 28 Oct 2025 14:53:19 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1761655984; b=SRVzIvAN9RyXrjy/jzGMQc4MpPQxjAd+aUyqX+QMdFJT2b3xnIsLEdOMi+C81gZUbQHEO i+MZjy6cXXUyQEKGYYKWnQiZpwJir85/JvR6sBMD7KY1ishqJf6gDw8N2EA4yOb2BuMtebO L/ckVqotTV60W0rQtHfbSKndrWDnLdxYVSuAIiaEM0yY1gnnO+kAPbVWf56ZbnawKwEbv8I uM6XO0CvkSpCmwfXmA8+HxKDmYUkHipHULr5lQas6U255ufe8QGMnfuAUqQKSO/F0ZRztQ0 rSYycseZYL4lK5018JJOKYzB9FNk5hZ1/lYW5Jm31nFU9nkh/PmUKWIiaMdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1761655984; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=XMKlG1rgtSFMAOZS8rFWgOvNVOmcJAbCR8yqs05yKzE=; b=k9tPqCsPhaR7eoNe32ldE+EmOo0JV6OkkAZ0/f/i9oSB3rMC5ufTKBrJPqXP+rty3+Bqz WNX2+Ht6gFHUWyCWhmViMBlfvvu6G/zz5+kbMLRzK/kIq7jbhVP2Ow40wHNz8Ev/1HgKO8e xbXeNIF7+N7iBJVwMUua5qXzl1YhBzRSZnBekilAuRQNmfxAvxp+30o3dUaYBF7vF7zUlTW XeBroAohzellNAA+1qq++rDdZWv1rFE27egBbg6dD58ubUigTkSHMM4d40kOf1r+Y1Ak7rp VLjmvImBACYih1R8xSZLFleMIHvBbSyCBt5pamh+rXV5jCgluAFPuqiQiHbQ== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1761655976; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=Me6vY+mOG/TQ4k2emZXhBwGGAXPP8748EiDFNDaRHU0=; b=RYR1YhfVr5Tg2R77+SiRJyoG8Kl4VJVzamBub9ZYZpAkG7FgfM3cuw1SBn+9vBOOSOgmJ 9bOSPGgm0S7BO5Wj2yItFc89qBFNImjRBIE3ddFoz2sH78YdAP/Qjaf4x6qT/CaNHuw2tdX KsQHArr7Rg1aIRkx6afeXfI+KAqVSS2BaYhFvE9zeeFmyqweX9iXe6kcqxmUIahQEno1qQw l7IRNCWrpkpGVyAe6he+Y+/wk64pHUgc2rCojnqRdyW/GVZncl4RrhsZ5d2hk9TVA93Exyz rfeDPmcGu4PW/H5WHGCM/sEvpEzlg9AYDoz6EBSJcl8uGrJWQ9CY+0/ok3Ow== Received: from 02c22a36bd31 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 8E4C7680181 for ; Tue, 28 Oct 2025 14:52:56 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Tue, 28 Oct 2025 12:52:56 -0000 Message-ID: <176165597668.81.6376310494052232976@7d278768979e> Message-ID-Hash: 76CK4BPR4B52RWCBGAOZQQIRSHXZEZRR X-Message-ID-Hash: 76CK4BPR4B52RWCBGAOZQQIRSHXZEZRR X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] avcodec/hevc: reset long_term_rps.nb_refs for IDR (PR #20774) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Zhao Zhili via ffmpeg-devel Cc: Zhao Zhili Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #20774 opened by Zhao Zhili (quink) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20774 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20774.patch For mv-hevc, the second layer of IDR frame can be a P slice. long_term_rps wasn't been reset before the patch, which leading to ff_hevc_frame_nb_refs return incorrect result. This fix decoding failure for samples from Pico VR. >>From 5adc48455a3750c2903989d173552ee4f65c21c6 Mon Sep 17 00:00:00 2001 From: Zhao Zhili Date: Tue, 28 Oct 2025 20:20:23 +0800 Subject: [PATCH 1/2] avcodec/hevc: remove an always true condition long_rps is &sh->long_term_rps. --- libavcodec/hevc/refs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavcodec/hevc/refs.c b/libavcodec/hevc/refs.c index 15f37bfcd8..ccf7258ec4 100644 --- a/libavcodec/hevc/refs.c +++ b/libavcodec/hevc/refs.c @@ -626,10 +626,8 @@ int ff_hevc_frame_nb_refs(const SliceHeader *sh, const HEVCPPS *pps, ret += !!(rps->used & (1 << i)); } - if (long_rps) { - for (i = 0; i < long_rps->nb_refs; i++) - ret += !!long_rps->used[i]; - } + for (i = 0; i < long_rps->nb_refs; i++) + ret += !!long_rps->used[i]; if (sh->inter_layer_pred) { av_assert0(pps->sps->vps->num_direct_ref_layers[layer_idx] < 2); -- 2.49.1 >>From 85420d061c7ad7928acab6f9c244726b0b7a5159 Mon Sep 17 00:00:00 2001 From: Zhao Zhili Date: Tue, 28 Oct 2025 20:25:12 +0800 Subject: [PATCH 2/2] avcodec/hevc: reset long_term_rps.nb_refs for IDR For mv-hevc, the second layer of IDR frame can be a P slice. long_term_rps wasn't been reset before the patch, which leading to ff_hevc_frame_nb_refs return incorrect result. This fix decoding failure for samples from Pico VR. --- libavcodec/hevc/hevcdec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 8d432a9a1f..3f471dbc14 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -917,6 +917,7 @@ static int hls_slice_header(SliceHeader *sh, const HEVCContext *s, GetBitContext sh->short_term_ref_pic_set_size = 0; sh->short_term_rps = NULL; sh->long_term_ref_pic_set_size = 0; + sh->long_term_rps.nb_refs = 0; sh->slice_temporal_mvp_enabled_flag = 0; } -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org