From patchwork Wed Feb 28 22:16:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 7769 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.181.170 with SMTP id m39csp4310992jaj; Wed, 28 Feb 2018 14:16:44 -0800 (PST) X-Google-Smtp-Source: AG47ELv8w9p3SlbsFJCGbDP4laNAYM3IcOwmzY0Rs2RiStE80EDwPrHv/oahM/pVLdRwpke22Ejd X-Received: by 10.28.218.147 with SMTP id r141mr31850wmg.55.1519856204374; Wed, 28 Feb 2018 14:16:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519856204; cv=none; d=google.com; s=arc-20160816; b=g2qCyjGsUtKXW7Lsm+z/nPOOyaJ5AT0ajBwkw8f+sPTDv5ars6gK5jXlr1xzFJL7g3 QH3EC9GTzw6gMUMbj1GJojGAl2/Urb0exe4ASGi5vMxVOCWrpPVhNXO6A1NMq1Xu3uFr zQc72GG2Y8J9ZPLpeTsFr+RLwHWOe/cALPxFDG54mXTUrnBRG5JrAR9lJiMvrx5wa86R /7l+/hkUQMcTWbDYB4bkwWglA9oWmRnPKnIEYHAm3+H2dLu/3bOcffaRKs1UnkJ9cYTT /nVUNieISZzmTcXbSghRXGSr9rsiDh76584MGcR/eQu3WKkH/UA7AwhrPAOhuo4JpUla m4ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :in-reply-to:mime-version:references:message-id:to:from:date :delivered-to:arc-authentication-results; bh=ooItRpixlVGC3XLn9rsB1vLiXlMn+Znzyt/e9KIS2E0=; b=drg6Alf/QXr6fLzJBiD0laPPYJ41oaGAKtq0FscJnXkq5T7EnqGRbyH59Db73iUcDu KJaXZUBz4B6lugobKpH+JC+EsZSxRdgWLhq/i5XmvjkY8EFEhic0bkPdRAlBp5t+Wr61 Xx9sjtX4WY1JnY3sao/tEkpz5N4mkeASeozRXQOgiJTe5ICBsezAhTpqrlF2pR4PiUxB Sbv+BykCB4ulGNJKALjRc+bPBst9tT2N/B+EoDSiJXLBpkynmM1JuNIn7DnXT6jKPIbU /NUvI/0DSzGkIkSSh5pyvoAsSAs8x0/7n+P6gu3d2PKC0uSS6jTvqpdnEU082fKERg7K cJqA== 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 n62si1167144wma.30.2018.02.28.14.16.43; Wed, 28 Feb 2018 14:16:44 -0800 (PST) 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 76500689AA9; Thu, 1 Mar 2018 00:16:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9339468971A for ; Thu, 1 Mar 2018 00:16:30 +0200 (EET) X-Originating-IP: 213.47.41.20 Received: from localhost (213-47-41-20.cable.dynamic.surfer.at [213.47.41.20]) (Authenticated sender: michael@niedermayer.cc) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 68F3341C08A for ; Wed, 28 Feb 2018 23:16:34 +0100 (CET) Date: Wed, 28 Feb 2018 23:16:33 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20180228221633.GW23018@michaelspb> References: MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [FFmpeg-devel] [PATCH][RFC] Improve and fix put_vc2_ue_uint() function. 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" On Wed, Feb 28, 2018 at 10:14:15PM +0200, Ivan Kalvachev wrote: > Replace two bit handling loops and internal conditional branch > with simple formula using few logical operations. > > The old function would generate wrong output > if the input does not fit into 15 bits. > > Fix this by using 64 bit math and put_bits64(). > This case should be quite rare, since the bug > has not asserted itself. > > --- > It's attempt for speed optimization, but in the > process it turned out it needs also bugfixing. > > I only tested the old case of the code, > to confirm i've implemented the correct function. > > Haven't done any benchmarks or run fate. fate fails: make fate-vsynth1-vc2-420p TEST vsynth1-vc2-420p Test vsynth1-vc2-420p failed. Look at tests/data/fate/vsynth1-vc2-420p.err for details. make: *** [fate-vsynth1-vc2-420p] Error 69 [...] --- ./tests/ref/vsynth/vsynth1-vc2-420p 2018-02-27 23:48:20.527608799 +0100 +++ tests/data/fate/vsynth1-vc2-420p 2018-02-28 23:16:02.250764645 +0100 @@ -1,4 +1,2 @@ -fb8fffcfc17558c87dd11a67ccb0f615 *tests/data/fate/vsynth1-vc2-420p.mov +f24243a627788000de7147d38880d019 *tests/data/fate/vsynth1-vc2-420p.mov 1155415 tests/data/fate/vsynth1-vc2-420p.mov -387696707c79cf1a6c9aeff4024226b9 *tests/data/fate/vsynth1-vc2-420p.out.rawvideo -stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 760320