From patchwork Sun Aug 5 20:29: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: 9899 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp2539941jad; Sun, 5 Aug 2018 13:30:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpczo5J1QFo7W5vMg9hxBJsqbh1eCg8FUinjpYtDU1yA6dyYwtgWgMMjlmVgKWsMXFWeas/s X-Received: by 2002:a1c:e409:: with SMTP id b9-v6mr9587139wmh.34.1533501028954; Sun, 05 Aug 2018 13:30:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533501028; cv=none; d=google.com; s=arc-20160816; b=WCTnhv7F0OQtHz/sycM3YXFJ0xiauHmkKK0cYLJ1TCFcQuntKd9jHKZqFXWOEPtS7/ YP3/v7pmyx4olURM/4a4zMpMJNdWQeyacaLmBk0JM6YCNRgK3UP9ZDwQeLpl0qp1yQqL UCuNXMXRyt68qTnK/cg+voyHCxspNnyZgIlBYuL5ZbBRHin7n2GCiW7h+W0MZzR51UV0 cLBujjn19xV64f3iPugfvCVNzbsTbbyaCnXLq2zXOt++AA/GAT76gS8W7wmnioFB0o+w mQq+C96m4uCUbn/f1lo2oQG0AmXMGYYGnKAPhDN2FxaXRxsEhFQROrUWqmwDAcjpfOhh HRrQ== 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=+ZIgSYxHZkQyYcgwNtWlKswbvhXsd/5piHKHdKvBQ50=; b=gGx0GHTB2tvABuJ8p1L6AkYV8ZIDEDyBhAzydls3Y817rv5zMpKz7cNXrvcRlVaOrL b9uoqmlnqMdFKmsaMnuoCLtNLUEuIQrmy0V8xVQJomict//n799ES7IJmIbL6vdMxwsA Jh2mMr76RpG4ZKSdDFgOFjC4BgWlZgYfQ6JiAtgXXrXfF/3yvSdyWl8fgAZfENDLrSlN nEa/b7hO7kfcxMHUP9n+pOOtkdqdFKmrmng8tm+zPwOHAKEj6Hkm+7YxOXHzkJVLcRdE 37xa7/iZf1msd9sUdaAzO6HyljyggSxxtOl7qmhi0CFRR82vR9QNuPZNYI/8EXeMiPbN Ityg== 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 p189-v6si4082983wmp.73.2018.08.05.13.30.28; Sun, 05 Aug 2018 13:30:28 -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 82AB568A297; Sun, 5 Aug 2018 23:30:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe06-2.mx.upcmail.net (vie01a-dmta-pe06-2.mx.upcmail.net [84.116.36.15]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D467468086F for ; Sun, 5 Aug 2018 23:29:56 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fmPfM-0005pD-J3 for ffmpeg-devel@ffmpeg.org; Sun, 05 Aug 2018 22:30:16 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id KYWF1y01H0S5wYM01YWGUu; Sun, 05 Aug 2018 22:30:16 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 5 Aug 2018 22:29:33 +0200 Message-Id: <20180805202937.7563-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180805202937.7563-1-michael@niedermayer.cc> References: <20180805202937.7563-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 5/9] avcodec/gdv: Simplify first inner loop in rescale() 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" Signed-off-by: Michael Niedermayer --- libavcodec/gdv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c index 1efc64b1dc..595d8ff4e4 100644 --- a/libavcodec/gdv.c +++ b/libavcodec/gdv.c @@ -85,8 +85,7 @@ static void rescale(GDVContext *gdv, uint8_t *dst, int w, int h, int scale_v, in int y = h - j - 1; uint8_t *dst1 = dst + PREAMBLE_SIZE + y * w; uint8_t *src1 = dst + PREAMBLE_SIZE + (y>>!!gdv->scale_h) * (w>>1); - for (i = 0; i < w; i++) { - int x = w - i - 1; + for (x = w - 1; x >= 0; x--) { dst1[x] = src1[(x>>1)]; } }