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 E3F82434E3 for ; Tue, 14 Jun 2022 01:30:24 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 25D7568B5DB; Tue, 14 Jun 2022 04:30:11 +0300 (EEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1BB1C68B635 for ; Tue, 14 Jun 2022 04:30: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=1655170209; x=1686706209; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xrDuAkUQinydNcA32sTqNMa87dRrKEtcFfDYYv8LHkg=; b=LU24prE5Uu3rG6dynREYnXVZva/1kFgrMZTnvtEMYWxR2TVdbTMij/GQ IYZMp/Uk7OLlfx6qiWU77vr6X8sW0+/txhBdj9Jy9dT1xZrEGWPEv5GF5 GbBSVrRe4GA7r7aDFA+F87Qzk7QGBtT2N6AyuxJP06SOy5gpnEYP7yh/K CfqaqnYG/qlhOhBIOUxEfprEsTYT9mzW+n6e5FFgT4TSiH9i5WY1ZGjlQ u1IhiExnCs5rm9fLx8VmGLScvzurz+3UYRBmLrfMDzp5KtNaFTspSRruz yx18rqeK7QCgFyJeWX7KkFNGVyX1Zid1rtkg0VKjmW6sI9SdL/GSsGp1Y g==; X-IronPort-AV: E=McAfee;i="6400,9594,10377"; a="342432972" X-IronPort-AV: E=Sophos;i="5.91,298,1647327600"; d="scan'208";a="342432972" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2022 18:29:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,298,1647327600"; d="scan'208";a="686378080" Received: from t.sh.intel.com ([10.239.159.147]) by fmsmga002.fm.intel.com with ESMTP; 13 Jun 2022 18:29:52 -0700 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Tue, 14 Jun 2022 09:23:01 +0800 Message-Id: <20220614012302.2808428-3-fei.w.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220614012302.2808428-1-fei.w.wang@intel.com> References: <20220614012302.2808428-1-fei.w.wang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 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 89053fd1a2..b3d5f96043 100644 --- a/libavcodec/hevc_refs.c +++ b/libavcodec/hevc_refs.c @@ -386,7 +386,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".