From patchwork Tue May 12 13:42:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Fu, Linjie" X-Patchwork-Id: 19646 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 0C92F44BBB6 for ; Tue, 12 May 2020 16:45:26 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DC8B6689A91; Tue, 12 May 2020 16:45:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 45528689722 for ; Tue, 12 May 2020 16:45:18 +0300 (EEST) IronPort-SDR: OvSUljlTtriVE2u3eoT44LvqcrsGkduAlybcGA6NDqGZg2dLOfDHozjiaXiHC+vgh41Emcri5X hGKI+EcsQWgw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2020 06:45:16 -0700 IronPort-SDR: CPNjHni1oNTwYg9f6iZjAwqsM3o0C8/0NEOutzGh2k/fNWjulsUhqoO09aukvvL7LGH4iaYkio J/JCAAGM3b0g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,383,1583222400"; d="scan'208";a="262125499" Received: from icl-dev.sh.intel.com ([10.239.158.73]) by orsmga003.jf.intel.com with ESMTP; 12 May 2020 06:45:15 -0700 From: Linjie Fu To: ffmpeg-devel@ffmpeg.org Date: Tue, 12 May 2020 21:42:49 +0800 Message-Id: <1589290969-3832-1-git-send-email-linjie.fu@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [FFmpeg-devel] [PATCH 1/2] lavc/hevc: Add poc_msb_present filed in LongTermRPS X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 , Linjie Fu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Xu Guangxin delta_poc_msb_present_flag is needed in find_ref_idx() to indicate whether MSB of POC should be taken into account. Details in 8.3.2. Signed-off-by: Xu Guangxin Signed-off-by: Linjie Fu --- libavcodec/hevc_ps.h | 1 + libavcodec/hevcdec.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/hevc_ps.h b/libavcodec/hevc_ps.h index 8e1bccd..238edd3 100644 --- a/libavcodec/hevc_ps.h +++ b/libavcodec/hevc_ps.h @@ -41,6 +41,7 @@ typedef struct ShortTermRPS { typedef struct LongTermRPS { int poc[32]; + uint8_t poc_msb_present[32]; uint8_t used[32]; uint8_t nb_refs; } LongTermRPS; diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 78299f4..0772608 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -280,7 +280,6 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb) rps->nb_refs = nb_sh + nb_sps; for (i = 0; i < rps->nb_refs; i++) { - uint8_t delta_poc_msb_present; if (i < nb_sps) { uint8_t lt_idx_sps = 0; @@ -295,8 +294,8 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb) rps->used[i] = get_bits1(gb); } - delta_poc_msb_present = get_bits1(gb); - if (delta_poc_msb_present) { + rps->poc_msb_present[i] = get_bits1(gb); + if (rps->poc_msb_present[i]) { int64_t delta = get_ue_golomb_long(gb); int64_t poc;