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 11AEF410E3 for ; Fri, 15 Jul 2022 05:08:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 20FDE68B97B; Fri, 15 Jul 2022 08:08:11 +0300 (EEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9333F68B78C for ; Fri, 15 Jul 2022 08:08:03 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657861688; x=1689397688; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dqZjY8+21UDy3woIV/K1+z2xGrTmYkS1yygskZyJoAo=; b=JapqHXtsBsTzKKH4lkZZMP6OfvW2VBrFy7UzpjDtXK7dQP1AEQJwIQ6j Udg2Fd8d5+vUVu8K5rXP10fSAB8j4pGxByB5QdzC1fairZCSGJfk1C+Ho 0CDZtM0GbgwYDElr7QzwmVgUN0xWU+1DqIyzFVisG+4PSfllJtLkRrRRb tz+Kq/rT6IqKnupR2aVYHZ8a3XbR6YucfJ2/Vq0hxZAqpDhtMO0Ii1xBA mUEBPBom0nvk/Q6ksS4p0Wqtqq8PFelLfmL9MhwuI4N19WNfL33hIUFZH NdIo7tNea65yEQS9hKevc+5SOtpeo+AkJwrlqhwu40nuHrdA1/nuLa1Bw w==; X-IronPort-AV: E=McAfee;i="6400,9594,10408"; a="265490997" X-IronPort-AV: E=Sophos;i="5.92,272,1650956400"; d="scan'208";a="265490997" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2022 22:07:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,272,1650956400"; d="scan'208";a="654183813" Received: from t.sh.intel.com ([10.239.159.159]) by fmsmga008.fm.intel.com with ESMTP; 14 Jul 2022 22:07:55 -0700 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Fri, 15 Jul 2022 13:06:43 +0800 Message-Id: <20220715050644.879488-3-fei.w.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220715050644.879488-1-fei.w.wang@intel.com> References: <20220715050644.879488-1-fei.w.wang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 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 5282716a61..811e8feff8 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".