From patchwork Sat Aug 4 00:58: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: 9885 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp737695jad; Fri, 3 Aug 2018 17:59:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdKMi//C0/HDIICR6r5TP6OOSGUwhzMvolg+vwPjzZpiSPWtDnbDMAoVtUN93dqWXfeqz7Z X-Received: by 2002:adf:8541:: with SMTP id 59-v6mr3701731wrh.223.1533344379462; Fri, 03 Aug 2018 17:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533344379; cv=none; d=google.com; s=arc-20160816; b=IB1Po9ecxJ4wu48IOi1thK/IG/QN9XM1SZxLOiLKaLKaVreetytAfcwyZwU/0Lvsg8 zbB9y5XMvnC7bVO9jZv3kW4/ssJkVMpgIBlgI0YjEBiLQqjLFSFTRm/m5HCkzSr93er0 Iw40FneXIQiDP9c4tk4EQYVvUTV+B8IFmWs5S6bo0yMAPPvCfQHe2q8cq0BSmWgPeevB xZPFmVLP041jjjUu+iU8MQVJlkbcECC7dC88GShrOHPJ6hWgWMH2DtWQjNse7/6fau12 0UqgXfAPVaVHTZMEvcUeHl6UrVE99awFjydzp54NYMQAQUcm7ijUprkl5j1NlAochTYQ GazA== 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=qwvWM0M2ZmM6hJwCcbkMb9aMFIzgYzFUBuzf3KwUWLY=; b=gSMfc9Cu2VekDS7QFGf2rio/hYouyNj97C8zaUf3pDviB1HINMyMjpvQSuPnwCMPA2 AeaIedmbHmgWRk7Ihm1o+s5kiP9R9pRFT+J0zxjYm7UGUt3R3wYu9P4kI7Nxc8F1Pxqv Im5A1CPu+6JtKHP9qFdswg/BQuAcTd3ynT/GC9Ujw8tl0D2B23N9VbVpACRLfeUrihHv zdAE6/OwDm237nsx5MrwSGRyi8b5ESwq4FPtf23ajG4fEueDVQaPMNqWn+56BE2/uzBq yBB+85GUA7hr382FyHoYkTFgBExsbSHaL9hNfafJB62VyesH6R3gh7Ss1aD4mwBtFKjE AxIw== 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 j5-v6si2473133wru.209.2018.08.03.17.59.39; Fri, 03 Aug 2018 17:59:39 -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 CE36F68A10A; Sat, 4 Aug 2018 03:58:59 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe08-2.mx.upcmail.net (vie01a-dmta-pe08-2.mx.upcmail.net [84.116.36.21]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6C122689C1C for ; Sat, 4 Aug 2018 03:58:52 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe08.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1flkuV-0000mX-1S for ffmpeg-devel@ffmpeg.org; Sat, 04 Aug 2018 02:59:11 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id Joz71y01s0S5wYM01oz94j; Sat, 04 Aug 2018 02:59:09 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 4 Aug 2018 02:58:33 +0200 Message-Id: <20180804005833.16836-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180804005833.16836-1-michael@niedermayer.cc> References: <20180804005833.16836-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 4/4] avcodec/ivi: Factor width dereference out of the loops in ivi_output_plane() 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" 396078 -> 268468 dezicycles Signed-off-by: Michael Niedermayer --- libavcodec/ivi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/ivi.c b/libavcodec/ivi.c index ebb7f03007..b23d4af27e 100644 --- a/libavcodec/ivi.c +++ b/libavcodec/ivi.c @@ -914,13 +914,14 @@ static void ivi_output_plane(IVIPlaneDesc *plane, uint8_t *dst, ptrdiff_t dst_pi for (y = 0; y < plane->height; y++) { int m = 0; - for (x = 0; x < plane->width; x++) { + int w = plane->width; + for (x = 0; x < w; x++) { int t = src[x] + 128; dst[x] = t; m |= t; } if (m & ~255) - for (x = 0; x < plane->width; x++) + for (x = 0; x < w; x++) dst[x] = av_clip_uint8(src[x] + 128); src += pitch; dst += dst_pitch;