From patchwork Mon Jul 5 08:26:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fei Wang X-Patchwork-Id: 28777 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5d:965a:0:0:0:0:0 with SMTP id d26csp3944705ios; Mon, 5 Jul 2021 01:29:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcOJNmxBKsJ1J5aSWuvardmJUmDLCI2e5Jie9NuDafLRAQbrWcx2g3OgFMFsYKsKnajje2 X-Received: by 2002:aa7:d554:: with SMTP id u20mr14956470edr.50.1625473742297; Mon, 05 Jul 2021 01:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625473742; cv=none; d=google.com; s=arc-20160816; b=UOL1PqCBuKFJIwXdfTm63f1rdP44mv+9L13zA+99D8QLT4D1TxbXtkjb3rTdIMqoQx dL0Uaa4wR1o7m8QAFhaze+TKtq9twWP2R6JxyJSv1GV+1B/JLV9siWzlimGDJJaxBpBr CcX2n9EhRO3i9gRUiuCU0u/OlUMtj1CGmQuVpAJs45QbxVoAktDqdotiAEAif/Sk4tSn APoKgAR1farENz6GC46NB3Q4BNYleOTjBjeTWC52GCigCKpEuKO/z8bf+k4e3feU7gsP Np41Hm5BoWOhJz+rmVt41hq/OL9lJLugwx9tF0dWYyRfz2B4eKVRn+2nHnQkzFQKSpsE Z+GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to; bh=PGowjithCpcdaytua5V5fYRixp4NYWCvgDLyZmU2b28=; b=sEOLC3f9TIWjBVq05VnL118WqtdLlwShhFjHE1wM+R5okdMB7K45koF5vzPaNkhdBN STd8JndeS79JjD2hilZv2X0U6b+v0T8X+jASNYfYYxmuQ+ywz7pvzPFqqOIZmtPPO98u 3ADuzoy2RlgTkqfSsQO/N1BCgoPGHKNCTrn0ONyYcgSQQ1YzXso3cC+u4UPaQiqQDKEV //Gy/0yDk6BunIsNfp2opuot84Eu87uNuDEd/Kf2+m043ZG4OOBapF2dl66Ei/pCaEIF VnB22NbtxuerF3IXhn8jdq8W7Pn41pxrfliP3mJfmFgofH7XrbZZw8qz6uolGV+JSlFF rc/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 23si11762728ejg.238.2021.07.05.01.29.01; Mon, 05 Jul 2021 01:29:02 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 34DFF68A64A; Mon, 5 Jul 2021 11:28:57 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E1FE968A28B for ; Mon, 5 Jul 2021 11:28:49 +0300 (EEST) X-IronPort-AV: E=McAfee;i="6200,9189,10035"; a="230662720" X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="230662720" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2021 01:28:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="496045677" Received: from f.sh.intel.com ([10.239.159.147]) by fmsmga002.fm.intel.com with ESMTP; 05 Jul 2021 01:28:42 -0700 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Mon, 5 Jul 2021 16:26:35 +0800 Message-Id: <20210705082643.28259-1-fei.w.wang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH v3 1/9] cbs_av1: fix incorrect data type 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: Fei Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ZaLcOB1L4DEC Since order_hint_bits_minus_1 range is 0~7, cur_frame_hint can be most 128. And similar return value for cbs_av1_get_relative_dist. So if plus them and use int8_t for the result may lose its precision. Signed-off-by: Fei Wang --- libavcodec/cbs_av1_syntax_template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c index 6fe6e9a4f3..d98d3d42de 100644 --- a/libavcodec/cbs_av1_syntax_template.c +++ b/libavcodec/cbs_av1_syntax_template.c @@ -355,7 +355,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw, AV1_REF_FRAME_ALTREF2, AV1_REF_FRAME_ALTREF }; int8_t ref_frame_idx[AV1_REFS_PER_FRAME], used_frame[AV1_NUM_REF_FRAMES]; - int8_t shifted_order_hints[AV1_NUM_REF_FRAMES]; + int16_t shifted_order_hints[AV1_NUM_REF_FRAMES]; int cur_frame_hint, latest_order_hint, earliest_order_hint, ref; int i, j;