From patchwork Mon May 30 19:09:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 35994 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6914:b0:82:6b11:2509 with SMTP id q20csp2441109pzj; Mon, 30 May 2022 12:09:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzENBgo/QiEzhMYhy9T29axrcXPlIqMt7nqbmnX81Nu7fEYomhuq0gFwz7Nrmj4iKARNI5x X-Received: by 2002:a17:907:7ba9:b0:6fe:5636:1636 with SMTP id ne41-20020a1709077ba900b006fe56361636mr52959516ejc.463.1653937776503; Mon, 30 May 2022 12:09:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653937776; cv=none; d=google.com; s=arc-20160816; b=Sw3d/Bdi+YjogVANueEwuPo0RBdy3tEKZh0vuucuYmJo6/ygVtI6J0XzhG5Gtx2WJY Hiu5RDnzUQHNM+K5DR/hTHpMaPCxb7fNmOrrJrxMpiFrA2SFQtcLnSwPZpFcARqkVL8e 6VGOHPBN3wzvtkb2+cDF1OsYqClGG0ncoNtJHN6fDWhhHWV/OKTZu27MmkQGx6ecIUrQ VHHVtgcSoRUnB7KREos4bTHxX3m1cqh2pimWFFL+X9aRVOsV0vj2+WGlaJJT7oszpeyz mEWuOPvo80e6unZ6Y45BYweFgg7z7rIJAXCtJnu9Tfzf0pUyzV0KUeDoxSgCpez+3acg 3OLw== 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:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=0e1YAjbujLWBBC4YGTKn8VUoAlol5CLaWRrT/iajanQ=; b=nLuk2dVfgdicgtVdLz+rMC1dxybOQ651v6+wyiaxS/ItJfrhy2Sivq3tI7Ljkohr4m ItHj88d+yF6KLZp/OWsGwxfCUA/A9mcSbuom7tlkbriG5hHrkD+hU1H+bkX5F9sPA8Xr KRWdGee2fzLsc7OJxRp/DJp1F/a3i1wIml7cl7zsoXQMpV2Pw3+yg/cOy6PC+bPONiRs 1QHm1k+4NE8fl/DQPLHWII5m72UrWpDquXqrOC31jeA89rLfnTizx0KqGsx6PR0uSyxC Ykwqb9OY6zx5hJAdR+y4ZC4bZ8BNis2zIYibzCBYbqDXZb4tsGz3SEnFqidpaASjxpqJ cSJA== 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g19-20020a056402321300b00427c9085991si12079478eda.282.2022.05.30.12.09.36; Mon, 30 May 2022 12:09:36 -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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1BAA768B61C; Mon, 30 May 2022 22:09:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-at03-3.mx.upcmail.net (vie01a-dmta-at03-3.mx.upcmail.net [62.179.121.153]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1BE3968B4D8 for ; Mon, 30 May 2022 22:09:20 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-at03.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1nvklN-0005K0-1M for ffmpeg-devel@ffmpeg.org; Mon, 30 May 2022 21:09:13 +0200 Received: from ren-mail-psmtp-mg02. ([80.109.253.241]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id vkasnXLAv8s8UvklNnwiXA; Mon, 30 May 2022 21:09:13 +0200 Received: from localhost ([213.47.68.29]) by ren-mail-psmtp-mg02. with ESMTP id vklMndva18eSWvklMn6TQp; Mon, 30 May 2022 21:09:13 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.4 cv=KKE5sHJo c=1 sm=1 tr=0 ts=62951659 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=oFJauFbHeTtwRc_cPs0A:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 30 May 2022 21:09:11 +0200 Message-Id: <20220530190911.20843-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220530190911.20843-1-michael@niedermayer.cc> References: <20220530190911.20843-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfFQ+ltuf2ZBN9/UXZEhh1/OUj2LBRO143d+DYcC62UIFiyFkuWBLFiYOH1s28+kna6rBq46CUPbknUzqKdvMo0trWWMC+IG+bAgRzJTFZkYzb8w0rYvq mZvhYEWKZRraofo/b0yRmdaIHLFS64tvoND32zP5qpyLOHSGf9d1L5T3Qt5NTc/3WCXd/64kkveE0A== Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/ffv1enc: Alpha workaround 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ClKT1CYYdezI alpha-linux-gnu-gcc-5 (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010 with qemu-alpha version 2.11.1(Debian 1:2.11+dfsg-1ubuntu7.39) trigger a FPE on the first iteration None of the intermediate values when printed shows an anomaly nor does casting the final value. I did not investigate this further by looking at the asm but that would be probably where to continue looking at this if someone is interrested in alpha. Signed-off-by: Michael Niedermayer --- libavcodec/ffv1enc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index 9849082e44..9609877498 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -142,8 +142,10 @@ static void find_best_state(uint8_t best_state[256][256], int i, j, k, m; uint32_t l2tab[256]; - for (i = 1; i < 256; i++) + l2tab[1] = -log2(1 / 256.0) * ((1U << 31) / 8); + for (i = 2; i < 256; i++) { l2tab[i] = -log2(i / 256.0) * ((1U << 31) / 8); + } for (i = 0; i < 256; i++) { uint64_t best_len[256];