From patchwork Tue Jun 27 19:47:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4141 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp2418701vsb; Tue, 27 Jun 2017 12:48:12 -0700 (PDT) X-Received: by 10.223.136.216 with SMTP id g24mr16401593wrg.199.1498592892192; Tue, 27 Jun 2017 12:48:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498592892; cv=none; d=google.com; s=arc-20160816; b=Wq1b4HvNKikyq4k/xd9QIcU3d2rYtRdCdLx14ACgiVSXlumriWFH3cEPmSDwzhtDkH oVlKsmjReQbhm4A1V4JPwA77C+ZS7+5ZPFSg8cgQP+UnWCVNwL7+vBuAOk18reFX1Qdm MCNPyHeU7slp2trFo9PZ3cpgKS5kuxcG6sHymErbeL4pkmdIkOAK+hUPw0Mpyndg8TzU u8O+zsZd3kqWdUcKN8VCvSOnJLRrgjhJuhIOQL1/5xEYsndGLFDjCX9g6eEBca3pmiRw uAQYct5tqUeESObRZ6Z9VPcnaC/JKMe+Jg11/PzvIrP3ipsuIKtpDkao4OwOcGKVOsMB cYvw== 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:arc-authentication-results; bh=2KTYi8AqrY68DKzqlvbnMLja9ogynzqPzarqFPKhKTk=; b=BQTJDQD9Xs3erC+Wb3dlQID8OQnDNEkAX1tXwaqA9AOgPcluajRNnhYww/gYZKmR2p M/RuOo1ncgqVmxRP9EBHJZQ6gk4C8B8GNujQpbyj9By9YyQSmbbE3Nowpu/KfDUU3o6L JK8qrAU1hQyIRlaImuK4yMjoJJ0nvwIo4FdNlBL8pZ0cZUCKYqu1LnwAuB9+51gHSgpx ZhUU6+WtSX3+IctcyQNQZ8270kWqz3R87KRBurN3eQTuT1JaWdbXEDtuYGhb2D6myMyC LpGv2odXAJyk1TE13c6X76IHDujxL+ivUe2uXm8D7/OBEqJbXxfGk2c+rxKAW9t4a5b5 6FLg== 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 k125si3415493wmb.95.2017.06.27.12.48.11; Tue, 27 Jun 2017 12:48:12 -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 31CF368A4BB; Tue, 27 Jun 2017 22:47:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-1.mx.upcmail.net (vie01a-dmta-pe07-1.mx.upcmail.net [84.116.36.17]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C49B168A383 for ; Tue, 27 Jun 2017 22:47:45 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe07.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dPwSh-0001Kv-0V for ffmpeg-devel@ffmpeg.org; Tue, 27 Jun 2017 21:47:47 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id dvnl1v01i0S5wYM01vnm7R; Tue, 27 Jun 2017 21:47:47 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 27 Jun 2017 21:47:35 +0200 Message-Id: <20170627194735.27533-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170627194735.27533-1-michael@niedermayer.cc> References: <20170627194735.27533-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 5/5] avcodec/utvideodec: Factor multiply out of inner loop 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 0.5% faster loop Signed-off-by: Michael Niedermayer --- libavcodec/utvideodec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index 788f4475b9..a20e28320c 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -196,7 +196,8 @@ static int decode_plane10(UtvideoContext *c, int plane_no, prev = 0x200; for (j = sstart; j < send; j++) { - for (i = 0; i < width * step; i += step) { + int ws = width * step; + for (i = 0; i < ws; i += step) { pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3); if (pix < 0) { av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n"); @@ -300,7 +301,8 @@ static int decode_plane(UtvideoContext *c, int plane_no, prev = 0x80; for (j = sstart; j < send; j++) { - for (i = 0; i < width * step; i += step) { + int ws = width * step; + for (i = 0; i < ws; i += step) { pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3); if (pix < 0) { av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n");