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 ESMTP id 4BC1B40B31 for ; Tue, 7 Jun 2022 07:15:53 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1C7FE68B5FF; Tue, 7 Jun 2022 10:15:37 +0300 (EEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2354A68B5AE for ; Tue, 7 Jun 2022 10:15:29 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654586135; x=1686122135; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HngGoGa5MSvythMXPwrNqCaAFNc/UpEMGVnVsgVih20=; b=eSo7KuHUCh/7YBs2ttM/6866lWjmYFaKwAuHC3MQxw+Bzf3n8EDe+znR Nx4Nh1asN5A2u1STXxkCMG+7Gyz/GAQnEZfhlosDzet8GDvQmIcNYkbGD i+82fs2KxI9jJnAkojJprKLSvtF2t3/4QhP4zpLYEFHxfrIlDTWbFnbPm psYgCWvriNh593l00cyclChpDp8GWvFr9f+idSgxB5X99NdKUFc67aJoz JYi9ykW0UcMMuJAzzkowk0KRFZ2Hlc26QLSEncBxV6GiDjFwJJ8LvSJQT EFLBvk4krXTv+iWQenJp0JCCb259Y+2llj/eB7UemrrsYMbwFhz7oqcrz A==; X-IronPort-AV: E=McAfee;i="6400,9594,10370"; a="337975037" X-IronPort-AV: E=Sophos;i="5.91,283,1647327600"; d="scan'208";a="337975037" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2022 00:15:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,283,1647327600"; d="scan'208";a="635988933" Received: from t.sh.intel.com ([10.239.159.147]) by fmsmga008.fm.intel.com with ESMTP; 07 Jun 2022 00:15:20 -0700 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Tue, 7 Jun 2022 15:08:29 +0800 Message-Id: <20220607070830.2654218-3-fei.w.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607070830.2654218-1-fei.w.wang@intel.com> References: <20220607070830.2654218-1-fei.w.wang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v1 3/4] lavc/hevc_refs: exclude current frame from long term refs 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: Xu Guangxin , Fei Wang 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: Xu Guangxin suppose a. You have 3 frames, 0, 1, 4096. b. The ltMask is 0xfff and use_msb is 0. c. The 0, 1 are lt refs for 4096. d. you are decoding frame 4096, and get the 0 frame. Since 4096 & ltMask is 0 too, even you want get 0, find_ref_idx may give you 4096. add_candidate_ref will report an error for this Tested-by: Fei Wang Signed-off-by: Xu Guangxin --- libavcodec/hevc_refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c index 3ea2fb6c0b..7b106e31d7 100644 --- a/libavcodec/hevc_refs.c +++ b/libavcodec/hevc_refs.c @@ -387,7 +387,7 @@ static HEVCFrame *find_ref_idx(HEVCContext *s, int poc, uint8_t use_msb) for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) { HEVCFrame *ref = &s->DPB[i]; if (ref->frame->buf[0] && ref->sequence == s->seq_decode) { - if ((ref->poc & mask) == poc) + if ((ref->poc & mask) == poc && (use_msb || ref->poc != s->poc)) return ref; } } -- 2.25.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".