From patchwork Fri Aug 20 10:54:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 29634 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp1141469iov; Fri, 20 Aug 2021 03:54:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwa3HLPMoQj5TPvQNGT6SshylfdOOvK+euqsxNHicoNA5HVT5h710NkP4ZgJ4F8NBcL4l7r X-Received: by 2002:a17:907:2458:: with SMTP id yw24mr3132927ejb.326.1629456869904; Fri, 20 Aug 2021 03:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629456869; cv=none; d=google.com; s=arc-20160816; b=M8HTvygJfO5Un5Ox5LXR/IGFzO6ePh/5qcghyiHUej7Rl2TB7DfzuiC0hY/wECFJYv lyXfXO8LlTN/TMIn8QJRhi7cthFILq0YTb6sQ4ILljOmPwWkemBYScIq+Pzuh0jVRckj nd+q0q/2ivKsmMZEZ9VtKOlQ7SRivVJITwYXG0fZ9z7Jzm3hVnOcfNOsotCVIhrvVHuk bSt+YQNwEv1mGjGQOEqixm5IEsquGEZjreymNNdtJMbFY3TP2eubFETjgDL5K8n+ze/i MRwVmZBa1LVPnW0jmrR7MDMOEDOErNpnyIT64X188x8U9NFT/gDSFyxNfFXDLsv0tbzz Pivg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:dkim-signature:delivered-to; bh=Fy21t4veBCDC6bEZb4rQpkCHhWoKMwWZAdk0CvVN24g=; b=OLj8leNy02PYkpWQ9HdopdcclXMKN1DvKNI4NDDrC2J5cPwENvatYVmfj+ibTT9o79 SZ6yqdjA+rFvNkcWhJbF1ErYYwZxQ89z8OPOvp/tslcPv7dyUOnJNse2RSl115ykiRWR dC8DQbR/LmHjDOW9M5Hzc4zFp3+57j9vfceXWRXqebvlqqQTaLJk6EVKoRxrYUp2lu4J fvembs18HqrO2TtGTXWA5r5xLf3qbMGw+oH0qO9y5nnAOxfZzIOdJ3ACEgT6SyDkKOMq lha/zFHz/HH6dImfBJX89VYYeVkLTvVIC1PhP5u1m/hzf7iaNjimPvXsDdtP5KmKe4ed /oxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@jailuthra.in header.s=fm2 header.b="CkB+D/um"; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm3 header.b=uQ3l14Sm; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n26si6399700edd.76.2021.08.20.03.54.28; Fri, 20 Aug 2021 03:54:29 -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; dkim=neutral (body hash did not verify) header.i=@jailuthra.in header.s=fm2 header.b="CkB+D/um"; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm3 header.b=uQ3l14Sm; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3D92E68078F; Fri, 20 Aug 2021 13:54:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out3-smtp.messagingengine.com (unknown [66.111.4.27]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 674BA68078F for ; Fri, 20 Aug 2021 13:54:18 +0300 (EEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 6A0285C012E; Fri, 20 Aug 2021 06:54:15 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 20 Aug 2021 06:54:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jailuthra.in; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm2; bh=Mr6LBPAHySRchO2TqUsgk7cYpi JEBJZBMLmlf24yDp0=; b=CkB+D/umUY/igs8BM4c1BwXbim97kUguy6oNOOFZB6 MGKIHFRBXQ5SByI8knR19PvPNuMsbMt89aK8L0T0uz5ZTw4UznRbZqFfkOhzraVF CZRCSxVnfnwqXWlObGxOCCD06nK7BVILhXS3Fd1hMbO5xHjlWKjE6qb9p/hCVi7N 79gdZ8uo+rWY+jHlFRlqVUyUrtkzH4c8y23Re2Z18hxQ4AHBVY6Rvee65mjrzbnc 8oX7jNXR3CHP9IJOJANSSJHdUzx+uUoeQPJYnTyMknm2016ykvOqNyOMLDT5ENZw PjyGECXDlVR2oWoEAXcXzdBsKyvR4B9rd89xkv86oTJg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=Mr6LBPAHySRchO2Tq Usgk7cYpiJEBJZBMLmlf24yDp0=; b=uQ3l14SmTlq9cQmZfhaIJPV2N4CyPv5SP IrMPv8IkGOKomiim5DxJ4y4KnbCl3tLv8Rbg+ND9THpgXe9NW45idFKjYQ810Mvm XU3AKRhX9enY9vGXjomOzl9DhCdbPFxU5Jk64OSSnJ/N4eFqb9vPv3eq3re20lPL ekzf2l+uQSl98CxqDa9GaPPokxuO0CAJavPrNYBgmXlsJ90BhSpVG26AAZ274GKr w91sM+a3r08B+L9WXHDsrDiR9Oe1NiPRiJ3DHIa9zPkvs6DUuaBbDwaC404n/yQg iRcoP0eiQENPZjDGmqBVeSLReKJNdoH8eCUWYrLWZxZ8bXaB50lBQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleelgdefvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertdertd dtnecuhfhrohhmpeflrghiucfnuhhthhhrrgcuoehmvgesjhgrihhluhhthhhrrgdrihhn qeenucggtffrrghtthgvrhhnpeevffefteegfffhteeijedugfeiheeftdelkeetvdettd eijeehffehudefveegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehmvgesjhgrihhluhhthhhrrgdrihhn X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 20 Aug 2021 06:54:13 -0400 (EDT) From: Jai Luthra To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Aug 2021 16:24:07 +0530 Message-Id: <20210820105407.683299-1-me@jailuthra.in> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avfilter/signature: fix integer rounding cast precedence 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: Oscar Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: m64DrPkDmRs8 Co-authored-by: Oscar Signed-off-by: Jai Luthra --- libavfilter/signature_lookup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/signature_lookup.c b/libavfilter/signature_lookup.c index 977f898049..86dd0c6675 100644 --- a/libavfilter/signature_lookup.c +++ b/libavfilter/signature_lookup.c @@ -244,9 +244,9 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont if (pairs[i].b[j] != pairs[k].b[l]) { /* linear regression */ m = (pairs[k].b_pos[l]-pairs[i].b_pos[j]) / (k-i); /* good value between 0.0 - 2.0 */ - framerate = (int) m*30 + 0.5; /* round up to 0 - 60 */ + framerate = (int) (m*30 + 0.5); /* round up to 0 - 60 */ if (framerate>0 && framerate <= MAX_FRAMERATE) { - offset = pairs[i].b_pos[j] - ((int) m*i + 0.5); /* only second part has to be rounded up */ + offset = pairs[i].b_pos[j] - ((int) (m*i + 0.5)); /* only second part has to be rounded up */ if (offset > -HOUGH_MAX_OFFSET && offset < HOUGH_MAX_OFFSET) { if (pairs[i].dist < pairs[k].dist) { if (pairs[i].dist < hspace[framerate-1][offset+HOUGH_MAX_OFFSET].dist) {